mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-28 17:23:09 -06:00
hash the event ID
This commit is contained in:
parent
aa06e37cad
commit
5fa9a4f270
|
|
@ -2,6 +2,8 @@ package streams
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"crypto/sha256"
|
||||||
|
"encoding/hex"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -59,9 +61,10 @@ func (p *InviteStreamProvider) IncrementalSync(
|
||||||
for roomID := range retiredInvites {
|
for roomID := range retiredInvites {
|
||||||
if _, ok := req.Response.Rooms.Join[roomID]; !ok {
|
if _, ok := req.Response.Rooms.Join[roomID]; !ok {
|
||||||
lr := types.NewLeaveResponse()
|
lr := types.NewLeaveResponse()
|
||||||
|
h := sha256.Sum256(append([]byte(roomID), []byte(strconv.FormatInt(int64(to), 10))...))
|
||||||
lr.Timeline.Events = append(lr.Timeline.Events, gomatrixserverlib.ClientEvent{
|
lr.Timeline.Events = append(lr.Timeline.Events, gomatrixserverlib.ClientEvent{
|
||||||
// fake event ID which muxes in the to position
|
// fake event ID which muxes in the to position
|
||||||
EventID: "$stub-retired-invite-" + roomID + "-" + strconv.FormatInt(int64(to), 10),
|
EventID: "$" + hex.EncodeToString(h[:]),
|
||||||
OriginServerTS: gomatrixserverlib.AsTimestamp(time.Now()),
|
OriginServerTS: gomatrixserverlib.AsTimestamp(time.Now()),
|
||||||
RoomID: roomID,
|
RoomID: roomID,
|
||||||
Sender: req.Device.UserID,
|
Sender: req.Device.UserID,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue