Base64 not hex

This commit is contained in:
Kegan Dougal 2021-07-14 10:16:58 +01:00
parent 5fa9a4f270
commit e6cb984c14

View file

@ -3,7 +3,7 @@ package streams
import ( import (
"context" "context"
"crypto/sha256" "crypto/sha256"
"encoding/hex" "encoding/base64"
"strconv" "strconv"
"time" "time"
@ -64,7 +64,7 @@ func (p *InviteStreamProvider) IncrementalSync(
h := sha256.Sum256(append([]byte(roomID), []byte(strconv.FormatInt(int64(to), 10))...)) 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: "$" + hex.EncodeToString(h[:]), EventID: "$" + base64.RawURLEncoding.EncodeToString(h[:]),
OriginServerTS: gomatrixserverlib.AsTimestamp(time.Now()), OriginServerTS: gomatrixserverlib.AsTimestamp(time.Now()),
RoomID: roomID, RoomID: roomID,
Sender: req.Device.UserID, Sender: req.Device.UserID,