From 2b02617289671ececbd98a209cb44aca81c22a65 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Wed, 11 Aug 2010 21:41:23 +0100 Subject: strptime() on FreeBSD (and possibly other non-glibc platforms) %z is not supported, so just insert the literal timezone there - let's hope Twitter won't ever change that. --- protocols/twitter/twitter_lib.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'protocols/twitter') diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c index f9e808f7..22d2a3bd 100644 --- a/protocols/twitter/twitter_lib.c +++ b/protocols/twitter/twitter_lib.c @@ -356,6 +356,11 @@ static xt_status twitter_xt_get_user_list( struct xt_node *node, struct twitter_ return XT_HANDLED; } +#ifdef __GLIBC__ +#define TWITTER_TIME_FORMAT "%a %b %d %H:%M:%S %z %Y" +#else +#define TWITTER_TIME_FORMAT "%a %b %d %H:%M:%S +0000 %Y" +#endif /** * Function to fill a twitter_xml_status struct. @@ -392,7 +397,7 @@ static xt_status twitter_xt_get_status( struct xt_node *node, struct twitter_xml /* Very sensitive to changes to the formatting of this field. :-( Also assumes the timezone used is UTC since C time handling functions suck. */ - if( strptime( child->text, "%a %b %d %H:%M:%S %z %Y", &parsed ) != NULL ) + if( strptime( child->text, TWITTER_TIME_FORMAT, &parsed ) != NULL ) txs->created_at = mktime_utc( &parsed ); } else if (g_strcasecmp( "user", child->name ) == 0) -- cgit v1.2.3 From 4ffd757724a657d2dc5c536473523a86f2331d9e Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 14 Aug 2010 11:21:44 +0100 Subject: Don't send a /QUIT for every Twitter contact when going offline, and show the twitter_$username /QUIT as a netsplit. --- protocols/twitter/twitter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'protocols/twitter') diff --git a/protocols/twitter/twitter.c b/protocols/twitter/twitter.c index a2f2325c..d5b71bc3 100644 --- a/protocols/twitter/twitter.c +++ b/protocols/twitter/twitter.c @@ -256,7 +256,7 @@ static void twitter_logout( struct im_connection *ic ) struct twitter_data *td = ic->proto_data; // Set the status to logged out. - ic->flags = 0; + ic->flags &= ~ OPT_LOGGED_IN; // Remove the main_loop function from the function queue. b_event_remove(td->main_loop_id); -- cgit v1.2.3