-
Notifications
You must be signed in to change notification settings - Fork 5
/
notifications.go
52 lines (37 loc) · 2.09 KB
/
notifications.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package builder
import (
poststypes "github.com/desmos-labs/desmos/v6/x/posts/types"
"github.com/desmos-labs/athena/types"
notificationscontext "github.com/desmos-labs/athena/x/notifications/context"
)
// -------------------------------------------------------------------------------------------------------------------
type NotificationsBuilderCreator func(context notificationscontext.Context) NotificationsBuilder
// NotificationsBuilder contains all the notifications builders
type NotificationsBuilder interface {
Posts() PostsNotificationsBuilder
Reactions() ReactionsNotificationsBuilder
Relationships() RelationshipsNotificationsBuilder
}
// -------------------------------------------------------------------------------------------------------------------
type PostNotificationBuilder = func(originalPost types.Post, post types.Post) types.NotificationData
type MentionNotificationBuilder = func(post types.Post, mention poststypes.TextTag) types.NotificationData
// PostsNotificationsBuilder contains all the notifications builders for the posts module
type PostsNotificationsBuilder interface {
Comment() PostNotificationBuilder
Reply() PostNotificationBuilder
Repost() PostNotificationBuilder
Quote() PostNotificationBuilder
Mention() MentionNotificationBuilder
}
// -------------------------------------------------------------------------------------------------------------------
type ReactionNotificationBuilder = func(post types.Post, reaction types.Reaction) types.NotificationData
// ReactionsNotificationsBuilder contains all the notifications builders for the reactions module
type ReactionsNotificationsBuilder interface {
Reaction() ReactionNotificationBuilder
}
// -------------------------------------------------------------------------------------------------------------------
type RelationshipNotificationBuilder = func(relationship types.Relationship) types.NotificationData
// RelationshipsNotificationsBuilder contains all the notifications builders for the relationships module
type RelationshipsNotificationsBuilder interface {
Relationship() RelationshipNotificationBuilder
}