diff --git a/.containerignore b/.containerignore new file mode 100644 index 0000000..40c589d --- /dev/null +++ b/.containerignore @@ -0,0 +1,7 @@ +.git +.gitignore +Dockerfile* +README.md +LICENSE +*.yaml +statefile diff --git a/main.go b/main.go index ab2d671..9dc8c34 100644 --- a/main.go +++ b/main.go @@ -54,6 +54,7 @@ func main() { var vtubers []*Vtuber log.Println("Logging into", Homeserver, "as", Username) var client *mautrix.Client + uid := id.NewUserID(strings.ToLower(Username), strings.ToLower(HomeserverDomain)) if Token == "" { client, err = mautrix.NewClient(Homeserver, "", "") if err != nil { @@ -61,7 +62,7 @@ func main() { } } else { log.Println("using token login") - client, err = mautrix.NewClient(Homeserver, id.NewUserID(Username, HomeserverDomain), Token) + client, err = mautrix.NewClient(Homeserver, uid, Token) if err != nil { panic(err) } @@ -75,11 +76,13 @@ func main() { }, } store := mautrix.NewAccountDataStore("simp.batch", client) - _, err = client.CreateFilter(dataFilter) + fID, err := client.CreateFilter(dataFilter) + store.SaveFilterID(uid, fID.FilterID) if err != nil { panic(err) } client.Store = store + if Token == "" { login_res, err := client.Login(&mautrix.ReqLogin{ Type: "m.login.password",