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

Add is directory moving header #45

Merged
merged 6 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public class DirectoryNotificationWebSocketHandler implements WebSocketHandler {
static final String HEADER_IS_ROOT_DIRECTORY = "isRootDirectory";
static final String HEADER_NOTIFICATION_TYPE = "notificationType";
static final String HEADER_ELEMENT_UUID = "elementUuid";
static final String HEADER_IS_DIRECTORY_MOVING = "isDirectoryMoving";

private ObjectMapper jacksonObjectMapper;

Expand Down Expand Up @@ -145,6 +146,9 @@ private static Map<String, Object> toResultHeader(Map<String, Object> messageHea
if (messageHeader.get(HEADER_ELEMENT_UUID) != null) {
resHeader.put(HEADER_ELEMENT_UUID, messageHeader.get(HEADER_ELEMENT_UUID));
}
if (messageHeader.get(HEADER_IS_DIRECTORY_MOVING) != null) {
resHeader.put(HEADER_IS_DIRECTORY_MOVING, messageHeader.get(HEADER_IS_DIRECTORY_MOVING));
}
return resHeader;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ private void withFilters(String filterUpdateType, String filterElementUuid, bool
Map.of(HEADER_DIRECTORY_UUID, "public_" + otherUserId, HEADER_UPDATE_TYPE, "rab", HEADER_USER_ID, otherUserId, HEADER_IS_PUBLIC_DIRECTORY, true, HEADER_ELEMENT_NAME, "toto"),
Map.of(HEADER_DIRECTORY_UUID, "private_" + otherUserId, HEADER_UPDATE_TYPE, "rab", HEADER_USER_ID, otherUserId, HEADER_IS_PUBLIC_DIRECTORY, false),
Map.of(HEADER_DIRECTORY_UUID, "public_" + otherUserId, HEADER_UPDATE_TYPE, "rab", HEADER_USER_ID, otherUserId, HEADER_IS_PUBLIC_DIRECTORY, true,
HEADER_ERROR, "error_message", HEADER_NOTIFICATION_TYPE, "UPDATE_DIRECTORY", HEADER_IS_ROOT_DIRECTORY, "false", HEADER_ELEMENT_NAME, "tutu"),
HEADER_ERROR, "error_message", HEADER_NOTIFICATION_TYPE, "UPDATE_DIRECTORY", HEADER_IS_ROOT_DIRECTORY, "false", HEADER_ELEMENT_NAME, "tutu", HEADER_IS_DIRECTORY_MOVING, "false"),
Map.of(HEADER_ELEMENT_UUID, ELEMENT_UUID, HEADER_USER_ID, connectedUserId))
.map(map -> new GenericMessage<>("", map))
.collect(Collectors.toList());
Expand Down Expand Up @@ -228,6 +228,9 @@ private Map<String, Object> toResultHeader(Map<String, Object> messageHeader) {
if (messageHeader.get(HEADER_ELEMENT_UUID) != null) {
resHeader.put(HEADER_ELEMENT_UUID, messageHeader.get(HEADER_ELEMENT_UUID));
}
if (messageHeader.get(HEADER_IS_DIRECTORY_MOVING) != null) {
resHeader.put(HEADER_IS_DIRECTORY_MOVING, messageHeader.get(HEADER_IS_DIRECTORY_MOVING));
}
resHeader.remove(HEADER_TIMESTAMP);

return resHeader;
Expand Down
Loading