1package notify
2
3import (
4 "context"
5
6 "tangled.org/core/appview/models"
7)
8
9type mergedNotifier struct {
10 notifiers []Notifier
11}
12
13func NewMergedNotifier(notifiers ...Notifier) Notifier {
14 return &mergedNotifier{notifiers}
15}
16
17var _ Notifier = &mergedNotifier{}
18
19func (m *mergedNotifier) NewRepo(ctx context.Context, repo *models.Repo) {
20 for _, notifier := range m.notifiers {
21 notifier.NewRepo(ctx, repo)
22 }
23}
24
25func (m *mergedNotifier) NewStar(ctx context.Context, star *models.Star) {
26 for _, notifier := range m.notifiers {
27 notifier.NewStar(ctx, star)
28 }
29}
30func (m *mergedNotifier) DeleteStar(ctx context.Context, star *models.Star) {
31 for _, notifier := range m.notifiers {
32 notifier.DeleteStar(ctx, star)
33 }
34}
35
36func (m *mergedNotifier) NewIssue(ctx context.Context, issue *models.Issue) {
37 for _, notifier := range m.notifiers {
38 notifier.NewIssue(ctx, issue)
39 }
40}
41func (m *mergedNotifier) NewIssueComment(ctx context.Context, comment *models.IssueComment) {
42 for _, notifier := range m.notifiers {
43 notifier.NewIssueComment(ctx, comment)
44 }
45}
46
47func (m *mergedNotifier) NewIssueClosed(ctx context.Context, issue *models.Issue) {
48 for _, notifier := range m.notifiers {
49 notifier.NewIssueClosed(ctx, issue)
50 }
51}
52
53func (m *mergedNotifier) NewFollow(ctx context.Context, follow *models.Follow) {
54 for _, notifier := range m.notifiers {
55 notifier.NewFollow(ctx, follow)
56 }
57}
58func (m *mergedNotifier) DeleteFollow(ctx context.Context, follow *models.Follow) {
59 for _, notifier := range m.notifiers {
60 notifier.DeleteFollow(ctx, follow)
61 }
62}
63
64func (m *mergedNotifier) NewPull(ctx context.Context, pull *models.Pull) {
65 for _, notifier := range m.notifiers {
66 notifier.NewPull(ctx, pull)
67 }
68}
69func (m *mergedNotifier) NewPullComment(ctx context.Context, comment *models.PullComment) {
70 for _, notifier := range m.notifiers {
71 notifier.NewPullComment(ctx, comment)
72 }
73}
74
75func (m *mergedNotifier) NewPullMerged(ctx context.Context, pull *models.Pull) {
76 for _, notifier := range m.notifiers {
77 notifier.NewPullMerged(ctx, pull)
78 }
79}
80
81func (m *mergedNotifier) NewPullClosed(ctx context.Context, pull *models.Pull) {
82 for _, notifier := range m.notifiers {
83 notifier.NewPullClosed(ctx, pull)
84 }
85}
86
87func (m *mergedNotifier) UpdateProfile(ctx context.Context, profile *models.Profile) {
88 for _, notifier := range m.notifiers {
89 notifier.UpdateProfile(ctx, profile)
90 }
91}
92
93func (m *mergedNotifier) NewString(ctx context.Context, string *models.String) {
94 for _, notifier := range m.notifiers {
95 notifier.NewString(ctx, string)
96 }
97}
98
99func (m *mergedNotifier) EditString(ctx context.Context, string *models.String) {
100 for _, notifier := range m.notifiers {
101 notifier.EditString(ctx, string)
102 }
103}
104
105func (m *mergedNotifier) DeleteString(ctx context.Context, did, rkey string) {
106 for _, notifier := range m.notifiers {
107 notifier.DeleteString(ctx, did, rkey)
108 }
109}