diff options
Diffstat (limited to 'src/multiuserchat.py')
-rw-r--r-- | src/multiuserchat.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/multiuserchat.py b/src/multiuserchat.py index ae8acb77..92d09a60 100644 --- a/src/multiuserchat.py +++ b/src/multiuserchat.py @@ -8,7 +8,7 @@ """ Implementation of the XEP-0045: Multi-User Chat. Add some facilities that are not available on the XEP_0045 -sleek plugin +slix plugin """ from gettext import gettext as _ @@ -47,7 +47,7 @@ def destroy_room(xmpp, room, reason='', altroom=''): _('Info')) else: xmpp.core.information(_('Room %s destroyed') % room, _('Info')) - iq.send(block=False, callback=callback) + iq.send(callback=callback) return True def send_private_message(xmpp, jid, line): @@ -97,7 +97,7 @@ def change_nick(core, jid, nick, status=None, show=None): def join_groupchat(core, jid, nick, passwd='', maxhistory=None, status=None, show=None, seconds=None): xmpp = core.xmpp - stanza = xmpp.makePresence(pto='%s/%s' % (jid, nick), pstatus=status, pshow=show) + stanza = xmpp.make_presence(pto='%s/%s' % (jid, nick), pstatus=status, pshow=show) x = ET.Element('{http://jabber.org/protocol/muc}x') if passwd: passelement = ET.Element('password') @@ -131,7 +131,7 @@ def set_user_role(xmpp, jid, nick, reason, role, callback=None): (role = 'none': eject user) """ jid = safeJID(jid) - iq = xmpp.makeIqSet() + iq = xmpp.make_iq_set() query = ET.Element('{%s}query' % NS_MUC_ADMIN) item = ET.Element('{%s}item' % NS_MUC_ADMIN, {'nick':nick, 'role':role}) if reason: @@ -142,7 +142,7 @@ def set_user_role(xmpp, jid, nick, reason, role, callback=None): iq.append(query) iq['to'] = jid if callback: - return iq.send(block=False, callback=callback) + return iq.send(callback=callback) try: return iq.send() except Exception as e: @@ -165,10 +165,10 @@ def set_user_affiliation(xmpp, muc_jid, affiliation, nick=None, jid=None, reason item.append(reason_item) query.append(item) - iq = xmpp.makeIqSet(query) + iq = xmpp.make_iq_set(query) iq['to'] = muc_jid if callback: - return iq.send(block=False, callback=callback) + return iq.send(callback=callback) try: return xmpp.plugin['xep_0045'].setAffiliation(str(muc_jid), str(jid) if jid else None, nick, affiliation) except: @@ -180,18 +180,18 @@ def cancel_config(xmpp, room): query = ET.Element('{http://jabber.org/protocol/muc#owner}query') x = ET.Element('{jabber:x:data}x', type='cancel') query.append(x) - iq = xmpp.makeIqSet(query) + iq = xmpp.make_iq_set(query) iq['to'] = room - iq.send(block=False) + iq.send() def configure_room(xmpp, room, form): if form is None: return - iq = xmpp.makeIqSet() + iq = xmpp.make_iq_set() iq['to'] = room query = ET.Element('{http://jabber.org/protocol/muc#owner}query') form = form.getXML('submit') query.append(form) iq.append(query) - iq.send(block=False) + iq.send() |