Skip to content

Commit

Permalink
feat(activitylog): Add FileUpdated Activity
Browse files Browse the repository at this point in the history
Signed-off-by: jkoberg <jkoberg@owncloud.com>
  • Loading branch information
kobergj committed Sep 17, 2024
1 parent 27d2cf1 commit 7d3c592
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/fileupdated-activity.md
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions services/activitylog/pkg/service/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions services/activitylog/pkg/service/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down

0 comments on commit 7d3c592

Please sign in to comment.