about summary refs log tree commit diff stats
path: root/src/xmpp/message.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-04-20 20:18:13 +0100
committerJames Booth <boothj5@gmail.com>2013-04-20 20:18:13 +0100
commit81020e6d4378e98039f1ba91bbba748c4283e7d1 (patch)
treebde9e4eb6e9377a5451275b4a5a9ed46c5f156ba /src/xmpp/message.c
parent91d587a19fde76a04560b3c100298253fd7d7aa5 (diff)
downloadprofani-tty-81020e6d4378e98039f1ba91bbba748c4283e7d1.tar.gz
Added /invite for direct MUC invitations
Diffstat (limited to 'src/xmpp/message.c')
-rw-r--r--src/xmpp/message.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/src/xmpp/message.c b/src/xmpp/message.c
index ace42a31..d18abd62 100644
--- a/src/xmpp/message.c
+++ b/src/xmpp/message.c
@@ -94,6 +94,18 @@ message_send_groupchat(const char * const msg, const char * const recipient)
 }
 
 void
+message_send_invite(const char * const room, const char * const contact,
+    const char * const reason)
+{
+    xmpp_conn_t * const conn = connection_get_conn();
+    xmpp_ctx_t * const ctx = connection_get_ctx();
+    xmpp_stanza_t *stanza = stanza_create_invite(ctx, room, contact, reason);
+
+    xmpp_send(conn, stanza);
+    xmpp_stanza_release(stanza);
+}
+
+void
 message_send_composing(const char * const recipient)
 {
     xmpp_conn_t * const conn = connection_get_conn();
@@ -149,23 +161,6 @@ static int
 _conference_message_handler(xmpp_conn_t * const conn,
     xmpp_stanza_t * const stanza, void * const userdata)
 {
-/*
- * <message to="prof2@panesar" from="test@conference.panesar">
- *      <x xmlns="http://jabber.org/protocol/muc#user">
- *          <invite from="prof4@panesar/2572c43f-aa3d-42fa-a74e-c322a80a90b8">
- *              <reason>Join the room!</reason>
- *          </invite>
- *      </x>
- *      <x jid="test@conference.panesar" xmlns="jabber:x:conference">
- *          Join the room!
- *      </x>
- *      <body>
- *          prof4@panesar/2572c43f-aa3d-42fa-a74e-c322a80a90b8 invited you to the room test@conference.panesar (Join the room!)
- *      </body>
- * </message>
- *
- */
-
     xmpp_stanza_t *x_muc = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_MUC_USER);
     xmpp_stanza_t *x_groupchat = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_CONFERENCE);
     char *from = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_FROM);