From 23d5a6e138beb525fc690205851dc278ebae5458 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philipp=20H=C3=B6rist?= <philipp@hoerist.com>
Date: Thu, 21 Nov 2019 22:23:56 +0100
Subject: [PATCH] Discovery: Store Account/Server disco info

---
 gajim/common/modules/discovery.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/gajim/common/modules/discovery.py b/gajim/common/modules/discovery.py
index db024986da..62b9de88c0 100644
--- a/gajim/common/modules/discovery.py
+++ b/gajim/common/modules/discovery.py
@@ -47,6 +47,17 @@ def __init__(self, con):
                           ns=nbxmpp.NS_DISCO_ITEMS),
         ]
 
+        self._account_info = None
+        self._server_info = None
+
+    @property
+    def account_info(self):
+        return self._account_info
+
+    @property
+    def server_info(self):
+        return self._server_info
+
     def disco_contact(self, jid, node=None):
         success_cb = self._con.get_module('Caps').contact_info_received
         self.disco_info(jid, node, callback=success_cb)
@@ -99,6 +110,8 @@ def _account_info_received(self, result):
 
         self._log.info('Account info received: %s', result.jid)
 
+        self._account_info = result
+
         self._con.get_module('MAM').pass_disco(result)
         self._con.get_module('PEP').pass_disco(result)
         self._con.get_module('PubSub').pass_disco(result)
@@ -122,6 +135,8 @@ def _server_info_received(self, result):
 
         self._log.info('Server info received: %s', result.jid)
 
+        self._server_info = result
+
         self._con.get_module('SecLabels').pass_disco(result)
         self._con.get_module('Blocking').pass_disco(result)
         self._con.get_module('VCardTemp').pass_disco(result)
-- 
GitLab