Beispiel #1
0
 def send_list(self,user):
     '''
     send server channel list to user
     '''
     user.send_num(321,'Channel Users :Name')
     for chan in self.chans:
         chan = self.chans[chan]
         if chan.is_invisible:
             continue
         user.send_raw({'src':self,'cmd':322,'target':'%s %s %d'%(user,chan,len(chan)),'param':chan.topic or ''})
     user.send_num(323 ,'End of LIST')
Beispiel #2
0
    def send_motd(self,user):
        '''
        send the message of the day to user
        '''
        user.send_num(375,'- %s Message of the day - '%self)
        for line in self.motd().split('\n'):
            user.send_num(372,'- %s'%line)

        user.send_num(376,'- End of MOTD command')
Beispiel #3
0
    def send_welcome(self,user):
        '''
        welcome user to the server
        does not add user to users list
        '''
        # send intial 001 response
        if not user.is_torchat:
            user.send_num('001','Welcome to Internet Relay chat %s'%user)
            user.send_num('002','Your host is %s, running %s'%(self,self.version()))
            user.send_num('003','This server was created on 00:00 Jan 1 1970')
            user.send_num('004','%s %s x :x'%(self,self.version()))

        # send the motd
        self.send_motd(user)
        # if there is an after_motd hook function to call , call it
        if hasattr(user,'after_motd') and user.after_motd is not None:
            user.after_motd()
        if user.nick.endswith('.onion'):
            return
        # user has been welcomed
        user.welcomed = True
        # set +P as needed
        if self.poniponi is not None:
            user.you_poni_now()