Skip to content

Commit

Permalink
fixes in WebsocketTool.showMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
car031 committed Nov 30, 2023
1 parent 55cb0dd commit 98edd14
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.logicaldoc.web.websockets;

import java.util.Random;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -35,6 +37,7 @@ public void showMessage(Session session, String message, String level) {
command.setUsername(session.getUsername());
command.setPayload(message);
command.setTarget(level);
command.setId(-new Random().nextLong());

EventEndpoint.distributeMessage(command);
}
Expand All @@ -54,6 +57,7 @@ public void openUrl(Session session, String url, String target) {
command.setUsername(session.getUsername());
command.setPayload(url);
command.setTarget(StringUtils.isNotEmpty(target) ? target : "_blank");
command.setId(-new Random().nextLong());

EventEndpoint.distributeMessage(command);
}
Expand Down

0 comments on commit 98edd14

Please sign in to comment.