=== modified file 'protocols/twitter/Makefile'
|
|
|
|
| 23 | 23 | lcov: check |
| 24 | 24 | gcov: |
| 25 | 25 | gcov *.c |
| 26 | | |
| | 26 | |
| 27 | 27 | .PHONY: all clean distclean |
| 28 | 28 | |
| 29 | 29 | clean: |
| … |
… |
|
| 42 | 42 | twitter_mod.o: $(objects) |
| 43 | 43 | @echo '*' Linking twitter_mod.o |
| 44 | 44 | @$(LD) $(LFLAGS) $(objects) -o twitter_mod.o |
| 45 | | |
| 46 | | |
=== modified file 'protocols/twitter/twitter.c'
|
|
|
|
| 118 | 118 | return FALSE; |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | | sprintf( name, "twitter_%s", ic->acc->user ); |
| | 121 | sprintf( name, "%s_%s", td->url_host, ic->acc->user ); |
| 122 | 122 | msg = g_strdup_printf( "To finish OAuth authentication, please visit " |
| 123 | 123 | "%s and respond with the resulting PIN code.", |
| 124 | 124 | info->auth_url ); |
| … |
… |
|
| 218 | 218 | if( strstr( acc->pass, "oauth_token=" ) ) |
| 219 | 219 | td->oauth_info = oauth_from_string( acc->pass, &twitter_oauth ); |
| 220 | 220 | |
| 221 | | sprintf( name, "twitter_%s", acc->user ); |
| | 221 | sprintf( name, "%s_%s", td->url_host, acc->user ); |
| 222 | 222 | imcb_add_buddy( ic, name, NULL ); |
| 223 | 223 | imcb_buddy_status( ic, name, OPT_LOGGED_IN, NULL, NULL ); |
| 224 | 224 | |
| … |
… |
|
| 261 | 261 | static int twitter_buddy_msg( struct im_connection *ic, char *who, char *message, int away ) |
| 262 | 262 | { |
| 263 | 263 | struct twitter_data *td = ic->proto_data; |
| 264 | | |
| 265 | | if (g_strncasecmp(who, "twitter_", 8) == 0 && |
| 266 | | g_strcasecmp(who + 8, ic->acc->user) == 0) |
| | 264 | gchar** s = g_strsplit(who, "_", 2); /* who has a value of "twitter.com_nick" */ |
| | 265 | if (NULL != s && |
| | 266 | g_strcasecmp(s[0], td->url_host) == 0 && |
| | 267 | g_strcasecmp(s[1], ic->acc->user) == 0) |
| 267 | 268 | { |
| 268 | 269 | if( set_getbool( &ic->acc->set, "oauth" ) && |
| 269 | 270 | td->oauth_info && td->oauth_info->token == NULL ) |
=== modified file 'protocols/twitter/twitter_lib.c'
|
|
|
|
| 446 | 446 | |
| 447 | 447 | td->home_timeline_gc = gc = imcb_chat_new( ic, "home/timeline" ); |
| 448 | 448 | |
| 449 | | name_hint = g_strdup_printf( "Twitter_%s", ic->acc->user ); |
| | 449 | name_hint = g_strdup_printf( "%s_%s", td->url_host, ic->acc->user ); |
| 450 | 450 | imcb_chat_name_hint( gc, name_hint ); |
| 451 | 451 | g_free( name_hint ); |
| 452 | 452 | } |
| … |
… |
|
| 503 | 503 | |
| 504 | 504 | if( mode_one ) |
| 505 | 505 | { |
| 506 | | g_snprintf( from, sizeof( from ) - 1, "twitter_%s", ic->acc->user ); |
| | 506 | g_snprintf( from, sizeof( from ) - 1, "%s_%s", td->url_host, ic->acc->user ); |
| 507 | 507 | from[MAX_STRING-1] = '\0'; |
| 508 | 508 | } |
| 509 | 509 | |
| … |
… |
|
| 735 | 735 | args[0] = "screen_name"; |
| 736 | 736 | args[1] = who; |
| 737 | 737 | twitter_http(ic, create ? TWITTER_FRIENDSHIPS_CREATE_URL : TWITTER_FRIENDSHIPS_DESTROY_URL, twitter_http_post, ic, 1, args, 2); |
| 738 | | } |
| 739 | | No newline at end of file |
| | 738 | } |