class
XMPP::PEPNotifications
- XMPP::PEPNotifications
- Reference
- Object
Overview
PEPNotifications is a high-level client for XEP-0223 - PEP Notifications.
PEP notifications carry an event payload on a subscribed node. When the
subscriber also subscribes to the publisher's presence, the notification
is delivered inside the presence stanza (as a
client.on("message") do |s, p| event = XMPP::PEPNotifications.from_message(p.as(XMPP::Stanza::Message)) end
client.on("presence") do |s, p| event = XMPP::PEPNotifications.from_presence(p.as(XMPP::Stanza::Presence)) end
See: https://xmpp.org/extensions/xep-0223.html
Defined in:
xmpp/pep_notifications.crClass Method Summary
-
.from_message(message : Stanza::Message) : Stanza::PubSubEvent | Nil
from_message extracts the pubsub#event payload from a message, or nil.
-
.from_presence(presence : Stanza::Presence) : Stanza::PubSubEvent | Nil
from_presence extracts the pubsub#event payload carried by a presence stanza (XEP-0223 §5), or nil.
-
.from_stanza(stanza) : Stanza::PubSubEvent | Nil
from_stanza accepts either a message or presence stanza and returns its pubsub#event payload, or nil when neither carries one.
Class Method Detail
from_message extracts the pubsub#event payload from a message, or nil.
from_presence extracts the pubsub#event payload carried by a presence stanza (XEP-0223 §5), or nil.
from_stanza accepts either a message or presence stanza and returns its pubsub#event payload, or nil when neither carries one.