mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-01 22:02:46 +00:00
Add misspell and gofmt simplify to the pre-commit hooks (#138)
This commit is contained in:
parent
7cbdab30f4
commit
472155837b
8 changed files with 25 additions and 10 deletions
|
@ -26,7 +26,7 @@ const (
|
|||
// Registration parameters vary depending on the request, and will need to remembered across
|
||||
// sessions. If no parameters are supplied, the server should use the parameters previously
|
||||
// remembered. If ANY parameters are supplied, the server should REPLACE all knowledge of
|
||||
// previous paramters with the ones supplied. This mean you cannot "build up" request params.
|
||||
// previous parameters with the ones supplied. This mean you cannot "build up" request params.
|
||||
type registerRequest struct {
|
||||
// registration parameters.
|
||||
Password string `json:"password"`
|
||||
|
|
|
@ -43,7 +43,7 @@ func localKeys(cfg config.FederationAPI, validUntil time.Time) (*gomatrixserverl
|
|||
publicKey := cfg.PrivateKey.Public().(ed25519.PublicKey)
|
||||
|
||||
keys.VerifyKeys = map[gomatrixserverlib.KeyID]gomatrixserverlib.VerifyKey{
|
||||
cfg.KeyID: gomatrixserverlib.VerifyKey{
|
||||
cfg.KeyID: {
|
||||
gomatrixserverlib.Base64String(publicKey),
|
||||
},
|
||||
}
|
||||
|
|
|
@ -184,7 +184,7 @@ func (t *txnReq) processEventWithMissingState(e gomatrixserverlib.Event) error {
|
|||
// or /state.
|
||||
// Synapse will attempt to do 1 and if that fails or if the gap is
|
||||
// too large then it will attempt 2.
|
||||
// Synapse will use /state_ids if possible since ususally the state
|
||||
// Synapse will use /state_ids if possible since usually the state
|
||||
// is largely unchanged and it is more efficient to fetch a list of
|
||||
// event ids and then use /event to fetch the individual events.
|
||||
// However not all version of synapse support /state_ids so you may
|
||||
|
|
|
@ -104,7 +104,7 @@ func TestImmediateNotification(t *testing.T) {
|
|||
func TestNewEventAndJoinedToRoom(t *testing.T) {
|
||||
n := NewNotifier(streamPositionBefore)
|
||||
n.setUsersJoinedToRooms(map[string][]string{
|
||||
roomID: []string{alice, bob},
|
||||
roomID: {alice, bob},
|
||||
})
|
||||
|
||||
var wg sync.WaitGroup
|
||||
|
@ -132,7 +132,7 @@ func TestNewEventAndJoinedToRoom(t *testing.T) {
|
|||
func TestNewInviteEventForUser(t *testing.T) {
|
||||
n := NewNotifier(streamPositionBefore)
|
||||
n.setUsersJoinedToRooms(map[string][]string{
|
||||
roomID: []string{alice, bob},
|
||||
roomID: {alice, bob},
|
||||
})
|
||||
|
||||
var wg sync.WaitGroup
|
||||
|
@ -160,7 +160,7 @@ func TestNewInviteEventForUser(t *testing.T) {
|
|||
func TestMultipleRequestWakeup(t *testing.T) {
|
||||
n := NewNotifier(streamPositionBefore)
|
||||
n.setUsersJoinedToRooms(map[string][]string{
|
||||
roomID: []string{alice, bob},
|
||||
roomID: {alice, bob},
|
||||
})
|
||||
|
||||
var wg sync.WaitGroup
|
||||
|
@ -198,7 +198,7 @@ func TestNewEventAndWasPreviouslyJoinedToRoom(t *testing.T) {
|
|||
// Make sure alice gets woken up only and not bob as well.
|
||||
n := NewNotifier(streamPositionBefore)
|
||||
n.setUsersJoinedToRooms(map[string][]string{
|
||||
roomID: []string{alice, bob},
|
||||
roomID: {alice, bob},
|
||||
})
|
||||
|
||||
var leaveWG sync.WaitGroup
|
||||
|
|
|
@ -50,7 +50,7 @@ func NewResponse(pos StreamPosition) *Response {
|
|||
// Make sure we send the next_batch as a string. We don't want to confuse clients by sending this
|
||||
// as an integer even though (at the moment) it is.
|
||||
res.NextBatch = pos.String()
|
||||
// Pre-initalise the maps. Synapse will return {} even if there are no rooms under a specific section,
|
||||
// Pre-initialise the maps. Synapse will return {} even if there are no rooms under a specific section,
|
||||
// so let's do the same thing. Bonus: this means we can't get dreaded 'assignment to entry in nil map' errors.
|
||||
res.Rooms.Join = make(map[string]JoinResponse)
|
||||
res.Rooms.Invite = make(map[string]InviteResponse)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue