notifs

package
v0.0.0-...-45ae864 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotifKindReply   = 1
	NotifKindMention = 2
	NotifKindUpVote  = 3
	NotifKindFollow  = 4
	NotifKindRepost  = 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GetRecord

type GetRecord func(ctx context.Context, user uint, collection string, rkey string, maybeCid cid.Cid) (cid.Cid, cbg.CBORMarshaler, error)

type HydratedNotification

type HydratedNotification struct {
	Record        any
	IsRead        bool
	IndexedAt     time.Time
	Uri           string
	Cid           string
	Author        *appbskytypes.ActorRef_WithInfo
	Reason        string
	ReasonSubject *string
}

type NotifRecord

type NotifRecord struct {
	gorm.Model
	For     uint
	Kind    int64
	Record  uint
	Who     uint
	ReplyTo uint
}

type NotifSeen

type NotifSeen struct {
	ID       uint `gorm:"primarykey"`
	Usr      uint `gorm:"uniqueIndex"`
	LastSeen time.Time
}

type NotificationManager

type NotificationManager struct {
	// contains filtered or unexported fields
}

func NewNotificationManager

func NewNotificationManager(db *gorm.DB, getrec GetRecord) *NotificationManager

func (*NotificationManager) AddFollow

func (nm *NotificationManager) AddFollow(ctx context.Context, follower, followed, recid uint) error

func (*NotificationManager) AddMention

func (nm *NotificationManager) AddMention(ctx context.Context, user uint, postid uint, mentioned uint) error

func (*NotificationManager) AddReplyTo

func (nm *NotificationManager) AddReplyTo(ctx context.Context, user uint, replyid uint, replyto *types.FeedPost) error

func (*NotificationManager) AddRepost

func (nm *NotificationManager) AddRepost(ctx context.Context, op uint, repost, reposter uint) error

func (*NotificationManager) AddUpVote

func (nm *NotificationManager) AddUpVote(ctx context.Context, voter uint, postid uint, voteid uint, postauthor uint) error

func (*NotificationManager) GetCount

func (nm *NotificationManager) GetCount(ctx context.Context, user uint) (int64, error)

func (*NotificationManager) GetNotifications

func (*NotificationManager) UpdateSeen

func (nm *NotificationManager) UpdateSeen(ctx context.Context, usr uint, seen time.Time) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL