fix poll unvoting

This commit is contained in:
Erik 2014-05-22 18:08:24 -04:00
parent baa8af58bc
commit d004c0bcdd
1 changed files with 7 additions and 0 deletions

View File

@ -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;