Exemple #1
0
    def remove_nick(self, nick, channel=None):
        nick_lower = lower(nick)

        if channel is None:
            for channel in self.channels:
                del self.channels[channel]['nicks'][nick_lower]
        else:
            del self.channels[lower(channel)]['nicks'][nick_lower]
Exemple #2
0
    def update_nick(self, nick, channel, user=None, host=None, mode=None):
        nick_lower = lower(nick)
        channel_lower = lower(channel)

        if user is not None:
            self.channels[channel_lower]['nicks'][nick_lower][1] = user

        if host is not None:
            self.channels[channel_lower]['nicks'][nick_lower][2] = host

        if mode is not None:
            self.channels[channel_lower]['nicks'][nick_lower][3] = mode
Exemple #3
0
    def add_channel(self, channel):
        channel_lower = lower(channel)

        if self.channels.get(channel_lower) is None:
            self.channels[channel_lower] = {'nicks': {},
                                            'mode': '',
                                            'topic': '',}
Exemple #4
0
    def update_channel(self, channel, mode=None, topic=None):
        channel_lower = lower(channel)

        if mode is not None:
            self.channels[channel_lower]['mode'] = mode

        if topic is not None:
            self.channels[channel_lower]['topic'] = topic
Exemple #5
0
 def get_nick_mode(self, nick, channel):
     return self.channels.get(lower(channel), {'nicks': {}}). \
                          get(lower(nick), [None, None, None, None])[3]
Exemple #6
0
 def get_nick_host(self, nick, channel=None):
     return self.channels.get(lower(channel), {'nicks': {}}). \
                          get(lower(nick), [None, None, None])[2]
Exemple #7
0
    def add_nick(self, nick, channel):
        self.add_channel(channel)

        self.channels[lower(channel)]['nicks'][lower(nick)] = [nick, None,
                                                               None, None]
Exemple #8
0
 def remove_channel(self, channel):
     del self.channels[lower(channel)]