mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
Add device ID to appservice OTK count map
This commit is contained in:
parent
b6fcbbf6b9
commit
d2fcc50f2d
2 changed files with 21 additions and 15 deletions
|
|
@ -161,13 +161,16 @@ func (as *AppService) handleTransaction(id string, txn *Transaction) {
|
|||
as.txnIDC.MarkProcessed(id)
|
||||
}
|
||||
|
||||
func (as *AppService) handleOTKCounts(otks map[id.UserID]mautrix.OTKCount) {
|
||||
for userID, otkCounts := range otks {
|
||||
otkCounts.UserID = userID
|
||||
select {
|
||||
case as.OTKCounts <- &otkCounts:
|
||||
default:
|
||||
as.Log.Warnfln("Dropped OTK count update for %s because channel is full", userID)
|
||||
func (as *AppService) handleOTKCounts(otks OTKCountMap) {
|
||||
for userID, devices := range otks {
|
||||
for deviceID, otkCounts := range devices {
|
||||
otkCounts.UserID = userID
|
||||
otkCounts.DeviceID = deviceID
|
||||
select {
|
||||
case as.OTKCounts <- &otkCounts:
|
||||
default:
|
||||
as.Log.Warnfln("Dropped OTK count update for %s because channel is full", userID)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue