Skip to content

Commit

Permalink
GUI2/Chatbox: attempt to send roomless messages to the active room first
Browse files Browse the repository at this point in the history
Fixes #2775. Server messages in particular are roomless, so now they should appear in
whatever tab (PMs included) you have open.

(cherry-picked from commit be580a1)
  • Loading branch information
Vultraz committed Oct 7, 2018
1 parent 1f397d7 commit 4e7b53f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/gui/widgets/chatbox.cpp
Expand Up @@ -733,6 +733,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";
Expand Down

0 comments on commit 4e7b53f

Please sign in to comment.