mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-14 01:14:29 +01:00
Generate AS registrations with bot sync workaround
Looks like synapse isn't going to be fixed soon (matrix-org/synapse#5758), so this changes all registrations to be generated using the workaround: the sender_localpart is set to a random string and the actual AS bot is added as another namespace.
This commit is contained in:
parent
7c799f1faa
commit
47a1d7f6cb
1 changed files with 6 additions and 0 deletions
|
@ -33,6 +33,12 @@ func (config *Config) NewRegistration() (*appservice.Registration, error) {
|
|||
|
||||
config.AppService.ASToken = registration.AppToken
|
||||
config.AppService.HSToken = registration.ServerToken
|
||||
|
||||
// Workaround for https://github.com/matrix-org/synapse/pull/5758
|
||||
registration.SenderLocalpart = appservice.RandomString(32)
|
||||
botRegex := regexp.MustCompile(fmt.Sprintf("^@%s:%s$", config.AppService.Bot.Username, config.Homeserver.Domain))
|
||||
registration.Namespaces.RegisterUserIDs(botRegex, true)
|
||||
|
||||
return registration, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue