class Jabber::LastActivity::IqQueryLastActivity

Class for handling Last Activity queries (XEP-0012)

Public Instance Methods

seconds() click to toggle source

Get the number of seconds since last activity.

With a bare jid, this will return the number of seconds since the client was last seen (offline user query).

With a full jid, this will return the number of seconds that the client has been idle (online user query).

With a server, this will return the server or component's uptime in seconds (server / component query).

# File lib/xmpp4r/last/iq/last.rb, line 28
def seconds
  attributes['seconds'] ? attributes['seconds'].to_i : nil
end
seconds=(val) click to toggle source

Set the number of seconds since last activity

# File lib/xmpp4r/last/iq/last.rb, line 34
def seconds=(val)
  attributes['seconds'] = val.to_s
end
set_second(val) click to toggle source

Set the number of seconds since last activity (chaining-friendly)

# File lib/xmpp4r/last/iq/last.rb, line 41
def set_second(val)
  self.seconds = val
  self
end
set_status(val) click to toggle source

For an offline user query, set the last status. (chaining-friendly)

# File lib/xmpp4r/last/iq/last.rb, line 61
def set_status(val)
  self.status = val
  self
end
status() click to toggle source

For an offline user query, get the last status.

# File lib/xmpp4r/last/iq/last.rb, line 48
def status
  self.text
end
status=(val) click to toggle source

For an offline user query, set the last status.

# File lib/xmpp4r/last/iq/last.rb, line 54
def status=(val)
  self.text = val
end