A Helper to manage discovery of Last Activity.
# File lib/xmpp4r/last/helper/helper.rb, line 13 def initialize(client) @stream = client end
Gets the last activity from a JID.
# 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