From 98f0043bfaf1593b0cd5bd864bcbaa1b73b4f0c1 Mon Sep 17 00:00:00 2001 From: Pablo Ovelleiro Corral Date: Mon, 22 Apr 2019 20:27:53 +0200 Subject: [PATCH] allow for other matrix hosts --- giteabot.go | 2 +- main.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/giteabot.go b/giteabot.go index 9ce4c7c..d9b1d98 100644 --- a/giteabot.go +++ b/giteabot.go @@ -18,7 +18,7 @@ type GiteaBot struct { } //NewGiteaBot creates a new bot form user credentials -func NewGiteaBot(user, pass string, DBPath string) *GiteaBot { +func NewGiteaBot(user, pass, host, string, DBPath string) *GiteaBot { bot, err := matrixbot.NewMatrixBot(user, pass, "gitea") diff --git a/main.go b/main.go index 1c7520b..4f3bf89 100644 --- a/main.go +++ b/main.go @@ -47,10 +47,11 @@ func init() { matrixUser := cfg.Section("matrix").Key("matrix_user").String() matrixPass := cfg.Section("matrix").Key("matrix_pass").String() + matrixHost := cfg.Section("matrix").Key("matrix_pass").String() dbPath := cfg.Section("bot").Key("db_path").String() //Set up the bot - mygiteabot = NewGiteaBot(matrixUser, matrixPass, dbPath) + mygiteabot = NewGiteaBot(matrixUser, matrixPass, matrixHost, dbPath) if err != nil { log.Fatal(err)