Merge pull request #10334 from obrakmann/fix10331_suppress-unread-irc-notifications
Fix counting IRC notifications as unread messages
This commit is contained in:
@@ -13,6 +13,7 @@ using System.Collections.Generic;
|
|||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using OpenRA.Chat;
|
||||||
using OpenRA.Graphics;
|
using OpenRA.Graphics;
|
||||||
using OpenRA.Mods.Common.Traits;
|
using OpenRA.Mods.Common.Traits;
|
||||||
using OpenRA.Network;
|
using OpenRA.Network;
|
||||||
@@ -596,7 +597,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
return globalChatLabel + " ({0})".F(globalChatUnreadMessages);
|
return globalChatLabel + " ({0})".F(globalChatUnreadMessages);
|
||||||
};
|
};
|
||||||
|
|
||||||
globalChatLastReadMessages = Game.GlobalChat.History.Count;
|
globalChatLastReadMessages = Game.GlobalChat.History.Count(m => m.Type == ChatMessageType.Message);
|
||||||
|
|
||||||
var lobbyChat = lobby.Get("LOBBYCHAT");
|
var lobbyChat = lobby.Get("LOBBYCHAT");
|
||||||
lobbyChat.IsVisible = () => chatPanel == ChatPanelType.Lobby;
|
lobbyChat.IsVisible = () => chatPanel == ChatPanelType.Lobby;
|
||||||
@@ -678,7 +679,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
public override void Tick()
|
public override void Tick()
|
||||||
{
|
{
|
||||||
var newMessages = Game.GlobalChat.History.Count;
|
var newMessages = Game.GlobalChat.History.Count(m => m.Type == ChatMessageType.Message);
|
||||||
globalChatUnreadMessages += newMessages - globalChatLastReadMessages;
|
globalChatUnreadMessages += newMessages - globalChatLastReadMessages;
|
||||||
globalChatLastReadMessages = newMessages;
|
globalChatLastReadMessages = newMessages;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user