Пример #1
0
 def __init__(self, errorCondition=None, errorType=None):
     super(StanzaErrorExtension, self).__init__(_TAG.ERROR)
     if errorCondition:
         if not errorCondition in STANZA_ERRORS:
             raise AssertionError
             codeExt = PyExtension(errorCondition)
             codeExt.setXmlNs(_NS.STANZA_ERROR)
             self.setChild(codeExt)
             if not errorType:
                 errorType = STANZA_ERRORS[errorCondition]
         errorType and self.setAttribute("type", errorType)
Пример #2
0
 def __init__(self, errorCondition = None, errorType = None):
     super(StanzaErrorExtension, self).__init__(_TAG.ERROR)
     if errorCondition:
         assert errorCondition in STANZA_ERRORS
         codeExt = PyExtension(errorCondition)
         codeExt.setXmlNs(_NS.STANZA_ERROR)
         self.setChild(codeExt)
         if not errorType:
             errorType = STANZA_ERRORS[errorCondition]
     if errorType:
         self.setAttribute('type', errorType)
Пример #3
0
 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)
Пример #4
0
 def __init__(self):
     super(ChannelsListHandler, self).__init__(
         PyExtension(_TAG.QUERY).setXmlNs(_NS.DISCO_ITEMS).setChild(
             ChannelItemExtension()))
Пример #5
0
 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)
Пример #6
0
def _createUnblockItemExt(jid=None):
    return PyExtension(_TAG.UNBLOCK_ITEM).setXmlNs(_NS.BLOCKING_CMD).setChild(
        ContactItemExtension(jid))
Пример #7
0
def _createBlockListExt():
    return PyExtension(_TAG.BLOCK_LIST).setXmlNs(_NS.BLOCKING_CMD)
Пример #8
0
 def __init__(self):
     super(NicknamePrefixSearchHandler, self).__init__(
         PyExtension(_TAG.WG_NICKNAME_PREFIX_SEARCH).setXmlNs(
             _NS.WG_SPA_RESOLVER).setChild(UserSearchItemExtension()))
Пример #9
0
 def __initExtension(self):
     return PyExtension(_TAG.WG_NICKNAME_PREFIX_SEARCH).setXmlNs(
         _NS.WG_SPA_RESOLVER).setAttribute('prefix',
                                           self._prefix).setAttribute(
                                               'limit', self._limit)
Пример #10
0
 def __init__(self):
     super(UserSearchHandler, self).__init__(
         PyExtension(_TAG.QUERY).setXmlNs(_NS.WG_SPA_RESOLVER).setChild(
             UserSearchItemExtension()))