diff options
Diffstat (limited to 'account.go')
-rw-r--r-- | account.go | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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) } |