aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/twitter/twitter_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/twitter/twitter_lib.c')
-rw-r--r--protocols/twitter/twitter_lib.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c
index 0578c5e0..620850ab 100644
--- a/protocols/twitter/twitter_lib.c
+++ b/protocols/twitter/twitter_lib.c
@@ -116,7 +116,7 @@ static void twitter_add_buddy(struct im_connection *ic, char *name, const char *
struct twitter_data *td = ic->proto_data;
// Check if the buddy is allready in the buddy list.
- if (!imcb_find_buddy( ic, name ))
+ if (!bee_user_by_handle( ic->bee, ic, name ))
{
char *mode = set_getstr(&ic->acc->set, "mode");
@@ -124,7 +124,12 @@ static void twitter_add_buddy(struct im_connection *ic, char *name, const char *
imcb_add_buddy( ic, name, NULL );
imcb_rename_buddy( ic, name, fullname );
if (g_strcasecmp(mode, "chat") == 0)
+ {
+ /* Necessary so that nicks always get translated to the
+ exact Twitter username. */
+ imcb_buddy_nick_hint( ic, name, name );
imcb_chat_add_buddy( td->home_timeline_gc, name );
+ }
else if (g_strcasecmp(mode, "many") == 0)
imcb_buddy_status( ic, name, OPT_LOGGED_IN, NULL, NULL );
}
@@ -458,7 +463,7 @@ static void twitter_groupchat_init(struct im_connection *ic)
td->home_timeline_gc = gc = imcb_chat_new( ic, "home/timeline" );
- name_hint = g_strdup_printf( "Twitter_%s", ic->acc->user );
+ name_hint = g_strdup_printf( "%s_%s", td->prefix, ic->acc->user );
imcb_chat_name_hint( gc, name_hint );
g_free( name_hint );
}
@@ -518,7 +523,7 @@ static void twitter_private_message_chat(struct im_connection *ic, GSList *list)
if( mode_one )
{
- g_snprintf( from, sizeof( from ) - 1, "twitter_%s", ic->acc->user );
+ g_snprintf( from, sizeof( from ) - 1, "%s_%s", td->prefix, ic->acc->user );
from[MAX_STRING-1] = '\0';
}