mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-13 23:47:44 +00:00
Change trending notification
This commit is contained in:
parent
2027760e1e
commit
8502a67352
1 changed files with 2 additions and 5 deletions
|
@ -38,7 +38,7 @@ type trendingWorker struct {
|
||||||
watcherRepo domain.WatcherRepository
|
watcherRepo domain.WatcherRepository
|
||||||
}
|
}
|
||||||
|
|
||||||
const trendingNotificationTitleFormat = "🔥 Trending in r/%s"
|
const trendingNotificationTitleFormat = "🔥 r/%s Trending"
|
||||||
|
|
||||||
func NewTrendingWorker(logger *logrus.Logger, statsd *statsd.Client, db *pgxpool.Pool, redis *redis.Client, queue rmq.Connection, consumers int) Worker {
|
func NewTrendingWorker(logger *logrus.Logger, statsd *statsd.Client, db *pgxpool.Pool, redis *redis.Client, queue rmq.Connection, consumers int) Worker {
|
||||||
reddit := reddit.NewClient(
|
reddit := reddit.NewClient(
|
||||||
|
@ -318,10 +318,9 @@ func (tc *trendingConsumer) Consume(delivery rmq.Delivery) {
|
||||||
func payloadFromTrendingPost(post *reddit.Thing) *payload.Payload {
|
func payloadFromTrendingPost(post *reddit.Thing) *payload.Payload {
|
||||||
title := fmt.Sprintf(trendingNotificationTitleFormat, post.Subreddit)
|
title := fmt.Sprintf(trendingNotificationTitleFormat, post.Subreddit)
|
||||||
|
|
||||||
payload := payload.
|
return payload.
|
||||||
NewPayload().
|
NewPayload().
|
||||||
AlertTitle(title).
|
AlertTitle(title).
|
||||||
AlertSubtitle(post.Title).
|
|
||||||
AlertBody(post.Title).
|
AlertBody(post.Title).
|
||||||
AlertSummaryArg(post.Subreddit).
|
AlertSummaryArg(post.Subreddit).
|
||||||
Category("post-watch").
|
Category("post-watch").
|
||||||
|
@ -332,6 +331,4 @@ func payloadFromTrendingPost(post *reddit.Thing) *payload.Payload {
|
||||||
Custom("post_age", post.CreatedAt).
|
Custom("post_age", post.CreatedAt).
|
||||||
MutableContent().
|
MutableContent().
|
||||||
Sound("traloop.wav")
|
Sound("traloop.wav")
|
||||||
|
|
||||||
return payload
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue