diff --git a/changelog/unreleased/fix-acitivity-update-share.md b/changelog/unreleased/fix-acitivity-update-share.md new file mode 100644 index 0000000000..b53d60ac64 --- /dev/null +++ b/changelog/unreleased/fix-acitivity-update-share.md @@ -0,0 +1,6 @@ +Bugfix: Added ShareUpdate activity + +Added the ShareUpdate activity in the space context. + +https://github.com/cs3org/reva/pull/4854 +https://github.com/owncloud/ocis/issues/10011 diff --git a/internal/grpc/interceptors/eventsmiddleware/conversion.go b/internal/grpc/interceptors/eventsmiddleware/conversion.go index 87ee14af57..9e5a739e0f 100644 --- a/internal/grpc/interceptors/eventsmiddleware/conversion.go +++ b/internal/grpc/interceptors/eventsmiddleware/conversion.go @@ -78,12 +78,6 @@ func ShareRemoved(r *collaboration.RemoveShareResponse, req *collaboration.Remov // ShareUpdated converts the response to an event func ShareUpdated(r *collaboration.UpdateShareResponse, req *collaboration.UpdateShareRequest, executant *user.UserId) events.ShareUpdated { - updated := "" - if req.Field.GetPermissions() != nil { - updated = "permissions" - } else if req.Field.GetDisplayName() != "" { - updated = "displayname" - } return events.ShareUpdated{ Executant: executant, ShareID: r.Share.Id, @@ -93,7 +87,7 @@ func ShareUpdated(r *collaboration.UpdateShareResponse, req *collaboration.Updat GranteeGroupID: r.Share.GetGrantee().GetGroupId(), Sharer: r.Share.Creator, MTime: r.Share.Mtime, - Updated: updated, + UpdateMask: req.GetUpdateMask().GetPaths(), } } @@ -139,7 +133,7 @@ func LinkUpdated(r *link.UpdatePublicShareResponse, req *link.UpdatePublicShareR DisplayName: r.Share.DisplayName, Expiration: r.Share.Expiration, PasswordProtected: r.Share.PasswordProtected, - CTime: r.Share.Ctime, + MTime: r.Share.Mtime, Token: r.Share.Token, FieldUpdated: link.UpdatePublicShareRequest_Update_Type_name[int32(req.Update.GetType())], } diff --git a/pkg/events/sharing.go b/pkg/events/sharing.go index 6c438d5dba..daa13ad11b 100644 --- a/pkg/events/sharing.go +++ b/pkg/events/sharing.go @@ -84,8 +84,9 @@ type ShareUpdated struct { Sharer *user.UserId MTime *types.Timestamp - // indicates what was updated - one of "displayname", "permissions" - Updated string + Updated string // Deprecated + // indicates what was updated + UpdateMask []string } // Unmarshal to fulfill umarshaller interface @@ -165,7 +166,7 @@ type LinkUpdated struct { DisplayName string Expiration *types.Timestamp PasswordProtected bool - CTime *types.Timestamp + MTime *types.Timestamp Token string FieldUpdated string