forked from MirrorHub/mautrix-whatsapp
Merge pull request #501 from mautrix/sumner/bri-3528
provisioning/login: set timezone sooner
This commit is contained in:
commit
9a10240293
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
|
return nil
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if userTimezone := r.URL.Query().Get("tz"); userTimezone != "" {
|
||||||
|
user.Timezone = userTimezone
|
||||||
|
user.Update()
|
||||||
|
}
|
||||||
|
|
||||||
qrChan, err := user.Login(ctx)
|
qrChan, err := user.Login(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
user.log.Errorln("Failed to log in from provisioning API:", err)
|
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),
|
"phone": fmt.Sprintf("+%s", jid.User),
|
||||||
"platform": user.Client.Store.Platform,
|
"platform": user.Client.Store.Platform,
|
||||||
})
|
})
|
||||||
|
|
||||||
if userTimezone := r.URL.Query().Get("tz"); userTimezone != "" {
|
|
||||||
user.Timezone = userTimezone
|
|
||||||
user.Update()
|
|
||||||
}
|
|
||||||
case whatsmeow.QRChannelTimeout.Event:
|
case whatsmeow.QRChannelTimeout.Event:
|
||||||
user.log.Debugln("Login via provisioning API timed out")
|
user.log.Debugln("Login via provisioning API timed out")
|
||||||
errCode := "login timed out"
|
errCode := "login timed out"
|
||||||
|
|
Loading…
Reference in a new issue