From c51a98c6693c0e6b337c8ef25977ce8cd80110d0 Mon Sep 17 00:00:00 2001 From: Melissa Noelle Date: Wed, 7 Jan 2015 14:59:07 -0500 Subject: [PATCH] Replaced with room object. Removed room nullification. --- src/core/event.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/core/event.js b/src/core/event.js index 998242f7..284d5a13 100644 --- a/src/core/event.js +++ b/src/core/event.js @@ -706,12 +706,7 @@ Candy.Core.Event = (function(self, Strophe, $) { Candy.Core.log('[Jabber:Room] Presence Error'); var from = Candy.Util.unescapeJid(msg.attr('from')), roomJid = Strophe.getBareJidFromJid(from), - room = Candy.Core.getRooms()[roomJid], - roomName = room.getName(); - - // Presence error: Remove room from array to prevent error when disconnecting - Candy.Core.removeRoom(roomJid); - room = undefined; + room = Candy.Core.getRoom(roomJid); /** Event: candy:core.presence.error * Triggered when a presence error happened @@ -719,14 +714,12 @@ Candy.Core.Event = (function(self, Strophe, $) { * Parameters: * (Object) msg - jQuery object of XML message * (String) type - Error type - * (String) roomJid - Room jid - * (String) roomName - Room name + * (Candy.Core.Chatroom) room -- room object with presence error */ $(Candy).triggerHandler('candy:core.presence.error', { 'msg' : msg, 'type': msg.children('error').children()[0].tagName.toLowerCase(), - 'roomJid': roomJid, - 'roomName': roomName + 'room': room; }); return true; },