changeset 2065:c09fc3834c69

Add option 'iq_version_hide_time'
author Mikael Berthe <mikael@lilotux.net>
date Sun, 28 Apr 2013 11:10:04 +0200
parents 01485f807811
children 69699ba3010f
files mcabber/mcabber/xmpp_iq.c mcabber/mcabberrc.example
diffstat 2 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/mcabber/xmpp_iq.c	Sun Apr 28 11:01:28 2013 +0200
+++ b/mcabber/mcabber/xmpp_iq.c	Sun Apr 28 11:10:04 2013 +0200
@@ -751,6 +751,11 @@
                  lm_message_get_from(m));
   }
 
+  if (settings_opt_get_int("iq_version_hide_time")) {
+    send_iq_error(c, m, XMPP_ERROR_SERVICE_UNAVAILABLE);
+    return LM_HANDLER_RESULT_REMOVE_MESSAGE;
+  }
+
   buf = g_new0(char, 512);
 
   r = lm_message_new_iq_from_query(m, LM_MESSAGE_SUB_TYPE_RESULT);
@@ -801,6 +806,11 @@
                  lm_message_get_from(m));
   }
 
+  if (settings_opt_get_int("iq_version_hide_time")) {
+    send_iq_error(c, m, XMPP_ERROR_SERVICE_UNAVAILABLE);
+    return LM_HANDLER_RESULT_REMOVE_MESSAGE;
+  }
+
   buf = g_new0(char, 512);
 
   r = lm_message_new_iq_from_query(m, LM_MESSAGE_SUB_TYPE_RESULT);
--- a/mcabber/mcabberrc.example	Sun Apr 28 11:01:28 2013 +0200
+++ b/mcabber/mcabberrc.example	Sun Apr 28 11:10:04 2013 +0200
@@ -186,6 +186,10 @@
 # your OS version.
 #set iq_version_hide_os = 0
 #
+# Set iq_version_hide_time to 1 if you do not want to allow people to retrieve
+# your OS time.
+#set iq_version_hide_time = 0
+#
 # Set iq_last_disable to 1 if you want to disable response to jabber:iq:last
 # queries (XEP-0012).  Set iq_last_disable_when_notavail to 1 if you want
 # to disable Last Activity reports only when the not-available status is set.