Beispiel #1
0
def makeWGInfoFromPresence(info):
    if 'userId' in info:
        try:
            dbID = long(info['userId'])
        except TypeError:
            LOG_CURRENT_EXCEPTION()
            dbID = 0

    else:
        dbID = 0
    if 'nickname' in info:
        nickname = info['nickname']
    else:
        nickname = ''
    if 'extsClientTag' in info:
        clientInfo = WgClientHandler().handleTag(info['extsClientTag'])
    else:
        clientInfo = None
    if 'clanInfo' in info:
        clanInfo = makeClanInfo(*info['clanInfo'])
    else:
        clanInfo = None
    if 'banInfo' in info:
        banInfo = makeBanInfo(*info['banInfo'])
    else:
        banInfo = None
    return WGExtsInfo(dbID, nickname, clientInfo, clanInfo, banInfo)
Beispiel #2
0
 def generator():
     for jid, name, groups, to, from_, clanInfo in roster:
         yield (ContactBareJID(jid),
          name,
          groups,
          (to, from_),
          makeClanInfo(*clanInfo))
Beispiel #3
0
 def generator():
     for jid, name, groups, to, from_, clanInfo in roster:
         yield (ContactBareJID(jid),
          name,
          groups,
          (to, from_),
          makeClanInfo(*clanInfo))
Beispiel #4
0
def makeWGInfoFromPresence(info):
    if "userId" in info:
        try:
            dbID = long(info["userId"])
        except TypeError:
            LOG_CURRENT_EXCEPTION()
            dbID = 0

    else:
        dbID = 0
    if "nickname" in info:
        nickname = info["nickname"]
    else:
        nickname = ""
    if "extsClientTag" in info:
        clientInfo = WgClientHandler().handleTag(info["extsClientTag"])
    else:
        clientInfo = None
    if "clanInfo" in info:
        clanInfo = makeClanInfo(*info["clanInfo"])
    else:
        clanInfo = None
    if "banInfo" in info:
        banInfo = makeBanInfo(*info["banInfo"])
    else:
        banInfo = None
    return WGExtsInfo(dbID, nickname, clientInfo, clanInfo, banInfo)
Beispiel #5
0
def makeWGInfoFromPresence(info):
    if 'userId' in info:
        try:
            dbID = long(info['userId'])
        except TypeError:
            LOG_CURRENT_EXCEPTION()
            dbID = 0

    else:
        dbID = 0
    if 'nickname' in info:
        nickname = info['nickname']
    else:
        nickname = ''
    if 'extsClientTag' in info:
        clientInfo = WgClientHandler().handleTag(info['extsClientTag'])
    else:
        clientInfo = None
    if 'clanInfo' in info:
        clanInfo = makeClanInfo(*info['clanInfo'])
    else:
        clanInfo = None
    if 'banInfo' in info:
        banInfo = makeBanInfo(*info['banInfo'])
    else:
        banInfo = None
    return WGExtsInfo(dbID, nickname, clientInfo, clanInfo, banInfo)
Beispiel #6
0
def makeWGInfoFromPresence(info):
    if 'extsClientTag' in info:
        clientInfo = WgClientHandler().handleTag(info['extsClientTag'])
    else:
        clientInfo = None
    if 'clanInfo' in info:
        clanInfo = makeClanInfo(*info['clanInfo'])
    else:
        clanInfo = None
    if 'banInfo' in info:
        banInfo = makeBanInfo(*info['banInfo'])
    else:
        banInfo = None
    return WGExtsInfo(clientInfo, clanInfo, banInfo)
Beispiel #7
0
def makeWGInfoFromPresence(info):
    if 'extsClientTag' in info:
        clientInfo = WgClientHandler().handleTag(info['extsClientTag'])
    else:
        clientInfo = None
    if 'clanInfo' in info:
        clanInfo = makeClanInfo(*info['clanInfo'])
    else:
        clanInfo = None
    if 'banInfo' in info:
        banInfo = makeBanInfo(*info['banInfo'])
    else:
        banInfo = None
    return WGExtsInfo(clientInfo, clanInfo, banInfo)
Beispiel #8
0
 def parseTag(self, pyGlooxTag):
     info = self.getDefaultData()
     tag = findFirst(None, pyGlooxTag.filterXPath(self.getXPath(suffix='nickname')))
     if tag:
         info['name'] = tag.getCData()
     tag = findFirst(None, pyGlooxTag.filterXPath(self.getXPath(suffix='userid')))
     if tag:
         info['dbID'] = long(tag.getCData())
     clanDBID, clanAbbrev = (0L, '')
     tag = findFirst(None, pyGlooxTag.filterXPath(self.getXPath(suffix='clanid')))
     if tag:
         clanDBID = tag.getCData()
     tag = findFirst(None, pyGlooxTag.filterXPath(self.getXPath(suffix='clantag')))
     if tag:
         clanAbbrev = tag.getCData()
     if clanDBID and clanAbbrev:
         info['clanInfo'] = makeClanInfo(clanDBID, clanAbbrev)
     return info
Beispiel #9
0
 def parseTag(self, pyGlooxTag):
     info = self.getDefaultData()
     tag = findFirst(None, pyGlooxTag.filterXPath(self.getXPath(suffix="nickname")))
     if tag:
         info["name"] = tag.getCData()
     tag = findFirst(None, pyGlooxTag.filterXPath(self.getXPath(suffix="userid")))
     if tag:
         info["dbID"] = long(tag.getCData())
     clanDBID, clanAbbrev = (0, "")
     tag = findFirst(None, pyGlooxTag.filterXPath(self.getXPath(suffix="clanid")))
     if tag:
         clanDBID = tag.getCData()
     tag = findFirst(None, pyGlooxTag.filterXPath(self.getXPath(suffix="clantag")))
     if tag:
         clanAbbrev = tag.getCData()
     if clanDBID and clanAbbrev:
         info["clanInfo"] = makeClanInfo(clanDBID, clanAbbrev)
     return info
 def parseTag(self, pyGlooxTag):
     info = self.getDefaultData()
     tag = findFirst(None, pyGlooxTag.filterXPath(self.getXPath(suffix='nickname')))
     if tag:
         info['name'] = tag.getCData()
     tag = findFirst(None, pyGlooxTag.filterXPath(self.getXPath(suffix='userid')))
     if tag:
         info['dbID'] = long(tag.getCData())
     clanDBID, clanAbbrev = (0, '')
     tag = findFirst(None, pyGlooxTag.filterXPath(self.getXPath(suffix='clanid')))
     if tag:
         clanDBID = tag.getCData()
     tag = findFirst(None, pyGlooxTag.filterXPath(self.getXPath(suffix='clantag')))
     if tag:
         clanAbbrev = tag.getCData()
     if clanDBID and clanAbbrev:
         info['clanInfo'] = makeClanInfo(clanDBID, clanAbbrev)
     return info
 def onRosterItemSet(self, jid, name, groups, to, from_, clanInfo):
     self.__handleEvent(GLOOX_EVENT.ROSTER_ITEM_SET, ContactBareJID(jid),
                        name, groups, (to, from_), makeClanInfo(*clanInfo))
Beispiel #12
0
 def onRosterItemSet(self, jid, name, groups, to, from_, clanInfo):
     self.__handleEvent(GLOOX_EVENT.ROSTER_ITEM_SET, ContactBareJID(jid), name, groups, (to, from_), makeClanInfo(*clanInfo))