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)
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)
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())
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
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
def getDefaultData(cls): return (None, WgSharedExtension.getDefaultData())
def getDefaultData(cls): return (SpaResolverItem.getDefaultData(), WgSharedExtension.getDefaultData())
def __init__(self): super(UserSearchItemExtension, self).__init__(_TAG.ITEM) self.setChild(WgSharedExtension())
def parseTag(self, pyGlooxTag): info = self._getChildData(pyGlooxTag, 0, WgSharedExtension.getDefaultData()) return info
def getDefaultData(cls): return WgSharedExtension.getDefaultData()
def __init__(self): super(CreatedByElement, self).__init__(_TAG.CREATED_BY) self.setXmlNs(_NS.WG_DISCO_ITEMS) self.setChild(WgSharedExtension())
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())