dump response from a /rooms query into the chat area
This commit is contained in:
parent
2c553d4dee
commit
de1bd335bb
1 changed files with 10 additions and 0 deletions
|
@ -1052,10 +1052,20 @@ void tlobby_main::process_room_query_response(const config& data)
|
|||
{
|
||||
const std::string& room = data["room"];
|
||||
const std::string& message = data["message"];
|
||||
DBG_LB << "room query response: " << room << " " << message << "\n";
|
||||
if (room.empty()) {
|
||||
if (!message.empty()) {
|
||||
add_active_window_message("server", message);
|
||||
}
|
||||
if (const config& rooms = data.child("rooms")) {
|
||||
//TODO: this should really open a nice join room dialog instead
|
||||
std::stringstream ss;
|
||||
ss << "Rooms:";
|
||||
foreach (const config& r, rooms.child_range("room")) {
|
||||
ss << " " << r["name"];
|
||||
}
|
||||
add_active_window_message("server", ss.str());
|
||||
}
|
||||
} else {
|
||||
if (room_window_open(room, false)) {
|
||||
if (!message.empty()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue