Skip to content

Commit

Permalink
Fixes #4 - Entering / exiting room lists with unauthenticated
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdimarco committed Nov 1, 2013
1 parent 388948c commit 0f3e8ac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/js/firechat.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,13 +363,14 @@
// Leave a chat room.
Firechat.prototype.leaveRoom = function(roomId) {
var self = this,
userRoomRef = self._firebase.child('room-users').child(roomId),
presenceRef = userRoomRef.child(self._userId).child(self._sessionId);
userRoomRef = self._firebase.child('room-users').child(roomId);

// Remove listener for new messages to this room.
self._messageRef.child(roomId).off();

if (self._user) {
var presenceRef = userRoomRef.child(self._userId).child(self._sessionId);

// Remove presence bit for the room and cancel on-disconnect removal.
self._removePresenceOperation(presenceRef.toString(), null);

Expand Down

0 comments on commit 0f3e8ac

Please sign in to comment.