{
ActivityList activitiesToRemove;
for (const auto &activity : _finalList) {
- if (activity._objectType == QStringLiteral("chat") && !newActivities.contains(activity)) {
+ const auto isTalkActiity = activity._objectType == QStringLiteral("chat") ||
+ activity._objectType == QStringLiteral("call");
+ if (isTalkActiity && !newActivities.contains(activity)) {
activitiesToRemove.push_back(activity);
}
}
!notificationAlreadyShown(notificationId);
}
-void User::checkAndRemoveSeenActivities(const ActivityList &list, const int numChatNotificationsReceived)
+void User::checkAndRemoveSeenActivities(const ActivityList &list, const int numTalkNotificationsReceived)
{
- if (numChatNotificationsReceived < _lastChatNotificationsReceivedCount) {
+ if (numTalkNotificationsReceived < _lastTalkNotificationsReceivedCount) {
_activityModel->checkAndRemoveSeenActivities(list);
}
- _lastChatNotificationsReceivedCount = numChatNotificationsReceived;
+ _lastTalkNotificationsReceivedCount = numTalkNotificationsReceived;
}
void User::showDesktopNotification(const QString &title, const QString &message, const long notificationId)
void User::slotBuildNotificationDisplay(const ActivityList &list)
{
- const auto chatNotificationsReceivedCount = std::count_if(std::cbegin(list), std::cend(list), [](const auto &activity) {
- return activity._objectType == QStringLiteral("chat");
+ const auto talkNotificationsReceivedCount = std::count_if(std::cbegin(list), std::cend(list), [](const auto &activity) {
+ return activity._objectType == QStringLiteral("chat") ||
+ activity._objectType == QStringLiteral("call");
});
- checkAndRemoveSeenActivities(list, chatNotificationsReceivedCount);
+ checkAndRemoveSeenActivities(list, talkNotificationsReceivedCount);
ActivityList toNotifyList;
bool notificationAlreadyShown(const long notificationId);
bool canShowNotification(const long notificationId);
- void checkAndRemoveSeenActivities(const ActivityList &list, const int numChatNotificationsReceived);
+ void checkAndRemoveSeenActivities(const ActivityList &list, const int numTalkNotificationsReceived);
AccountStatePtr _account;
bool _isCurrentUser;
// no query for notifications is started.
int _notificationRequestsRunning = 0;
- int _lastChatNotificationsReceivedCount = 0;
+ int _lastTalkNotificationsReceivedCount = 0;
bool _isNotificationFetchRunning = false;
};