mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-25 07:43:10 -06:00
Use key/value directly
This commit is contained in:
parent
80f346d70a
commit
3a5c8256df
|
|
@ -332,7 +332,7 @@ func (t *txnReq) processEDUs(ctx context.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for roomID, receipt := range payload {
|
for roomID, receipt := range payload {
|
||||||
for userID := range receipt.User {
|
for userID, mread := range receipt.User {
|
||||||
_, domain, err := gomatrixserverlib.SplitID('@', userID)
|
_, domain, err := gomatrixserverlib.SplitID('@', userID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
util.GetLogger(ctx).WithError(err).Error("Failed to split domain from receipt event sender")
|
util.GetLogger(ctx).WithError(err).Error("Failed to split domain from receipt event sender")
|
||||||
|
|
@ -342,14 +342,12 @@ func (t *txnReq) processEDUs(ctx context.Context) {
|
||||||
util.GetLogger(ctx).Warnf("Dropping receipt event where sender domain (%q) doesn't match origin (%q)", domain, t.Origin)
|
util.GetLogger(ctx).Warnf("Dropping receipt event where sender domain (%q) doesn't match origin (%q)", domain, t.Origin)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
ts := receipt.User[userID].Data.TS
|
if err := t.processReceiptEvent(ctx, userID, roomID, "m.read", mread.Data.TS, mread.EventIDs); err != nil {
|
||||||
events := receipt.User[userID].EventIDs
|
|
||||||
if err := t.processReceiptEvent(ctx, userID, roomID, "m.read", ts, events); err != nil {
|
|
||||||
util.GetLogger(ctx).WithError(err).WithFields(logrus.Fields{
|
util.GetLogger(ctx).WithError(err).WithFields(logrus.Fields{
|
||||||
"sender": t.Origin,
|
"sender": t.Origin,
|
||||||
"user_id": userID,
|
"user_id": userID,
|
||||||
"room_id": roomID,
|
"room_id": roomID,
|
||||||
"events": receipt.User[userID].EventIDs,
|
"events": mread.EventIDs,
|
||||||
}).Error("Failed to send receipt event to edu server")
|
}).Error("Failed to send receipt event to edu server")
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue