aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go17
1 files changed, 4 insertions, 13 deletions
diff --git a/main.go b/main.go
index 0864b66..d74e3d8 100644
--- a/main.go
+++ b/main.go
@@ -15,7 +15,6 @@ import (
log "github.com/sirupsen/logrus"
"gopkg.in/yaml.v2"
- "git.deuxfleurs.fr/Deuxfleurs/easybridge/appservice"
"git.deuxfleurs.fr/Deuxfleurs/easybridge/connector"
"git.deuxfleurs.fr/Deuxfleurs/easybridge/connector/irc"
"git.deuxfleurs.fr/Deuxfleurs/easybridge/connector/mattermost"
@@ -166,15 +165,7 @@ func main() {
reg_file := readRegistration(config.Registration)
registration = &reg_file
- as_config := &appservice.Config{
- HttpBindAddr: config.HttpBindAddr,
- Server: config.Server,
- DbType: config.DbType,
- DbPath: config.DbPath,
- MatrixDomain: config.MatrixDomain,
- }
-
- errch, err := appservice.Start(registration, as_config)
+ errch, err := StartAppService()
if err != nil {
log.Fatal(err)
}
@@ -192,7 +183,7 @@ func main() {
default:
log.Fatalf("Invalid protocol %s", params.Protocol)
}
- account := &appservice.Account{
+ account := &Account{
MatrixUser: fmt.Sprintf("@%s:%s", user, config.MatrixDomain),
AccountName: name,
Protocol: params.Protocol,
@@ -200,7 +191,7 @@ func main() {
JoinedRooms: map[connector.RoomID]bool{},
}
conn.SetHandler(account)
- appservice.AddAccount(account)
+ AddAccount(account)
go connectAndJoin(account, params)
}
}
@@ -211,7 +202,7 @@ func main() {
}
}
-func connectAndJoin(account *appservice.Account, params ConfigAccount) {
+func connectAndJoin(account *Account, params ConfigAccount) {
log.Printf("Connecting to %s", params.Protocol)
err := account.Conn.Configure(params.Config)
if err != nil {