# Path: txircd/modbase.py
# class Mode(object):
#     def hook(self, base):
#         self.ircd = base
#         return self
#     def checkSet(self, user, target, param):
#         return [True, param]
#     def checkUnset(self, user, target, param):
#         return [True, param]
#     def showParam(self, user, target, param):
#         return param
#     def checkPermission(self, user, cmd, data):
#         return data


from txircd.modbase import Mode

class InvisibleMode(Mode):
    def namesListEntry(self, recipient, channel, user, representation):
        if recipient not in channel.users and "i" in user.mode:
            return ""
        return representation
    
    def checkWhoVisible(self, user, targetUser, filters, fields, channel, udata):
        if channel:
            if user not in channel.users and "i" in targetUser.mode:
                return {}

# Path: txircd/modbase.py
# class Mode(object):
#     def hook(self, base):
#         self.ircd = base
#         return self
#     def checkSet(self, user, target, param):
#         return [True, param]
#     def checkUnset(self, user, target, param):
#         return [True, param]
#     def showParam(self, user, target, param):
#         return param
#     def checkPermission(self, user, cmd, data):
#         return data


# Path: txircd/modules/umode_i.py
from txircd.modbase import Mode


class InvisibleMode(Mode):
    def namesListEntry(self, recipient, channel, user, representation):
        if recipient not in channel.users and "i" in user.mode:
            return ""
        return representation
    
    def checkWhoVisible(self, user, targetUser, filters, fields, channel, udata):
        if channel:
            if user not in channel.users and "i" in targetUser.mode:
                return {}

        if "i" in targetUser.mode: