Sfoglia il codice sorgente

Use constants for homeserver software checks

Tulir Asokan 2 anni fa
parent
commit
e0294b64dd
2 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 1 1
      config/config.go
  2. 1 1
      user.go

+ 1 - 1
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

+ 1 - 1
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,