diff options
author | Miklos Vajna <vmiklos@frugalware.org> | 2007-10-17 02:46:38 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@frugalware.org> | 2007-10-17 02:46:38 +0200 |
commit | f8674dbaa346e5097d9f56657673edbf80493599 (patch) | |
tree | 2ea23af08a0fb1c76d3de276695255df4dc87cce | |
parent | 09e2a69d7a43d15f3c41dc333133f8ad4d1d6ff0 (diff) |
show topic if it was set before join
-rw-r--r-- | skype/skype.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/skype/skype.c b/skype/skype.c index 4d6dc7bd..4ad6cdb8 100644 --- a/skype/skype.c +++ b/skype/skype.c @@ -75,6 +75,8 @@ struct skype_data /* Using /j #nick we want to have a groupchat with two people. Usually * not (default). */ char* groupchat_with; + /* The user who invited us to the chat. */ + char* adder; }; struct skype_away_state @@ -437,6 +439,10 @@ static gboolean skype_read_callback( gpointer data, gint fd, b_input_condition c if(!strcmp(info, "STATUS MULTI_SUBSCRIBED")) { imcb_chat_new( ic, id ); + g_snprintf(buf, 1024, "GET CHAT %s ADDER\n", id); + skype_write(ic, buf, strlen(buf)); + g_snprintf(buf, 1024, "GET CHAT %s TOPIC\n", id); + skype_write(ic, buf, strlen(buf)); } else if(!strcmp(info, "STATUS DIALOG") && sd->groupchat_with) { @@ -454,6 +460,10 @@ static gboolean skype_read_callback( gpointer data, gint fd, b_input_condition c imcb_chat_add_buddy(gc, sd->username); g_free(sd->groupchat_with); sd->groupchat_with = NULL; + g_snprintf(buf, 1024, "GET CHAT %s ADDER\n", id); + skype_write(ic, buf, strlen(buf)); + g_snprintf(buf, 1024, "GET CHAT %s TOPIC\n", id); + skype_write(ic, buf, strlen(buf)); } else if(!strcmp(info, "STATUS UNSUBSCRIBED")) { @@ -461,12 +471,22 @@ static gboolean skype_read_callback( gpointer data, gint fd, b_input_condition c if(gc) gc->data = (void*)FALSE; } + else if(!strncmp(info, "ADDER ", 6)) + { + info += 6; + g_free(sd->adder); + sd->adder = g_strdup_printf("%s@skype.com", info); + } else if(!strncmp(info, "TOPIC ", 6)) { info += 6; struct groupchat *gc = skype_chat_by_name(ic, id); - if(gc) - imcb_chat_topic(gc, NULL, info); + if(gc && sd->adder) + { + imcb_chat_topic(gc, sd->adder, info); + g_free(sd->adder); + sd->adder = NULL; + } } else if(!strncmp(info, "ACTIVEMEMBERS ", 14)) { |