Class: Blather::Stanza::PubSub::Unsubscribe

Inherits:
Blather::Stanza::PubSub show all
Defined in:
lib/blather/unsubscribe.rb

Constant Summary collapse

PREFIX =
"unsub"

Class Method Summary collapse

Class Method Details

.new(type = :set, host = nil, node = nil, jid = nil, unsub_id = nil) ⇒ Object

Patch to set the id of the unsubscription request so the reply can be cross-referenced (see examples/sub_unsub.rb)



8
9
10
11
12
13
14
# File 'lib/blather/unsubscribe.rb', line 8

def self.new(type = :set, host = nil, node = nil, jid = nil, unsub_id = nil)
  new_node = super(type, host)
  new_node.node = node
  new_node.jid = jid
  new_node.id = unsub_id || "#{PREFIX}_#{node}"
  new_node
end