aboutsummaryrefslogtreecommitdiff
path: root/mod/messages/start.php
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2012-06-19 20:12:49 -0400
committercash <cash.costello@gmail.com>2012-06-19 20:12:49 -0400
commitacb6ceb71afa00a66280f4d33e952df39729eca6 (patch)
treef73d5ea8c120a8f8fe695efb6389c68373dab802 /mod/messages/start.php
parente3222535a07e39ffe506eb9688db515798ebf2a4 (diff)
downloadelgg-acb6ceb71afa00a66280f4d33e952df39729eca6.tar.gz
elgg-acb6ceb71afa00a66280f4d33e952df39729eca6.tar.bz2
Fixes #4608 optimizes messages_count_unread() - from Jeroen
Diffstat (limited to 'mod/messages/start.php')
-rw-r--r--mod/messages/start.php10
1 files changed, 2 insertions, 8 deletions
diff --git a/mod/messages/start.php b/mod/messages/start.php
index 1a2709324..2e61d6e21 100644
--- a/mod/messages/start.php
+++ b/mod/messages/start.php
@@ -356,16 +356,10 @@ function messages_count_unread() {
"msg_msg.name_id='{$map['msg']}' AND msg_msg.value_id='{$map[1]}'",
),
'owner_guid' => $user_guid,
- 'limit' => 0
+ 'count' => true,
);
- $num_messages = elgg_get_entities_from_metadata($options);
-
- if (is_array($num_messages)) {
- return sizeof($num_messages);
- }
-
- return 0;
+ return elgg_get_entities_from_metadata($options);
}
/**