diff --git a/src/client.nim b/src/client.nim index c591cf1..93cefd8 100644 --- a/src/client.nim +++ b/src/client.nim @@ -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( diff --git a/src/inbox.nim b/src/inbox.nim index 3b6e7b1..fdf9231 100644 --- a/src/inbox.nim +++ b/src/inbox.nim @@ -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[