@@ -12,7 +12,8 @@ import # Foreign
1212 std/ sequtils,
1313 strformat,
1414 strutils,
15- tables
15+ tables,
16+ types
1617
1718import # local
1819 conversation_store,
@@ -37,8 +38,8 @@ logScope:
3738type
3839 MessageCallback * [T] = proc (conversation: Conversation , msg: T): Future [void ] {.async .}
3940 NewConvoCallback * = proc (conversation: Conversation ): Future [void ] {.async .}
40- ReadReceiptCallback * = proc (conversation: Conversation ,
41- msgId: string ): Future [void ] {.async .}
41+ DeliveryAckCallback * = proc (conversation: Conversation ,
42+ msgId: MessageId ): Future [void ] {.async .}
4243
4344
4445type KeyEntry * = object
@@ -56,7 +57,7 @@ type Client* = ref object
5657
5758 newMessageCallbacks: seq [MessageCallback [ContentFrame ]]
5859 newConvoCallbacks: seq [NewConvoCallback ]
59- readReceiptCallbacks : seq [ReadReceiptCallback ]
60+ deliveryAckCallbacks : seq [DeliveryAckCallback ]
6061
6162# ################################################
6263# Constructors
@@ -136,12 +137,12 @@ proc notifyNewConversation(client: Client, convo: Conversation) =
136137 for cb in client.newConvoCallbacks:
137138 discard cb (convo)
138139
139- proc onReadReceipt * (client: Client , callback: ReadReceiptCallback ) =
140- client.readReceiptCallbacks .add (callback)
140+ proc onDeliveryAck * (client: Client , callback: DeliveryAckCallback ) =
141+ client.deliveryAckCallbacks .add (callback)
141142
142- proc notifyReadReceipt (client: Client , convo: Conversation ,
143+ proc notifyDeliveryAck (client: Client , convo: Conversation ,
143144 messageId: MessageId ) =
144- for cb in client.readReceiptCallbacks :
145+ for cb in client.deliveryAckCallbacks :
145146 discard cb (convo, messageId)
146147
147148# ################################################
@@ -213,7 +214,7 @@ proc newPrivateConversation*(client: Client,
213214 let deliveryAckCb = proc (
214215 conversation: Conversation ,
215216 msgId: string ): Future [void ] {.async .} =
216- client.notifyReadReceipt (conversation, msgId)
217+ client.notifyDeliveryAck (conversation, msgId)
217218
218219 let convo = initPrivateV1 (client.identity (), destPubkey, " default" , deliveryAckCb)
219220 client.addConversation (convo)
0 commit comments