Module: Jabber::PubSub::OAuthPubSubStreamHelper

Defined in:
lib/xmpp4r/pubsub/helper/oauth_service_helper.rb

Overview

Jabber::Stream helper that will transparently sign PubSub requests

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#oauth_consumerObject

Returns the value of attribute oauth_consumer.



5
6
7
# File 'lib/xmpp4r/pubsub/helper/oauth_service_helper.rb', line 5

def oauth_consumer
  @oauth_consumer
end

#oauth_optionsObject

Returns the value of attribute oauth_options.



5
6
7
# File 'lib/xmpp4r/pubsub/helper/oauth_service_helper.rb', line 5

def oauth_options
  @oauth_options
end

#oauth_tokenObject

Returns the value of attribute oauth_token.



5
6
7
# File 'lib/xmpp4r/pubsub/helper/oauth_service_helper.rb', line 5

def oauth_token
  @oauth_token
end

#pubsubjidObject

Returns the value of attribute pubsubjid.



5
6
7
# File 'lib/xmpp4r/pubsub/helper/oauth_service_helper.rb', line 5

def pubsubjid
  @pubsubjid
end

Instance Method Details

#send_with_id(iq) ⇒ Object

enhanced #send_with_id method that signs stanzas



8
9
10
11
12
13
14
15
# File 'lib/xmpp4r/pubsub/helper/oauth_service_helper.rb', line 8

def send_with_id(iq)
  if iq.first_element("pubsub")
    oauth = OAuthServiceHelper.create_oauth_node(self.jid, self.pubsubjid, self.oauth_consumer, self.oauth_token, self.oauth_options)
    iq.pubsub.add(oauth)
  end

  super(iq)
end