aboutsummaryrefslogtreecommitdiff
path: root/account.go
diff options
context:
space:
mode:
Diffstat (limited to 'account.go')
-rw-r--r--account.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/account.go b/account.go
index c7f30f0..c975c6e 100644
--- a/account.go
+++ b/account.go
@@ -9,6 +9,11 @@ import (
log "github.com/sirupsen/logrus"
. "git.deuxfleurs.fr/Deuxfleurs/easybridge/connector"
+
+ // Necessary for them to register their protocols
+ _ "git.deuxfleurs.fr/Deuxfleurs/easybridge/connector/irc"
+ _ "git.deuxfleurs.fr/Deuxfleurs/easybridge/connector/mattermost"
+ _ "git.deuxfleurs.fr/Deuxfleurs/easybridge/connector/xmpp"
)
type Account struct {
@@ -45,7 +50,11 @@ func SetAccount(mxid string, name string, protocol string, config map[string]str
go prev_acct.connect()
}
} else {
- conn := createConnector(protocol)
+ proto, ok := Protocols[protocol]
+ if !ok {
+ return fmt.Errorf("Invalid protocol: %s", protocol)
+ }
+ conn := proto.NewConnector()
if conn == nil {
return fmt.Errorf("Could not create connector for protocol %s", protocol)
}