mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-14 17:33:48 +01:00
provisioning/login: set timezone sooner
This commit is contained in:
parent
f1a4cfe7d5
commit
32032161e2
1 changed files with 5 additions and 5 deletions
|
@ -619,6 +619,11 @@ func (prov *ProvisioningAPI) Login(w http.ResponseWriter, r *http.Request) {
|
|||
return nil
|
||||
})
|
||||
|
||||
if userTimezone := r.URL.Query().Get("tz"); userTimezone != "" {
|
||||
user.Timezone = userTimezone
|
||||
user.Update()
|
||||
}
|
||||
|
||||
qrChan, err := user.Login(ctx)
|
||||
if err != nil {
|
||||
user.log.Errorln("Failed to log in from provisioning API:", err)
|
||||
|
@ -652,11 +657,6 @@ func (prov *ProvisioningAPI) Login(w http.ResponseWriter, r *http.Request) {
|
|||
"phone": fmt.Sprintf("+%s", jid.User),
|
||||
"platform": user.Client.Store.Platform,
|
||||
})
|
||||
|
||||
if userTimezone := r.URL.Query().Get("tz"); userTimezone != "" {
|
||||
user.Timezone = userTimezone
|
||||
user.Update()
|
||||
}
|
||||
case whatsmeow.QRChannelTimeout.Event:
|
||||
user.log.Debugln("Login via provisioning API timed out")
|
||||
errCode := "login timed out"
|
||||
|
|
Loading…
Reference in a new issue