From 916416a019c398a484b6a436ee908808780263f9 Mon Sep 17 00:00:00 2001 From: mathieui Date: Thu, 8 May 2014 01:37:52 +0200 Subject: Add an ugly fix to avoid endless disco#info queries with each message (with receipts) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We need to check if the remote entity supports 0184, but if it doesn’t support disco#info, then we will get an iq type="error" and nothing will be cached, leading to disco#info queries being sent each time. Keep a cache valid 2 hours of the JIDs which replied with an error. TODO: check that this the kind of time period we want. --- src/core/core.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/core/core.py') diff --git a/src/core/core.py b/src/core/core.py index e340bd5d..74930083 100644 --- a/src/core/core.py +++ b/src/core/core.py @@ -25,6 +25,7 @@ import bookmark import connection import decorators import events +import fixes import singleton import tabs import theming @@ -297,6 +298,7 @@ class Core(object): self.on_theme_config_change) self.add_configuration_handler("", self.on_any_config_change) + self.reset_iq_errors() def on_any_config_change(self, option, value): """ @@ -739,6 +741,12 @@ class Core(object): self.timed_events.remove(event) break + def reset_iq_errors(self): + "Reset the iq error cache periodically" + fixes.reset_iq_errors() + self.add_timed_event( + timed_events.DelayedEvent(7200, self.reset_iq_errors)) + ####################### XMPP-related actions ################################## -- cgit v1.2.3