Add support for MSC4163

This commit is contained in:
Till Faelligen 2024-12-20 20:29:16 +01:00
parent add73ec866
commit cef479bd6c
No known key found for this signature in database
GPG key ID: 3DF82D8AB9211D4E

View file

@ -216,13 +216,17 @@ func (t *TxnReq) processEDUs(ctx context.Context) {
util.GetLogger(ctx).WithError(err).Debug("Failed to unmarshal typing event")
continue
}
if _, serverName, err := gomatrixserverlib.SplitID('@', typingPayload.UserID); err != nil {
_, serverName, err := gomatrixserverlib.SplitID('@', typingPayload.UserID)
if err != nil {
continue
} else if serverName == t.ourServerName {
continue
} else if serverName != t.Origin {
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 {
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)
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 {
util.GetLogger(ctx).WithError(err).WithFields(logrus.Fields{
"sender": t.Origin,