aboutsummaryrefslogtreecommitdiff
path: root/models/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/models/repo.go b/models/repo.go
index 6d2dd029..37e8756b 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -2075,7 +2075,7 @@ func notifyWatchers(e Engine, act *Action) error {
// Add feed for actioner.
act.UserID = act.ActUserID
- if _, err = e.InsertOne(act); err != nil {
+ if _, err = e.Insert(act); err != nil {
return fmt.Errorf("insert new actioner: %v", err)
}
@@ -2086,7 +2086,7 @@ func notifyWatchers(e Engine, act *Action) error {
act.ID = 0
act.UserID = watches[i].UserID
- if _, err = e.InsertOne(act); err != nil {
+ if _, err = e.Insert(act); err != nil {
return fmt.Errorf("insert new action: %v", err)
}
}
@@ -2098,6 +2098,13 @@ func NotifyWatchers(act *Action) error {
return notifyWatchers(x, act)
}
+func MustNotifyWatchers(act *Action) {
+ act.ID = 0 // Reset ID to reuse Action object
+ if err := NotifyWatchers(act); err != nil {
+ log.Error(2, "NotifyWatchers: %v", err)
+ }
+}
+
// _________ __
// / _____// |______ _______
// \_____ \\ __\__ \\_ __ \