mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
MDL-63913 core_message: fix to ensure favourites is exclusive
If a conversation is included in the favourites unread count, it cannot be included in any other type-based counts.
This commit is contained in:
parent
33022ee1d5
commit
a54115355a
2 changed files with 12 additions and 6 deletions
|
@ -2968,10 +2968,11 @@ class api {
|
|||
self::MESSAGE_CONVERSATION_TYPE_GROUP => 0
|
||||
]];
|
||||
foreach ($unreadcounts as $convid => $info) {
|
||||
$counts['types'][$info->type]++;
|
||||
if (isset($favouriteconvids[$convid])) {
|
||||
$counts['favourites']++;
|
||||
continue;
|
||||
}
|
||||
$counts['types'][$info->type]++;
|
||||
}
|
||||
|
||||
return $counts;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue