@@ -21,16 +21,16 @@ type NotificationBody interface {
2121}
2222
2323type Notification struct {
24- ID common.Hash
25- Platform float32
26- Body NotificationBody
27- BodyType NotificationType
28- Title string
29- Message string
24+ ID common.Hash
25+ Platform float32
26+ Body NotificationBody
27+ BodyType NotificationType
28+ Title string
29+ Message string
3030 // DisplayTitle and DisplayMessage are privacy-filtered for lock screen/OS display.
3131 // When set, clients should use these for OS notifications; Title/Message remain full for in-app.
32- DisplayTitle string
33- DisplayMessage string
32+ DisplayTitle string
33+ DisplayMessage string
3434 Category PushCategory
3535 Deeplink string
3636 Image string
@@ -45,7 +45,9 @@ type Notification struct {
4545 CommunityIcon string
4646 // ChatIcon is the chat/group avatar (data URI) for group chat notifications.
4747 ChatIcon string
48- Deleted bool
48+ Deleted bool
49+ // IsFromMe indicates the message was sent by the current user (outgoing).
50+ IsFromMe bool
4951}
5052
5153type NotificationAuthor struct {
@@ -56,27 +58,28 @@ type NotificationAuthor struct {
5658
5759// notificationAlias is an interim struct used for json un/marshalling
5860type notificationAlias struct {
59- ID common.Hash `json:"id"`
60- Platform float32 `json:"platform,omitempty"`
61- Body json.RawMessage `json:"body"`
62- BodyType NotificationType `json:"bodyType"`
63- Title string `json:"title,omitempty"`
64- Message string `json:"message,omitempty"`
65- DisplayTitle string `json:"displayTitle,omitempty"`
66- DisplayMessage string `json:"displayMessage,omitempty"`
67- Category PushCategory `json:"category,omitempty"`
68- Deeplink string `json:"deepLink,omitempty"`
69- Image string `json:"imageUrl,omitempty"`
70- IsScheduled bool `json:"isScheduled,omitempty"`
71- ScheduledTime string `json:"scheduleTime,omitempty"`
72- IsConversation bool `json:"isConversation,omitempty"`
73- IsGroupConversation bool `json:"isGroupConversation,omitempty"`
74- ConversationID string `json:"conversationId,omitempty"`
75- Timestamp uint64 `json:"timestamp,omitempty"`
76- Author NotificationAuthor `json:"notificationAuthor,omitempty"`
77- CommunityIcon string `json:"communityIcon,omitempty"`
78- ChatIcon string `json:"chatIcon,omitempty"`
79- Deleted bool `json:"deleted,omitempty"`
61+ ID common.Hash `json:"id"`
62+ Platform float32 `json:"platform,omitempty"`
63+ Body json.RawMessage `json:"body"`
64+ BodyType NotificationType `json:"bodyType"`
65+ Title string `json:"title,omitempty"`
66+ Message string `json:"message,omitempty"`
67+ DisplayTitle string `json:"displayTitle,omitempty"`
68+ DisplayMessage string `json:"displayMessage,omitempty"`
69+ Category PushCategory `json:"category,omitempty"`
70+ Deeplink string `json:"deepLink,omitempty"`
71+ Image string `json:"imageUrl,omitempty"`
72+ IsScheduled bool `json:"isScheduled,omitempty"`
73+ ScheduledTime string `json:"scheduleTime,omitempty"`
74+ IsConversation bool `json:"isConversation,omitempty"`
75+ IsGroupConversation bool `json:"isGroupConversation,omitempty"`
76+ ConversationID string `json:"conversationId,omitempty"`
77+ Timestamp uint64 `json:"timestamp,omitempty"`
78+ Author NotificationAuthor `json:"notificationAuthor,omitempty"`
79+ CommunityIcon string `json:"communityIcon,omitempty"`
80+ ChatIcon string `json:"chatIcon,omitempty"`
81+ Deleted bool `json:"deleted,omitempty"`
82+ IsFromMe bool `json:"isFromMe,omitempty"`
8083}
8184
8285// MessageEvent - structure used to pass messages from chat to bus
@@ -132,6 +135,7 @@ func (n *Notification) MarshalJSON() ([]byte, error) {
132135 CommunityIcon : n .CommunityIcon ,
133136 ChatIcon : n .ChatIcon ,
134137 Deleted : n .Deleted ,
138+ IsFromMe : n .IsFromMe ,
135139 }
136140
137141 return json .Marshal (alias )
0 commit comments