aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/jabber/conference.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2007-12-09 23:19:35 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2007-12-09 23:19:35 +0000
commitc058ff976bbbbf43ef11c262f21440e61244f73e (patch)
treefb5f6438555ab486d44925f7fd06f0d4265ec10d /protocols/jabber/conference.c
parentde0337481fca3894c406a2724da30af8cc8bae2f (diff)
Added /invite support for Jabber chatrooms (and fixed the argument order
to chat_invite).
Diffstat (limited to 'protocols/jabber/conference.c')
-rw-r--r--protocols/jabber/conference.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/protocols/jabber/conference.c b/protocols/jabber/conference.c
index c5bc0e68..074412ec 100644
--- a/protocols/jabber/conference.c
+++ b/protocols/jabber/conference.c
@@ -175,6 +175,27 @@ int jabber_chat_leave( struct groupchat *c, const char *reason )
return 1;
}
+void jabber_chat_invite( struct groupchat *c, char *who, char *message )
+{
+ struct xt_node *node;
+ struct im_connection *ic = c->ic;
+ struct jabber_chat *jc = c->data;
+
+ node = xt_new_node( "reason", message, NULL );
+
+ node = xt_new_node( "invite", NULL, node );
+ xt_add_attr( node, "to", who );
+
+ node = xt_new_node( "x", NULL, node );
+ xt_add_attr( node, "xmlns", XMLNS_MUC_USER );
+
+ node = jabber_make_packet( "message", NULL, jc->name, node );
+
+ jabber_write_packet( ic, node );
+
+ xt_free_node( node );
+}
+
/* Not really the same syntax as the normal pkt_ functions, but this isn't
called by the xmltree parser directly and this way I can add some extra
parameters so we won't have to repeat too many things done by the caller