예제 #1
0
파일: IRC.py 프로젝트: 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,
             )
         )
예제 #2
0
파일: IRC.py 프로젝트: 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,
             )
         )
예제 #3
0
파일: IRC.py 프로젝트: 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,
             )
         )
예제 #4
0
파일: IRC.py 프로젝트: 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,
             )
         )
예제 #5
0
파일: Skype.py 프로젝트: 4rChon/gadget
 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,
             )
         )
예제 #6
0
파일: IRC.py 프로젝트: 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,
         )
     )