Tip of the day: Did you know that users are put in the security-group known-users based on their reputation score or if they are identified to Services?

Users in this group receive a number of benefits, such as being able to send more messages per minute.

JSON-RPC:Whowas

From UnrealIRCd documentation wiki
Jump to navigation Jump to search

The whowas.* JSON RPC calls retrieve whowas history of users.

Requires UnrealIRCd 6.1.0 or later.

Structure of a whowas object

A "Whowas object" is used in responses.

The Whowas object looks similar to the Client Object (including an User Object) but is different in the sense that many fields are omitted, and some fields only exist for whowas entries (event, logon_time, logoff_time).

Detail level Variable Description Example value
0+ name The name of the client (nick name, server name, ..) Syzop
0+ event Event that caused the WHOWAS entry to be added, one of: quit, nick-change or server-terminating quit
0+ logon_time Date/time when the nickname logged on (since last NICK change, or if none then identical to connected_since) 2022-05-23T11:02:06.000Z
0+ logoff_time Date/time when the nickname logged off (when the nick change or quit happened) 2022-05-23T11:02:06.000Z
1+ hostname Resolved hostname (or IP) xyz.example.org
1+ ip IP address of the user (empty for services) 198.51.100.1
1+ details Detailed description of the client.
The output depends on the type of client and what information we have.
nick!user@host

[email protected]
[198.51.100.1]

2+ connected_since Date/time when the client connected 2022-05-23T11:02:06.000Z
2+ user.username The user name / ident ~xyz
2+ user.realname The real name / GECOS IRC User
2+ user.vhost If the user is +x or +t this contains the vhost/cloakedhost oper/netadmin.test.net
2+ user.servername The server to which the user is connected irc.example.net
2+ user.account The account name, if the user is logged in to Services. SomeAccount

API Calls

whowas.get

Get WHOWAS history of a user. 6.1.0+

Request arguments

Optional arguments:

  • nick: the nick name to search for
  • ip: the IP address to search for
  • object_detail_level: set the detail of the response object, this is similar to the Detail level column in Structure of a client object. In this RPC call it defaults to 2 if this parameter is not specified.

Result

A list of matches (which can be 0, 1 or more). The list of matches contains something similar to a client object, but is not identical, because many client fields are not present in whowas history. It also has the extra field logoff_time which indicates when the user went offline (for whatever reason).

Example

{"jsonrpc": "2.0", "method": "whowas.get", "params": {"nick":"ABCD"}, "id": 123}