Closed (fixed)
Project:
Privatemsg
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Feb 2011 at 22:17 UTC
Updated:
22 Feb 2011 at 21:50 UTC
Jump to comment: Most recent file
My module is printing a block with this count. The count is inaccurate after some messages change status because the static stores the incorrect count before the messages are changed.
Patch incoming.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 1054206-unread_count_reset4.patch | 679 bytes | te-brian |
| #3 | 1054206-unread_count_reset2.patch | 1.77 KB | te-brian |
| #1 | 1054206-unread_count_reset.patch | 871 bytes | te-brian |
Comments
Comment #1
te-brian commentedHere's the patch.
Comment #2
te-brian commentedKeep in mind that patch only 'resets' the value for the current $account. This is desirable for me because I'd rather leave the static values in place for other users.
However, it may be more 'standard' to clear the whole variable.
Comment #3
te-brian commentedBased on some IRC feedback, I changed the $reset flag so it clears the whole array of counts.
Also, I added two resets: One for when a message changes status and another for when a thread changes status.
I don't feel a clear is necessary in _privatemsg_send() because the user who sent the message will not receive an unread version of it (afaik).
These clears may move depending on what is committed in #1054082: Allow modules to respond to a status change.
Comment #4
te-brian commentedRe-rolled and also removed the resets (per IRC discussion).
Comment #5
berdirCommited, thanks!
No need to port to D7, thanks to drupal_static_reset().