Mercurial > libervia-backend
comparison sat/core/xmpp.py @ 3162:b5c058c7692e
core (xmpp), plugin android: fixed DNS, SRV handling on Android:
Android doesn't have a "/etc/resolv.conf" that Twisted expect. As a result, SRV records
can't be checked correctly on connection.
To work around that, DNS servers used on Android are checked when necessary (on Android
plugin startup and on connectivity change), using some hacks, and Twisted is patched to
use them.
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 09 Feb 2020 23:56:42 +0100 |
parents | 2c7b42f53e9a |
children | 39d7327583e1 |
comparison
equal
deleted
inserted
replaced
3161:be5fffe34987 | 3162:b5c058c7692e |
---|---|
718 # with a web frontend, | 718 # with a web frontend, |
719 # etc., we should implement a way to dynamically update identities through the | 719 # etc., we should implement a way to dynamically update identities through the |
720 # bridge | 720 # bridge |
721 self.identities = [disco.DiscoIdentity("client", "pc", C.APP_NAME)] | 721 self.identities = [disco.DiscoIdentity("client", "pc", C.APP_NAME)] |
722 if sys.platform == "android": | 722 if sys.platform == "android": |
723 # FIXME: temporary hack as SRV is not working on android | |
724 # TODO: remove this hack and fix SRV | |
725 log.info("FIXME: Android hack, ignoring SRV") | |
726 if host is None: | |
727 host = user_jid.host | |
728 # for now we consider Android devices to be always phones | 723 # for now we consider Android devices to be always phones |
729 self.identities = [disco.DiscoIdentity("client", "phone", C.APP_NAME)] | 724 self.identities = [disco.DiscoIdentity("client", "phone", C.APP_NAME)] |
730 | 725 |
731 hosts_map = host_app.memory.getConfig(None, "hosts_dict", {}) | 726 hosts_map = host_app.memory.getConfig(None, "hosts_dict", {}) |
732 if host is None and user_jid.host in hosts_map: | 727 if host is None and user_jid.host in hosts_map: |