Save access token when enabling double puppeting manually. Fixes #5
This commit is contained in:
parent
b958401b73
commit
bef980092f
1 changed files with 9 additions and 1 deletions
|
@ -42,7 +42,15 @@ func (user *User) SwitchCustomMXID(accessToken string, mxid id.UserID) error {
|
||||||
}
|
}
|
||||||
user.DoublePuppetIntent = nil
|
user.DoublePuppetIntent = nil
|
||||||
user.AccessToken = accessToken
|
user.AccessToken = accessToken
|
||||||
return user.startCustomMXID(false)
|
err := user.startCustomMXID(false)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
err = user.Update(context.TODO())
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("failed to save access token to database: %w", err)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (user *User) CustomIntent() *appservice.IntentAPI {
|
func (user *User) CustomIntent() *appservice.IntentAPI {
|
||||||
|
|
Loading…
Reference in a new issue