# 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()


from twisted.words.protocols import irc
from txircd.modbase import Command
        targetUser.sendMessage("INVITE", targetChan.name, prefix=user.prefix())
        if "invites" not in targetUser.cache:
            targetUser.cache["invites"] = [targetChan.name]
        else:
            targetUser.cache["invites"].append(targetChan.name)
    
    def processParams(self, user, params):
        if user.registered > 0:
            user.sendMessage(irc.ERR_NOTREGISTERED, "INVITE", ":You have not registered")
            return {}
        if not params or len(params) < 2:
            user.sendMessage(irc.ERR_NEEDMOREPARAMS, "INVITE", ":Not enough parameters")
            return {}
        if params[0] not in self.ircd.users:
            user.sendMessage(irc.ERR_NOSUCHNICK, params[0], ":No such nick/channel")
            return {}
        if params[1] not in self.ircd.channels:
            user.sendMessage(irc.ERR_NOSUCHNICK, params[1], ":No such nick/channel")
            return {}
        udata = self.ircd.users[params[0]]
        cdata = self.ircd.channels[params[1]]
        if udata in cdata.users:
            user.sendMessage(irc.ERR_USERONCHANNEL, udata.nickname, cdata.name, ":is already on channel")
            return {}
        if user not in cdata.users:
            user.sendMessage(irc.ERR_NOTONCHANNEL, cdata.name, ":You're not on that channel")
            return {}
        if "i" in cdata.mode and not user.hasAccess(cdata, self.ircd.servconfig["channel_minimum_level"]["INVITE"]):
            user.sendMessage(irc.ERR_CHANOPRIVSNEEDED, cdata.name, ":You're not a channel operator")
            return {}

# 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/modules/cmd_invite.py
from twisted.words.protocols import irc
from txircd.modbase import Command

        targetUser.sendMessage("INVITE", targetChan.name, prefix=user.prefix())
        if "invites" not in targetUser.cache:
            targetUser.cache["invites"] = [targetChan.name]
        else:
            targetUser.cache["invites"].append(targetChan.name)
    
    def processParams(self, user, params):
        if user.registered > 0:
            user.sendMessage(irc.ERR_NOTREGISTERED, "INVITE", ":You have not registered")
            return {}
        if not params or len(params) < 2:
            user.sendMessage(irc.ERR_NEEDMOREPARAMS, "INVITE", ":Not enough parameters")
            return {}
        if params[0] not in self.ircd.users:
            user.sendMessage(irc.ERR_NOSUCHNICK, params[0], ":No such nick/channel")
            return {}
        if params[1] not in self.ircd.channels:
            user.sendMessage(irc.ERR_NOSUCHNICK, params[1], ":No such nick/channel")
            return {}
        udata = self.ircd.users[params[0]]
        cdata = self.ircd.channels[params[1]]
        if udata in cdata.users:
            user.sendMessage(irc.ERR_USERONCHANNEL, udata.nickname, cdata.name, ":is already on channel")
            return {}
        if user not in cdata.users:
            user.sendMessage(irc.ERR_NOTONCHANNEL, cdata.name, ":You're not on that channel")
            return {}
        if "i" in cdata.mode and not user.hasAccess(cdata, self.ircd.servconfig["channel_minimum_level"]["INVITE"]):
            user.sendMessage(irc.ERR_CHANOPRIVSNEEDED, cdata.name, ":You're not a channel operator")
            return {}

        return {