aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/xep/0060_pubsub.vala
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2026-07-18 18:10:27 +0200
committerMarvin W <git@larma.de>2026-08-02 12:44:10 +0200
commit64f09ce50063e6ccc135a535fe98f58751d7ac7d (patch)
treef8e407f0ab94a44ef1208202df3778ca10f89cb5 /xmpp-vala/src/module/xep/0060_pubsub.vala
parent45723ac201c1905571f9f78c8c970828db97139a (diff)
Add support for XEP-0490 Message Displayed Synchronization
Diffstat (limited to 'xmpp-vala/src/module/xep/0060_pubsub.vala')
-rw-r--r--xmpp-vala/src/module/xep/0060_pubsub.vala11
1 files changed, 6 insertions, 5 deletions
diff --git a/xmpp-vala/src/module/xep/0060_pubsub.vala b/xmpp-vala/src/module/xep/0060_pubsub.vala
index c6395eb9..c9af4263 100644
--- a/xmpp-vala/src/module/xep/0060_pubsub.vala
+++ b/xmpp-vala/src/module/xep/0060_pubsub.vala
@@ -41,9 +41,9 @@ namespace Xmpp.Xep.Pubsub {
retract_listeners.unset(node);
}
- public async Gee.List<StanzaNode>? request_all(XmppStream stream, Jid jid, string node) { // TODO multiple nodes gehen auch
+ public async Gee.List<StanzaNode>? request_all(XmppStream stream, Jid? jid, string node) { // TODO multiple nodes gehen auch
Iq.Stanza request_iq = new Iq.Stanza.get(new StanzaNode.build("pubsub", NS_URI).add_self_xmlns().put_node(new StanzaNode.build("items", NS_URI).put_attribute("node", node)));
- request_iq.to = jid;
+ if (jid != null) request_iq.to = jid;
Iq.Stanza iq_res = yield stream.get_module(Iq.Module.IDENTITY).send_iq_async(stream, request_iq);
@@ -56,9 +56,9 @@ namespace Xmpp.Xep.Pubsub {
}
public delegate void OnResult(XmppStream stream, Jid jid, string? id, StanzaNode? node);
- public void request(XmppStream stream, Jid jid, string node, owned OnResult listener) { // TODO multiple nodes gehen auch
+ public void request(XmppStream stream, Jid? jid, string node, owned OnResult listener) { // TODO multiple nodes gehen auch
Iq.Stanza request_iq = new Iq.Stanza.get(new StanzaNode.build("pubsub", NS_URI).add_self_xmlns().put_node(new StanzaNode.build("items", NS_URI).put_attribute("node", node)));
- request_iq.to = jid;
+ if (jid != null) request_iq.to = jid;
stream.get_module(Iq.Module.IDENTITY).send_iq(stream, request_iq, (stream, iq) => {
StanzaNode event_node = iq.stanza.get_subnode("pubsub", NS_URI);
StanzaNode items_node = event_node != null ? event_node.get_subnode("items", NS_URI) : null;
@@ -100,6 +100,7 @@ namespace Xmpp.Xep.Pubsub {
}
Iq.Stanza iq = new Iq.Stanza.set(pubsub_node);
+ if (jid != null) iq.to = jid;
// If the node was configured differently before, reconfigure it to meet our requirements and try again
Iq.Stanza iq_result = yield stream.get_module(Iq.Module.IDENTITY).send_iq_async(stream, iq);
@@ -222,7 +223,7 @@ namespace Xmpp.Xep.Pubsub {
}
private async bool change_node_config(XmppStream stream, Jid jid, string node, PublishOptions publish_options) {
- DataForms.DataForm? data_form = yield stream.get_module(Pubsub.Module.IDENTITY).request_node_config(stream, null, node);
+ DataForms.DataForm? data_form = yield stream.get_module(Pubsub.Module.IDENTITY).request_node_config(stream, jid, node);
if (data_form == null) return false;
foreach (DataForms.DataForm.Field field in data_form.fields) {