core: Fix IrcChannel.preserve. Closes GH-1106.

This commit is contained in:
Valentin Lorentz 2015-05-16 03:59:36 +02:00
parent 82b8bf801a
commit f1fae13b4a

View File

@ -478,6 +478,8 @@ class IrcChannel(object):
for capability in self.capabilities:
write('capability ' + capability)
bans = self.bans.items()
bans = [(x, (y, None) if isinstance(y, int) else y)
for (x, y) in bans]
utils.sortBy(lambda x:x[1][0], bans)
for (ban, (expiration, description)) in bans:
write('ban %s %d %s' % (ban, expiration, description))