gmessages/libgm/handler_useralert.go
2023-06-30 14:05:33 +03:00

23 lines
572 B
Go

package libgm
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
}
}