Skip to content

Commit

Permalink
Merge pull request cs3org#4854 from 2403905/issue-10011
Browse files Browse the repository at this point in the history
Added the ShareUpdate activity in the space context.
  • Loading branch information
butonic authored Sep 18, 2024
2 parents 5a494dc + 2e1d422 commit 4849435
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/fix-acitivity-update-share.md
Original file line number Diff line number Diff line change
@@ -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
10 changes: 2 additions & 8 deletions internal/grpc/interceptors/eventsmiddleware/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(),
}
}

Expand Down Expand Up @@ -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())],
}
Expand Down
7 changes: 4 additions & 3 deletions pkg/events/sharing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -165,7 +166,7 @@ type LinkUpdated struct {
DisplayName string
Expiration *types.Timestamp
PasswordProtected bool
CTime *types.Timestamp
MTime *types.Timestamp
Token string

FieldUpdated string
Expand Down

0 comments on commit 4849435

Please sign in to comment.