Class: Jabber::LastActivity::Helper
- Inherits:
-
Object
- Object
- Jabber::LastActivity::Helper
- Defined in:
- lib/xmpp4r/last/helper/helper.rb
Overview
A Helper to manage discovery of Last Activity.
Instance Method Summary (collapse)
-
- (Object) get_last_activity_from(jid)
Gets the last activity from a JID.
-
- (Helper) initialize(client)
constructor
A new instance of Helper.
Constructor Details
- (Helper) initialize(client)
A new instance of Helper
13 14 15 |
# File 'lib/xmpp4r/last/helper/helper.rb', line 13 def initialize(client) @stream = client end |
Instance Method Details
- (Object) get_last_activity_from(jid)
Gets the last activity from a JID.
jid |
|
return |
|
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/xmpp4r/last/helper/helper.rb', line 21 def get_last_activity_from(jid) iq = Jabber::Iq.new(:get, jid) iq.from = @stream.jid iq.add(Jabber::LastActivity::IqQueryLastActivity.new) reply = @stream.send_with_id(iq) if reply.query && reply.query.kind_of?(IqQueryLastActivity) reply.query else nil end end |