summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--privatemsg.module4
1 files changed, 2 insertions, 2 deletions
diff --git a/privatemsg.module b/privatemsg.module
index 481cfd6..3875b53 100644
--- a/privatemsg.module
+++ b/privatemsg.module
@@ -529,7 +529,7 @@ function _privatemsg_send($sender, $recipient, $subject, $body, $format) {
function privatemsg_view($message_id) {
global $user;
- $result = db_query('SELECT p.id, u.uid, u.name, p.author, p.timestamp, p.subject, p.message, p.newmsg, p.recipient, p.format FROM {privatemsg} p, {users} u WHERE (recipient = %d OR author = %d) AND author = u.uid AND id = %d', $user->uid, $user->uid, $message_id);
+ $result = db_query('SELECT p.id, u.uid, u.name, p.author, p.timestamp, p.subject, p.message, p.newmsg, p.recipient, p.folder, p.format FROM {privatemsg} p, {users} u WHERE (recipient = %d OR author = %d) AND author = u.uid AND id = %d', $user->uid, $user->uid, $message_id);
$message = db_fetch_object($result);
if ($message->newmsg && $user->uid == $message->recipient) {
@@ -643,7 +643,7 @@ function theme_privatemsg_view($message) {
$links[] = l(t('Delete this message'), 'privatemsg/delete/'. $message->id, array('onclick' => "return confirm('". t('Are you sure to delete this message?') ."')"));
}
- $links[] = l(t('List messages'), $message->folder ? 'privatemsg/list/'. $message->folder : 'privatemsg');
+ $links[] = l(t('List messages'), ($message->recipient == $user->uid && $message->folder) ? 'privatemsg/list/'. $message->folder : 'privatemsg');
$body .= '<div class="links">'. theme('links', $links) .'</div>';
}
else {