Documentation ¶
Index ¶
- type Config
- type Database
- type Module
- func (m *Module) BuildMessage(recipient types.NotificationRecipient, config types.NotificationData) (types.NotificationMessage, error)
- func (m *Module) HandleMsg(index int, msg sdk.Msg, tx *juno.Tx) error
- func (m *Module) HandleMsgExec(index int, _ *authz.MsgExec, _ int, executedMsg sdk.Msg, tx *juno.Tx) error
- func (m *Module) HandleTx(tx *juno.Tx) error
- func (m *Module) Name() string
- func (m *Module) SendAndStoreNotification(recipient types.NotificationRecipient, notification types.NotificationData) error
- func (m *Module) SendPostNotifications(height int64, subspaceID uint64, postID uint64) error
- func (m *Module) SendReactionNotifications(reaction types.Reaction) error
- func (m *Module) SendRelationshipNotifications(relationship types.Relationship) error
- func (m *Module) SendTransactionNotifications(tx *juno.Tx, user string) error
- func (m *Module) WithMessagesBuilder(builder notificationsbuilder.MessagesBuilder) *Module
- func (m *Module) WithNotificationSender(sender notificationssender.NotificationSender) *Module
- func (m *Module) WithNotificationsBuilder(builder notificationsbuilder.NotificationsBuilder) *Module
- type PostsModule
- type ProfilesModule
- type ReactionsModule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { FirebaseCredentialsFilePath string `yaml:"firebase_credentials_file_path"` PersistHistory bool `yaml:"persist_history"` }
func ParseConfig ¶
type Database ¶
type Database interface { SaveNotification(recipient types.NotificationRecipient, notification types.NotificationData) error SaveToken(token types.NotificationToken) error GetUserTokens(userAddress string) ([]types.NotificationToken, error) }
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func NewModule ¶
func NewModule( junoCfg config.Config, postsModule PostsModule, reactionsModule ReactionsModule, cdc codec.Codec, db Database, ) *Module
NewModule returns a new Module instance
func (*Module) BuildMessage ¶
func (m *Module) BuildMessage(recipient types.NotificationRecipient, config types.NotificationData) (types.NotificationMessage, error)
BuildMessage builds the notification message that should be sent based on the given recipient, notification and data
func (*Module) HandleMsgExec ¶
func (m *Module) HandleMsgExec(index int, _ *authz.MsgExec, _ int, executedMsg sdk.Msg, tx *juno.Tx) error
HandleMsgExec implements modules.AuthzMessageModule
func (*Module) SendAndStoreNotification ¶
func (m *Module) SendAndStoreNotification(recipient types.NotificationRecipient, notification types.NotificationData) error
SendAndStoreNotification sends the given notification to the given recipient and stores it inside the database.
func (*Module) SendPostNotifications ¶
SendPostNotifications sends all the notifications to the users that are somehow involved with the given post. These include: - the author of the original post to which the post is a reply (if any) - the users mentioned inside the post - the authors of the various referenced posts (if this post is a reply/repost/quote)
func (*Module) SendReactionNotifications ¶
SendReactionNotifications sends all the notifications to the author of the post that has been reacted to
func (*Module) SendRelationshipNotifications ¶
func (m *Module) SendRelationshipNotifications(relationship types.Relationship) error
SendRelationshipNotifications sends the notification to the user towards which a relationship has just been created
func (*Module) SendTransactionNotifications ¶
SendTransactionNotifications notifies the user involved in the transaction
func (*Module) WithMessagesBuilder ¶
func (m *Module) WithMessagesBuilder(builder notificationsbuilder.MessagesBuilder) *Module
WithMessagesBuilder sets the given builder as the messages builder
func (*Module) WithNotificationSender ¶
func (m *Module) WithNotificationSender(sender notificationssender.NotificationSender) *Module
WithNotificationSender sets the given sender as the notification sender
func (*Module) WithNotificationsBuilder ¶
func (m *Module) WithNotificationsBuilder(builder notificationsbuilder.NotificationsBuilder) *Module
WithNotificationsBuilder sets the given builder as the notifications builder