send sse when file is locked/unlocked

Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
jkoberg
2024-03-07 13:46:43 +01:00
parent 53fcb808ce
commit 271a591850
3 changed files with 13 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
Enhancement: Send SSE when file is locked/unlocked
Send sse events when a file is locked or unlocked.
https://github.com/owncloud/ocis/pull/8602

View File

@@ -30,6 +30,8 @@ var _registeredEvents = []events.Unmarshaller{
events.ItemRestored{},
events.ItemMoved{},
events.ContainerCreated{},
events.FileLocked{},
events.FileUnlocked{},
}
// Server is the entrypoint for the server command.

View File

@@ -139,6 +139,12 @@ func (cl *ClientlogService) processEvent(event events.Event) {
}
evType = "item-renamed"
users, data, err = processFileEvent(ctx, e.Ref, gwc)
case events.FileLocked:
evType = "file-locked"
users, data, err = processFileEvent(ctx, e.Ref, gwc)
case events.FileUnlocked:
evType = "file-unlocked"
users, data, err = processFileEvent(ctx, e.Ref, gwc)
}
if err != nil {