update convo_id

This commit is contained in:
Jazz Turner-Baggs 2025-07-11 14:57:34 -07:00
parent be89da9afc
commit e834704a89
2 changed files with 3 additions and 5 deletions

View File

@ -121,14 +121,12 @@ proc createPrivateConversation*(self: var Client, participant: PublicKey,
proc handleIntro*(self: var Client, intro_bundle: IntroBundle): TransportMessage =
## Creates a private conversation with the given Invitebundle.
let res_pubkey = SkPublicKey.fromRaw(intro_bundle.ident)
if res_pubkey.isErr:
raise newException(ValueError, "Invalid public key in intro bundle.")
let dest_pubkey = res_pubkey.get()
let convo_id = "/convo/inbox/" & dest_pubkey.getAddr()
let convo_id = conversation_id_for(dest_pubkey)
let dst_convo_topic = topic_inbox(dest_pubkey.get_addr())
let invite = InvitePrivateV1(

View File

@ -34,11 +34,11 @@ proc wrap_env*(payload: EncryptedPayload, convo_id: string): WapEnvelopeV1 =
proc conversation_id_for*(pubkey: SkPublicKey): string =
## Generates a conversation ID based on the public key.
return "/convo/inbox/" & pubkey.get_addr()
return "/convo/inbox/v1" & pubkey.get_addr()
# TODO derive this from instance of Inbox
proc topic_inbox*(client_addr: string): string =
return "/inbox/v1/" & client_addr
return "/inbox/" & client_addr
proc handle_incomming_frame*(self: Inbox, topic: string, bytes: seq[