]>
Commit | Line | Data |
---|---|---|
685e346e A |
1 | from collection import *\r |
2 | from sys_base import *\r | |
3 | \r | |
4 | class Channel(CollectionEntity):\r | |
5 | def __init__(self, id, name):\r | |
6 | CollectionEntity.__init__(self, id)\r | |
7 | self.name = name\r | |
8 | \r | |
9 | news = None\r | |
10 | \r | |
11 | class ChannelManager(CollectionManager, Subsystem):\r | |
12 | def __init__(self, module, type = Channel):\r | |
13 | Subsystem.__init__(self, module, module.options, 'channels')\r | |
14 | CollectionManager.__init__(self, type)\r | |
15 | \r | |
16 | def on_added(self, channel):\r | |
17 | self.module.join(channel)\r | |
18 | \r | |
19 | def on_removed(self, channel):\r | |
20 | self.module.part(channel)\r | |
21 | \r | |
22 | def on_banned(self, channel):\r | |
23 | self.module.part(channel)\r | |
24 | \r | |
25 | def on_unbanned(self, channel):\r | |
26 | if channel in self:\r | |
27 | self.module.join(channel)\r |