diff --git a/libresapi/src/api/ChatHandler.cpp b/libresapi/src/api/ChatHandler.cpp index fe2846a32..1f10351a8 100644 --- a/libresapi/src/api/ChatHandler.cpp +++ b/libresapi/src/api/ChatHandler.cpp @@ -888,7 +888,12 @@ void ChatHandler::handleClearLobby(Request &req, Response &resp) { ChatLobbyId id = 0; req.mStream << makeKeyValueReference("id", id); - notifyChatCleared(ChatId(id)); + if (id !=0) { + notifyChatCleared(ChatId(id)); + } else { + //Is BroadCast + notifyChatCleared(ChatId("B")); + } resp.setOk(); } diff --git a/libresapi/src/webui-src/app/chat.js b/libresapi/src/webui-src/app/chat.js index bde0494ac..c5bd6d418 100644 --- a/libresapi/src/webui-src/app/chat.js +++ b/libresapi/src/webui-src/app/chat.js @@ -211,6 +211,26 @@ function lobby(lobbyid){ } ) ] + } else { + if (lobdt.subscribed != undefined + && lobdt.subscribed + && lobdt.is_broadcast + ) { + //set participants + particips = [ + m("div.btn", { + style: { + "text-align":"center" + }, + onclick: function (){ + rs.request("chat/clear_lobby",{ + lobbyid, + }); + m.route("/chat?lobby=" + lobbyid); + } + },"clear"), + ] + } } return [ intro,