aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@frugalware.org>2008-12-21 20:37:59 +0100
committerMiklos Vajna <vmiklos@frugalware.org>2008-12-21 20:37:59 +0100
commit08a355bc2c95bee6ce53b3d6052ccb63684df8a8 (patch)
treec2a800358d7bf5e9d59e3958e6c15234a2c74701
parent7258d34ab4d1b1f55c3b52944a0b5264111ad3a2 (diff)
add 'skypeconsole' feature
this replaces the old client.py
-rw-r--r--skype/README8
-rw-r--r--skype/skype.c11
2 files changed, 18 insertions, 1 deletions
diff --git a/skype/README b/skype/README
index ee90ca3a..bf1bda66 100644
--- a/skype/README
+++ b/skype/README
@@ -342,6 +342,14 @@ $ skyped -n -d
* `account set skype/balance query`
+- For debug purposes, it's possible to send any command to `skyped`. To
+ achieve this, you need to:
+
+ * `account set skype/skypeconsole true`
+
+ * then writing `skypeconsole: <command>` will work in the control
+ channel.
+
== 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 470c1035..29d53e39 100644
--- a/skype/skype.c
+++ b/skype/skype.c
@@ -958,6 +958,9 @@ static void skype_login( account_t *acc )
sd->username = g_strdup( acc->user );
sd->ic = ic;
+
+ if (set_getbool(&acc->set, "skypeconsole"))
+ imcb_add_buddy(ic, "skypeconsole", NULL);
}
static void skype_logout( struct im_connection *ic )
@@ -985,7 +988,10 @@ static int skype_buddy_msg( struct im_connection *ic, char *who, char *message,
if(ptr)
*ptr = '\0';
- buf = g_strdup_printf("MESSAGE %s %s\n", nick, message);
+ if (!strncmp(who, "skypeconsole", 12))
+ buf = g_strdup_printf("%s\n", message);
+ else
+ buf = g_strdup_printf("MESSAGE %s %s\n", nick, message);
g_free(nick);
st = skype_write( ic, buf, strlen( buf ) );
g_free(buf);
@@ -1264,6 +1270,9 @@ static void skype_init( account_t *acc )
s->flags |= ACC_SET_NOSAVE | ACC_SET_ONLINE_ONLY;
s = set_add( &acc->set, "skypeout_offline", "true", set_eval_bool, acc );
+
+ s = set_add( &acc->set, "skypeconsole", "false", set_eval_bool, acc );
+ s->flags |= ACC_SET_OFFLINE_ONLY;
}
void init_plugin(void)