# Path: txircd/modbase.py
# class Module(object):
#     def hook(self, base):
#         self.ircd = base
#         return self


from txircd.modbase import Module

class AwayNotify(Module):
    def capRequest(self, user, capability):
        return True
    
    def capAcknowledge(self, user, capability):
        return False
    
    def capRequestRemove(self, user, capability):
        return True
    
    def capAcknowledgeRemove(self, user, capability):
        return False
    
    def capClear(self, user, capability):
        return True
    
    def notifyUsers(self, user, namespace, key, oldValue, value):
        try:
            if not (namespace == "ext" and key == "away"):
                return
            message = value
            if "away" not in user.metadata["ext"]:
                message = None
            notify = set()
            for channel in self.ircd.channels.itervalues():
                if user in channel.users:

# Path: txircd/modbase.py
# class Module(object):
#     def hook(self, base):
#         self.ircd = base
#         return self


# Path: txircd/modules/ircv3_away-notify.py
from txircd.modbase import Module


class AwayNotify(Module):
    def capRequest(self, user, capability):
        return True
    
    def capAcknowledge(self, user, capability):
        return False
    
    def capRequestRemove(self, user, capability):
        return True
    
    def capAcknowledgeRemove(self, user, capability):
        return False
    
    def capClear(self, user, capability):
        return True
    
    def notifyUsers(self, user, namespace, key, oldValue, value):
        try:
            if not (namespace == "ext" and key == "away"):
                return
            message = value
            if "away" not in user.metadata["ext"]:
                message = None
            notify = set()
            for channel in self.ircd.channels.itervalues():
                if user in channel.users:

                    for u in channel.users.iterkeys():