XEP 0045

1.6 Documentation

«  XEP 0033   ::   Contents   ::   XEP 0047  »

XEP 0045

class slixmpp.plugins.xep_0045.XEP_0045(xmpp, config=None)[source]

Implements XEP-0045 Multi-User Chat

async cancel_config(room, *, ifrom=None, **iqkwargs)[source]

Cancel a requested config form

Return type

Iq

decline(room, jid, reason='', *, mfrom=None)[source]

Decline a mediated invitation.

async destroy(room, reason='', altroom='', *, ifrom=None, **iqkwargs)[source]

Destroy a room.

Return type

Iq

async get_affiliation_list(room, affiliation, *, ifrom=None, **iqkwargs)[source]

“Get a list of JIDs with the specified affiliation

Return type

List[JID]

get_jid_property(room, nick, jid_property)[source]

Get the property of a nick in a room, such as its ‘jid’ or ‘affiliation’ If not found, return None.

get_our_jid_in_room(room_jid)[source]

Return the jid we’re using in a room.

Return type

str

async get_roles_list(room, role, *, ifrom=None, **iqkwargs)[source]

“Get a list of JIDs with the specified role

Return type

List[str]

async get_room_config(room, ifrom='')[source]

Get the room config form in 0004 plugin format

get_roster(room)[source]

Get the list of nicks in a room.

Return type

List[str]

handle_config_change(msg)[source]

Handle a MUC configuration change (with status code).

handle_groupchat_decline(decl)[source]

Handle an invitation decline.

handle_groupchat_error_message(msg)[source]

Handle a message error event in a muc.

handle_groupchat_invite(inv)[source]

Handle an invite into a muc.

handle_groupchat_message(msg)[source]

Handle a message event in a muc.

Return type

None

handle_groupchat_presence(pr)[source]

Handle a presence in a muc.

handle_groupchat_subject(msg)[source]

Handle a message coming from a muc indicating a change of subject (or announcing it when joining the room)

Return type

None

invite(room, jid, reason='', *, mfrom=None)[source]

Invite a jid to a room.

join_muc(room, nick, maxhistory='0', password='', pstatus='', pshow='', pfrom='')[source]

Join the specified room, requesting ‘maxhistory’ lines of history.

leave_muc(room, nick, msg='', pfrom=None)[source]

Leave the specified room.

async send_affiliation_list(room, affiliations, *, ifrom=None, **iqkwargs)[source]

Send an affiliation delta list

Return type

Iq

async send_role_list(room, roles, *, ifrom=None, **iqkwargs)[source]

Send a role delta list

Return type

Iq

async set_affiliation(room, jid=None, nick=None, *, affiliation, ifrom=None, **iqkwargs)[source]

Change room affiliation.

async set_role(room, nick, role, *, ifrom=None, **iqkwargs)[source]

Change role property of a nick in a room. Typically, roles are temporary (they last only as long as you are in the room), whereas affiliations are permanent (they last across groupchat sessions).

Return type

Iq

async set_room_config(room, config, *, ifrom=None, **iqkwargs)[source]

Send a room config form

Return type

Iq

stanza = <module 'slixmpp.plugins.xep_0045.stanza' from '/home/docs/checkouts/readthedocs.org/user_builds/slixmpp/checkouts/slix-1.6.0/slixmpp/plugins/xep_0045/stanza.py'>

Stanza elements

Slixmpp: The Slick XMPP Library Copyright (C) 2010 Nathanael C. Fritz Copyright (C) 2020 “Maxime “pep” Buquet <pep@bouah.net>” This file is part of Slixmpp.

See the file LICENSE for copying permission.

class slixmpp.plugins.xep_0045.stanza.MUCAdminItem(xml=None, parent=None)[source]
interfaces = {'affiliation', 'jid', 'nick', 'role'}
name = 'item'
namespace = 'http://jabber.org/protocol/muc#admin'
plugin_attrib = 'item'
class slixmpp.plugins.xep_0045.stanza.MUCAdminQuery(xml=None, parent=None)[source]
name = 'query'
namespace = 'http://jabber.org/protocol/muc#admin'
plugin_attrib = 'mucadmin_query'
class slixmpp.plugins.xep_0045.stanza.MUCBase(xml=None, parent=None)[source]
del_affiliation()[source]
del_item_attr(attr)[source]
del_jid()[source]
del_nick()[source]
del_role()[source]
del_room()[source]
del_status_codes()[source]
get_affiliation()[source]
get_item_attr(attr, default)[source]
get_jid()[source]
get_nick()[source]
get_role()[source]
get_room()[source]
get_status_codes()[source]
Return type

Set[str]

interfaces = {'affiliation', 'jid', 'nick', 'role', 'room', 'status_codes'}
name = 'x'
namespace = 'http://jabber.org/protocol/muc#user'
plugin_attrib = 'muc'
set_affiliation(value)[source]
set_item_attr(attr, value)[source]
set_jid(value)[source]
set_nick(value)[source]
set_role(value)[source]
set_room(value)[source]
set_status_codes(codes)[source]
class slixmpp.plugins.xep_0045.stanza.MUCDecline(xml=None, parent=None)[source]
interfaces = {'from', 'reason', 'to'}
name = 'decline'
namespace = 'http://jabber.org/protocol/muc#user'
plugin_attrib = 'decline'
sub_interfaces = {'reason'}
class slixmpp.plugins.xep_0045.stanza.MUCHistory(xml=None, parent=None)[source]
interfaces = {'maxchars', 'maxstanzas', 'seconds', 'since'}
name = 'history'
namespace = 'http://jabber.org/protocol/muc'
plugin_attrib = 'history'
class slixmpp.plugins.xep_0045.stanza.MUCInvite(xml=None, parent=None)[source]
interfaces = {'from', 'reason', 'to'}
name = 'invite'
namespace = 'http://jabber.org/protocol/muc#user'
plugin_attrib = 'invite'
sub_interfaces = {'reason'}
class slixmpp.plugins.xep_0045.stanza.MUCJoin(xml=None, parent=None)[source]
interfaces = {'password'}
name = 'x'
namespace = 'http://jabber.org/protocol/muc'
plugin_attrib = 'muc_join'
sub_interfaces = {'password'}
class slixmpp.plugins.xep_0045.stanza.MUCMessage(xml=None, parent=None)[source]

A MUC Message

<message from='foo@muc/user1' type='groupchat' id='someid'>
    <body>Foo</body>
    <x xmlns='http://jabber.org/protocol/muc#user'>
        <item affiliation='none'
              role='none'
              nick='newnick2'
              jid='some@jid'/>
    </x>
</message>
class slixmpp.plugins.xep_0045.stanza.MUCOwnerDestroy(xml=None, parent=None)[source]
interfaces = {'jid', 'reason'}
name = 'destroy'
plugin_attrib = 'destroy'
sub_interfaces = {'reason'}
class slixmpp.plugins.xep_0045.stanza.MUCOwnerQuery(xml=None, parent=None)[source]
name = 'query'
namespace = 'http://jabber.org/protocol/muc#owner'
plugin_attrib = 'mucowner_query'
class slixmpp.plugins.xep_0045.stanza.MUCPresence(xml=None, parent=None)[source]

A MUC Presence

<presence from='foo@muc/user1' type='unavailable'>
    <x xmlns='http://jabber.org/protocol/muc#user'>
        <item affiliation='none'
              role='none'
              nick='newnick2'
              jid='some@jid'/>
        <status code='303'/>
    </x>
</presence>
class slixmpp.plugins.xep_0045.stanza.MUCStatus(xml=None, parent=None)[source]
interfaces = {'code'}
name = 'status'
namespace = 'http://jabber.org/protocol/muc#user'
plugin_attrib = 'status'
set_code(code)[source]

«  XEP 0033   ::   Contents   ::   XEP 0047  »