Handle 'X Premium' native ads in notifications
This commit is contained in:
parent
1b290d9b5c
commit
5b7713bb05
@ -171,6 +171,10 @@ func (t *TweetResponse) ToTweetTroveAsNotifications(current_user_id UserID) (Twe
|
||||
// TODO: communities
|
||||
delete(ret.Notifications, notification.ID)
|
||||
continue
|
||||
} else if strings.Contains(entry.Content.Item.ClientEventInfo.Element, "promotion_premium") {
|
||||
// Native ad for buying X Premium; ignore
|
||||
delete(ret.Notifications, notification.ID)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -138,6 +138,10 @@ func TestParseNotificationsPage(t *testing.T) {
|
||||
// assert.True(is_ok)
|
||||
// assert.Equal(NOTIFICATION_TYPE_COMMUNITY_PINNED_POST, notif12.Type)
|
||||
|
||||
// Ad for X Premium
|
||||
_, is_ok = tweet_trove.Notifications["FKncQJGVgAQAAAABSQ3bEak9zbD6K-zcrss"]
|
||||
assert.False(is_ok)
|
||||
|
||||
// Check users
|
||||
for _, u_id := range []UserID{1458284524761075714, 28815778, 1633158398555353096} {
|
||||
_, is_ok := tweet_trove.Users[u_id]
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user