Ticket #3171: t3171_clear_muc_messages_v5_16789.patch
File t3171_clear_muc_messages_v5_16789.patch, 2.0 KB (added by , 9 years ago) |
---|
-
binaries/data/mods/public/gui/lobby/lobby.js
12 12 var g_mapSizes = {}; 13 13 const g_mapTypesText = [translateWithContext("map", "Skirmish"), translateWithContext("map", "Random"), translate("Scenario")]; 14 14 const g_mapTypes = ["skirmish", "random", "scenario"]; 15 15 var g_userRating = ""; // Rating of user, defaults to Unrated 16 16 var g_modPrefix = "@"; 17 var g_joined = false;18 17 // Block spammers for 30 seconds. 19 18 var SPAM_BLOCK_LENGTH = 30; 20 19 21 20 //////////////////////////////////////////////////////////////////////////////////////////////// 22 21 … … 701 700 case "join": 702 701 if (nick == g_Name) 703 702 { 704 703 // We just joined, we need to get the full player list 705 704 [playerList, presenceList, nickList, ratingList] = updatePlayerList(); 706 // Don't display any joins until our join request bounces back707 // Our join message should be the last one as we just got added to the stack708 g_joined = true;709 break;710 705 } 711 else if (g_joined)706 else 712 707 { 713 708 var [name, status, rating] = formatPlayerListEntry(nick, presence, "-"); 714 709 playerList.push(name); 715 710 presenceList.push(status); 716 711 nickList.push(nick); -
source/lobby/XmppClient.cpp
492 492 * 493 493 * @return A JS array containing all known players and their presences 494 494 */ 495 495 void XmppClient::GUIGetPlayerList(ScriptInterface& scriptInterface, JS::MutableHandleValue ret) 496 496 { 497 // Clear outdated presence updates 498 std::remove_if(m_GuiMessageQueue.begin(), m_GuiMessageQueue.end(), 499 [](XmppClient::GUIMessage& message) 500 { 501 return message.type == L"muc"; 502 } 503 ); 504 497 505 JSContext* cx = scriptInterface.GetContext(); 498 506 JSAutoRequest rq(cx); 499 507 500 508 scriptInterface.Eval("([])", ret); 501 509