mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-28 17:06:22 +00:00
Allow message with status updates
This commit is contained in:
15
jabber.c
15
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user