mirror of
https://github.com/logos-messaging/nim-chat-poc.git
synced 2026-01-07 16:43:06 +00:00
update convo_id
This commit is contained in:
parent
be89da9afc
commit
e834704a89
@ -121,14 +121,12 @@ proc createPrivateConversation*(self: var Client, participant: PublicKey,
|
|||||||
proc handleIntro*(self: var Client, intro_bundle: IntroBundle): TransportMessage =
|
proc handleIntro*(self: var Client, intro_bundle: IntroBundle): TransportMessage =
|
||||||
## Creates a private conversation with the given Invitebundle.
|
## Creates a private conversation with the given Invitebundle.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let res_pubkey = SkPublicKey.fromRaw(intro_bundle.ident)
|
let res_pubkey = SkPublicKey.fromRaw(intro_bundle.ident)
|
||||||
if res_pubkey.isErr:
|
if res_pubkey.isErr:
|
||||||
raise newException(ValueError, "Invalid public key in intro bundle.")
|
raise newException(ValueError, "Invalid public key in intro bundle.")
|
||||||
let dest_pubkey = res_pubkey.get()
|
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 dst_convo_topic = topic_inbox(dest_pubkey.get_addr())
|
||||||
|
|
||||||
let invite = InvitePrivateV1(
|
let invite = InvitePrivateV1(
|
||||||
|
|||||||
@ -34,11 +34,11 @@ proc wrap_env*(payload: EncryptedPayload, convo_id: string): WapEnvelopeV1 =
|
|||||||
|
|
||||||
proc conversation_id_for*(pubkey: SkPublicKey): string =
|
proc conversation_id_for*(pubkey: SkPublicKey): string =
|
||||||
## Generates a conversation ID based on the public key.
|
## 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
|
# TODO derive this from instance of Inbox
|
||||||
proc topic_inbox*(client_addr: string): string =
|
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[
|
proc handle_incomming_frame*(self: Inbox, topic: string, bytes: seq[
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user