poll: be more resilient to restarts poll-channel-name
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Fri, 21 Sep 2012 12:31:37 +0000 (14:31 +0200)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Fri, 21 Sep 2012 12:36:25 +0000 (14:36 +0200)
commit17dbb806ce34ca6479e42bd3529b86fa8d3be31d
tree6207308aa0c6694b044139f4988ffd66160f6b1c
parent3fba86655eaf3fefd4068360234a42e34a013388
poll: be more resilient to restarts

When restarting or reconnecting to servers, the channel objects may
change, causing odd crashes when counting votes during poll closure.

This is easily fixed by letting poll.channel hold a string rather than
an object, but past polls reloaded from the registry will already have
actual Channel object stored, so we need to convert them. Do this, and
keep track of whether it has been done or not.
data/rbot/plugins/poll.rb