Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/python-nbxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hörist <philipp@hoerist.com>2019-02-11 23:04:10 +0300
committerPhilipp Hörist <philipp@hoerist.com>2019-02-11 23:30:06 +0300
commit4feb9d4a2e434fd8c4d21210cb4bd2f367dceb03 (patch)
tree62f4cb18b9a59fcc1cb3ef121347c19f6cdb7ac1 /nbxmpp/modules
parentdeba718091f4702f50dc8e3e60f104094d57e616 (diff)
Simplify AffiliationResult
Diffstat (limited to 'nbxmpp/modules')
-rw-r--r--nbxmpp/modules/muc.py20
1 files changed, 6 insertions, 14 deletions
diff --git a/nbxmpp/modules/muc.py b/nbxmpp/modules/muc.py
index 380918f..10a1930 100644
--- a/nbxmpp/modules/muc.py
+++ b/nbxmpp/modules/muc.py
@@ -300,18 +300,12 @@ class MUC:
iq = Iq(typ='get', to=jid, queryNS=NS_MUC_ADMIN)
item = iq.setQuery().setTag('item')
item.setAttr('affiliation', affiliation)
- return iq, {'affiliation': affiliation}
+ return iq
@callback
- def _affiliation_received(self, stanza, affiliation):
+ def _affiliation_received(self, stanza):
if not isResultNode(stanza):
- log.info('Affiliation error: %s %s %s',
- stanza.getFrom(),
- stanza.getError(),
- affiliation)
- return AffiliationResult(jid=stanza.getFrom(),
- affiliation=affiliation,
- error=stanza.getError())
+ return raise_error(log.info, stanza)
room_jid = stanza.getFrom()
query = stanza.getTag('query', namespace=NS_MUC_ADMIN)
@@ -333,12 +327,10 @@ class MUC:
if reason:
users_dict[jid]['reason'] = reason
- log.info('%s affiliations received from %s: %s',
- affiliation, room_jid, users_dict)
+ log.info('Affiliations received from %s: %s',
+ room_jid, users_dict)
- return AffiliationResult(jid=room_jid,
- affiliation=affiliation,
- users=users_dict)
+ return AffiliationResult(jid=room_jid, users=users_dict)
@call_on_response('_default_response')
def destroy(self, room_jid, reason='', jid=''):