diff options
| author | Kyren223 <Kyren223@proton.me> | 2025-02-02 19:23:50 +0200 |
|---|---|---|
| committer | Kyren223 <Kyren223@proton.me> | 2025-02-02 19:23:50 +0200 |
| commit | c77ac77e78268bc2f4265a872b213d4300b3eb66 (patch) | |
| tree | 1c2f1be6f2c7a724486d24b0c83014032e761f49 /internal/packet | |
| parent | a1c20cbfc5a90642e486132d4673646342df13fd (diff) | |
Added support for offline notifications where the server calculates them
and sends the info to the client when it connects
Diffstat (limited to 'internal/packet')
| -rw-r--r-- | internal/packet/packet.go | 8 | ||||
| -rw-r--r-- | internal/packet/types.go | 18 |
2 files changed, 26 insertions, 0 deletions
diff --git a/internal/packet/packet.go b/internal/packet/packet.go index d107fb7..72ff4b9 100644 --- a/internal/packet/packet.go +++ b/internal/packet/packet.go @@ -80,6 +80,9 @@ const ( PacketTrustUser PacketTrustInfo + PacketGetNotifications + PacketNotificationsInfo + PacketMax ) @@ -245,6 +248,11 @@ func (p Packet) DecodedPayload() (Payload, error) { case PacketTrustInfo: payload = &TrustInfo{} + case PacketGetNotifications: + payload = &GetNotifications{} + case PacketNotificationsInfo: + payload = &NotificationsInfo{} + default: assert.Never("unexpected packet.PacketType", "type", p.Type()) } diff --git a/internal/packet/types.go b/internal/packet/types.go index 6d0b1dd..27fd028 100644 --- a/internal/packet/types.go +++ b/internal/packet/types.go @@ -233,3 +233,21 @@ type GetBannedMembers struct { func (m *GetBannedMembers) Type() PacketType { return PacketGetBannedMembers } + +type GetNotifications struct { + Source []snowflake.ID + LastReadId []snowflake.ID +} + +func (m *GetNotifications) Type() PacketType { + return PacketGetNotifications +} + +type NotificationsInfo struct { + Source []snowflake.ID + Pings []*int64 +} + +func (m *NotificationsInfo) Type() PacketType { + return PacketNotificationsInfo +} |
