# Path: txircd/modbase.py
# class Command(object):
#     def hook(self, base):
#         self.ircd = base
#         return self
#     def onUse(self, user, data):
#         pass
#     def processParams(self, user, params):
#         return {
#             "user": user,
#             "params": params
#         }
#     def updateActivity(self, user):
#         user.lastactivity = now()
# 
# Path: txircd/utils.py
# def irc_lower(str):
#     return str.lower().replace("[","{").replace("]","}").replace("/","|").replace("~","^")


from twisted.words.protocols import irc
from txircd.modbase import Command
from txircd.utils import irc_lower
                "CURRENTAUCTION": BSCurrentAuctionCommand(),
                
                "SERVADMIN": OSServAdminCommand(self)
            },
            "actions": {
                "commandpermission": self.commandPermission,
                "netsplit": self.onNetsplit
            },
            "server": {
                "ServiceServer": self.noteServer,
                "ServiceBlockUser": self.addBlock,
                "ServiceUnblockUser": self.removeBlock,
                "ServiceAdmins": self.setAdmins,
                "ServiceLogin": self.loginUser,
                "ServiceLogout": self.logoutUser
            }
        }
    
    def commandPermission(self, user, cmd, data):
        if cmd == "NICK" and data["nick"] in [ self.ircd.servconfig["services_nickserv_nick"], self.ircd.servconfig["services_chanserv_nick"], self.ircd.servconfig["services_bidserv_nick"] ]:
            user.sendMessage(irc.ERR_ERRONEUSNICKNAME, data["nick"], ":Invalid nickname: Reserved for Services")
            return {}
        if self.ircd.servconfig["services_nickserv_nick"] not in self.ircd.users:
            return data
        nickserv = self.ircd.users[self.ircd.servconfig["services_nickserv_nick"]]
        if user not in self.blockedUsers:
            return data
        if cmd == "PRIVMSG":
            to_nickserv = False
            for u in data["targetuser"]:

# Path: txircd/modbase.py
# class Command(object):
#     def hook(self, base):
#         self.ircd = base
#         return self
#     def onUse(self, user, data):
#         pass
#     def processParams(self, user, params):
#         return {
#             "user": user,
#             "params": params
#         }
#     def updateActivity(self, user):
#         user.lastactivity = now()
# 
# Path: txircd/utils.py
# def irc_lower(str):
#     return str.lower().replace("[","{").replace("]","}").replace("/","|").replace("~","^")


# Path: txircd/modules/db_services_leaf.py
from twisted.words.protocols import irc
from txircd.modbase import Command
from txircd.utils import irc_lower

                "CURRENTAUCTION": BSCurrentAuctionCommand(),
                
                "SERVADMIN": OSServAdminCommand(self)
            },
            "actions": {
                "commandpermission": self.commandPermission,
                "netsplit": self.onNetsplit
            },
            "server": {
                "ServiceServer": self.noteServer,
                "ServiceBlockUser": self.addBlock,
                "ServiceUnblockUser": self.removeBlock,
                "ServiceAdmins": self.setAdmins,
                "ServiceLogin": self.loginUser,
                "ServiceLogout": self.logoutUser
            }
        }
    
    def commandPermission(self, user, cmd, data):
        if cmd == "NICK" and data["nick"] in [ self.ircd.servconfig["services_nickserv_nick"], self.ircd.servconfig["services_chanserv_nick"], self.ircd.servconfig["services_bidserv_nick"] ]:
            user.sendMessage(irc.ERR_ERRONEUSNICKNAME, data["nick"], ":Invalid nickname: Reserved for Services")
            return {}
        if self.ircd.servconfig["services_nickserv_nick"] not in self.ircd.users:
            return data
        nickserv = self.ircd.users[self.ircd.servconfig["services_nickserv_nick"]]
        if user not in self.blockedUsers:
            return data
        if cmd == "PRIVMSG":
            to_nickserv = False
            for u in data["targetuser"]:

                if irc_lower(u.nickname) == irc_lower(nickserv.nickname):