def __initExtension(self): filterExtension = PyExtension( _TAG.FILTER).setXmlNs(_NS.WG_MUC_ROOMS).setAttribute( 'roomname-prefix', self._token).setAttribute('max-entries', self._results_count) filterExtension.setChild( _SimpleCriterionExtension('muc#roomconfig_membersonly', 0)) return PyExtension(_TAG.QUERY).setXmlNs( _NS.DISCO_ITEMS).setChild(filterExtension)
def __init__(self, errorCondition=None, errorType=None): super(StanzaErrorExtension, self).__init__(_TAG.ERROR) if errorCondition: codeExt = PyExtension(errorCondition) codeExt.setXmlNs(_NS.STANZA_ERROR) self.setChild(codeExt) if not errorType: errorType = STANZA_ERRORS[errorCondition] if errorType: self.setAttribute('type', errorType)
def __init__(self): super(NicknamePrefixSearchHandler, self).__init__(PyExtension(_TAG.WG_NICKNAME_PREFIX_SEARCH).setXmlNs(_NS.WG_SPA_RESOLVER).setChild(UserSearchItemExtension()))
def __initExtension(self): return PyExtension(_TAG.WG_NICKNAME_PREFIX_SEARCH).setXmlNs(_NS.WG_SPA_RESOLVER).setAttribute('prefix', self._prefix).setAttribute('limit', self._limit)
def __init__(self): super(UserSearchHandler, self).__init__(PyExtension(_TAG.QUERY).setXmlNs(_NS.WG_SPA_RESOLVER).setChild(UserSearchItemExtension()))
def __initExtension(self): filterExtension = PyExtension(_TAG.ITEM).setXmlNs(_NS.WG_SPA_RESOLVER).setAttribute('nickname', self._nickname) return PyExtension(_TAG.QUERY).setXmlNs(_NS.WG_SPA_RESOLVER).setChild(filterExtension)
def __init__(self): super(ChannelsListHandler, self).__init__(PyExtension(_TAG.QUERY).setXmlNs(_NS.DISCO_ITEMS).setChild(ChannelItemExtension()))
def _createUnblockItemExt(jid=None): return PyExtension(_TAG.UNBLOCK_ITEM).setXmlNs(_NS.BLOCKING_CMD).setChild( ContactItemExtension(jid))
def _createBlockListExt(): return PyExtension(_TAG.BLOCK_LIST).setXmlNs(_NS.BLOCKING_CMD)