aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVMiklos <vmiklos@frugalware.org>2007-10-06 21:20:12 +0200
committerVMiklos <vmiklos@frugalware.org>2007-10-06 21:20:12 +0200
commit72aa7f08b94aada5a15ee1185e468d695ef54106 (patch)
treecaf94e48f17e05f432c4462171dec1140ec9229d
parent2d0780303e487cbca12ac1443a951b77339068b5 (diff)
initial groupchat support
read: we detect that we are invited we retreive the nicklist but we can't receive/send messages yet
-rw-r--r--skype/skype.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/skype/skype.c b/skype/skype.c
index 9658c796..615fca01 100644
--- a/skype/skype.c
+++ b/skype/skype.c
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <poll.h>
#include <bitlbee.h>
+#include <glib.h>
#define SKYPE_PORT_DEFAULT "2727"
@@ -169,6 +170,19 @@ void skype_buddy_ask( struct im_connection *ic, char *handle, char *message)
g_free( buf );
}
+struct groupchat *skype_chat_by_name( struct im_connection *ic, char *name )
+{
+ struct groupchat *ret;
+
+ for( ret = ic->conversations; ret; ret = ret->next )
+ {
+ if(strcmp(name, ret->title ) == 0 )
+ break;
+ }
+
+ return ret;
+}
+
static gboolean skype_read_callback( gpointer data, gint fd, b_input_condition cond )
{
struct im_connection *ic = data;
@@ -391,6 +405,29 @@ static gboolean skype_read_callback( gpointer data, gint fd, b_input_condition c
info++;
if(!strncmp(info, "TOPIC ", 6))
sd->topic = 1;
+ else if(!strcmp(info, "STATUS MULTI_SUBSCRIBED"))
+ {
+ struct groupchat *gc;
+ gc = imcb_chat_new( ic, id );
+ }
+ else if(!strncmp(info, "ACTIVEMEMBERS ", 14))
+ {
+ info += 14;
+ struct groupchat *gc = skype_chat_by_name(ic, id);
+ if(!gc)
+ gc = imcb_chat_new( ic, id );
+ char **members = g_strsplit(info, " ", 0);
+ int i;
+ for(i=0;members[i];i++)
+ {
+ if(!strcmp(members[i], sd->username))
+ continue;
+ g_snprintf(buf, 1024, "%s@skype.com", members[i]);
+ imcb_chat_add_buddy(gc, buf);
+ }
+ imcb_chat_add_buddy(gc, sd->username);
+ g_strfreev(members);
+ }
}
}
lineptr++;