This commit is contained in:
Umputun
2018-02-18 13:57:48 -06:00
parent 8f5093a3c9
commit 06742311d5
2 changed files with 17 additions and 17 deletions
+16 -16
View File
@@ -58,22 +58,6 @@ type BlockedUser struct {
Timestamp time.Time `json:"time"`
}
// NotifUser holds id and destination for notifiable user
type NotifUser struct {
ID string `json:"id"`
Destination string `json:"destination"`
}
// NotifScope defines "enum" of notification scopes
type NotifScope int
// All NotifScope values
const (
ScopeSite NotifScope = 1
ScopePost NotifScope = 2
ScopeReply NotifScope = 3
)
// Sanitize clean dangerous html/js from the comment
func (c *Comment) Sanitize() {
p := bluemonday.UGCPolicy()
@@ -94,3 +78,19 @@ func (c *Comment) Mask() {
c.Votes = map[string]bool{}
c.Edit = nil
}
// NotifUser holds id and destination for notifiable user
type NotifUser struct {
ID string `json:"id"`
Destination string `json:"destination"`
}
// NotifScope defines "enum" of notification scopes
type NotifScope int
// All NotifScope values
const (
ScopeSite NotifScope = 1
ScopePost NotifScope = 2
ScopeReply NotifScope = 3
)
+1 -1
View File
@@ -33,7 +33,7 @@ type Admin interface {
Blocked(siteID string) ([]BlockedUser, error) // get list of blocked users
}
// Notifier defines all store ops to store/retrive notification info for users
// Notifier defines all store ops to store/retrieve notification info for users
type Notifier interface {
Set(locator Locator, user NotifUser, scope NotifScope, status bool) error // subscribe / unsubscribe user to locator updates
Status(locator Locator, userID string) bool // get subscription status for user & locator