Use constants for homeserver software checks

This commit is contained in:
Tulir Asokan 2022-09-12 22:14:50 +03:00
parent 2e934abe43
commit e0294b64dd
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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,