コード例 #1
0
ファイル: command.py プロジェクト: Jack1007/clubot
 def rm(self, stanza, *args):
     """剔除用户"""
     #XXX 没有效果
     emails = [Logics.get_with_nick(n).email for n in args]
     if len(emails) < 1: return self.help(stanza, 'rm')
     for e in emails:
         jid = JID(e)
         Logics.drop(jid)
         self._message_bus.send_unsubscribe(jid)
コード例 #2
0
ファイル: command.py プロジェクト: huahu/clubot
 def rm(self, stanza, *args):
     """剔除用户"""
     #XXX 没有效果
     emails = [Logics.get_with_nick(n).email for n in args]
     if len(emails) < 1: return self.help(stanza, 'rm')
     for e in emails:
         jid = JID(e)
         Logics.drop(jid)
         self._message_bus.send_unsubscribe(jid)
コード例 #3
0
ファイル: clubot.py プロジェクト: huahu/clubot
 def handle_presence_unsubscribe(self, stanza):
     self.logger.info(u"{0} canceled presence subscription".format(
         stanza.from_jid))
     presence = Presence(to_jid=stanza.from_jid.bare(),
                         stanza_type="unsubscribe")
     nick = Logics.get_one(stanza.from_jid).nick
     self.message_bus.send_sys_msg(stanza, u'{0} 离开群'.format(nick))
     Logics.drop(stanza.from_jid.bare())
     r = [stanza.make_accept_response(), presence]
     return r
コード例 #4
0
ファイル: clubot.py プロジェクト: Jack1007/clubot
 def handle_presence_unsubscribe(self, stanza):
     self.logger.info(u"{0} canceled presence subscription"
                                                 .format(stanza.from_jid))
     presence = Presence(to_jid = stanza.from_jid.bare(),
                                                 stanza_type = "unsubscribe")
     nick = Logics.get_one(stanza.from_jid).nick
     self.message_bus.send_sys_msg(stanza, u'{0} 离开群'.format(nick))
     Logics.drop(stanza.from_jid.bare())
     r =[stanza.make_accept_response(), presence]
     return r
コード例 #5
0
ファイル: clubot.py プロジェクト: huahu/clubot
 def handle_presence_unsubscribed(self, stanza):
     self.logger.info(
         u"{0!r} acknowledged our subscrption cancelation".format(
             stanza.from_jid))
     Logics.drop(stanza.from_jid.bare())
     return True
コード例 #6
0
ファイル: clubot.py プロジェクト: Jack1007/clubot
 def handle_presence_unsubscribed(self, stanza):
     self.logger.info(u"{0!r} acknowledged our subscrption cancelation"
                                                 .format(stanza.from_jid))
     Logics.drop(stanza.from_jid.bare())
     return True