]> jfr.im git - irc/rizon/acid.git/blob - pyva/pyva/src/main/python/pseudoclient/sys_channels.py
Split pyva plugin into pyva.core and pyva.pyva
[irc/rizon/acid.git] / pyva / pyva / src / main / python / pseudoclient / sys_channels.py
1 from collection import *
2 from sys_base import *
3
4 class Channel(CollectionEntity):
5 def __init__(self, id, name):
6 CollectionEntity.__init__(self, id)
7 self.name = name
8
9 news = None
10
11 class ChannelManager(CollectionManager, Subsystem):
12 def __init__(self, module, type = Channel):
13 Subsystem.__init__(self, module, module.options, 'channels')
14 CollectionManager.__init__(self, type)
15
16 def on_added(self, channel):
17 self.module.join(channel)
18
19 def on_removed(self, channel):
20 self.module.part(channel)
21
22 def on_banned(self, channel):
23 self.module.part(channel)
24
25 def on_unbanned(self, channel):
26 if channel in self:
27 self.module.join(channel)