Class Jabber::LastActivity::IqQueryLastActivity
In: lib/xmpp4r/last/iq/last.rb
Parent: IqQuery

Class for handling Last Activity queries (XEP-0012)

Methods

Public Instance methods

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).

[Source]

    # File lib/xmpp4r/last/iq/last.rb, line 28
28:       def seconds
29:         attributes['seconds'] ? attributes['seconds'].to_i : nil
30:       end

Set the number of seconds since last activity

[Source]

    # File lib/xmpp4r/last/iq/last.rb, line 34
34:       def seconds=(val)
35:         attributes['seconds'] = val.to_s
36:       end

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

[Source]

    # File lib/xmpp4r/last/iq/last.rb, line 41
41:       def set_second(val)
42:         self.seconds = val
43:         self
44:       end

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

[Source]

    # File lib/xmpp4r/last/iq/last.rb, line 61
61:       def set_status(val)
62:         self.status = val
63:         self
64:       end

For an offline user query, get the last status.

[Source]

    # File lib/xmpp4r/last/iq/last.rb, line 48
48:       def status
49:         self.text
50:       end

For an offline user query, set the last status.

[Source]

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

[Validate]