Skip to content
Back to top
View this page

# XEP-0369: MIX-CORE

XEP-0369 on xmpp.org

class slixmpp.plugins.xep_0369.XEP_0369(xmpp, config=None)

  XEP-0369: MIX-CORE

  async can_create_channel(service)

    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)

    Create a MIX channel.

    Parameters:

      - service (`JID`) – MIX service JID

      - channel (`str` | `None`) – Channel name (or leave empty to let the service generate it)

    Return type:

      `str`

    Returns:

      The channel name, as created by the service

  async destroy_channel(channel, *, ifrom=None, **iqkwargs)

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

  async get_channel_info(channel)

    ” 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)

    Join a MIX channel.

    Parameters:

      - channel (`JID`) – JID of the MIX channel

      - nick (`str`) – Desired nickname on that channel

      - subscribe (`set`[`str`] | `None`) – 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)

    ” Leave a MIX channel :type channel: `JID` :param channel: JID of the channel to leave

    Return type:

      `None`

  async list_channels(service, *, ifrom=None, **discokwargs)

    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)

    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)

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

    Return type:

      `list`[`tuple`[`str`, `str`, `JID` | `None`]]

    Returns:

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

  async set_nick(channel, nick, *, ifrom=None, **iqkwargs)

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

    Return type:

      `str`

    Returns:

      The nick saved on the MIX channel

  async update_subscription(channel, subscribe=None, unsubscribe=None, *, ifrom=None, **iqkwargs)

    Update a MIX channel subscription.

    Parameters:

      - channel (`JID`) – JID of the MIX channel

      - subscribe (`set`[`str`] | `None`) – Set of notes to subscribe to additionally.

      - unsubscribe (`set`[`str`] | `None`) – 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)
  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)
  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)
  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)
  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)
  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)
  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)
  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)
  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)
  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)
  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()