Class Jabber::LastActivity::Helper
In: lib/xmpp4r/last/helper/helper.rb
Parent: Object

A Helper to manage discovery of Last Activity.

Methods

Public Class methods

[Source]

    # File lib/xmpp4r/last/helper/helper.rb, line 13
13:       def initialize(client)
14:         @stream = client
15:       end

Public Instance methods

Gets the last activity from a JID.

jid:[JID]
return:[Jabber::LastActivity::IqQueryLastActivity]

[Source]

    # File lib/xmpp4r/last/helper/helper.rb, line 21
21:       def get_last_activity_from(jid)
22:         iq = Jabber::Iq.new(:get, jid)
23:         iq.from = @stream.jid
24:         iq.add(Jabber::LastActivity::IqQueryLastActivity.new)
25: 
26:         reply = @stream.send_with_id(iq)
27: 
28:         if reply.query && reply.query.kind_of?(IqQueryLastActivity)
29:           reply.query
30:         else
31:           nil
32:         end
33:       end

[Validate]