aboutsummaryrefslogtreecommitdiff
path: root/mod/messages
diff options
context:
space:
mode:
Diffstat (limited to 'mod/messages')
-rw-r--r--mod/messages/pages/messages/read.php2
-rw-r--r--mod/messages/start.php10
2 files changed, 3 insertions, 9 deletions
diff --git a/mod/messages/pages/messages/read.php b/mod/messages/pages/messages/read.php
index d41551be4..19e3ecdd7 100644
--- a/mod/messages/pages/messages/read.php
+++ b/mod/messages/pages/messages/read.php
@@ -9,7 +9,7 @@ gatekeeper();
$message = get_entity(get_input('guid'));
if (!$message) {
- forward();
+ forward('messages/inbox');
}
// mark the message as read
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);
}
/**