From 5e55120317ae6c828e33b15e09403e954b7d45a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Mon, 19 Nov 2018 11:31:05 +0100 Subject: [PATCH] xep_0384: simplify trust management even more for now MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- storage.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/storage.py b/storage.py index 5a2c126..dc7f7d5 100644 --- a/storage.py +++ b/storage.py @@ -18,7 +18,6 @@ class SyncFileStorage(omemo.Storage): self.__own_data = None self.__sessions = {} self.__devices = {} - self.__trusted = True def dump(self): return copy.deepcopy({ @@ -27,9 +26,6 @@ class SyncFileStorage(omemo.Storage): "devices" : self.__devices }) - def trust(self, trusted): - self.__trusted = trusted - def loadOwnData(self, _callback): if self.__own_data is None: try: @@ -115,15 +111,11 @@ class SyncFileStorage(omemo.Storage): with open(filepath, 'w') as f: json.dump(self.__devices, f) - def isTrusted(self, callback, bare_jid, device): - result = False + def trust(self, _trusted: str) -> None: + """Set somebody as trusted""" - if self.__trusted == True: - result = True - else: - result = bare_jid in self.__trusted and device in self.__trusted[bare_jid] - - return result + def isTrusted(self, callback, bare_jid: str, device: int) -> bool: + return True @property def is_async(self):