You are here

function privatemsg_message_change_status in Privatemsg 6

Same name and namespace in other branches
  1. 6.2 privatemsg.module \privatemsg_message_change_status()
  2. 7.2 privatemsg.module \privatemsg_message_change_status()
  3. 7 privatemsg.module \privatemsg_message_change_status()

Changes the read/new status of a single message.

Parameters

$pmid: Message id

$status: Either PRIVATEMSG_READ or PRIVATEMSG_UNREAD

$account: User object, defaults to the current user

2 calls to privatemsg_message_change_status()
privatemsg_update_6003 in ./privatemsg.install
Update function to resolve "forever new" messages.
privatemsg_view in ./privatemsg.module
Menu callback for viewing a thread.

File

./privatemsg.module, line 709
Allows users to send private messages to other users.

Code

function privatemsg_message_change_status($pmid, $status, $account = NULL) {
  if (!$account) {
    global $user;
    $account = $user;
  }
  $query = "UPDATE {pm_index} SET is_new = %d WHERE mid = %d AND uid = %d";
  db_query($query, $status, $pmid, $account->uid);
}