Cannot use #approve!, #cancel!, etc on subscription presences that include a status child
Closed this issue · 3 comments
Since Blather's switch to using decorators, if I receive the following stanza:
<presence from="mamu@localhost" to="blather@localhost" type="subscribe">
<status/>
</presence>
I get the following error if I try use the various #approve!, #cancel!, etc helpers on the object:
Invalid type (subscribed). Must be nil or unavailable
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/blather-0.7.1/lib/blather/stanza/presence/status.rb:139:in `type='
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/blather-0.7.1/lib/blather/stanza/presence/subscription.rb:44:in `approve!'
As far as I can tell, the VALID_TYPES constant from the Status class is severely limiting the allowed types for the response the helper methods are trying to generate. I'm not exactly sure how this should be fixed. For now, I've worked around it by removing the Status decorator if a Subscription decorator was added, but this eliminates my ability to access the status message.
Thanks for your time!
Have you tried using Blather from git, which includes 21c874d? I will get this released shortly.
Hi Ben,
Thanks for the speedy reply! I had somehow missed the commit you just referenced. It does indeed fix the issue. Looking forward to the next release.
Blather 0.8.0 released