GUI2/Chatbox: attempt to send roomless messages to the active room first
Fixes #2775. Server messages in particular are roomless, so now they should appear in whatever tab (PMs included) you have open.
This commit is contained in:
parent
2769345f55
commit
be580a1973
1 changed files with 8 additions and 0 deletions
|
@ -736,6 +736,14 @@ void chatbox::process_message(const ::config& data, bool whisper /*= false*/)
|
|||
add_whisper_received(sender, message);
|
||||
} else {
|
||||
std::string room = data["room"];
|
||||
|
||||
// Attempt to send to the currently active room first.
|
||||
if(room.empty()) {
|
||||
LOG_LB << "Message without a room from " << sender << ", falling back to active window\n";
|
||||
room = open_windows_[active_window_].name;
|
||||
}
|
||||
|
||||
// If we still don't have a name, fall back to lobby.
|
||||
if(room.empty()) {
|
||||
LOG_LB << "Message without a room from " << sender << ", assuming lobby\n";
|
||||
room = "lobby";
|
||||
|
|
Loading…
Add table
Reference in a new issue