aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/xep/0049_private_xml_storage.vala
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-03-11 01:40:42 +0100
committerfiaxh <git@mx.ax.lt>2017-03-11 01:40:42 +0100
commit1ccad732b9a783d8f0140373602b7c1b84d04198 (patch)
tree368df267ba013c03d01c06c78b6559fa59338be3 /xmpp-vala/src/module/xep/0049_private_xml_storage.vala
parent95e8d126db06a183918b4db4e84013ff28f8b1f7 (diff)
downloaddino-1ccad732b9a783d8f0140373602b7c1b84d04198.tar.gz
dino-1ccad732b9a783d8f0140373602b7c1b84d04198.zip
Use typed identity in stream modules
Diffstat (limited to 'xmpp-vala/src/module/xep/0049_private_xml_storage.vala')
-rw-r--r--xmpp-vala/src/module/xep/0049_private_xml_storage.vala10
1 files changed, 3 insertions, 7 deletions
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 0472296c..f59d0bdd 100644
--- a/xmpp-vala/src/module/xep/0049_private_xml_storage.vala
+++ b/xmpp-vala/src/module/xep/0049_private_xml_storage.vala
@@ -10,7 +10,7 @@ namespace Xmpp.Xep.PrivateXmlStorage {
public void store(XmppStream stream, StanzaNode node, StoreResponseListener listener) {
StanzaNode queryNode = new StanzaNode.build("query", NS_URI).add_self_xmlns().put_node(node);
Iq.Stanza iq = new Iq.Stanza.set(queryNode);
- Iq.Module.get_module(stream).send_iq(stream, iq, new IqStoreResponse(listener));
+ stream.get_module(Iq.Module.IDENTITY).send_iq(stream, iq, new IqStoreResponse(listener));
}
private class IqStoreResponse : Iq.ResponseListener, Object {
@@ -26,7 +26,7 @@ namespace Xmpp.Xep.PrivateXmlStorage {
public void retrieve(XmppStream stream, StanzaNode node, RetrieveResponseListener responseListener) {
StanzaNode queryNode = new StanzaNode.build("query", NS_URI).add_self_xmlns().put_node(node);
Iq.Stanza iq = new Iq.Stanza.get(queryNode);
- Iq.Module.get_module(stream).send_iq(stream, iq, new IqRetrieveResponse(responseListener));
+ stream.get_module(Iq.Module.IDENTITY).send_iq(stream, iq, new IqRetrieveResponse(responseListener));
}
private class IqRetrieveResponse : Iq.ResponseListener, Object {
@@ -44,12 +44,8 @@ namespace Xmpp.Xep.PrivateXmlStorage {
public override void detach(XmppStream stream) { }
- public static Module? get_module(XmppStream stream) {
- return (Module?) stream.get_module(IDENTITY);
- }
-
public static void require(XmppStream stream) {
- if (get_module(stream) == null) stream.add_module(new PrivateXmlStorage.Module());
+ if (stream.get_module(IDENTITY) == null) stream.add_module(new PrivateXmlStorage.Module());
}
public override string get_ns() { return NS_URI; }