From 226621f523c2e7ec6ca50c8dada64bb520be88b0 Mon Sep 17 00:00:00 2001 From: Chad Kouse Date: Thu, 31 Jul 2025 12:48:43 -0400 Subject: [PATCH] Allow double puppeting with isolated appservice registration --- custompuppet.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/custompuppet.go b/custompuppet.go index 8ea2593d..b1aa2176 100644 --- a/custompuppet.go +++ b/custompuppet.go @@ -22,6 +22,7 @@ import ( "encoding/hex" "errors" "fmt" + "strings" "maunium.net/go/mautrix" "maunium.net/go/mautrix/appservice" @@ -86,6 +87,9 @@ func (user *User) loginWithSharedSecret() error { if loginSecret == "appservice" { client.AccessToken = user.bridge.AS.Registration.AppToken req.Type = mautrix.AuthTypeAppservice + } else if strings.HasPrefix(loginSecret, "as_token:") { + client.AccessToken = loginSecret[9:] + req.Type = mautrix.AuthTypeAppservice } else { mac := hmac.New(sha512.New, []byte(loginSecret)) mac.Write([]byte(user.MXID))