diff --git a/src/jabber.c b/src/jabber.c index a94a6693..fc0b7d2f 100644 --- a/src/jabber.c +++ b/src/jabber.c @@ -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); } diff --git a/src/room_chat.c b/src/room_chat.c index c735c75f..a81914aa 100644 --- a/src/room_chat.c +++ b/src/room_chat.c @@ -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); } }