mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Fixed leaving chat room
This commit is contained in:
parent
187ea6e8b8
commit
8099dfbde6
@ -1093,8 +1093,8 @@ _cmd_close(const char * const inp, struct cmd_help_t help)
|
||||
if (win_in_groupchat()) {
|
||||
char *room_jid = win_get_recipient();
|
||||
jabber_leave_chat_room(room_jid);
|
||||
}
|
||||
if (win_in_chat()) {
|
||||
win_close_win();
|
||||
} else if (win_in_chat()) {
|
||||
|
||||
if (prefs_get_states()) {
|
||||
char *recipient = win_get_recipient();
|
||||
|
@ -253,6 +253,7 @@ jabber_leave_chat_room(const char * const room_jid)
|
||||
xmpp_stanza_t *presence = xmpp_stanza_new(jabber_conn.ctx);
|
||||
xmpp_stanza_set_name(presence, STANZA_NAME_PRESENCE);
|
||||
xmpp_stanza_set_type(presence, STANZA_TYPE_UNAVAILABLE);
|
||||
xmpp_stanza_set_attribute(presence, STANZA_ATTR_TO, full_jid->str);
|
||||
xmpp_send(jabber_conn.conn, presence);
|
||||
xmpp_stanza_release(presence);
|
||||
|
||||
|
15
src/stanza.c
15
src/stanza.c
@ -98,4 +98,19 @@ stanza_create_room_presence(xmpp_ctx_t *ctx, const char * const room,
|
||||
|
||||
return presence;
|
||||
}
|
||||
/*
|
||||
xmpp_stanza_t *
|
||||
stanza_create_room_leave(xmpp_ctx_t *ctx, const char * const room,
|
||||
const char * const nick)
|
||||
{
|
||||
GString *full_jid = g_string_new(room);
|
||||
g_string_append(full_jid, "/");
|
||||
g_string_append(full_jid, nick);
|
||||
|
||||
xmpp_stanza_t *presence = xmpp_stanza_new(ctx);
|
||||
xmpp_stanza_set_name(presence, STANZA_NAME_PRESENCE);
|
||||
xmpp_stanza_set_type(presence, STANZA_TYPE_UNAVAILABLE);
|
||||
|
||||
g_string_free(full_jid, TRUE);
|
||||
}
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user