use of com.faforever.client.chat.event.UnreadPrivateMessageEvent in project downlords-faf-client by FAForever.
the class PrivateChatTabController method onChatMessage.
@Override
public void onChatMessage(ChatMessage chatMessage) {
Player player = playerService.getPlayerForUsername(chatMessage.getUsername());
ChatPrefs chatPrefs = preferencesService.getPreferences().getChat();
if (player != null && player.getSocialStatus() == FOE && chatPrefs.getHideFoeMessages()) {
return;
}
super.onChatMessage(chatMessage);
if (!hasFocus()) {
audioService.playPrivateMessageSound();
showNotificationIfNecessary(chatMessage);
setUnread(true);
incrementUnreadMessagesCount(1);
eventBus.post(new UnreadPrivateMessageEvent(chatMessage));
}
}
Aggregations