From bb72e3c114a88728ecc2371d675d897bf185f224 Mon Sep 17 00:00:00 2001 From: Devon Hudson Date: Tue, 30 May 2023 21:15:08 -0600 Subject: [PATCH] Fix linter errors --- clientapi/routing/createroom.go | 1 - clientapi/routing/membership.go | 6 +++++- roomserver/internal/perform/perform_create_room.go | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/clientapi/routing/createroom.go b/clientapi/routing/createroom.go index 5e5a0002c..9d14b46f6 100644 --- a/clientapi/routing/createroom.go +++ b/clientapi/routing/createroom.go @@ -133,7 +133,6 @@ func CreateRoom( } // createRoom implements /createRoom -// nolint: gocyclo func createRoom( ctx context.Context, // TODO: remove dependency on createRoomRequest diff --git a/clientapi/routing/membership.go b/clientapi/routing/membership.go index 536f041a2..0fe0a4ade 100644 --- a/clientapi/routing/membership.go +++ b/clientapi/routing/membership.go @@ -337,7 +337,11 @@ func buildMembershipEventDirect( return nil, err } - identity := &fclient.SigningIdentity{senderDomain, keyID, privateKey} + identity := &fclient.SigningIdentity{ + ServerName: senderDomain, + KeyID: keyID, + PrivateKey: privateKey, + } return eventutil.QueryAndBuildEvent(ctx, &proto, identity, evTime, rsAPI, nil) } diff --git a/roomserver/internal/perform/perform_create_room.go b/roomserver/internal/perform/perform_create_room.go index 19fd7dae4..30b47d80e 100644 --- a/roomserver/internal/perform/perform_create_room.go +++ b/roomserver/internal/perform/perform_create_room.go @@ -42,6 +42,8 @@ type Creator struct { RSAPI api.RoomserverInternalAPI } +// PerformCreateRoom handles all the steps necessary to create a new room. +// nolint: gocyclo func (c *Creator) PerformCreateRoom(ctx context.Context, userID spec.UserID, roomID spec.RoomID, createRequest *api.PerformCreateRoomRequest) (string, *util.JSONResponse) { createContent := map[string]interface{}{} if len(createRequest.CreationContent) > 0 { @@ -419,7 +421,7 @@ func (c *Creator) PerformCreateRoom(ctx context.Context, userID spec.UserID, roo IsDirect: createRequest.IsDirect, } - if err := proto.SetContent(content); err != nil { + if err = proto.SetContent(content); err != nil { return "", &util.JSONResponse{ Code: http.StatusInternalServerError, JSON: spec.InternalServerError{},