Closed (fixed)
Project:
Push Notifications
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
31 Jul 2012 at 01:57 UTC
Updated:
2 Aug 2012 at 15:17 UTC
Jump to comment: Most recent file
Comments
Comment #1
webkenny commentedOriginal thoughts. Seems modifying only the token is probably the best idea right now. Another implementation may need to add a lot of lines to convert the 3 variables into an array and then back out again. If we think it'll be useful, I'll do so. In the meantime, thinking of rolling this patch. Feedback welcome:
If they decide to set $token to false, it will not write anything. Could be useful for doing additional access checks not covered by the module itself. (e.g. is the user part of a group)
Comment #2
haagendazs commentedHi webkenny,
Great idea to add a hook that allows other modules to modify the token if they need to. My suggestion for adding the hook would be changing the name to 'push_notifications_store_token' and change it as following:
This way, other modules could implement the hook and pass the token by reference, for example
What do you think?
Comment #3
haagendazs commentedSmall change: I noticed that you probably need the type_id and uid in the hook. With that in mind, the change should probably be:
Other modules could then use it like this:
Comment #4
webkenny commentedExcellent! I was, in fact, hoping to pass all 3 but only have to modify token if needed. Beautifully done. :) Patch attached. I also added an api.php file to document the hook and any future ones we may consider.
Comment #5
haagendazs commentedThanks for the patch file and the additional api.php file. I applied the patch to the 7.x-1.x branch here: http://drupalcode.org/project/push_notifications.git/commit/f0d7e7b4ce1d....