Clear a whole bunch of lint issues

This commit is contained in:
Neil Alexander 2020-09-04 16:17:02 +01:00
parent ff65f0ec7b
commit 2ccd4fa069
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
7 changed files with 20 additions and 26 deletions

View file

@ -204,7 +204,7 @@ type OutputRedactedEvent struct {
// An OutputNewPeek is written whenever a user starts peeking into a room
// using a given device.
type OutputNewPeek struct {
RoomID string
UserID string
RoomID string
UserID string
DeviceID string
}

View file

@ -20,8 +20,8 @@ import (
"fmt"
"strings"
"github.com/matrix-org/dendrite/internal/config"
fsAPI "github.com/matrix-org/dendrite/federationsender/api"
"github.com/matrix-org/dendrite/internal/config"
"github.com/matrix-org/dendrite/roomserver/api"
"github.com/matrix-org/dendrite/roomserver/internal/input"
"github.com/matrix-org/dendrite/roomserver/storage"
@ -39,7 +39,6 @@ type Peeker struct {
Inputer *input.Inputer
}
// PerformPeek handles peeking into matrix rooms, including over federation by talking to the federationsender.
func (r *Peeker) PerformPeek(
ctx context.Context,
@ -164,7 +163,7 @@ func (r *Peeker) performPeekRoomByID(
// XXX: we should probably factor out history_visibility checks into a common utility method somewhere
// which handles the default value etc.
var worldReadable = false
ev, err := r.DB.GetStateEvent(ctx, roomID, "m.room.history_visibility", "")
ev, _ := r.DB.GetStateEvent(ctx, roomID, "m.room.history_visibility", "")
if ev != nil {
content := map[string]string{}
if err = json.Unmarshal(ev.Content(), &content); err != nil {
@ -179,7 +178,7 @@ func (r *Peeker) performPeekRoomByID(
if !worldReadable {
return "", &api.PerformError{
Code: api.PerformErrorNotAllowed,
Msg: "Room is not world-readable",
Msg: "Room is not world-readable",
}
}
@ -189,8 +188,8 @@ func (r *Peeker) performPeekRoomByID(
{
Type: api.OutputTypeNewPeek,
NewPeek: &api.OutputNewPeek{
RoomID: roomID,
UserID: req.UserID,
RoomID: roomID,
UserID: req.UserID,
DeviceID: req.DeviceID,
},
},
@ -203,5 +202,5 @@ func (r *Peeker) performPeekRoomByID(
// it will have been overwritten with a room ID by performPeekRoomByAlias.
// We should now include this in the response so that the CS API can
// return the right room ID.
return roomID, nil;
return roomID, nil
}