Prevent false-positives for mentions

This commit is contained in:
Jaidyn Ann 2021-07-31 11:43:09 -05:00
parent 51dc12236c
commit 9309562cfb

View File

@ -92,8 +92,9 @@ Conversation::ImMessage(BMessage* msg)
bool winFocused = (win != NULL && bool winFocused = (win != NULL &&
(win->IsFront() && !(win->IsMinimized()))); (win->IsFront() && !(win->IsMinimized())));
bool mentioned = ((text.IFindFirst(contact->GetName()) != B_ERROR) bool mentioned = ((contact->GetName().IsEmpty() == false
|| (text.IFindFirst(contact->GetName()) != B_ERROR)); && text.IFindFirst(contact->GetName()) != B_ERROR)
|| (text.IFindFirst(contact->GetId()) != B_ERROR));
// Send a notification, if appropriate // Send a notification, if appropriate
if (winFocused == false && AppPreferences::Get()->NotifyNewMessage if (winFocused == false && AppPreferences::Get()->NotifyNewMessage