about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-01-23 22:54:47 +0100
committerMichael Vetter <jubalh@iodoru.org>2020-01-23 22:54:47 +0100
commit2d19ad0db4b41a800e1753922c0d09d136473812 (patch)
tree7264aaa55e41c0399099620aa0d89769e9cb8be3 /src/xmpp
parentfd38c7adae32f3fd3823c1e43513102a6bd7aa08 (diff)
downloadprofani-tty-2d19ad0db4b41a800e1753922c0d09d136473812.tar.gz
Add option to notify about version request
Cannot be configured for now.
Can be set via `adv.notify.discoversion` in the `notification` section.

Will notify about version requests via XEP-0092 and XEP-0232.

Client version can still be seen via caps (capabilities).
See `stanza_attach_caps()`.
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/iq.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c
index 0e4dd151..b2fed28c 100644
--- a/src/xmpp/iq.c
+++ b/src/xmpp/iq.c
@@ -1564,6 +1564,10 @@ _version_get_handler(xmpp_stanza_t *const stanza)
     }
 
     if (from) {
+        if (prefs_get_boolean(PREF_ADV_NOTIFY_DISCO_OR_VERSION)) {
+            cons_show("Received IQ version request (XEP-0092) from %s", from);
+        }
+
         xmpp_stanza_t *response = xmpp_iq_new(ctx, STANZA_TYPE_RESULT, id);
         xmpp_stanza_set_to(response, from);
 
@@ -1709,6 +1713,10 @@ _disco_info_get_handler(xmpp_stanza_t *const stanza)
     }
 
     if (from) {
+        if (prefs_get_boolean(PREF_ADV_NOTIFY_DISCO_OR_VERSION)) {
+            cons_show("Received IQ disco info request (XEP-0232) from %s", from);
+        }
+
         xmpp_stanza_t *response = xmpp_iq_new(ctx, STANZA_TYPE_RESULT, xmpp_stanza_get_id(stanza));
         xmpp_stanza_set_to(response, from);