]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #4608 optimizes messages_count_unread() - from Jeroen
authorcash <cash.costello@gmail.com>
Wed, 20 Jun 2012 00:12:49 +0000 (20:12 -0400)
committercash <cash.costello@gmail.com>
Wed, 20 Jun 2012 00:12:49 +0000 (20:12 -0400)
mod/messages/start.php

index 1a27093248c350712e77dd93e094a3740d383a3a..2e61d6e21c02994f851bfa27127176bbd18aab2c 100644 (file)
@@ -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);
 }
 
 /**