当前位置: 首页>>代码示例>>Python>>正文


Python YowsupConnectionManager.sendGetParticipants方法代码示例

本文整理汇总了Python中Yowsup.connectionmanager.YowsupConnectionManager.sendGetParticipants方法的典型用法代码示例。如果您正苦于以下问题:Python YowsupConnectionManager.sendGetParticipants方法的具体用法?Python YowsupConnectionManager.sendGetParticipants怎么用?Python YowsupConnectionManager.sendGetParticipants使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Yowsup.connectionmanager.YowsupConnectionManager的用法示例。


在下文中一共展示了YowsupConnectionManager.sendGetParticipants方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Worker

# 需要导入模块: from Yowsup.connectionmanager import YowsupConnectionManager [as 别名]
# 或者: from Yowsup.connectionmanager.YowsupConnectionManager import sendGetParticipants [as 别名]

#.........这里部分代码省略.........
        
        self.session.contacts.me.status = self.session.account.status
        #self.send_presence("available", account)
        
        
        # Your account
        #tmp_cont = e3.base.Contact(account, 1, account, account, e3.status.BUSY, '', True)
        #self.session.contacts.contacts[account] = tmp_cont		
        
            
    def onGroupGotPartecipants(self, group, parts):
        g = ""
        for part in parts:
            if not self._check_if_contact_exist (part):
                self._add_contact(part, part, e3.status.ONLINE, part, False, "")
            
        
    def onGroupGotInfo(self, info):
        print "infoooooooooooooooooooooooooooooooo"
        print info
        print "infoooooooooooooooooooooooooooooooo"
    
        
    def onGroupMessageReceived(self, msgId, fromAttribute, author, msgData, timestamp, wantsReceipt, pushName):
        print "You got a group message!"
        print "%s (%s, %s): %s" % (pushName, author, timestamp, msgData)
        print fromAttribute
        
        # Add the group
        if not self._check_if_contact_exist (fromAttribute):
            #print fromAttribute
            #self.methodsInterface.call ("group_getInfo", (fromAttribute))
            #self.methodsInterface.call ("group_getParticipants", (fromAttribute))
            self.connectionManager.sendGetParticipants (fromAttribute)
            #self.connectionManager.sendGetGroupInfo (fromAttribute)
            self._add_contact(fromAttribute, "Group chat", e3.status.ONLINE, "Group chat", False, "")
            
        # Add the single contact
        if not self._check_if_contact_exist (author):
            self._add_contact(author, pushName, e3.status.ONLINE, pushName, False, "")
            
            
        self._on_group_message({'id':msgId, 'from':{'jid':author, 'realname':pushName}, 'type':'chat', 'body':msgData}, fromAttribute)
        #TODO enable ack
        if wantsReceipt:
            self.methodsInterface.call("message_ack", (fromAttribute, msgId))
    
    
    def onMessageReceived(self, messageId, jid, messageContent, timestamp, wantsReceipt, pushName, isBroadcast):
        print "You got a message!"
        print "%s (%s, %s): %s" % (pushName, jid, timestamp, messageContent)
        
        if not self._check_if_contact_exist (jid):
            self._add_contact(jid, pushName, e3.status.ONLINE, pushName, False, "")
                
        self._on_message({'id':messageId, 'from':{'jid':jid, 'realname':pushName}, 'type':'chat', 'body':messageContent})
        #TODO enable ack
        if wantsReceipt:
            self.methodsInterface.call("message_ack", (jid, messageId))
			



    # Emesene events handler    
    #def _on_conversation_message_received(self, message):
    #    e3.Logger.log_message(self.session, participants, msgobj, sent, cid = cid)
开发者ID:ahlfors,项目名称:uazapp-im,代码行数:70,代码来源:Worker.py


注:本文中的Yowsup.connectionmanager.YowsupConnectionManager.sendGetParticipants方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。