mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-18 17:46:21 +00:00
Moved function to remove from roster on nick change
This commit is contained in:
@@ -736,10 +736,11 @@ _room_presence_handler(const char * const jid, xmpp_stanza_t * const stanza)
|
||||
}
|
||||
|
||||
if ((type != NULL) && (strcmp(type, STANZA_TYPE_UNAVAILABLE) == 0)) {
|
||||
|
||||
// handle nickname change
|
||||
if (stanza_is_room_nick_change(stanza)) {
|
||||
char *new_nick = stanza_get_new_nick(stanza);
|
||||
room_add_pending_nick_change(room, new_nick, nick);
|
||||
room_remove_from_roster(room, nick);
|
||||
} else {
|
||||
prof_handle_room_member_offline(room, nick, "offline", status_str);
|
||||
}
|
||||
|
||||
@@ -240,6 +240,7 @@ room_add_pending_nick_change(const char * const room,
|
||||
|
||||
if (chat_room != NULL) {
|
||||
g_hash_table_insert(chat_room->nick_changes, strdup(new_nick), strdup(old_nick));
|
||||
room_remove_from_roster(room, old_nick);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user