From 9cdc3619bd172a731333b8152ee561eed76e77f8 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Fri, 10 Mar 2017 21:13:35 +0100 Subject: Add typed identity to stream modules --- xmpp-vala/src/module/xep/0027_pgp/module.vala | 3 ++- xmpp-vala/src/module/xep/0030_service_discovery/module.vala | 3 ++- xmpp-vala/src/module/xep/0045_muc/module.vala | 3 ++- xmpp-vala/src/module/xep/0048_bookmarks/module.vala | 3 ++- xmpp-vala/src/module/xep/0049_private_xml_storage.vala | 3 ++- xmpp-vala/src/module/xep/0054_vcard/module.vala | 3 ++- xmpp-vala/src/module/xep/0060_pubsub.vala | 3 ++- xmpp-vala/src/module/xep/0084_user_avatars.vala | 3 ++- xmpp-vala/src/module/xep/0085_chat_state_notifications.vala | 3 ++- xmpp-vala/src/module/xep/0115_entitiy_capabilities.vala | 3 ++- xmpp-vala/src/module/xep/0184_message_delivery_receipts.vala | 3 ++- xmpp-vala/src/module/xep/0199_ping.vala | 3 ++- xmpp-vala/src/module/xep/0203_delayed_delivery.vala | 3 ++- xmpp-vala/src/module/xep/0280_message_carbons.vala | 3 ++- xmpp-vala/src/module/xep/0333_chat_markers.vala | 3 ++- 15 files changed, 30 insertions(+), 15 deletions(-) (limited to 'xmpp-vala/src/module/xep') diff --git a/xmpp-vala/src/module/xep/0027_pgp/module.vala b/xmpp-vala/src/module/xep/0027_pgp/module.vala index 63177f4d..3fcd6559 100644 --- a/xmpp-vala/src/module/xep/0027_pgp/module.vala +++ b/xmpp-vala/src/module/xep/0027_pgp/module.vala @@ -9,6 +9,7 @@ namespace Xmpp.Xep.Pgp { public class Module : XmppStreamModule { public const string ID = "0027_current_pgp_usage"; + public static ModuleIdentity IDENTITY = new ModuleIdentity(NS_URI, ID); public signal void received_jid_key_id(XmppStream stream, string jid, string key_id); @@ -52,7 +53,7 @@ namespace Xmpp.Xep.Pgp { } public static Module? get_module(XmppStream stream) { - return (Module?) stream.get_module(NS_URI, ID); + return (Module?) stream.get_module(IDENTITY); } public static void require(XmppStream stream) { diff --git a/xmpp-vala/src/module/xep/0030_service_discovery/module.vala b/xmpp-vala/src/module/xep/0030_service_discovery/module.vala index 109da897..163f8cfc 100644 --- a/xmpp-vala/src/module/xep/0030_service_discovery/module.vala +++ b/xmpp-vala/src/module/xep/0030_service_discovery/module.vala @@ -9,6 +9,7 @@ namespace Xmpp.Xep.ServiceDiscovery { public class Module : XmppStreamModule, Iq.Handler { public const string ID = "0030_service_discovery_module"; + public static ModuleIdentity IDENTITY = new ModuleIdentity(NS_URI, ID); public ArrayList identities = new ArrayList(); @@ -83,7 +84,7 @@ namespace Xmpp.Xep.ServiceDiscovery { public override void detach(XmppStream stream) { } public static Module? get_module(XmppStream stream) { - return (Module?) stream.get_module(NS_URI, ID); + return (Module?) stream.get_module(IDENTITY); } public static void require(XmppStream stream) { diff --git a/xmpp-vala/src/module/xep/0045_muc/module.vala b/xmpp-vala/src/module/xep/0045_muc/module.vala index f9ed9539..cb7f0d85 100644 --- a/xmpp-vala/src/module/xep/0045_muc/module.vala +++ b/xmpp-vala/src/module/xep/0045_muc/module.vala @@ -30,6 +30,7 @@ public enum MucEnterError { public class Module : XmppStreamModule { public const string ID = "0045_muc_module"; + public static ModuleIdentity IDENTITY = new ModuleIdentity(NS_URI, ID); public signal void received_occupant_affiliation(XmppStream stream, string jid, string? affiliation); public signal void received_occupant_jid(XmppStream stream, string jid, string? real_jid); @@ -97,7 +98,7 @@ public class Module : XmppStreamModule { } public static Module? get_module(XmppStream stream) { - return (Module?) stream.get_module(NS_URI, ID); + return (Module?) stream.get_module(IDENTITY); } public static void require(XmppStream stream) { diff --git a/xmpp-vala/src/module/xep/0048_bookmarks/module.vala b/xmpp-vala/src/module/xep/0048_bookmarks/module.vala index d7767208..25a4678e 100644 --- a/xmpp-vala/src/module/xep/0048_bookmarks/module.vala +++ b/xmpp-vala/src/module/xep/0048_bookmarks/module.vala @@ -7,6 +7,7 @@ private const string NS_URI = "storage:bookmarks"; public class Module : XmppStreamModule { public const string ID = "0048_bookmarks_module"; + public static ModuleIdentity IDENTITY = new ModuleIdentity(NS_URI, ID); public signal void conferences_updated(XmppStream stream, ArrayList conferences); @@ -110,7 +111,7 @@ public class Module : XmppStreamModule { public override void detach(XmppStream stream) { } public static Module? get_module(XmppStream stream) { - return (Module?) stream.get_module(NS_URI, ID); + return (Module?) stream.get_module(IDENTITY); } public static void require(XmppStream stream) { diff --git a/xmpp-vala/src/module/xep/0049_private_xml_storage.vala b/xmpp-vala/src/module/xep/0049_private_xml_storage.vala index c57acdde..0472296c 100644 --- a/xmpp-vala/src/module/xep/0049_private_xml_storage.vala +++ b/xmpp-vala/src/module/xep/0049_private_xml_storage.vala @@ -5,6 +5,7 @@ namespace Xmpp.Xep.PrivateXmlStorage { public class Module : XmppStreamModule { public const string ID = "0049_private_xml_storage"; + public static ModuleIdentity IDENTITY = new ModuleIdentity(NS_URI, ID); public void store(XmppStream stream, StanzaNode node, StoreResponseListener listener) { StanzaNode queryNode = new StanzaNode.build("query", NS_URI).add_self_xmlns().put_node(node); @@ -44,7 +45,7 @@ namespace Xmpp.Xep.PrivateXmlStorage { public override void detach(XmppStream stream) { } public static Module? get_module(XmppStream stream) { - return (Module?) stream.get_module(NS_URI, ID); + return (Module?) stream.get_module(IDENTITY); } public static void require(XmppStream stream) { diff --git a/xmpp-vala/src/module/xep/0054_vcard/module.vala b/xmpp-vala/src/module/xep/0054_vcard/module.vala index 58b71d2c..d0b23db5 100644 --- a/xmpp-vala/src/module/xep/0054_vcard/module.vala +++ b/xmpp-vala/src/module/xep/0054_vcard/module.vala @@ -6,6 +6,7 @@ private const string NS_URI_UPDATE = NS_URI + ":x:update"; public class Module : XmppStreamModule { public const string ID = "0027_current_pgp_usage"; + public static ModuleIdentity IDENTITY = new ModuleIdentity(NS_URI, ID); public signal void received_avatar(XmppStream stream, string jid, string id); @@ -26,7 +27,7 @@ public class Module : XmppStreamModule { } public static Module? get_module(XmppStream stream) { - return (Module?) stream.get_module(NS_URI, ID); + return (Module?) stream.get_module(IDENTITY); } public static void require(XmppStream stream) { diff --git a/xmpp-vala/src/module/xep/0060_pubsub.vala b/xmpp-vala/src/module/xep/0060_pubsub.vala index 600ddded..f9379c45 100644 --- a/xmpp-vala/src/module/xep/0060_pubsub.vala +++ b/xmpp-vala/src/module/xep/0060_pubsub.vala @@ -8,6 +8,7 @@ namespace Xmpp.Xep.Pubsub { public class Module : XmppStreamModule { public const string ID = "0060_pubsub_module"; + public static ModuleIdentity IDENTITY = new ModuleIdentity(NS_URI, ID); private HashMap event_listeners = new HashMap(); @@ -70,7 +71,7 @@ namespace Xmpp.Xep.Pubsub { } public static Module? get_module(XmppStream stream) { - return (Module?) stream.get_module(NS_URI, ID); + return (Module?) stream.get_module(IDENTITY); } public static void require(XmppStream stream) { diff --git a/xmpp-vala/src/module/xep/0084_user_avatars.vala b/xmpp-vala/src/module/xep/0084_user_avatars.vala index 575b5d78..3654509c 100644 --- a/xmpp-vala/src/module/xep/0084_user_avatars.vala +++ b/xmpp-vala/src/module/xep/0084_user_avatars.vala @@ -7,6 +7,7 @@ namespace Xmpp.Xep.UserAvatars { public class Module : XmppStreamModule { public const string ID = "0084_user_avatars"; + public static ModuleIdentity IDENTITY = new ModuleIdentity(NS_URI, ID); public signal void received_avatar(XmppStream stream, string jid, string id); @@ -73,7 +74,7 @@ namespace Xmpp.Xep.UserAvatars { } public static Module? get_module(XmppStream stream) { - return (Module?) stream.get_module(NS_URI, ID); + return (Module?) stream.get_module(IDENTITY); } public static void require(XmppStream stream) { diff --git a/xmpp-vala/src/module/xep/0085_chat_state_notifications.vala b/xmpp-vala/src/module/xep/0085_chat_state_notifications.vala index cefc7a18..3e92cd44 100644 --- a/xmpp-vala/src/module/xep/0085_chat_state_notifications.vala +++ b/xmpp-vala/src/module/xep/0085_chat_state_notifications.vala @@ -15,6 +15,7 @@ private const string[] STATES = {STATE_ACTIVE, STATE_INACTIVE, STATE_GONE, STATE public class Module : XmppStreamModule { public const string ID = "0085_chat_state_notifications"; + public static ModuleIdentity IDENTITY = new ModuleIdentity(NS_URI, ID); public signal void chat_state_received(XmppStream stream, string jid, string state); @@ -42,7 +43,7 @@ public class Module : XmppStreamModule { } public static Module? get_module(XmppStream stream) { - return (Module?) stream.get_module(NS_URI, ID); + return (Module?) stream.get_module(IDENTITY); } public static void require(XmppStream stream) { diff --git a/xmpp-vala/src/module/xep/0115_entitiy_capabilities.vala b/xmpp-vala/src/module/xep/0115_entitiy_capabilities.vala index 472eb9bd..c39f9cad 100644 --- a/xmpp-vala/src/module/xep/0115_entitiy_capabilities.vala +++ b/xmpp-vala/src/module/xep/0115_entitiy_capabilities.vala @@ -7,6 +7,7 @@ namespace Xmpp.Xep.EntityCapabilities { public class Module : XmppStreamModule { public const string ID = "0115_entity_capabilities"; + public static ModuleIdentity IDENTITY = new ModuleIdentity(NS_URI, ID); private string own_ver_hash; private Storage storage; @@ -36,7 +37,7 @@ namespace Xmpp.Xep.EntityCapabilities { } public static Module? get_module(XmppStream stream) { - return (Module?) stream.get_module(NS_URI, ID); + return (Module?) stream.get_module(IDENTITY); } public static void require(XmppStream stream) { diff --git a/xmpp-vala/src/module/xep/0184_message_delivery_receipts.vala b/xmpp-vala/src/module/xep/0184_message_delivery_receipts.vala index 489592fa..bd0fe98a 100644 --- a/xmpp-vala/src/module/xep/0184_message_delivery_receipts.vala +++ b/xmpp-vala/src/module/xep/0184_message_delivery_receipts.vala @@ -7,6 +7,7 @@ namespace Xmpp.Xep.MessageDeliveryReceipts { public class Module : XmppStreamModule { public const string ID = "0184_message_delivery_receipts"; + public static ModuleIdentity IDENTITY = new ModuleIdentity(NS_URI, ID); public signal void receipt_received(XmppStream stream, string jid, string id); @@ -25,7 +26,7 @@ namespace Xmpp.Xep.MessageDeliveryReceipts { } public static Module? get_module(XmppStream stream) { - return (Module?) stream.get_module(NS_URI, ID); + return (Module?) stream.get_module(IDENTITY); } public static void require(XmppStream stream) { diff --git a/xmpp-vala/src/module/xep/0199_ping.vala b/xmpp-vala/src/module/xep/0199_ping.vala index 82da1d23..800ccfd8 100644 --- a/xmpp-vala/src/module/xep/0199_ping.vala +++ b/xmpp-vala/src/module/xep/0199_ping.vala @@ -7,6 +7,7 @@ namespace Xmpp.Xep.Ping { public class Module : XmppStreamModule { public const string ID = "0199_ping"; + public static ModuleIdentity IDENTITY = new ModuleIdentity(NS_URI, ID); public void send_ping(XmppStream stream, string jid, ResponseListener? listener = null) { Iq.Stanza iq = new Iq.Stanza.get(new StanzaNode.build("ping", NS_URI).add_self_xmlns()); @@ -32,7 +33,7 @@ namespace Xmpp.Xep.Ping { public override void detach(XmppStream stream) { } public static Module? get_module(XmppStream stream) { - return (Module?) stream.get_module(NS_URI, ID); + return (Module?) stream.get_module(IDENTITY); } public static void require(XmppStream stream) { diff --git a/xmpp-vala/src/module/xep/0203_delayed_delivery.vala b/xmpp-vala/src/module/xep/0203_delayed_delivery.vala index 9f9761f2..4dd8a0cb 100644 --- a/xmpp-vala/src/module/xep/0203_delayed_delivery.vala +++ b/xmpp-vala/src/module/xep/0203_delayed_delivery.vala @@ -5,6 +5,7 @@ namespace Xmpp.Xep.DelayedDelivery { public class Module : XmppStreamModule { public const string ID = "0203_delayed_delivery"; + public static ModuleIdentity IDENTITY = new ModuleIdentity(NS_URI, ID); public static void set_message_delay(Message.Stanza message, DateTime datetime) { StanzaNode delay_node = (new StanzaNode.build("delay", NS_URI)).add_self_xmlns(); @@ -29,7 +30,7 @@ namespace Xmpp.Xep.DelayedDelivery { public override void detach(XmppStream stream) { } public static Module? get_module(XmppStream stream) { - return (Module?) stream.get_module(NS_URI, ID); + return (Module?) stream.get_module(IDENTITY); } public static void require(XmppStream stream) { diff --git a/xmpp-vala/src/module/xep/0280_message_carbons.vala b/xmpp-vala/src/module/xep/0280_message_carbons.vala index 18b2ecdf..097a4a76 100644 --- a/xmpp-vala/src/module/xep/0280_message_carbons.vala +++ b/xmpp-vala/src/module/xep/0280_message_carbons.vala @@ -5,6 +5,7 @@ namespace Xmpp.Xep.MessageCarbons { public class Module : XmppStreamModule { public const string ID = "0280_message_carbons_module"; + public static ModuleIdentity IDENTITY = new ModuleIdentity(NS_URI, ID); public void enable(XmppStream stream) { Iq.Stanza iq = new Iq.Stanza.set(new StanzaNode.build("enable", NS_URI).add_self_xmlns()); @@ -33,7 +34,7 @@ namespace Xmpp.Xep.MessageCarbons { } public static Module? get_module(XmppStream stream) { - return (Module?) stream.get_module(NS_URI, ID); + return (Module?) stream.get_module(IDENTITY); } public static void require(XmppStream stream) { diff --git a/xmpp-vala/src/module/xep/0333_chat_markers.vala b/xmpp-vala/src/module/xep/0333_chat_markers.vala index 0dc0e637..64388e47 100644 --- a/xmpp-vala/src/module/xep/0333_chat_markers.vala +++ b/xmpp-vala/src/module/xep/0333_chat_markers.vala @@ -13,6 +13,7 @@ private const string[] MARKERS = {MARKER_RECEIVED, MARKER_DISPLAYED, MARKER_ACKN public class Module : XmppStreamModule { public const string ID = "0333_chat_markers"; + public static ModuleIdentity IDENTITY = new ModuleIdentity(NS_URI, ID); public signal void marker_received(XmppStream stream, string jid, string marker, string id); @@ -45,7 +46,7 @@ public class Module : XmppStreamModule { } public static Module? get_module(XmppStream stream) { - return (Module?) stream.get_module(NS_URI, ID); + return (Module?) stream.get_module(IDENTITY); } public static void require(XmppStream stream) { -- cgit v1.2.3-70-g09d2