dump response from a /rooms query into the chat area

This commit is contained in:
Tomasz Śniatowski 2009-11-14 01:26:00 +01:00
parent 2c553d4dee
commit de1bd335bb

View file

@ -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()) {