Added jabber_join for MUC

This commit is contained in:
James Booth
2012-11-04 22:59:52 +00:00
parent 191b3b96a2
commit 5e4c662b23
3 changed files with 17 additions and 0 deletions

View File

@@ -279,6 +279,21 @@ jabber_subscribe(const char * const recipient)
xmpp_stanza_release(presence);
}
void
jabber_join(const char * const room_jid, const char * const nick)
{
xmpp_stanza_t *presence = xmpp_stanza_new(jabber_conn.ctx);
xmpp_stanza_set_name(presence, "presence");
GString *to = g_string_new(room_jid);
g_string_append(to, "/");
g_string_append(to, nick);
xmpp_stanza_set_attribute(presence, "to", to->str);
xmpp_send(jabber_conn.conn, presence);
xmpp_stanza_release(presence);
}
void
jabber_update_presence(jabber_presence_t status, const char * const msg)
{