about summary refs log tree commit diff stats
path: root/jabber.c
diff options
context:
space:
mode:
Diffstat (limited to 'jabber.c')
-rw-r--r--jabber.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/jabber.c b/jabber.c
index 3dc5a18c..ce04aaa4 100644
--- a/jabber.c
+++ b/jabber.c
@@ -180,7 +180,7 @@ void jabber_roster_request(void)
     xmpp_stanza_release(iq);
 }
 
-void jabber_update_presence(jabber_presence_t status)
+void jabber_update_presence(jabber_presence_t status, const char * const msg)
 {
     jabber_conn.presence = status;
 
@@ -211,6 +211,19 @@ void jabber_update_presence(jabber_presence_t status)
         xmpp_stanza_release(show);
     }
 
+    if (msg != NULL) {
+        xmpp_stanza_t *status = xmpp_stanza_new(jabber_conn.ctx);
+        xmpp_stanza_set_name(status, "status");
+        xmpp_stanza_t *text = xmpp_stanza_new(jabber_conn.ctx);
+
+        xmpp_stanza_set_text(text, msg);
+
+        xmpp_stanza_add_child(status, text);
+        xmpp_stanza_add_child(pres, status);
+        xmpp_stanza_release(text);
+        xmpp_stanza_release(status);
+    }
+
     xmpp_send(jabber_conn.conn, pres);
     xmpp_stanza_release(pres);
 }