Fix a bunch of iq.send() by removing the block argument

This commit is contained in:
Florent Le Coz 2014-07-30 17:26:39 +02:00
parent ecf22cb4a4
commit 39c8319ec4
3 changed files with 11 additions and 11 deletions

View file

@ -815,11 +815,11 @@ def command_quit(self, arg=''):
else: else:
msg = None msg = None
if config.get('enable_user_mood', True): if config.get('enable_user_mood', True):
self.xmpp.plugin['xep_0107'].stop(block=False) self.xmpp.plugin['xep_0107'].stop()
if config.get('enable_user_activity', True): if config.get('enable_user_activity', True):
self.xmpp.plugin['xep_0108'].stop(block=False) self.xmpp.plugin['xep_0108'].stop()
if config.get('enable_user_gaming', True): if config.get('enable_user_gaming', True):
self.xmpp.plugin['xep_0196'].stop(block=False) self.xmpp.plugin['xep_0196'].stop()
self.save_config() self.save_config()
self.plugin_manager.disable_plugins() self.plugin_manager.disable_plugins()
self.disconnect(msg) self.disconnect(msg)

View file

@ -423,11 +423,11 @@ class Core(object):
log.error("%s received. Exiting…", signals[sig]) log.error("%s received. Exiting…", signals[sig])
if config.get('enable_user_mood', True): if config.get('enable_user_mood', True):
self.xmpp.plugin['xep_0107'].stop(block=False) self.xmpp.plugin['xep_0107'].stop()
if config.get('enable_user_activity', True): if config.get('enable_user_activity', True):
self.xmpp.plugin['xep_0108'].stop(block=False) self.xmpp.plugin['xep_0108'].stop()
if config.get('enable_user_gaming', True): if config.get('enable_user_gaming', True):
self.xmpp.plugin['xep_0196'].stop(block=False) self.xmpp.plugin['xep_0196'].stop()
self.plugin_manager.disable_plugins() self.plugin_manager.disable_plugins()
self.disconnect('%s received' % signals.get(sig)) self.disconnect('%s received' % signals.get(sig))
self.xmpp.add_event_handler("disconnected", self.exit, disposable=True) self.xmpp.add_event_handler("disconnected", self.exit, disposable=True)

View file

@ -47,7 +47,7 @@ def destroy_room(xmpp, room, reason='', altroom=''):
_('Info')) _('Info'))
else: else:
xmpp.core.information(_('Room %s destroyed') % room, _('Info')) xmpp.core.information(_('Room %s destroyed') % room, _('Info'))
iq.send(block=False, callback=callback) iq.send(callback=callback)
return True return True
def send_private_message(xmpp, jid, line): def send_private_message(xmpp, jid, line):
@ -142,7 +142,7 @@ def set_user_role(xmpp, jid, nick, reason, role, callback=None):
iq.append(query) iq.append(query)
iq['to'] = jid iq['to'] = jid
if callback: if callback:
return iq.send(block=False, callback=callback) return iq.send(callback=callback)
try: try:
return iq.send() return iq.send()
except Exception as e: except Exception as e:
@ -168,7 +168,7 @@ def set_user_affiliation(xmpp, muc_jid, affiliation, nick=None, jid=None, reason
iq = xmpp.makeIqSet(query) iq = xmpp.makeIqSet(query)
iq['to'] = muc_jid iq['to'] = muc_jid
if callback: if callback:
return iq.send(block=False, callback=callback) return iq.send(callback=callback)
try: try:
return xmpp.plugin['xep_0045'].setAffiliation(str(muc_jid), str(jid) if jid else None, nick, affiliation) return xmpp.plugin['xep_0045'].setAffiliation(str(muc_jid), str(jid) if jid else None, nick, affiliation)
except: except:
@ -182,7 +182,7 @@ def cancel_config(xmpp, room):
query.append(x) query.append(x)
iq = xmpp.makeIqSet(query) iq = xmpp.makeIqSet(query)
iq['to'] = room iq['to'] = room
iq.send(block=False) iq.send()
def configure_room(xmpp, room, form): def configure_room(xmpp, room, form):
if form is None: if form is None:
@ -193,5 +193,5 @@ def configure_room(xmpp, room, form):
form = form.getXML('submit') form = form.getXML('submit')
query.append(form) query.append(form)
iq.append(query) iq.append(query)
iq.send(block=False) iq.send()