diff options
author | kegsay <kegan@matrix.org> | 2023-05-04 11:17:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-04 11:17:42 +0100 |
commit | 2b34f88fde6b3aa633c8f23ff424a5db4951efd3 (patch) | |
tree | bbf58904af8499f756fc1965f63a5ca359418c0a /clientapi/routing/membership.go | |
parent | d5c11a3c86bf1eeb7ae6b1c243ec889432fcd881 (diff) |
Use ProtoEvent where needed instead of EventBuilder (#3075)
They are fundamentally different concepts, so should be represented as
such. Proto events are exchanged in /make_xxx calls over federation, and
made as "fledgling" events in /createRoom and general event sending.
*Building* events is a reasonably complex VERSION SPECIFIC process which
needs amongst other things, auth event providers, prev events, signing
keys, etc.
Requires https://github.com/matrix-org/gomatrixserverlib/pull/379
Diffstat (limited to 'clientapi/routing/membership.go')
-rw-r--r-- | clientapi/routing/membership.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clientapi/routing/membership.go b/clientapi/routing/membership.go index a4aa963a..d696f2b1 100644 --- a/clientapi/routing/membership.go +++ b/clientapi/routing/membership.go @@ -313,7 +313,7 @@ func buildMembershipEvent( return nil, err } - builder := gomatrixserverlib.EventBuilder{ + proto := gomatrixserverlib.ProtoEvent{ Sender: device.UserID, RoomID: roomID, Type: "m.room.member", @@ -328,7 +328,7 @@ func buildMembershipEvent( IsDirect: isDirect, } - if err = builder.SetContent(content); err != nil { + if err = proto.SetContent(content); err != nil { return nil, err } @@ -337,7 +337,7 @@ func buildMembershipEvent( return nil, err } - return eventutil.QueryAndBuildEvent(ctx, &builder, cfg.Matrix, identity, evTime, rsAPI, nil) + return eventutil.QueryAndBuildEvent(ctx, &proto, cfg.Matrix, identity, evTime, rsAPI, nil) } // loadProfile lookups the profile of a given user from the database and returns |