mirror of
https://github.com/element-hq/dendrite.git
synced 2025-03-14 14:15:35 +00:00
Add support for MSC4163 (#3470)
Ignore typing and receipt events from ACL'd servers as per MSC4163
This commit is contained in:
parent
7f4ba1f6eb
commit
829ecafdc4
1 changed files with 8 additions and 1 deletions
|
@ -216,13 +216,17 @@ func (t *TxnReq) processEDUs(ctx context.Context) {
|
||||||
util.GetLogger(ctx).WithError(err).Debug("Failed to unmarshal typing event")
|
util.GetLogger(ctx).WithError(err).Debug("Failed to unmarshal typing event")
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if _, serverName, err := gomatrixserverlib.SplitID('@', typingPayload.UserID); err != nil {
|
_, serverName, err := gomatrixserverlib.SplitID('@', typingPayload.UserID)
|
||||||
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
} else if serverName == t.ourServerName {
|
} else if serverName == t.ourServerName {
|
||||||
continue
|
continue
|
||||||
} else if serverName != t.Origin {
|
} else if serverName != t.Origin {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if api.IsServerBannedFromRoom(ctx, t.rsAPI, typingPayload.RoomID, serverName) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if err := t.producer.SendTyping(ctx, typingPayload.UserID, typingPayload.RoomID, typingPayload.Typing, 30*1000); err != nil {
|
if err := t.producer.SendTyping(ctx, typingPayload.UserID, typingPayload.RoomID, typingPayload.Typing, 30*1000); err != nil {
|
||||||
util.GetLogger(ctx).WithError(err).Error("Failed to send typing event to JetStream")
|
util.GetLogger(ctx).WithError(err).Error("Failed to send typing event to JetStream")
|
||||||
}
|
}
|
||||||
|
@ -278,6 +282,9 @@ func (t *TxnReq) processEDUs(ctx context.Context) {
|
||||||
util.GetLogger(ctx).Debugf("Dropping receipt event where sender domain (%q) doesn't match origin (%q)", domain, t.Origin)
|
util.GetLogger(ctx).Debugf("Dropping receipt event where sender domain (%q) doesn't match origin (%q)", domain, t.Origin)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if api.IsServerBannedFromRoom(ctx, t.rsAPI, roomID, domain) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if err := t.processReceiptEvent(ctx, userID, roomID, "m.read", mread.Data.TS, mread.EventIDs); err != nil {
|
if err := t.processReceiptEvent(ctx, userID, roomID, "m.read", mread.Data.TS, mread.EventIDs); err != nil {
|
||||||
util.GetLogger(ctx).WithError(err).WithFields(logrus.Fields{
|
util.GetLogger(ctx).WithError(err).WithFields(logrus.Fields{
|
||||||
"sender": t.Origin,
|
"sender": t.Origin,
|
||||||
|
|
Loading…
Add table
Reference in a new issue