aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@frugalware.org>2007-11-24 00:46:20 +0100
committerMiklos Vajna <vmiklos@frugalware.org>2007-11-24 00:46:20 +0100
commit5652d4369f6a807db7301f8d1350b7cc38abd6d1 (patch)
treed1cec13857a74ce6ae0773d693f7080364d99c8c
parenteb9cbb8fd49380d73161dc197b91dadb974d18e5 (diff)
warning fix in skype_chat_with()
fix "when you start a group chat, a warning is shown saying creating the group chat is failed, but in fact it is created"
-rw-r--r--skype/README4
-rw-r--r--skype/skype.c16
2 files changed, 12 insertions, 8 deletions
diff --git a/skype/README b/skype/README
index c3f0f7e3..c95271dd 100644
--- a/skype/README
+++ b/skype/README
@@ -229,9 +229,7 @@ then it would be nice to include them here.
== Known bugs
-- When you join start a group chat, a warning is shown saying creating the
- group chat is failed. Indeed it is created. I should improve the API to be
- able to suppress that warning.
+- None at this time.
== Screenshots
diff --git a/skype/skype.c b/skype/skype.c
index 739e001c..ee9f05f1 100644
--- a/skype/skype.c
+++ b/skype/skype.c
@@ -445,6 +445,10 @@ static gboolean skype_read_callback( gpointer data, gint fd, b_input_condition c
if(info)
*info = '\0';
info++;
+ /* Remove fake chat if we created one in skype_chat_with() */
+ struct groupchat *gc = skype_chat_by_name(ic, "");
+ if(gc)
+ imcb_chat_free(gc);
if(!strcmp(info, "STATUS MULTI_SUBSCRIBED"))
{
imcb_chat_new( ic, id );
@@ -455,7 +459,7 @@ static gboolean skype_read_callback( gpointer data, gint fd, b_input_condition c
}
else if(!strcmp(info, "STATUS DIALOG") && sd->groupchat_with)
{
- struct groupchat *gc = imcb_chat_new( ic, id );
+ gc = imcb_chat_new( ic, id );
/* According to the docs this
* is necessary. However it
* does not seem the situation
@@ -476,7 +480,7 @@ static gboolean skype_read_callback( gpointer data, gint fd, b_input_condition c
}
else if(!strcmp(info, "STATUS UNSUBSCRIBED"))
{
- struct groupchat *gc = skype_chat_by_name(ic, id);
+ gc = skype_chat_by_name(ic, id);
if(gc)
gc->data = (void*)FALSE;
}
@@ -489,7 +493,7 @@ static gboolean skype_read_callback( gpointer data, gint fd, b_input_condition c
else if(!strncmp(info, "TOPIC ", 6))
{
info += 6;
- struct groupchat *gc = skype_chat_by_name(ic, id);
+ gc = skype_chat_by_name(ic, id);
if(gc && (sd->adder || sd->topic_wait))
{
if(sd->topic_wait)
@@ -505,7 +509,7 @@ static gboolean skype_read_callback( gpointer data, gint fd, b_input_condition c
else if(!strncmp(info, "ACTIVEMEMBERS ", 14))
{
info += 14;
- struct groupchat *gc = skype_chat_by_name(ic, id);
+ gc = skype_chat_by_name(ic, id);
/* Hack! We set ->data to TRUE
* while we're on the channel
* so that we won't rejoin
@@ -740,7 +744,9 @@ struct groupchat *skype_chat_with(struct im_connection *ic, char *who)
g_free(buf);
sd->groupchat_with = g_strdup(nick);
g_free(nick);
- return(NULL);
+ /* We create a fake chat for now. We will replace it with a real one in
+ * the real callback. */
+ return(imcb_chat_new( ic, "" ));
}
void init_plugin(void)