Download:
child 30:f21f5ee3e32c
parent 28:7f7fdce01952
29:c04a4faec835
Anton Shestakov <av6@dwimlabs.net>, Wed, 20 Jul 2016 00:32:32 +0800
rollbot: no need to wait for MUCs If a user sends groupchat message to a room while the bot is still in the process of joining that room, the message will not be handled. And it shouldn't be, because the bot is not there yet! So there's no point in blocking the current thread on joining MUCs. Additionally, using wait=True triggers a warning: "Use of send mask waiters is deprecated." (from XMLStream.send)

1 файлов изменено, 2 вставок(+), 2 удалений(-) [+]
rollbot.py file | annotate | diff | comparison | revisions
--- a/rollbot.py Mon Jul 18 19:17:54 2016 +0800
+++ b/rollbot.py Wed Jul 20 00:32:32 2016 +0800
@@ -198,12 +198,12 @@
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)
+ self.plugin['xep_0045'].joinMUC(room, self.nick, password=password)
def muc_direct_invite(self, invite):
room = invite['groupchat_invite']['jid']
password = invite['groupchat_invite']['password']
- self.plugin['xep_0045'].joinMUC(room, self.nick, password=password, wait=True)
+ self.plugin['xep_0045'].joinMUC(room, self.nick, password=password)
def respond(self, message, prefix=None):
plain = ''