@@ -34,7 +34,7 @@ proc initReceivedMessage(sender: PublicKey, timestamp: int64, content: ContentFr
3434
3535type
3636 PrivateV1 * = ref object of Conversation
37- # Placeholder for PrivateV1 conversation type
37+ ds: WakuClient
3838 sdsClient: ReliabilityManager
3939 owner: Identity
4040 topic: string
@@ -126,7 +126,7 @@ proc wireCallbacks(convo: PrivateV1, deliveryAckCb: proc(
126126
127127
128128
129- proc initPrivateV1 * (owner: Identity , participant: PublicKey , seedKey: array [32 , byte ],
129+ proc initPrivateV1 * (owner: Identity , ds: WakuClient , participant: PublicKey , seedKey: array [32 , byte ],
130130 discriminator: string = " default" , isSender: bool , deliveryAckCb: proc (
131131 conversation: Conversation ,
132132 msgId: string ): Future [void ] {.async .} = nil ):
@@ -138,6 +138,7 @@ proc initPrivateV1*(owner: Identity, participant: PublicKey, seedKey: array[32,
138138 raise newException (ValueError , fmt" sds initialization: { repr (error)} " )
139139
140140 result = PrivateV1 (
141+ ds: ds,
141142 sdsClient: rm,
142143 owner: owner,
143144 topic: derive_topic (participants, discriminator),
@@ -152,13 +153,13 @@ proc initPrivateV1*(owner: Identity, participant: PublicKey, seedKey: array[32,
152153 raise newException (ValueError , " bad sds channel" )
153154
154155
155- proc initPrivateV1Sender * (owner:Identity , participant: PublicKey , seedKey: array [32 , byte ], deliveryAckCb: proc (
156+ proc initPrivateV1Sender * (owner:Identity , ds: WakuClient , participant: PublicKey , seedKey: array [32 , byte ], deliveryAckCb: proc (
156157 conversation: Conversation , msgId: string ): Future [void ] {.async .} = nil ): PrivateV1 =
157- initPrivateV1 (owner, participant, seedKey, " default" , true , deliveryAckCb)
158+ initPrivateV1 (owner, ds, participant, seedKey, " default" , true , deliveryAckCb)
158159
159- proc initPrivateV1Recipient * (owner:Identity , participant: PublicKey , seedKey: array [32 , byte ], deliveryAckCb: proc (
160+ proc initPrivateV1Recipient * (owner:Identity ,ds: WakuClient , participant: PublicKey , seedKey: array [32 , byte ], deliveryAckCb: proc (
160161 conversation: Conversation , msgId: string ): Future [void ] {.async .} = nil ): PrivateV1 =
161- initPrivateV1 (owner, participant, seedKey, " default" , false , deliveryAckCb)
162+ initPrivateV1 (owner,ds, participant, seedKey, " default" , false , deliveryAckCb)
162163
163164
164165proc sendFrame (self: PrivateV1 , ds: WakuClient ,
@@ -216,14 +217,13 @@ proc handleFrame*[T: ConversationStore](convo: PrivateV1, client: T,
216217 notice " Got Placeholder" , text = frame.placeholder.counter
217218
218219
219- method sendMessage * (convo: PrivateV1 , ds: WakuClient ,
220- content_frame: ContentFrame ) : Future [MessageId ] {.async .} =
220+ method sendMessage * (convo: PrivateV1 , content_frame: ContentFrame ) : Future [MessageId ] {.async .} =
221221
222222 try :
223223 let frame = PrivateV1Frame (sender: @ (convo.owner.getPubkey ().bytes ()),
224224 timestamp: getCurrentTimestamp (), content: content_frame)
225225
226- result = await convo.sendFrame (ds, frame)
226+ result = await convo.sendFrame (convo. ds, frame)
227227 except Exception as e:
228228 error " Unknown error in PrivateV1:SendMessage"
229229
0 commit comments