diff options
| author | Colin Reeder <colin@vpzom.click> | 2025-11-14 14:34:19 -0600 |
|---|---|---|
| committer | fiaxh <git@lightrise.org> | 2025-11-14 14:34:19 -0600 |
| commit | 9f02aba799e07ad2ab587334fe59c577e5d4605d (patch) | |
| tree | 249ac6961072cc58db7a9385ea988a2f97400038 /xmpp-vala | |
| parent | 68b07ef13c857b07d32c2fd8da08a0660f961a0a (diff) | |
Add xmpp-vala module for XEP-0424 (message retraction)
Diffstat (limited to 'xmpp-vala')
| -rw-r--r-- | xmpp-vala/meson.build | 1 | ||||
| -rw-r--r-- | xmpp-vala/src/module/xep/0424_message_retraction.vala | 27 |
2 files changed, 28 insertions, 0 deletions
diff --git a/xmpp-vala/meson.build b/xmpp-vala/meson.build index 4ce5a8e5..4aa6e328 100644 --- a/xmpp-vala/meson.build +++ b/xmpp-vala/meson.build @@ -124,6 +124,7 @@ sources = files( 'src/module/xep/0402_bookmarks2.vala', 'src/module/xep/0410_muc_self_ping.vala', 'src/module/xep/0421_occupant_ids.vala', + 'src/module/xep/0424_message_retraction.vala', 'src/module/xep/0428_fallback_indication.vala', 'src/module/xep/0444_reactions.vala', 'src/module/xep/0446_file_metadata_element.vala', diff --git a/xmpp-vala/src/module/xep/0424_message_retraction.vala b/xmpp-vala/src/module/xep/0424_message_retraction.vala new file mode 100644 index 00000000..747f4c08 --- /dev/null +++ b/xmpp-vala/src/module/xep/0424_message_retraction.vala @@ -0,0 +1,27 @@ +namespace Xmpp.Xep.MessageRetraction { + + private const string NS_URI = "urn:xmpp:message-retract:1"; + + public static string? get_retract_id(MessageStanza message) { + StanzaNode? node = message.stanza.get_subnode("retract", NS_URI); + if (node == null) return null; + + return node.get_attribute("id"); + } + + public class Module : XmppStreamModule { + public static ModuleIdentity<Module> IDENTITY = new ModuleIdentity<Module>(NS_URI, "0424_message_retraction"); + + public override void attach(XmppStream stream) { + stream.get_module(ServiceDiscovery.Module.IDENTITY).add_feature(stream, NS_URI); + } + + public override void detach(XmppStream stream) { + stream.get_module(ServiceDiscovery.Module.IDENTITY).remove_feature(stream, NS_URI); + } + + public override string get_ns() { return NS_URI; } + + public override string get_id() { return IDENTITY.id; } + } +}
\ No newline at end of file |
