xep_0384: simplify trust management even more for now

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2018-11-19 11:31:05 +01:00
parent f15626c6d1
commit 5e55120317

View file

@ -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):