aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-cli/src/meshbay_cli/client
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-cli/src/meshbay_cli/client')
-rw-r--r--packages/meshbay-cli/src/meshbay_cli/client/chat.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/meshbay-cli/src/meshbay_cli/client/chat.py b/packages/meshbay-cli/src/meshbay_cli/client/chat.py
index 60629e2..22a99ef 100644
--- a/packages/meshbay-cli/src/meshbay_cli/client/chat.py
+++ b/packages/meshbay-cli/src/meshbay_cli/client/chat.py
@@ -48,6 +48,9 @@ class Message:
text: str
unreadable: str = "" # why it could not be read: signature, epoch, ...
trust: str = "" # roster.RosterCheck's verdict on the signing device
+ # Which message this is, wherever it was read from — history or a push,
+ # which carries no id: the node stores a (device, nonce) pair only once.
+ key: str = ""
class ChatKeys:
@@ -100,6 +103,7 @@ async def open_row(row: dict, keys: ChatKeys, group_id: str,
if not (device and nonce and ct and sig):
msg.unreadable = "envelope"
return msg
+ msg.key = f"{b64(bytes(device))}:{b64(bytes(nonce))}"
if not verify(group_id, epoch, bytes(device), bytes(nonce), bytes(ct), bytes(sig)):
msg.unreadable = "signature"
return msg