Add comment to highlight conflict prevention
We use dark magic to prevent illegal chars on a range of filesystems, same as the omemo library uses. Maybe that should be abstracted away. Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
beb5255cb2
commit
f677633c69
1 changed files with 2 additions and 0 deletions
|
@ -70,9 +70,11 @@ class Plugin(E2EEPlugin):
|
||||||
|
|
||||||
self.info = lambda i: self.api.information(i, 'Info')
|
self.info = lambda i: self.api.information(i, 'Info')
|
||||||
|
|
||||||
|
# Ensure folder names don't contain illegal chars for the FS
|
||||||
jid_str = self.core.xmpp.boundjid.bare.encode('utf-8')
|
jid_str = self.core.xmpp.boundjid.bare.encode('utf-8')
|
||||||
digest = hashlib.sha256(jid_str).digest()
|
digest = hashlib.sha256(jid_str).digest()
|
||||||
hashed_jid = base64.b32encode(digest).decode('US-ASCII')
|
hashed_jid = base64.b32encode(digest).decode('US-ASCII')
|
||||||
|
|
||||||
data_dir = os.path.join(DATA_HOME, 'omemo', hashed_jid)
|
data_dir = os.path.join(DATA_HOME, 'omemo', hashed_jid)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue