feat(activitylog): Add FileUpdated Activity

Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
jkoberg
2024-09-17 10:07:37 +02:00
parent 27d2cf122e
commit 9ef00dbf27
4 changed files with 10 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
Enhancement: Add an Activity for FileUpdated
Previously FileUpdated has also triggered a FileAdded Activity
https://github.com/owncloud/ocis/pull/10072

View File

@@ -109,6 +109,9 @@ func (s *ActivitylogService) HandleGetItemActivities(w http.ResponseWriter, r *h
continue
case events.UploadReady:
message = MessageResourceCreated
if ev.IsVersion {
message = MessageResourceUpdated
}
ts = utils.TSToTime(ev.Timestamp)
vars, err = s.GetVars(ctx, WithResource(ev.FileRef, true), WithUser(ev.ExecutingUser.GetId(), ev.ExecutingUser.GetDisplayName()), WithSpace(toSpace(ev.FileRef)))
case events.FileTouched:

View File

@@ -21,6 +21,7 @@ import (
// Translations
var (
MessageResourceCreated = l10n.Template("{user} added {resource} to {space}")
MessageResourceUpdated = l10n.Template("{user} updated {resource} in {space}")
MessageResourceTrashed = l10n.Template("{user} deleted {resource} from {space}")
MessageResourceMoved = l10n.Template("{user} moved {resource} to {space}")
MessageResourceRenamed = l10n.Template("{user} renamed {oldResource} to {resource}")

View File

@@ -637,7 +637,7 @@ Feature: check share activity
"required": ["message","variables"],
"properties": {
"message": {
"const": "{user} added {resource} to {space}"
"const": "{user} updated {resource} in {space}"
},
"variables": {
"type": "object",