Closed (fixed)
Project:
Privatemsg
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Feb 2011 at 20:24 UTC
Updated:
6 Mar 2011 at 11:51 UTC
Jump to comment: Most recent file
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.