Mercurial > ~mikael > mcabber > hg
comparison mcabber/mcabber/xmpp_iq.c @ 2065:c09fc3834c69
Add option 'iq_version_hide_time'
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 28 Apr 2013 11:10:04 +0200 |
parents | a0437e179b35 |
children | 69699ba3010f |
comparison
equal
deleted
inserted
replaced
2064:01485f807811 | 2065:c09fc3834c69 |
---|---|
749 if (!settings_opt_get_int("iq_hide_requests")) { | 749 if (!settings_opt_get_int("iq_hide_requests")) { |
750 scr_LogPrint(LPRINT_LOGNORM, "Received an IQ time request from <%s>", | 750 scr_LogPrint(LPRINT_LOGNORM, "Received an IQ time request from <%s>", |
751 lm_message_get_from(m)); | 751 lm_message_get_from(m)); |
752 } | 752 } |
753 | 753 |
754 if (settings_opt_get_int("iq_version_hide_time")) { | |
755 send_iq_error(c, m, XMPP_ERROR_SERVICE_UNAVAILABLE); | |
756 return LM_HANDLER_RESULT_REMOVE_MESSAGE; | |
757 } | |
758 | |
754 buf = g_new0(char, 512); | 759 buf = g_new0(char, 512); |
755 | 760 |
756 r = lm_message_new_iq_from_query(m, LM_MESSAGE_SUB_TYPE_RESULT); | 761 r = lm_message_new_iq_from_query(m, LM_MESSAGE_SUB_TYPE_RESULT); |
757 query = lm_message_node_add_child(r->node, "query", NULL); | 762 query = lm_message_node_add_child(r->node, "query", NULL); |
758 lm_message_node_set_attribute(query, "xmlns", NS_TIME); | 763 lm_message_node_set_attribute(query, "xmlns", NS_TIME); |
799 if (!settings_opt_get_int("iq_hide_requests")) { | 804 if (!settings_opt_get_int("iq_hide_requests")) { |
800 scr_LogPrint(LPRINT_LOGNORM, "Received an IQ time request from <%s>", | 805 scr_LogPrint(LPRINT_LOGNORM, "Received an IQ time request from <%s>", |
801 lm_message_get_from(m)); | 806 lm_message_get_from(m)); |
802 } | 807 } |
803 | 808 |
809 if (settings_opt_get_int("iq_version_hide_time")) { | |
810 send_iq_error(c, m, XMPP_ERROR_SERVICE_UNAVAILABLE); | |
811 return LM_HANDLER_RESULT_REMOVE_MESSAGE; | |
812 } | |
813 | |
804 buf = g_new0(char, 512); | 814 buf = g_new0(char, 512); |
805 | 815 |
806 r = lm_message_new_iq_from_query(m, LM_MESSAGE_SUB_TYPE_RESULT); | 816 r = lm_message_new_iq_from_query(m, LM_MESSAGE_SUB_TYPE_RESULT); |
807 query = lm_message_node_add_child(r->node, "time", NULL); | 817 query = lm_message_node_add_child(r->node, "time", NULL); |
808 lm_message_node_set_attribute(query, "xmlns", NS_XMPP_TIME); | 818 lm_message_node_set_attribute(query, "xmlns", NS_XMPP_TIME); |