mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-14 17:33:48 +01:00
Include main device platform in ping and login APIs
This commit is contained in:
parent
625e110aab
commit
6f5fee5d37
1 changed files with 7 additions and 3 deletions
|
@ -434,6 +434,9 @@ func (prov *ProvisioningAPI) Ping(w http.ResponseWriter, r *http.Request) {
|
||||||
wa["jid"] = user.JID.String()
|
wa["jid"] = user.JID.String()
|
||||||
wa["phone"] = "+" + user.JID.User
|
wa["phone"] = "+" + user.JID.User
|
||||||
wa["device"] = user.JID.Device
|
wa["device"] = user.JID.Device
|
||||||
|
if user.Session != nil {
|
||||||
|
wa["platform"] = user.Session.Platform
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if user.Client != nil {
|
if user.Client != nil {
|
||||||
wa["conn"] = map[string]interface{}{
|
wa["conn"] = map[string]interface{}{
|
||||||
|
@ -569,6 +572,7 @@ func (prov *ProvisioningAPI) Login(w http.ResponseWriter, r *http.Request) {
|
||||||
"success": true,
|
"success": true,
|
||||||
"jid": jid,
|
"jid": jid,
|
||||||
"phone": fmt.Sprintf("+%s", jid.User),
|
"phone": fmt.Sprintf("+%s", jid.User),
|
||||||
|
"platform": user.Client.Store.Platform,
|
||||||
})
|
})
|
||||||
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")
|
||||||
|
|
Loading…
Reference in a new issue