gmessages/libgm/handler_useralert.go

24 lines
572 B
Go
Raw Normal View History

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:
2023-06-30 13:26:46 +00:00
browserActive := events.NewBrowserActive(response.Data.RequestID)
2023-06-30 09:54:08 +00:00
c.triggerEvent(browserActive)
return
case 5, 6:
batteryEvt := events.NewBattery()
c.triggerEvent(batteryEvt)
return
case 3, 4:
dataConnectionEvt := events.NewDataConnection()
c.triggerEvent(dataConnectionEvt)
return
}
}