Example #1
0
File: IRC.py Project: 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,
             )
         )
Example #2
0
File: IRC.py Project: 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,
             )
         )
Example #3
0
File: IRC.py Project: 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,
             )
         )
Example #4
0
File: IRC.py Project: 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,
             )
         )
Example #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)
Example #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,
             )
         )
Example #7
0
File: IRC.py Project: 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,
         )
     )