Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrap provider ids #2811

Merged
merged 5 commits into from
May 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/unreleased/events2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: add event for created directories

We added another event for created directories.

https://github.com/cs3org/reva/pull/2811
8 changes: 8 additions & 0 deletions internal/grpc/interceptors/eventsmiddleware/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ import (
"github.com/cs3org/reva/v2/pkg/utils"
)

// ContainerCreated converts the response to an event
func ContainerCreated(r *provider.CreateContainerResponse, req *provider.CreateContainerRequest, executant *user.UserId) events.ContainerCreated {
return events.ContainerCreated{
Executant: executant,
Ref: req.Ref,
}
}

// ShareCreated converts the response to an event
func ShareCreated(r *collaboration.CreateShareResponse) events.ShareCreated {
return events.ShareCreated{
Expand Down
4 changes: 4 additions & 0 deletions internal/grpc/interceptors/eventsmiddleware/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ func NewUnary(m map[string]interface{}) (grpc.UnaryServerInterceptor, int, error
} else {
ev = LinkAccessFailed(v, req.(*link.GetPublicShareByTokenRequest))
}
case *provider.CreateContainerResponse:
if isSuccess(v) {
ev = ContainerCreated(v, req.(*provider.CreateContainerRequest), executantID)
}
case *provider.InitiateFileUploadResponse:
if isSuccess(v) {
ev = FileUploaded(v, req.(*provider.InitiateFileUploadRequest), executantID)
Expand Down
Loading