When a subscriber deletes a subscription, an "unsubscribe" request is sent from subscriber to hub. Currently, the module does not handle these POSTs. I will post a patch.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | unsubscribe_1421994_6.patch | 8.25 KB | stevector |
| #5 | unsubscribe_1421994_5.patch | 8.21 KB | stevector |
| #3 | unsubscribe_1421994_3.patch | 4.91 KB | stevector |
| #1 | unsubscribe-1421994-1.patch | 2.43 KB | stevector |
Comments
Comment #1
stevectorThis patch also switches exit() to drupal_exit().
Comment #2
Crell commentedSince the code that follows assumes an array, we should type-specify array here and make it explicit. Any code that breaks is already broken.
This needs an isset() check to avoid a notice, or else provide a default value.
I would almost say the code would be cleaner by just doing a $post += array_of_empty_strings early on. That's a common tactic.
Needs to be broken to a new line.
Also, let's move the condition checking up to the menu callback, then have the menu callback fork to either a subscribe() method or an unsubscribe() method. The menu callback can even handle the parsing of $_POST into proper method parameters to make the code more readable and self-documenting rather than passing $_POST around (which is always icky and sometimes a security hole).
Comment #3
stevectorThis revised patch changes a few things
Comment #4
Crell commentedWoah, momma, that's some error checking! :-) I definitely like this better.
$post should be explicitly documented as an array.
$post should be explicitly declared as an array, since the code will break otherwise.
Also, since this doesn't really represent a post anymore but the hub command, should it be named differently?
Is there a reason this cannot/should not be made method parameters instead of an array? If it's an array, the legal keys should be documented in the docblock.
Ibid.
Comment #5
stevectorI'd like to keep it as an array since outside of Drupal Pubsubhubbub is built on arrays like this. I think it makes the code more accessible.
I have added documentation to the methods. Much of it is copied directly from the spec: http://pubsubhubbub.googlecode.com/svn/trunk/pubsubhubbub-core-0.3.html#...
Comment #6
stevectorComment #7
stevectorForgot the inline array declaration in the method signatures.
Comment #8
Crell commentedw00t!
Comment #9
dasjothank you guys for working on this!
i don't really have time to maintain this module right now, so if you like, feel free to propose yourselfs at #1425142: Looking for (co-)maintainers
Comment #10
Crell commentedCommitted and pushed.