mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-16 11:23:11 -06:00
Update common.BuildEvent
This commit is contained in:
parent
85e658ca06
commit
a4401e3fb0
|
|
@ -47,16 +47,17 @@ func BuildEvent(
|
|||
return nil, err
|
||||
}
|
||||
|
||||
fmt.Println("BUILDING EVENT FOR ROOM", builder.RoomID)
|
||||
roomVersion := 2
|
||||
|
||||
vQueryReq := api.QueryRoomVersionForRoomIDRequest{RoomID: builder.RoomID}
|
||||
vQueryRes := api.QueryRoomVersionForRoomIDResponse{}
|
||||
if e := queryAPI.QueryRoomVersionForRoomID(ctx, &vQueryReq, &vQueryRes); e != nil {
|
||||
fmt.Println("Eaux neaux, an error occured:", e)
|
||||
if e := queryAPI.QueryRoomVersionForRoomID(ctx, &vQueryReq, &vQueryRes); e == nil {
|
||||
roomVersion = vQueryRes.RoomVersion
|
||||
}
|
||||
fmt.Println("Building event for", roomVersion)
|
||||
|
||||
fmt.Println("ROOM VERSION IS", roomVersion)
|
||||
// FIXME: Why don't we delegate to the BuildEvent function from
|
||||
// gomatrixserverlib here?
|
||||
// TODO: Room versions affect the below
|
||||
|
||||
eventID := fmt.Sprintf("$%s:%s", util.RandomString(16), cfg.Matrix.ServerName)
|
||||
event, err := builder.Build(eventID, evTime, cfg.Matrix.ServerName, cfg.Matrix.KeyID, cfg.Matrix.PrivateKey)
|
||||
|
|
|
|||
Loading…
Reference in a new issue