mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
parent
03703fa8f7
commit
bf4c1a810f
@ -145,8 +145,10 @@ muc_join_room(const char * const room, const char * const nick)
|
|||||||
void
|
void
|
||||||
muc_leave_room(const char * const room)
|
muc_leave_room(const char * const room)
|
||||||
{
|
{
|
||||||
|
if (rooms != NULL) {
|
||||||
g_hash_table_remove(rooms, room);
|
g_hash_table_remove(rooms, room);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns TRUE if the user is currently in the room
|
* Returns TRUE if the user is currently in the room
|
||||||
|
@ -192,6 +192,11 @@ prof_handle_error_message(const char *from, const char *err_msg)
|
|||||||
} else {
|
} else {
|
||||||
cons_show_error("Error received from server: %s", err_msg);
|
cons_show_error("Error received from server: %s", err_msg);
|
||||||
}
|
}
|
||||||
|
// remove the room from muc
|
||||||
|
Jid *room_jid = jid_create(from);
|
||||||
|
muc_leave_room(room_jid->barejid);
|
||||||
|
jid_destroy(room_jid);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
cons_show_error("Error received from server: %s", err_msg);
|
cons_show_error("Error received from server: %s", err_msg);
|
||||||
}
|
}
|
||||||
|
@ -303,11 +303,13 @@ presence_leave_chat_room(const char * const room_jid)
|
|||||||
xmpp_conn_t *conn = connection_get_conn();
|
xmpp_conn_t *conn = connection_get_conn();
|
||||||
char *nick = muc_get_room_nick(room_jid);
|
char *nick = muc_get_room_nick(room_jid);
|
||||||
|
|
||||||
|
if (nick != NULL) {
|
||||||
xmpp_stanza_t *presence = stanza_create_room_leave_presence(ctx, room_jid,
|
xmpp_stanza_t *presence = stanza_create_room_leave_presence(ctx, room_jid,
|
||||||
nick);
|
nick);
|
||||||
xmpp_send(conn, presence);
|
xmpp_send(conn, presence);
|
||||||
xmpp_stanza_release(presence);
|
xmpp_stanza_release(presence);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_unsubscribed_handler(xmpp_conn_t * const conn,
|
_unsubscribed_handler(xmpp_conn_t * const conn,
|
||||||
|
Loading…
Reference in New Issue
Block a user