Handle when servers dont send status 101 or jid for MUC nick changes

This commit is contained in:
James Booth
2013-08-05 21:20:07 +01:00
parent e170965c93
commit 55282e063d
5 changed files with 72 additions and 16 deletions

View File

@@ -567,13 +567,13 @@ _room_presence_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
// handle self presence
if (stanza_is_muc_self_presence(stanza, jabber_get_fulljid())) {
char *type = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_TYPE);
gboolean nick_change = stanza_is_room_nick_change(stanza);
char *new_nick = stanza_is_room_nick_change(stanza);
if ((type != NULL) && (strcmp(type, STANZA_TYPE_UNAVAILABLE) == 0)) {
// leave room if not self nick change
if (nick_change) {
muc_set_room_pending_nick_change(room);
if (new_nick != NULL) {
muc_set_room_pending_nick_change(room, new_nick);
} else {
prof_handle_leave_room(room);
}
@@ -606,7 +606,7 @@ _room_presence_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
if ((type != NULL) && (strcmp(type, STANZA_TYPE_UNAVAILABLE) == 0)) {
// handle nickname change
if (stanza_is_room_nick_change(stanza)) {
if (stanza_is_room_nick_change(stanza) != NULL) {
char *new_nick = stanza_get_new_nick(stanza);
muc_set_roster_pending_nick_change(room, new_nick, nick);
} else {