]> jfr.im git - erebus.git/commitdiff
fixed lib.OWNER - created lib.COWNER
authorzonidjan <redacted>
Sun, 26 Mar 2017 02:21:42 +0000 (21:21 -0500)
committerzonidjan <redacted>
Sun, 26 Mar 2017 02:21:42 +0000 (21:21 -0500)
modlib.py

index 30e07858987a5ee3f38cf7e92654e2534d97d956..6862b0e09f1dceeacc0b8453c274e86f488876af 100644 (file)
--- a/modlib.py
+++ b/modlib.py
@@ -22,7 +22,7 @@ class modlib(object):
        ANYONE  =  -1
 
        # (channel) access levels
-       OWNER   =   5
+       COWNER  =   5
        MASTER  =   4
        OP      =   3
        VOICE   =   2
@@ -44,6 +44,7 @@ class modlib(object):
                self.parent = parent
                for cmd, func in self.hooks.iteritems():
                        self.parent.hook(cmd, func)
+                       self.parent.hook("%s.%s" % (self.name, cmd), func)
                for num, func in self.numhooks.iteritems():
                        self.parent.hooknum(num, func)
                for chan, func in self.chanhooks.iteritems():
@@ -52,6 +53,7 @@ class modlib(object):
        def modstop(self, parent):
                for cmd, func in self.hooks.iteritems():
                        self.parent.unhook(cmd, func)
+                       self.parent.unhook("%s.%s" % (self.name, cmd), func)
                for num, func in self.numhooks.iteritems():
                        self.parent.unhooknum(num, func)
                for chan, func in self.chanhooks.iteritems():
@@ -91,6 +93,7 @@ class modlib(object):
                                self.hooks[c] = func
                                if self.parent is not None:
                                        self.parent.hook(c, func)
+                                       self.parent.hook("%s.%s" % (self.name, c), func)
                        return func
                return realhook