XEP-0369: MIX-CORE#

class slixmpp.plugins.xep_0369.XEP_0369(xmpp, config=None)[source]#

XEP-0369: MIX-CORE

async can_create_channel(service)[source]#

Check if the current user can create a channel on the MIX service

Parameters:

service (JID) – MIX service jid

Return type:

bool

async create_channel(service, channel=None, *, ifrom=None, **iqkwargs)[source]#

Create a MIX channel.

Parameters:
  • service (JID) – MIX service JID

  • channel (Optional[str]) – Channel name (or leave empty to let the service generate it)

Return type:

str

Returns:

The channel name, as created by the service

dependencies: ClassVar[Set[str]] = {'xep_0004', 'xep_0030', 'xep_0060', 'xep_0082'}#

Some plugins may depend on others in order to function properly. Any plugin names included in dependencies will be initialized as needed if this plugin is enabled.

description: str = 'XEP-0369: MIX-CORE'#

A longer name for the plugin, describing its purpose. For example, a plugin for XEP-0030 would use ‘Service Discovery’ as its description value.

async destroy_channel(channel, *, ifrom=None, **iqkwargs)[source]#

Destroy a MIX channel. :param JID channel: MIX channelJID

async get_channel_info(channel)[source]#

” Get the contents of the channel info node.

Parameters:

channel (JID) – The MIX channel

Return type:

InfoType

Returns:

a dict containing the last modified time and form contents (Name, Description, Contact per the spec, YMMV)

async join_channel(channel, nick, subscribe=None, *, ifrom=None, **iqkwargs)[source]#

Join a MIX channel.

Parameters:
  • channel (JID) – JID of the MIX channel

  • nick (str) – Desired nickname on that channel

  • subscribe (Set[str]) – Set of notes to subscribe to when joining. If empty, all nodes will be subscribed by default.

Return type:

Set[str]

Returns:

The nodes that failed to subscribe, if any

async leave_channel(channel, *, ifrom=None, **iqkwargs)[source]#

” :rtype: None

Leave a MIX channel :param JID channel: JID of the channel to leave

async list_channels(service, *, ifrom=None, **discokwargs)[source]#

List the channels on a MIX service

Parameters:

service (JID) – MIX service JID

Return type:

List[Tuple[JID, str]]

Returns:

A list of channels with their JID and name

async list_mix_nodes(channel, ifrom=None, **discokwargs)[source]#

List mix nodes for a channel.

Parameters:

channel (JID) – The MIX channel

Return type:

Set[str]

Returns:

List of nodes available

async list_participants(channel, *, ifrom=None, **pubsubkwargs)[source]#

List the participants of a MIX channel :param JID channel: The MIX channel

Return type:

List[Tuple[str, str, Optional[JID]]]

Returns:

A list of tuples containing the participant id, nick, and jid (if available)

name: str = 'xep_0369'#

A short name for the plugin based on the implemented specification. For example, a plugin for XEP-0030 would use ‘xep_0030’.

async set_nick(channel, nick, *, ifrom=None, **iqkwargs)[source]#

Set your nick on a channel. The returned nick MAY be different from the one provided, depending on service configuration. :param JID channel: MIX channel JID :param str nick: desired nick :rtype: str :return: The nick saved on the MIX channel

async update_subscription(channel, subscribe=None, unsubscribe=None, *, ifrom=None, **iqkwargs)[source]#

Update a MIX channel subscription.

Parameters:
  • channel (JID) – JID of the MIX channel

  • subscribe (Set[str]) – Set of notes to subscribe to additionally.

  • unsubscribe (Set[str]) – Set of notes to unsubscribe from.

Return type:

Tuple[Set[str], Set[str]]

Returns:

A tuple containing the set of nodes that failed to subscribe and the set of nodes that failed to unsubscribe.

Stanza elements#

class slixmpp.plugins.xep_0369.stanza.Create(xml=None, parent=None)[source]#
interfaces: ClassVar[Set[str]] = {'channel'}#

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

name: ClassVar[str] = 'create'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'urn:xmpp:mix:core:1'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

plugin_attrib: ClassVar[str] = 'mix_create'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
class slixmpp.plugins.xep_0369.stanza.Destroy(xml=None, parent=None)[source]#
interfaces: ClassVar[Set[str]] = {'channel'}#

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

name: ClassVar[str] = 'destroy'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'urn:xmpp:mix:core:1'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

plugin_attrib: ClassVar[str] = 'mix_destroy'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
class slixmpp.plugins.xep_0369.stanza.Join(xml=None, parent=None)[source]#
interfaces: ClassVar[Set[str]] = {'id', 'nick'}#

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

name: ClassVar[str] = 'join'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'urn:xmpp:mix:core:1'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

plugin_attrib: ClassVar[str] = 'mix_join'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
sub_interfaces: ClassVar[Set[str]] = {'nick'}#

A subset of interfaces which maps interfaces to direct subelements of the underlying XML object. Using this set, the text of these subelements may be set, retrieved, or removed without needing to define custom methods.

class slixmpp.plugins.xep_0369.stanza.Leave(xml=None, parent=None)[source]#
name: ClassVar[str] = 'leave'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'urn:xmpp:mix:core:1'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

plugin_attrib: ClassVar[str] = 'mix_leave'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
class slixmpp.plugins.xep_0369.stanza.MIX(xml=None, parent=None)[source]#
interfaces: ClassVar[Set[str]] = {'jid', 'nick'}#

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

name: ClassVar[str] = 'mix'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'urn:xmpp:mix:core:1'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

plugin_attrib: ClassVar[str] = 'mix'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
sub_interfaces: ClassVar[Set[str]] = {'jid', 'nick'}#

A subset of interfaces which maps interfaces to direct subelements of the underlying XML object. Using this set, the text of these subelements may be set, retrieved, or removed without needing to define custom methods.

class slixmpp.plugins.xep_0369.stanza.Participant(xml=None, parent=None)[source]#
interfaces: ClassVar[Set[str]] = {'jid', 'nick'}#

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

name: ClassVar[str] = 'participant'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'urn:xmpp:mix:core:1'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

plugin_attrib: ClassVar[str] = 'mix_participant'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
sub_interfaces: ClassVar[Set[str]] = {'jid', 'nick'}#

A subset of interfaces which maps interfaces to direct subelements of the underlying XML object. Using this set, the text of these subelements may be set, retrieved, or removed without needing to define custom methods.

class slixmpp.plugins.xep_0369.stanza.Setnick(xml=None, parent=None)[source]#
interfaces: ClassVar[Set[str]] = {'nick'}#

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

name: ClassVar[str] = 'setnick'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'urn:xmpp:mix:core:1'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

plugin_attrib: ClassVar[str] = 'mix_setnick'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
sub_interfaces: ClassVar[Set[str]] = {'nick'}#

A subset of interfaces which maps interfaces to direct subelements of the underlying XML object. Using this set, the text of these subelements may be set, retrieved, or removed without needing to define custom methods.

class slixmpp.plugins.xep_0369.stanza.Subscribe(xml=None, parent=None)[source]#
interfaces: ClassVar[Set[str]] = {'node'}#

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

name: ClassVar[str] = 'subscribe'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'urn:xmpp:mix:core:1'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

plugin_attrib: ClassVar[str] = 'subscribe'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
class slixmpp.plugins.xep_0369.stanza.Unsubscribe(xml=None, parent=None)[source]#
interfaces: ClassVar[Set[str]] = {'node'}#

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

name: ClassVar[str] = 'unsubscribe'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'urn:xmpp:mix:core:1'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

plugin_attrib: ClassVar[str] = 'unsubscribe'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
class slixmpp.plugins.xep_0369.stanza.UpdateSubscription(xml=None, parent=None)[source]#
interfaces: ClassVar[Set[str]] = {'jid'}#

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

name: ClassVar[str] = 'update-subscription'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'urn:xmpp:mix:core:1'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

plugin_attrib: ClassVar[str] = 'mix_updatesub'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
slixmpp.plugins.xep_0369.stanza.register_plugins()[source]#