This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

core / appview / notify / notifier.go
3.9 kB 88 lines
1package notify 2 3import ( 4 "context" 5 6 "github.com/bluesky-social/indigo/atproto/syntax" 7 "tangled.org/core/appview/models" 8) 9 10type Notifier interface { 11 NewRepo(ctx context.Context, repo *models.Repo) 12 DeleteRepo(ctx context.Context, repo *models.Repo) 13 RenameRepo(ctx context.Context, actor syntax.DID, oldRepo, newRepo *models.Repo) 14 15 NewStar(ctx context.Context, star *models.Star) 16 DeleteStar(ctx context.Context, star *models.Star) 17 18 NewComment(ctx context.Context, comment *models.Comment, mentions []syntax.DID) 19 DeleteComment(ctx context.Context, comment *models.Comment) 20 21 NewIssue(ctx context.Context, issue *models.Issue, mentions []syntax.DID) 22 NewIssueState(ctx context.Context, actor syntax.DID, issue *models.Issue) 23 DeleteIssue(ctx context.Context, issue *models.Issue) 24 25 NewFollow(ctx context.Context, follow *models.Follow) 26 DeleteFollow(ctx context.Context, follow *models.Follow) 27 28 NewPull(ctx context.Context, pull *models.Pull) 29 ResubmitPull(ctx context.Context, pull *models.Pull) 30 NewPullState(ctx context.Context, actor syntax.DID, pull *models.Pull) 31 32 NewIssueLabelOp(ctx context.Context, actor syntax.DID, issue *models.Issue, ops []models.LabelOp) 33 NewPullLabelOp(ctx context.Context, actor syntax.DID, pull *models.Pull, ops []models.LabelOp) 34 35 UpdateProfile(ctx context.Context, profile *models.Profile) 36 37 NewString(ctx context.Context, s *models.String) 38 EditString(ctx context.Context, s *models.String) 39 DeleteString(ctx context.Context, did, rkey string) 40 41 Push(ctx context.Context, repo *models.Repo, ref, oldSha, newSha, committerDid string) 42 43 Clone(ctx context.Context, repo *models.Repo) 44} 45 46// BaseNotifier is a listener that does nothing 47type BaseNotifier struct{} 48 49var _ Notifier = &BaseNotifier{} 50 51func (m *BaseNotifier) NewRepo(ctx context.Context, repo *models.Repo) {} 52func (m *BaseNotifier) DeleteRepo(ctx context.Context, repo *models.Repo) {} 53func (m *BaseNotifier) RenameRepo(ctx context.Context, actor syntax.DID, oldRepo, newRepo *models.Repo) { 54} 55 56func (m *BaseNotifier) NewStar(ctx context.Context, star *models.Star) {} 57func (m *BaseNotifier) DeleteStar(ctx context.Context, star *models.Star) {} 58 59func (m *BaseNotifier) NewComment(ctx context.Context, comment *models.Comment, mentions []syntax.DID) { 60} 61func (m *BaseNotifier) DeleteComment(ctx context.Context, comment *models.Comment) {} 62 63func (m *BaseNotifier) NewIssue(ctx context.Context, issue *models.Issue, mentions []syntax.DID) {} 64func (m *BaseNotifier) NewIssueState(ctx context.Context, actor syntax.DID, issue *models.Issue) {} 65func (m *BaseNotifier) DeleteIssue(ctx context.Context, issue *models.Issue) {} 66 67func (m *BaseNotifier) NewIssueLabelOp(ctx context.Context, actor syntax.DID, issue *models.Issue, ops []models.LabelOp) { 68} 69func (m *BaseNotifier) NewPullLabelOp(ctx context.Context, actor syntax.DID, pull *models.Pull, ops []models.LabelOp) { 70} 71 72func (m *BaseNotifier) NewFollow(ctx context.Context, follow *models.Follow) {} 73func (m *BaseNotifier) DeleteFollow(ctx context.Context, follow *models.Follow) {} 74 75func (m *BaseNotifier) NewPull(ctx context.Context, pull *models.Pull) {} 76func (m *BaseNotifier) ResubmitPull(ctx context.Context, pull *models.Pull) {} 77func (m *BaseNotifier) NewPullState(ctx context.Context, actor syntax.DID, pull *models.Pull) {} 78 79func (m *BaseNotifier) UpdateProfile(ctx context.Context, profile *models.Profile) {} 80 81func (m *BaseNotifier) NewString(ctx context.Context, s *models.String) {} 82func (m *BaseNotifier) EditString(ctx context.Context, s *models.String) {} 83func (m *BaseNotifier) DeleteString(ctx context.Context, did, rkey string) {} 84 85func (m *BaseNotifier) Push(ctx context.Context, repo *models.Repo, ref, oldSha, newSha, committerDid string) { 86} 87 88func (m *BaseNotifier) Clone(ctx context.Context, repo *models.Repo) {}