void OnMessageReceived(IBuddy buddy, Guid id, string message, string fontName, System.Drawing.Color color, int fontSize, System.Drawing.FontStyle fontStyle) { chatState.MessageReceived(); if ((buddy.IsIgnored || (ignore && IsGroupChat)) && !chatState.ChatStarted) { chatTextBox.AddInfo(String.Format(Translation.Instance.ChatWindow_Ignore, buddy.DisplayName)); } filters.Filter(message, this, FilterDirection.In, filteredMessage => { chatTextBox.AddMessage(id, buddy.DisplayName, filteredMessage, fontName, fontSize, fontStyle, color, parsers, false); FlashWindow(); PlayAlert(AudioAlertType.MessageReceived); if (!chatState.ChatStarted && !IsActive) { if (IsGroupChat) { if (!ignore) { TrayPopup.Instance.Show(Translation.Instance.Popup_NewMessage, String.Format("{0} " + Translation.Instance.Global_ContactSays + ": {1}", buddy.DisplayName, filteredMessage), args => this.Restore()); } } else { if (!PrimaryBuddy.IsIgnored) { TrayPopup.Instance.Show(Translation.Instance.Popup_NewMessage, String.Format("{0} " + Translation.Instance.Global_ContactSays + ": {1}", buddy.DisplayName, filteredMessage), args => this.Restore()); } } } }); ResetStatus(); chatState.ChatStarted = true; }