Well, I hate to create more issues when I'm neglecting the others :(
However, I needed to clear more caches when messages are marked as 'read' so here is a new hook to do just that.
Patch on the way.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 1054082-status_changed3.patch | 2.22 KB | te-brian |
| #3 | 1054082-status_change2.patch | 2.19 KB | te-brian |
| #1 | 1054082_status_change.patch | 1.11 KB | te-brian |
Comments
Comment #1
te-brian commentedHere's the patch.
Comment #2
berdirHm, what about http://api.worldempire.ch/api/privatemsg/privatemsg.module/function/priv...?
In contrast to http://api.worldempire.ch/api/privatemsg/privatemsg.module/function/priv..., the status change function doesn't forward to the message function it executes a single query.
So I guess we should add two separate hooks here, and include message/thread in it.
The alternative would be changing the thread function to call message_status but we did it explicitly for performance reasons to avoid multiple queries. And even then, we should still rename the hook to include message.
Comment #3
te-brian commentedThis patch addresses your concern about http://api.worldempire.ch/api/privatemsg/privatemsg.module/function/priv... without needing a new hook or forcing that function to call privatemsg_message_change_status().
This approach is more performant than calling privatemsg_message_change_status() because it only adds one additional query instead of one per message.
It's also nice that modules only need to implement one hook. Note: if a module really wants to respond to the thread change, they can already do so via the .._operation_executed() hook we added.
Comment #4
te-brian commentedComment #5
te-brian commentedChanged hook name to "privatemsg_message_status_changed".
Comment #7
berdir#5: 1054082-status_changed3.patch queued for re-testing.
Comment #8
berdirCommited!
Resurrected and updated #750566: Add message delete changed hook and update thread_change_delete() to work like thread_change_status()
Comment #9
berdirCommited to 7.x.
Also fixed a bug in the 6.x version of this patch: You should use "<>" instead of "!=" in sql queries.