* skip merging xuan notifications with contentType of text, bug #19668, task #49980.

This commit is contained in:
Wenrui LI
2022-03-02 11:25:03 +08:00
parent 8f408df0f5
commit e23a1be570
@@ -192,7 +192,7 @@ class xuanxuanIm extends imModel
}
/**
* Merge notifications with same actor, objectType, actionType.
* Merge notifications with same actor, objectType, actionType. Notifications with contentType of 'text' won't be merged.
*
* @param array $notificationData
* @access public
@@ -209,11 +209,16 @@ class xuanxuanIm extends imModel
/* Group by $message->content->content->objectType, ...->parentType, ...->action, ...->actor */
$contentData = json_decode($message->content);
$contentData = json_decode($contentData->content);
if($contentData->contentType == 'text')
{
$messageGroups[$contentData->contentType][] = $message;
continue;
}
$messageGroups["$contentData->objectType-$contentData->parentType-$contentData->action-$contentData->actor"][] = $message;
}
foreach($messageGroups as $groupKey => $messages)
{
if(count($messages) < 2) continue;
if(count($messages) < 2 || $groupKey == 'text') continue;
$notification = current($messages);
array_shift($messages);