mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 13:22:46 +00:00
Private read receipts (#2789)
Implement behaviours for `m.read.private` receipts.
This commit is contained in:
parent
3920b9f9b6
commit
0a9aebdf01
6 changed files with 66 additions and 33 deletions
|
@ -81,6 +81,14 @@ func (t *OutputReceiptConsumer) onMessage(ctx context.Context, msgs []*nats.Msg)
|
|||
Type: msg.Header.Get("type"),
|
||||
}
|
||||
|
||||
switch receipt.Type {
|
||||
case "m.read":
|
||||
// These are allowed to be sent over federation
|
||||
case "m.read.private", "m.fully_read":
|
||||
// These must not be sent over federation
|
||||
return true
|
||||
}
|
||||
|
||||
// only send receipt events which originated from us
|
||||
_, receiptServerName, err := gomatrixserverlib.SplitID('@', receipt.UserID)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue