Exemplo n.º 1
0
Arquivo: IRC.py Projeto: 4rChon/gadget
 def userQuit(self, user, reason):
     for channel in self.channels: #TODO: figure out which channels the user is in
         handle_message(
             make_context(
                 protocol=self.factory,
                 source=self.network+channel,
                 name=None,
                 body="[IRC] %s quit (%s)" % (user, reason),
                 isFormatted=True,
             )
         )
Exemplo n.º 2
0
Arquivo: IRC.py Projeto: 4rChon/gadget
 def userKicked(self, user, channel, kicker, reason):
     if channel in self.channels:
         handle_message(
             make_context(
                 protocol=self.factory,
                 source=self.network+channel,
                 name=None,
                 body="[IRC] <%s> %s was kicked by %s (%s)" % (channel, user, kicker, reason),
                 isFormatted=True,
             )
         )
Exemplo n.º 3
0
Arquivo: IRC.py Projeto: 4rChon/gadget
 def userLeft(self, user, channel):
     if channel in self.channels:
         handle_message(
             make_context(
                 protocol=self.factory,
                 source=self.network+channel,
                 name=None,
                 body="[IRC] <%s> %s left" % (channel, user,),
                 isFormatted=True,
             )
         )
Exemplo n.º 4
0
Arquivo: IRC.py Projeto: 4rChon/gadget
 def userRenamed(self, old, new):
     for channel in self.channels: #TODO: figure out which channels the user is in
         handle_message(
             make_context(
                 protocol=self.factory,
                 source=self.network+channel,
                 name=None,
                 body="[IRC] %s changed name to %s" % (old, new),
                 isFormatted=True,
             )
         )
Exemplo n.º 5
0
 def message_handler(self, msg, status):
     if status == skype4py.cmsReceived:
         context = make_context(
             protocol=self,
             source=msg.ChatName,
             name=msg.FromDisplayName,
             body=msg.Body,
             skypeHandle=msg.FromHandle,
             isEmote=msg.Type == skype4py.cmeEmoted,
         )
         
         reactor.callFromThread(handle_message, context)
Exemplo n.º 6
0
 def message_handler(self, msg, status):
     if status == skype4py.cmsReceived:
         emote = False
         
         if msg.Type == skype4py.cmeEmoted:
             emote = True
         
         handle_message(
             make_context(
                 protocol=self,
                 source=msg.ChatName,
                 name=msg.FromDisplayName,
                 body=msg.Body,
                 skypeHandle=msg.FromHandle,
                 isEmote=emote,
             )
         )
Exemplo n.º 7
0
Arquivo: IRC.py Projeto: 4rChon/gadget
 def privmsg(self, user, channel, message, action=False):
     name = user.split("!")[0]
     isGlobal = (channel in self.channels)
     
     if channel in self.channels:
         source = channel
     else:
         source = '!' + name
             
     handle_message(
         make_context(
             protocol=self.factory,
             source=self.network + source,
             name=name,
             body=message,
             isEmote=action,
             isGlobal=isGlobal,
         )
     )