diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2007-12-09 23:19:35 +0000 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2007-12-09 23:19:35 +0000 |
commit | c058ff976bbbbf43ef11c262f21440e61244f73e (patch) | |
tree | fb5f6438555ab486d44925f7fd06f0d4265ec10d /protocols/jabber/jabber.c | |
parent | de0337481fca3894c406a2724da30af8cc8bae2f (diff) |
Added /invite support for Jabber chatrooms (and fixed the argument order
to chat_invite).
Diffstat (limited to 'protocols/jabber/jabber.c')
-rw-r--r-- | protocols/jabber/jabber.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index e2a3a27a..4c89ab5c 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -426,6 +426,20 @@ static void jabber_chat_leave_( struct groupchat *c ) jabber_chat_leave( c, NULL ); } +static void jabber_chat_invite_( struct groupchat *c, char *who, char *msg ) +{ + struct jabber_chat *jc = c->data; + gchar *msg_alt = NULL; + + if( msg == NULL ) + msg_alt = g_strdup_printf( "%s invited you to %s", c->ic->acc->user, jc->name ); + + if( c && who ) + jabber_chat_invite( c, who, msg ? msg : msg_alt ); + + g_free( msg_alt ); +} + static void jabber_keepalive( struct im_connection *ic ) { /* Just any whitespace character is enough as a keepalive for XMPP sessions. */ @@ -497,7 +511,7 @@ void jabber_initmodule() ret->remove_buddy = jabber_remove_buddy; ret->chat_msg = jabber_chat_msg_; ret->chat_topic = jabber_chat_topic_; -// ret->chat_invite = jabber_chat_invite; + ret->chat_invite = jabber_chat_invite_; ret->chat_leave = jabber_chat_leave_; ret->chat_join = jabber_chat_join_; ret->keepalive = jabber_keepalive; |