diff options
author | mathieui <mathieui@mathieui.net> | 2014-05-08 01:37:52 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2014-05-08 01:37:52 +0200 |
commit | 916416a019c398a484b6a436ee908808780263f9 (patch) | |
tree | 6de5b51968e8113b18251e8dee4131cd681860d9 /src/core/core.py | |
parent | 9786592b80f7ddcfefa967ea910f38ba3c02b0b4 (diff) | |
download | poezio-916416a019c398a484b6a436ee908808780263f9.tar.gz poezio-916416a019c398a484b6a436ee908808780263f9.tar.bz2 poezio-916416a019c398a484b6a436ee908808780263f9.tar.xz poezio-916416a019c398a484b6a436ee908808780263f9.zip |
Add an ugly fix to avoid endless disco#info queries with each message (with receipts)
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.
Diffstat (limited to 'src/core/core.py')
-rw-r--r-- | src/core/core.py | 8 |
1 files changed, 8 insertions, 0 deletions
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 ################################## |