Skip to content
Browse files

Pubsub: fix namespace for purge_items_from

Received from lfcipriani on github.com:
--------------------
Hi Lucas,

I found a simple but annoying bug on pubsub support of xmpp4r, I think
that
isn't worthy to clone and send a push request to you. So, here it is:

On method purge_items_from of service_helper.rb

      def purge_items_from(node)
        iq = basic_pubsub_query(:set)
        purge = REXML::Element.new('purge')
        purge.attributes['node'] = node
        iq.pubsub.add(purge)
        @stream.send_with_id(iq)
      end

The call to method basic_pubsub_query(:set) should be
basic_pubsub_query(:set, true), because the namespace of this command is
pubsub#owner.

That's it. Thanks for this really useful gem.
--------------------
  • Loading branch information...
1 parent a506a85 commit 37466c529b7ecf79e1a395c027d9b41335621737 @lnussbaum lnussbaum committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/xmpp4r/pubsub/helper/servicehelper.rb
View
2 lib/xmpp4r/pubsub/helper/servicehelper.rb
@@ -218,7 +218,7 @@ def delete_item_from(node, item_id)
# node:: [String]
# return:: true
def purge_items_from(node)
- iq = basic_pubsub_query(:set)
+ iq = basic_pubsub_query(:set, true)
purge = REXML::Element.new('purge')
purge.attributes['node'] = node
iq.pubsub.add(purge)

0 comments on commit 37466c5

Please sign in to comment.
Something went wrong with that request. Please try again.