From 759bb70b2f448066ae7554b29a93de73f988f56b Mon Sep 17 00:00:00 2001 From: Christopher Poile Date: Wed, 15 Nov 2023 13:06:03 -0500 Subject: [PATCH] MM-55060 - Calls: Add PushTypeCalls for calls-specific push notifications (#25405) * add PushTypeCalls for calls-specific push notifications * remove PushTypeCalls; add PushSubType for backwards compatability * don't capitalize calls subtype --------- Co-authored-by: Mattermost Build --- server/public/model/push_notification.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/public/model/push_notification.go b/server/public/model/push_notification.go index 3151430920..4ee82b73d8 100644 --- a/server/public/model/push_notification.go +++ b/server/public/model/push_notification.go @@ -34,6 +34,13 @@ const ( PushReceived = "Received by device" ) +// PushSubType allows for passing additional message type information +// to mobile clients in a backwards-compatible way +type PushSubType string + +// PushSubTypeCalls is used by the Calls plugin +const PushSubTypeCalls PushSubType = "calls" + type PushNotificationAck struct { Id string `json:"id"` ClientReceivedAt int64 `json:"received_at"` @@ -59,6 +66,7 @@ type PushNotification struct { RootId string `json:"root_id,omitempty"` ChannelName string `json:"channel_name,omitempty"` Type string `json:"type,omitempty"` + SubType PushSubType `json:"sub_type,omitempty"` SenderId string `json:"sender_id,omitempty"` SenderName string `json:"sender_name,omitempty"` OverrideUsername string `json:"override_username,omitempty"`