Hi

after upgrade to drupal 6 and to privatemsg on drupal 6 (using patch in privatemsg issues because upgrade wasn't directly in module yet - 2 weeks ago)
Some of my users are sending me emails that they have permanent info about new messages in privatemsg menu and block, but actually they have no new messages in their inbox. They wrote that bug persists although they delete all their messages.

Do you have some idea for patch how to synchronize info about new messages with real state of users new messages?
Except this problem privatemsg works fine.

Thanks
Igorik
http://www.somvprahe.sk

Comments

naheemsays’s picture

can you verify from the database (phpmyadmin?) whether there actually are new messages for those users...

the query should be something like "SELECT * FROM pm_index WHERE new = 1 AND uid = {uid}"

replace the uid there with the actual users.

If there are results, that means that there are some unread messages there, (you should get a list of which ones), so the problem is in displaying the messages.

(also, are you using in integration modules such as messaging?)

igorik’s picture

Hi

I did you wrote on one concrete user and I found that:
In menu and block he has shown he has 2 new messages
In messages list he has no new messages in fact.
Sql query you worte to me returns 2 results:

mid thread_id uid new deleted
52377 52377 1409 1 1
52842 52842 1409 1 1

I don't use messaging with private messages. It is possible that I enabled this submodule some time ago (when i enabled notifications and messaging for the fist time) but I never use it.

Thanks
Igorik
http://www.somvprahe.sk

naheemsays’s picture

Version: 6.x-1.x-dev »
Status: Active » Needs review
StatusFileSize
new657 bytes

I see the problem - privatemsg version 5 allowed people to delete messages without reading them, and these messages have been "deleted".

However the current unread count is scanning through ALL messages, no matter if they have been deleted or not.

Attached patch should fix that.

(or you can run a query to set new = 0 where deleted = 1)

naheemsays’s picture

Title: there is some inconsistent after upgrade from drupal 5 with new messages » unread message count also includes deleted messages
berdir’s picture

The patch is fine, but I noticed that the privatemsg_unread_count() function is called up to 5 times (and atleast twice on every site because of the menu and the block), so I added a very simple cache using a static $unread variable.

berdir’s picture

Ups, the above patch had some debug code in it, which I forgot to remove.

This one should be fine

naheemsays’s picture

StatusFileSize
new1.23 KB

rerolled after current mega-patch.

andypost’s picture

StatusFileSize
new1.22 KB

This patch works fine but !is_null better to change to isset

andypost’s picture

StatusFileSize
new750 bytes

Reroll,

maybe count "unread" per tag?

naheemsays’s picture

Status: Needs review » Reviewed & tested by the community
naheemsays’s picture

patch is rtbc, but what do you mean by "count per tag"? is that in conjunction with the filter module? if so, the work for that will need to go there. No idea how you would display it either.

berdir’s picture

Is there a reason why you removed "my" caching stuff? It seems to got removed without reason, just wondering...

naheemsays’s picture

litwol’s picture

Berdir, your accounted only for a single user.

naheemsays’s picture

The patch in comment 9 still needs to go in.

Apart from that, do we need anything else for the beta release, or is it good to go?

litwol’s picture

Status: Reviewed & tested by the community » Fixed

Commited. thanks.

@nbz: i think we need ability to delete multiple messages in single delete. for example deleting whole thread rather than per thread reply deletion. after that some general code cleanup and out goes the RC1.

Status: Fixed » Closed (fixed)

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