1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

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

@ -1016,6 +1016,7 @@ _cmd_join(const char * const inp, struct cmd_help_t help)
} }
cons_show("Joining %s as %s", room_jid, nick); cons_show("Joining %s as %s", room_jid, nick);
jabber_join(room_jid, nick);
} }
} }

View File

@ -279,6 +279,21 @@ jabber_subscribe(const char * const recipient)
xmpp_stanza_release(presence); 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 void
jabber_update_presence(jabber_presence_t status, const char * const msg) jabber_update_presence(jabber_presence_t status, const char * const msg)
{ {

View File

@ -46,6 +46,7 @@ jabber_conn_status_t jabber_connect(const char * const user,
void jabber_disconnect(void); void jabber_disconnect(void);
void jabber_process_events(void); void jabber_process_events(void);
void jabber_subscribe(const char * const recipient); void jabber_subscribe(const char * const recipient);
void jabber_join(const char * const room_jid, const char * const nick);
void jabber_send(const char * const msg, const char * const recipient); void jabber_send(const char * const msg, const char * const recipient);
void jabber_send_inactive(const char * const recipient); void jabber_send_inactive(const char * const recipient);
void jabber_send_composing(const char * const recipient); void jabber_send_composing(const char * const recipient);