Skip to content
Back to top
View this page

# XEP-0492: Chat Notification Settings

class slixmpp.plugins.xep_0492.XEP_0492(xmpp, config=None)

  XEP-0492: Chat notification settings

  dependencies: ClassVar[Set[str]] = {'xep_0402'}

    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-0492: Chat notification settings'

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

  name: str = 'xep_0492'

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

## Stanza elements

class slixmpp.plugins.xep_0492.stanza.Advanced(xml=None, parent=None)
  name: ClassVar[str] = 'advanced'

    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:notification-settings:0'

    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] = 'advanced'

    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_0492.stanza.Always(xml=None, parent=None)
  name: ClassVar[str] = 'always'

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

  plugin_attrib: ClassVar[str] = 'always'

    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_0492.stanza.Never(xml=None, parent=None)
  name: ClassVar[str] = 'never'

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

  plugin_attrib: ClassVar[str] = 'never'

    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_0492.stanza.Notify(xml=None, parent=None)

  Chat notification settings element

  To enable it on a Conference element, use configure() like this:

  Which will add the <notify> element to the <extensions> element.

  configure(when, client_type=None)

    Configure the chat notification settings for this bookmark.

    This method ensures that there are no conflicting settings, e.g., both a <never /> and a <always /> element.

    Return type:

      `None`

  get_config(client_type=None)

    Get the chat notification settings for this bookmark.

    Parameters:

      client_type (`Literal`[`'bot'`, `'console'`, `'game'`, `'handheld'`, `'pc'`, `'phone'`, `'sms'`, `'tablet'`, `'web'`] | `None`) – Optionally, get the notification for a specific client type. If unset, returns the global notification setting.

    Return type:

      `Literal`[`'never'`, `'always'`, `'on-mention'`] | `None`

    Returns:

      The chat notification setting as a string, or None if unset.

  interfaces: ClassVar[Set[str]] = {'notify'}

    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] = 'notify'

    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:notification-settings:0'

    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] = 'notify'

    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_0492.stanza.OnMention(xml=None, parent=None)
  name: ClassVar[str] = 'on-mention'

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

  plugin_attrib: ClassVar[str] = 'on-mention'

    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_0492.stanza.register_plugin()