Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=bitlbee-skype.git;a=commitdiff;h=494f25ea4185789399e671b4dd24f5b1d0371b72

commit 494f25ea4185789399e671b4dd24f5b1d0371b72
Author: Miklos Vajna <[EMAIL PROTECTED]>
Date:   Sat Nov 24 00:45:43 2007 +0100

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"

diff --git a/README b/README
index c3f0f7e..c95271d 100644
--- a/README
+++ b/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.c b/skype.c
index 739e001..ee9f05f 100644
--- a/skype.c
+++ b/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)
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to