aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@frugalware.org>2008-12-21 21:00:30 +0100
committerMiklos Vajna <vmiklos@frugalware.org>2008-12-21 21:00:30 +0100
commit5acf9ab725181e59f475f17d4647b700b36015cd (patch)
treef3dd56774c8aacec322d1019a6b2ce021c93c299
parent08a355bc2c95bee6ce53b3d6052ccb63684df8a8 (diff)
support autojoin for bookmarked chats
-rw-r--r--skype/README5
-rw-r--r--skype/skype.c26
2 files changed, 31 insertions, 0 deletions
diff --git a/skype/README b/skype/README
index bf1bda66..6e1cd195 100644
--- a/skype/README
+++ b/skype/README
@@ -350,6 +350,11 @@ $ skyped -n -d
* then writing `skypeconsole: <command>` will work in the control
channel.
+- If you want to automatically join bookmarked groupchats right after
+ you logged in, do:
+
+ * `account set skype/auto_join true`
+
== What needs to be done (aka. TODO)
- Notice if foo invites bar. Currently you can see only that bar joined.
diff --git a/skype/skype.c b/skype/skype.c
index 29d53e39..86ae3af8 100644
--- a/skype/skype.c
+++ b/skype/skype.c
@@ -884,6 +884,22 @@ static gboolean skype_read_callback( gpointer data, gint fd, b_input_condition c
g_snprintf(buf, 1024, "PONG\n");
skype_write(ic, buf, strlen(buf));
}
+ else if(!strncmp(line, "CHATS ", 6))
+ {
+ char **i;
+ char **chats = g_strsplit(line + 6, ", ", 0);
+
+ i = chats;
+ while (*i)
+ {
+ g_snprintf(buf, 1024, "GET CHAT %s STATUS\n", *i);
+ skype_write( ic, buf, strlen( buf ) );
+ g_snprintf(buf, 1024, "GET CHAT %s ACTIVEMEMBERS\n", *i);
+ skype_write( ic, buf, strlen( buf ) );
+ i++;
+ }
+ g_strfreev(chats);
+ }
lineptr++;
}
g_strfreev(lines);
@@ -927,6 +943,13 @@ gboolean skype_start_stream( struct im_connection *ic )
buf = g_strdup_printf("SET USERSTATUS ONLINE\n");
skype_write( ic, buf, strlen( buf ) );
g_free(buf);
+
+ /* Auto join to bookmarked chats if requested.*/
+ if (set_getbool(&ic->acc->set, "auto_join")) {
+ buf = g_strdup_printf("SEARCH BOOKMARKEDCHATS\n");
+ skype_write( ic, buf, strlen( buf ) );
+ g_free(buf);
+ }
return st;
}
@@ -1273,6 +1296,9 @@ static void skype_init( account_t *acc )
s = set_add( &acc->set, "skypeconsole", "false", set_eval_bool, acc );
s->flags |= ACC_SET_OFFLINE_ONLY;
+
+ s = set_add( &acc->set, "auto_join", "false", set_eval_bool, acc );
+ s->flags |= ACC_SET_OFFLINE_ONLY;
}
void init_plugin(void)