mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-25 13:17:42 +00:00
include subreddit fields too
This commit is contained in:
parent
c2a77e7c66
commit
e48460572a
1 changed files with 5 additions and 0 deletions
|
@ -422,9 +422,12 @@ func payloadFromMessage(acct domain.Account, msg *reddit.Thing, badgeCount int)
|
||||||
switch {
|
switch {
|
||||||
case (msg.Kind == "t1" && msg.Type == "username_mention"):
|
case (msg.Kind == "t1" && msg.Type == "username_mention"):
|
||||||
title := fmt.Sprintf(usernameMentionNotificationTitleFormat, postTitle)
|
title := fmt.Sprintf(usernameMentionNotificationTitleFormat, postTitle)
|
||||||
|
postID := reddit.PostIDFromContext(msg.Context)
|
||||||
payload = payload.
|
payload = payload.
|
||||||
AlertTitle(title).
|
AlertTitle(title).
|
||||||
Custom("comment_id", msg.ID).
|
Custom("comment_id", msg.ID).
|
||||||
|
Custom("post_id", postID).
|
||||||
|
Custom("subreddit", msg.Subreddit).
|
||||||
Custom("type", "username")
|
Custom("type", "username")
|
||||||
|
|
||||||
pType, _ := reddit.SplitID(msg.ParentID)
|
pType, _ := reddit.SplitID(msg.ParentID)
|
||||||
|
@ -444,6 +447,7 @@ func payloadFromMessage(acct domain.Account, msg *reddit.Thing, badgeCount int)
|
||||||
Custom("comment_id", msg.ID).
|
Custom("comment_id", msg.ID).
|
||||||
Custom("post_id", postID).
|
Custom("post_id", postID).
|
||||||
Custom("subject", "comment").
|
Custom("subject", "comment").
|
||||||
|
Custom("subreddit", msg.Subreddit).
|
||||||
Custom("type", "post").
|
Custom("type", "post").
|
||||||
ThreadID("comment")
|
ThreadID("comment")
|
||||||
case (msg.Kind == "t1" && msg.Type == "comment_reply"):
|
case (msg.Kind == "t1" && msg.Type == "comment_reply"):
|
||||||
|
@ -455,6 +459,7 @@ func payloadFromMessage(acct domain.Account, msg *reddit.Thing, badgeCount int)
|
||||||
Custom("comment_id", msg.ID).
|
Custom("comment_id", msg.ID).
|
||||||
Custom("post_id", postID).
|
Custom("post_id", postID).
|
||||||
Custom("subject", "comment").
|
Custom("subject", "comment").
|
||||||
|
Custom("subreddit", msg.Subreddit).
|
||||||
Custom("type", "comment").
|
Custom("type", "comment").
|
||||||
ThreadID("comment")
|
ThreadID("comment")
|
||||||
case (msg.Kind == "t4"):
|
case (msg.Kind == "t4"):
|
||||||
|
|
Loading…
Reference in a new issue