mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-05 19:59:37 -06:00
Merge pull request #10104 from 2403905/issue-10011
Added the ShareUpdate activity in the space context.
This commit is contained in:
@@ -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())],
|
||||
}
|
||||
|
||||
7
vendor/github.com/cs3org/reva/v2/pkg/events/sharing.go
generated
vendored
7
vendor/github.com/cs3org/reva/v2/pkg/events/sharing.go
generated
vendored
@@ -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
|
||||
|
||||
3
vendor/github.com/cs3org/reva/v2/pkg/utils/utils.go
generated
vendored
3
vendor/github.com/cs3org/reva/v2/pkg/utils/utils.go
generated
vendored
@@ -146,6 +146,9 @@ func TSToUnixNano(ts *types.Timestamp) uint64 {
|
||||
|
||||
// TSToTime converts a protobuf Timestamp to Go's time.Time.
|
||||
func TSToTime(ts *types.Timestamp) time.Time {
|
||||
if ts == nil {
|
||||
return time.Time{}
|
||||
}
|
||||
return time.Unix(int64(ts.Seconds), int64(ts.Nanos))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user