Add context to network.storeClientDeliveryReceipts
This commit is contained in:
parent
04b0c2fd6b
commit
f75ee272a4
8
user.go
8
user.go
@ -372,7 +372,7 @@ func (net *network) updateCasemapping(newCasemap casemapping) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (net *network) storeClientDeliveryReceipts(clientName string) {
|
func (net *network) storeClientDeliveryReceipts(ctx context.Context, clientName string) {
|
||||||
if !net.user.hasPersistentMsgStore() {
|
if !net.user.hasPersistentMsgStore() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -389,7 +389,7 @@ func (net *network) storeClientDeliveryReceipts(clientName string) {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
if err := net.user.srv.db.StoreClientDeliveryReceipts(context.TODO(), net.ID, clientName, receipts); err != nil {
|
if err := net.user.srv.db.StoreClientDeliveryReceipts(ctx, net.ID, clientName, receipts); err != nil {
|
||||||
net.logger.Printf("failed to store delivery receipts for client %q: %v", clientName, err)
|
net.logger.Printf("failed to store delivery receipts for client %q: %v", clientName, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -658,7 +658,7 @@ func (u *user) run() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dc.forEachNetwork(func(net *network) {
|
dc.forEachNetwork(func(net *network) {
|
||||||
net.storeClientDeliveryReceipts(dc.clientName)
|
net.storeClientDeliveryReceipts(context.TODO(), dc.clientName)
|
||||||
})
|
})
|
||||||
|
|
||||||
u.forEachUpstream(func(uc *upstreamConn) {
|
u.forEachUpstream(func(uc *upstreamConn) {
|
||||||
@ -713,7 +713,7 @@ func (u *user) run() {
|
|||||||
n.stop()
|
n.stop()
|
||||||
|
|
||||||
n.delivered.ForEachClient(func(clientName string) {
|
n.delivered.ForEachClient(func(clientName string) {
|
||||||
n.storeClientDeliveryReceipts(clientName)
|
n.storeClientDeliveryReceipts(context.TODO(), clientName)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user