From e0294b64dd6ac5b7b6e420dceee2373a4d382ed9 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 12 Sep 2022 22:14:50 +0300 Subject: [PATCH] Use constants for homeserver software checks --- config/config.go | 2 +- user.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/config.go b/config/config.go index 0f63bca..6398bd3 100644 --- a/config/config.go +++ b/config/config.go @@ -51,7 +51,7 @@ func (config *Config) CanDoublePuppetBackfill(userID id.UserID) bool { } _, homeserver, _ := userID.Parse() // Batch sending can only use local users, so don't allow double puppets on other servers. - if homeserver != config.Homeserver.Domain && config.Homeserver.Software != "hungry" { + if homeserver != config.Homeserver.Domain && config.Homeserver.Software != bridgeconfig.SoftwareHungry { return false } return true diff --git a/user.go b/user.go index 14d521b..27a8d44 100644 --- a/user.go +++ b/user.go @@ -1081,7 +1081,7 @@ func (user *User) UpdateDirectChats(chats map[id.UserID][]id.RoomID) { } user.log.Debugln("Updating m.direct list on homeserver") var err error - if user.bridge.Config.Homeserver.Software == "asmux" { + if user.bridge.Config.Homeserver.Software == bridgeconfig.SoftwareAsmux { urlPath := intent.BuildClientURL("unstable", "com.beeper.asmux", "dms") _, err = intent.MakeFullRequest(mautrix.FullRequest{ Method: method,