示例#1
0
 def parseTag(self, pyGlooxTag):
     dbId, nickname, _ = super(UserSearchItemExtension, self).parseTag(pyGlooxTag)
     info = self._getChildData(pyGlooxTag, 1, WgSharedExtension.getDefaultData())
     if 'clanInfo' in info:
         clanInfo = info['clanInfo']
     else:
         clanInfo = None
     return XmppUserSearchInfo(dbId, nickname, clanInfo)
示例#2
0
 def parseTag(self, pyGlooxTag):
     dbId, nickname, _ = super(UserSearchItemExtension, self).parseTag(pyGlooxTag)
     info = self._getChildData(pyGlooxTag, 1, WgSharedExtension.getDefaultData())
     if 'clanInfo' in info:
         clanInfo = info['clanInfo']
     else:
         clanInfo = None
     return XmppUserSearchInfo(dbId, nickname, clanInfo)
示例#3
0
 def parseTag(self, pyGlooxTag):
     jid = pyGlooxTag.findAttribute('jid')
     if jid:
         jid = ContactJID(jid)
     else:
         jid = None
     info = self._getChildData(pyGlooxTag, 0, WgSharedExtension.getDefaultData())
     return (jid, info)
示例#4
0
 def __init__(self, msgType, state=CHAT_STATE.UNDEFINED):
     super(_MessageCustomExtension, self).__init__(_TAG.MESSAGE)
     self.setAttribute('type', msgType)
     self.setChild(ChatStateExtension(state))
     self.setChild(WgSharedExtension(False))
     self.setChild(DelayExtension())
     self.setChild(MessageIDExtension())
     self.setChild(PrivateHistoryItem())
示例#5
0
 def parseTag(self, pyGlooxTag):
     jid = pyGlooxTag.findAttribute('jid')
     if jid:
         jid = ContactJID(jid)
     else:
         jid = None
     info = self._getChildData(pyGlooxTag, 0, WgSharedExtension.getDefaultData())
     return (jid, info)
示例#6
0
 def parseTag(self, pyGlooxTag):
     message = ChatMessage()
     message.state = self._getChildData(pyGlooxTag, 0, ChatStateExtension.getDefaultData())
     info = self._getChildData(pyGlooxTag, 1, WgSharedExtension.getDefaultData())
     if info:
         message.accountDBID = info['dbID']
         message.accountName = info['name']
     message.sentAt = self._getChildData(pyGlooxTag, 2, DelayExtension.getDefaultData())
     message.uuid = self._getChildData(pyGlooxTag, 3, MessageIDExtension.getDefaultData())
     message.requestID, message.isFinalInHistory = self._getChildData(pyGlooxTag, 4, PrivateHistoryItem.getDefaultData())
     return message
示例#7
0
 def parseTag(self, pyGlooxTag):
     message = ChatMessage()
     message.state = self._getChildData(pyGlooxTag, 0,
                                        ChatStateExtension.getDefaultData())
     info = self._getChildData(pyGlooxTag, 1,
                               WgSharedExtension.getDefaultData())
     if info:
         message.accountDBID = info['dbID']
         message.accountName = info['name']
     message.sentAt = self._getChildData(pyGlooxTag, 2,
                                         DelayExtension.getDefaultData())
     message.uuid = self._getChildData(pyGlooxTag, 3,
                                       MessageIDExtension.getDefaultData())
     message.requestID, message.isFinalInHistory = self._getChildData(
         pyGlooxTag, 4, PrivateHistoryItem.getDefaultData())
     return message
示例#8
0
 def getDefaultData(cls):
     return (None, WgSharedExtension.getDefaultData())
示例#9
0
 def getDefaultData(cls):
     return (SpaResolverItem.getDefaultData(), WgSharedExtension.getDefaultData())
示例#10
0
 def __init__(self):
     super(UserSearchItemExtension, self).__init__(_TAG.ITEM)
     self.setChild(WgSharedExtension())
示例#11
0
 def parseTag(self, pyGlooxTag):
     info = self._getChildData(pyGlooxTag, 0,
                               WgSharedExtension.getDefaultData())
     return info
示例#12
0
 def getDefaultData(cls):
     return WgSharedExtension.getDefaultData()
示例#13
0
 def __init__(self):
     super(CreatedByElement, self).__init__(_TAG.CREATED_BY)
     self.setXmlNs(_NS.WG_DISCO_ITEMS)
     self.setChild(WgSharedExtension())
示例#14
0
 def getDefaultData(cls):
     return (SpaResolverItem.getDefaultData(), WgSharedExtension.getDefaultData())
示例#15
0
 def parseTag(self, pyGlooxTag):
     info = self._getChildData(pyGlooxTag, 0, WgSharedExtension.getDefaultData())
     return info
示例#16
0
 def parseTag(self, pyGlooxTag):
     info = self._getChildData(pyGlooxTag, 0, WgSharedExtension.getDefaultData())
     state = self._getChildData(pyGlooxTag, 1, ChatStateExtension.getDefaultData())
     sentAt = self._getChildData(pyGlooxTag, 2, time.time())
     return (state, info, sentAt)
 def __init__(self, jid=None):
     super(ContactItemExtension, self).__init__(_TAG.ITEM)
     if jid:
         self.setAttribute('jid', str(jid))
     self.setChild(WgSharedExtension())