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/connection.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/connection.py')
-rw-r--r-- | src/connection.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/connection.py b/src/connection.py index a0e9a395..b06a013b 100644 --- a/src/connection.py +++ b/src/connection.py @@ -16,12 +16,17 @@ log = logging.getLogger(__name__) import getpass import sleekxmpp from sleekxmpp.plugins.xep_0184 import XEP_0184 +from sleekxmpp.plugins.xep_0030 import StaticDisco +from sleekxmpp.plugins.xep_0115 import StaticCaps import common import fixes from common import safeJID from config import config, options +StaticDisco.supports = fixes.xep_30_supports +StaticCaps.supports = fixes.xep_115_supports + class Connection(sleekxmpp.ClientXMPP): """ Receives everything from Jabber and emits the @@ -72,8 +77,6 @@ class Connection(sleekxmpp.ClientXMPP): self.whitespace_keepalive_interval = int(interval) else: self.whitespace_keepalive_interval = 300 - # Hack to check the sleekxmpp version - # TODO: Remove that when a sufficient time has passed since the move self.register_plugin('xep_0004') self.register_plugin('xep_0012') self.register_plugin('xep_0030') |