2023-06-30 11:05:33 +00:00
|
|
|
package libgm
|
2023-06-30 09:54:08 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"go.mau.fi/mautrix-gmessages/libgm/binary"
|
|
|
|
"go.mau.fi/mautrix-gmessages/libgm/events"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (c *Client) handleUserAlertEvent(response *Response, evtData *binary.Event_UserAlertEvent) {
|
|
|
|
switch evtData.UserAlertEvent.AlertType {
|
|
|
|
case 2:
|
|
|
|
browserActive := events.NewBrowserActive(response.Data.RequestId)
|
|
|
|
c.triggerEvent(browserActive)
|
|
|
|
return
|
|
|
|
case 5, 6:
|
|
|
|
batteryEvt := events.NewBattery()
|
|
|
|
c.triggerEvent(batteryEvt)
|
|
|
|
return
|
|
|
|
case 3, 4:
|
|
|
|
dataConnectionEvt := events.NewDataConnection()
|
|
|
|
c.triggerEvent(dataConnectionEvt)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|