1
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-01-03 14:57:42 -05:00

Moved function to remove from roster on nick change

This commit is contained in:
James Booth 2012-11-18 22:07:26 +00:00
parent 154c98ed65
commit c6b07533c9
2 changed files with 3 additions and 1 deletions

View File

@ -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);
}

View File

@ -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);
}
}