XEP-0492: Chat Notification Settings¶
- class slixmpp.plugins.xep_0492.XEP_0492(xmpp, config=None)[source]¶
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)[source]¶
- name: ClassVar[str] = 'advanced'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBase
object for<message />
would usename = 'message'
.
- namespace: str = 'urn:xmpp:notification-settings:0'¶
The XML namespace for the element. Given
<foo xmlns="bar" />
, thennamespace = "bar"
should be used. The default namespace isjabber: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, theplugin_attrib
value defines the plugin name. Plugins may be accessed by using theplugin_attrib
value as the interface. An example usingplugin_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)[source]¶
- name: ClassVar[str] = 'always'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBase
object for<message />
would usename = 'message'
.
- plugin_attrib: ClassVar[str] = 'always'¶
For
ElementBase
subclasses which are intended to be used as plugins, theplugin_attrib
value defines the plugin name. Plugins may be accessed by using theplugin_attrib
value as the interface. An example usingplugin_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)[source]¶
- name: ClassVar[str] = 'never'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBase
object for<message />
would usename = 'message'
.
- plugin_attrib: ClassVar[str] = 'never'¶
For
ElementBase
subclasses which are intended to be used as plugins, theplugin_attrib
value defines the plugin name. Plugins may be accessed by using theplugin_attrib
value as the interface. An example usingplugin_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)[source]¶
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)[source]¶
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:
- get_config(client_type=None)[source]¶
Get the chat notification settings for this bookmark.
- Parameters:
client_type (
Optional
[Literal
['bot'
,'console'
,'game'
,'handheld'
,'pc'
,'phone'
,'sms'
,'tablet'
,'web'
]]) – Optionally, get the notification for a specific client type. If unset, returns the global notification setting.- Return type:
Optional
[Literal
['never'
,'always'
,'on-mention'
]]- 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 usename = 'message'
.
- namespace: str = 'urn:xmpp:notification-settings:0'¶
The XML namespace for the element. Given
<foo xmlns="bar" />
, thennamespace = "bar"
should be used. The default namespace isjabber: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, theplugin_attrib
value defines the plugin name. Plugins may be accessed by using theplugin_attrib
value as the interface. An example usingplugin_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)[source]¶
- 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 usename = 'message'
.
- plugin_attrib: ClassVar[str] = 'on-mention'¶
For
ElementBase
subclasses which are intended to be used as plugins, theplugin_attrib
value defines the plugin name. Plugins may be accessed by using theplugin_attrib
value as the interface. An example usingplugin_attrib = 'foo'
:register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']