mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 13:22:46 +00:00
Fix linter issues (#2624)
* Try that again * All hail the mighty linter? * And once again * goimport all the things
This commit is contained in:
parent
de78eab63a
commit
1b7f84250a
20 changed files with 136 additions and 105 deletions
|
@ -6,12 +6,13 @@ import (
|
|||
"sort"
|
||||
"testing"
|
||||
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
"github.com/matrix-org/util"
|
||||
|
||||
keyapi "github.com/matrix-org/dendrite/keyserver/api"
|
||||
"github.com/matrix-org/dendrite/roomserver/api"
|
||||
"github.com/matrix-org/dendrite/syncapi/types"
|
||||
userapi "github.com/matrix-org/dendrite/userapi/api"
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
"github.com/matrix-org/util"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -364,13 +365,14 @@ func TestKeyChangeCatchupChangeAndLeft(t *testing.T) {
|
|||
|
||||
// tests that joining/leaving the SAME room puts users in `left` if the final state is leave.
|
||||
// NB: Consider the case:
|
||||
// - Alice and Bob are in a room.
|
||||
// - Alice goes offline, Charlie joins, sends encrypted messages then leaves the room.
|
||||
// - Alice comes back online. Technically nothing has changed in the set of users between those two points in time,
|
||||
// it's still just (Alice,Bob) but then we won't be tracking Charlie -- is this okay though? It's device keys
|
||||
// which are only relevant when actively sending events I think? And if Alice does need the keys she knows
|
||||
// charlie's (user_id, device_id) so can just hit /keys/query - no need to keep updated about it because she
|
||||
// doesn't share any rooms with him.
|
||||
// - Alice and Bob are in a room.
|
||||
// - Alice goes offline, Charlie joins, sends encrypted messages then leaves the room.
|
||||
// - Alice comes back online. Technically nothing has changed in the set of users between those two points in time,
|
||||
// it's still just (Alice,Bob) but then we won't be tracking Charlie -- is this okay though? It's device keys
|
||||
// which are only relevant when actively sending events I think? And if Alice does need the keys she knows
|
||||
// charlie's (user_id, device_id) so can just hit /keys/query - no need to keep updated about it because she
|
||||
// doesn't share any rooms with him.
|
||||
//
|
||||
// Ergo, we put them in `left` as it is simpler.
|
||||
func TestKeyChangeCatchupChangeAndLeftSameRoom(t *testing.T) {
|
||||
newShareUser := "@berta:localhost"
|
||||
|
|
|
@ -19,13 +19,14 @@ import (
|
|||
"io/ioutil"
|
||||
"net/http"
|
||||
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
"github.com/matrix-org/util"
|
||||
"github.com/tidwall/gjson"
|
||||
|
||||
"github.com/matrix-org/dendrite/clientapi/jsonerror"
|
||||
"github.com/matrix-org/dendrite/syncapi/storage"
|
||||
"github.com/matrix-org/dendrite/syncapi/sync"
|
||||
"github.com/matrix-org/dendrite/userapi/api"
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
"github.com/matrix-org/util"
|
||||
"github.com/tidwall/gjson"
|
||||
)
|
||||
|
||||
// GetFilter implements GET /_matrix/client/r0/user/{userId}/filter/{filterId}
|
||||
|
@ -65,7 +66,9 @@ type filterResponse struct {
|
|||
FilterID string `json:"filter_id"`
|
||||
}
|
||||
|
||||
//PutFilter implements POST /_matrix/client/r0/user/{userId}/filter
|
||||
// PutFilter implements
|
||||
//
|
||||
// POST /_matrix/client/r0/user/{userId}/filter
|
||||
func PutFilter(
|
||||
req *http.Request, device *api.Device, syncDB storage.Database, userID string,
|
||||
) util.JSONResponse {
|
||||
|
|
|
@ -18,10 +18,11 @@ import (
|
|||
"context"
|
||||
"database/sql"
|
||||
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
|
||||
"github.com/matrix-org/dendrite/internal/eventutil"
|
||||
"github.com/matrix-org/dendrite/roomserver/api"
|
||||
"github.com/matrix-org/dendrite/syncapi/types"
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
)
|
||||
|
||||
type AccountData interface {
|
||||
|
@ -122,12 +123,14 @@ type CurrentRoomState interface {
|
|||
//
|
||||
// We persist the previous event IDs as well, one per row, so when we do fetch even
|
||||
// earlier events we can simply delete rows which referenced it. Consider the graph:
|
||||
// A
|
||||
// | Event C has 1 prev_event ID: A.
|
||||
// B C
|
||||
// |___| Event D has 2 prev_event IDs: B and C.
|
||||
// |
|
||||
// D
|
||||
//
|
||||
// A
|
||||
// | Event C has 1 prev_event ID: A.
|
||||
// B C
|
||||
// |___| Event D has 2 prev_event IDs: B and C.
|
||||
// |
|
||||
// D
|
||||
//
|
||||
// The earliest known event we have is D, so this table has 2 rows.
|
||||
// A backfill request gives us C but not B. We delete rows where prev_event=C. This
|
||||
// still means that D is a backwards extremity as we do not have event B. However, event
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue