From acb6ceb71afa00a66280f4d33e952df39729eca6 Mon Sep 17 00:00:00 2001 From: cash Date: Tue, 19 Jun 2012 20:12:49 -0400 Subject: Fixes #4608 optimizes messages_count_unread() - from Jeroen --- mod/messages/start.php | 10 ++-------- 1 file 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); } /** -- cgit v1.2.3