I was able to get this functionality to work properly by changing line 1603 from

db_query("UPDATE {privatemsg} SET newmsg = 0 WHERE id = %d", $message_id);

to

db_query("UPDATE {privatemsg} SET newmsg = 0 WHERE id = %d", $message->id);

In the _privatemsg_view function, $message->id is used rather than $message_id

Josh

Comments

cetron’s picture

It works for me... thanks

czarphanguye’s picture

Doesn't this break the nonfiction that the recipient got and read the message? *confused*

  $recipients = explode(',', $form_values['recipient']);
  $sent = FALSE;
  foreach ($recipients as $recipient) {
    $recipient = user_load(array('name' => trim($recipient)));
    $message_id = _privatemsg_send($user, $recipient, $form_values['subject'], $form_values['privatemsgbody'], $form_values['format'], $form_values['thread']);
    if ($message_id) {
      // Load the message for consistency.
      $message = privatemsg_load($message_id);
      // Tell the other modules a new private message has been sent.
      privatemsg_invoke_privatemsg($message, 'sent');
      $sent = TRUE;
    }
  }
Zen’s picture

Status: Needs review » Fixed

This appears to have been fixed (in mid August). Marking as such.

Thanks,
-K

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.