Download:
child 16:767c4ae49fc0
parent 14:2fffb6701d37
15:26b97ecf8e16
Anton Shestakov <av6@dwimlabs.net>, Sun, 15 May 2016 21:39:48 +0800
rollbot: extract password from XEP-0045 mediated invitation by hand

1 файлов изменено, 4 вставок(+), 1 удалений(-) [+]
rollbot.py file | annotate | diff | comparison | revisions
--- a/rollbot.py Sun May 15 11:38:32 2016 +0800
+++ b/rollbot.py Sun May 15 21:39:48 2016 +0800
@@ -136,7 +136,10 @@
def muc_invite(self, invite):
room = invite['from']
- password = '' # https://github.com/fritzy/SleekXMPP/issues/409
+ # https://github.com/fritzy/SleekXMPP/issues/409
+ ns = 'http://jabber.org/protocol/muc#user'
+ pel = invite.find('{%(ns)s}x/{%(ns)s}password' % {'ns': ns})
+ password = pel.text if pel is not None else ''
self.plugin['xep_0045'].joinMUC(room, self.nick, password=password, wait=True)
def muc_direct_invite(self, invite):