Skip to content
This repository has been archived by the owner on Aug 1, 2020. It is now read-only.

Commit

Permalink
Format and remove unnecessary things
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Sep 1, 2018
1 parent fb75624 commit 4e24d1d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
8 changes: 5 additions & 3 deletions generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,16 @@ func GenerateRegistration(asName, botName string, reserveRooms, reserveUsers boo
boldCyan.Println("Generating appservice config and registration.")
reader := bufio.NewReader(os.Stdin)

registration := CreateRegistration()
config := Create()
registration.RateLimited = false

name, err := readString(reader, "Enter name for appservice", asName)
if err != nil {
fmt.Println("Failed to read user Input:", err)
return
}
registration := CreateRegistration(name)
config := Create()
registration.RateLimited = false
registration.ID = name

registration.SenderLocalpart, err = readString(reader, "Enter bot username", botName)
if err != nil {
Expand Down
5 changes: 2 additions & 3 deletions http.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package appservice

import (
"context"
"encoding/json"
"github.com/gorilla/mux"
"io/ioutil"
"net/http"
"github.com/gorilla/mux"
"context"
"time"
)

Expand Down Expand Up @@ -106,7 +106,6 @@ func (as *AppService) PutTransaction(w http.ResponseWriter, r *http.Request) {
}

for _, event := range eventList.Events {
as.Log.Debugln("Received event", event.ID)
as.UpdateState(event)
as.Events <- event
}
Expand Down
2 changes: 1 addition & 1 deletion protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package appservice

import (
"encoding/json"
"net/http"
"maunium.net/go/gomatrix"
"net/http"
)

// EventList contains a list of events.
Expand Down
2 changes: 1 addition & 1 deletion registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Registration struct {
}

// CreateRegistration creates a Registration with random appservice and homeserver tokens.
func CreateRegistration(name string) *Registration {
func CreateRegistration() *Registration {
return &Registration{
AppToken: RandomString(64),
ServerToken: RandomString(64),
Expand Down

0 comments on commit 4e24d1d

Please sign in to comment.