I needed to clear some caches based on on the thread operations on the main 'inbox'.
Here is a patch that adds a new hook so other modules can see when operations are performed.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | privatemsg-operation-execute.patch | 1.39 KB | te-brian |
| privatemsg-operation-execute.patch | 1.45 KB | te-brian |
Comments
Comment #1
berdir- Why is $account optional here? I think we should define it as a required argument, makes implementing the hook easier.
- @see is usually at the end of a docblock.
- Maybe something like "An array which contains the thread ids on which the operation has been executed." instead of your current sentence?
No need to use module_implements directly?
This should be exactly the same:
module_invoke_all('privatemsg_operation_executed', $operation, $threads, $account);
Edit: Doing it manually is only required when you are passing arguments by reference but aren't using an _alter() hook.
Powered by Dreditor.
Comment #2
te-brian commented$account is optional in privatemsg_operation_execute(), from which this hook is invoked. So it can't require account unless we know there will be one.
The other changes make sense.
Comment #3
berdirAh, makes sense.
Looking at where the privatemsg_operation_execute() is called, this is a possible bug when viewing messages of an other user. Looks like we might need a separate issue that makes $account required for both.
Comment #4
te-brian commentedImplemented some of the discussed changes.
Comment #5
berdirThanks commited.
This will need to be added to 7.x too. Patch will likely apply there too, testbot can check that.
Comment #6
berdir#4: privatemsg-operation-execute.patch queued for re-testing.
Comment #7
berdirCommited.