Skip to content

Commit 4d83258

Browse files
committed
added handler for 'errorMessage' DataType
1 parent e6d4114 commit 4d83258

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/main/java/net/b07z/sepia/websockets/common/SocketMessage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static enum DataType{
3535
assistAnswer, //has data for assistant communication
3636
directCmd, //has a direct cmd for assistant
3737
remoteAction, //has a remote action like ASR trigger or hotkey submit
38-
errorMessage //tbd
38+
errorMessage //combined with TextType.status this message will be displayed as error line in channel (ignores normal status msg settings)
3939
}
4040
public static enum SenderType{
4141
user,

src/main/java/net/b07z/sepia/websockets/server/SepiaSocketHandler.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,12 @@ public void onMessage(Session userSession, String message) {
208208
){
209209
preBroadcastAction(user, msg, false, false, false);
210210
broadcastMessage(msg);
211+
212+
//error broadcast
213+
}else if (dataType.equals(DataType.errorMessage.name())){
214+
msg.textType = TextType.status.name(); //force status text
215+
preBroadcastAction(user, msg, false, false, false);
216+
broadcastMessage(msg);
211217

212218
//broadcast default welcome and byebye
213219
/* -- has been disabled, for now only server is allowed to send it --

0 commit comments

Comments
 (0)