Sha256: b6a74926aead86f515ffb7976f869d571a4ad13b7c4e69e4328e4c18e475b789

Contents?: true

Size: 517 Bytes

Versions: 3

Compression:

Stored size: 517 Bytes

Contents

class UnsubscribeQueryStanza < IqQueryStanza
  
  def initialize(params)
    super(params.merge({:type => :set}))
    pubsub = Nokogiri::XML::Node.new("pubsub", @doc)
    pubsub["xmlns"] = "http://jabber.org/protocol/pubsub"
    @iq.add_child(pubsub)
    unsubscribe = Nokogiri::XML::Node.new("unsubscribe", @doc)
    unsubscribe["node"] = params[:node].to_s
    unsubscribe["jid"] = from.split("/").first
    pubsub.add_child(unsubscribe)
  end 
  
  def node
    @iq.search("unsubscribe").first["node"]
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
superfeedr-superfeedr-ruby-0.2.1 lib/stanzas/unsubscribe_query_stanza.rb
superfeedr-superfeedr-ruby-0.3.0 lib/stanzas/unsubscribe_query_stanza.rb
superfeedr-superfeedr-ruby-0.3.1 lib/stanzas/unsubscribe_query_stanza.rb