Skip to content

Commit

Permalink
Merge pull request #2811 from aduffeck/rewrap-provider-ids
Browse files Browse the repository at this point in the history
Rewrap provider ids
  • Loading branch information
aduffeck authored May 2, 2022
2 parents 8bcec2e + bda5fb5 commit 7cd20c5
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 94 deletions.
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

0 comments on commit 7cd20c5

Please sign in to comment.