From d004c0bcdde6efd7ced9603566bda2b65c62dc9d Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 22 May 2014 18:08:24 -0400 Subject: [PATCH] fix poll unvoting --- lib/channel/poll.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/channel/poll.js b/lib/channel/poll.js index cb320fcd..f6991327 100644 --- a/lib/channel/poll.js +++ b/lib/channel/poll.js @@ -65,6 +65,13 @@ PollModule.prototype.onUserPostJoin = function (user) { user.socket.on("closePoll", this.handleClosePoll.bind(this, user)); }; +PollModule.prototype.onUserPart = function(user) { + if (this.poll) { + this.poll.unvote(user.ip); + this.sendPollUpdate(this.channel.users); + } +}; + PollModule.prototype.sendPoll = function (users) { if (!this.poll) { return;