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.

Comments

te-brian’s picture

Status: Active » Needs review
StatusFileSize
new1.11 KB

Here's the patch.

berdir’s picture

Status: Needs review » Needs work

Hm, 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.

te-brian’s picture

StatusFileSize
new2.19 KB

This 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.

te-brian’s picture

Status: Needs work » Needs review
te-brian’s picture

StatusFileSize
new2.22 KB

Changed hook name to "privatemsg_message_status_changed".

Status: Needs review » Needs work

The last submitted patch, 1054082-status_changed3.patch, failed testing.

berdir’s picture

Status: Needs work » Needs review

#5: 1054082-status_changed3.patch queued for re-testing.

berdir’s picture

Version: » 7.x-1.x-dev
Status: Needs review » Patch (to be ported)
berdir’s picture

Status: Patch (to be ported) » Fixed

Commited to 7.x.

Also fixed a bug in the 6.x version of this patch: You should use "<>" instead of "!=" in sql queries.

Status: Fixed » Closed (fixed)

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