offline-twitter/pkg/scraper/notification.go
Alessio e94327b153 Add current user ID to notifications' UserID field (notification recient) when parsing
- also make an enum for notification types instead of magic numbers in the code
2024-08-25 22:48:09 -07:00

35 lines
692 B
Go

package scraper
type NotificationID string
type NotificationType int
const (
NOTIFICATION_TYPE_LIKE = iota + 1
NOTIFICATION_TYPE_RETWEET
NOTIFICATION_TYPE_QUOTE_TWEET
NOTIFICATION_TYPE_REPLY
NOTIFICATION_TYPE_FOLLOW
NOTIFICATION_TYPE_MENTION
NOTIFICATION_TYPE_USER_IS_LIVE
NOTIFICATION_TYPE_POLL_ENDED
NOTIFICATION_TYPE_LOGIN
NOTIFICATION_TYPE_COMMUNITY_PINNED_POST
NOTIFICATION_TYPE_RECOMMENDED_POST
)
type Notification struct {
ID NotificationID
Type int
SentAt Timestamp
SortIndex int64
UserID UserID // recipient of the notification
ActionUserID UserID
ActionTweetID TweetID
ActionRetweetID TweetID
TweetIDs []TweetID
UserIDs []UserID
}