Added device analytics packet

This commit is contained in:
2025-07-11 16:07:02 +03:00
parent 62f17157d8
commit 86c3f3f730
2 changed files with 19 additions and 0 deletions

View File

@@ -98,6 +98,8 @@ const (
PacketBlockUser
PacketBlockInfo
PacketDeviceAnalytics
PacketMax
)
@@ -148,6 +150,8 @@ var packetNames = map[PacketType]string{
PacketGetUsers: "PacketGetUsers",
PacketUsersInfo: "PacketUsersInfo",
PacketDeviceAnalytics: "PacketDeviceAnalytics",
}
func init() {
@@ -359,6 +363,9 @@ func (p Packet) DecodedPayload() (Payload, error) {
case PacketUsersInfo:
payload = &UsersInfo{}
case PacketDeviceAnalytics:
payload = &DeviceAnalytics{}
default:
assert.Assert(!p.Type().IsSupported(), "supported PackeType wasn't handled", "type", p.Type())
return nil, fmt.Errorf("unsupported PackeType: %v", p.Type().String())

View File

@@ -329,3 +329,15 @@ type Authenticate struct {
func (m *Authenticate) Type() PacketType {
return PacketAuthenticate
}
type DeviceAnalytics struct {
DeviceID string
OS string
Arch string
Term string
Colorterm string
}
func (m *DeviceAnalytics) Type() PacketType {
return PacketDeviceAnalytics
}