Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsOnlyBinary committed Aug 28, 2024
1 parent 3403e3a commit b9d4fd7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
11 changes: 7 additions & 4 deletions docs/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -596,18 +596,21 @@ Not all of these options will be available. Some will be missing depending on th

**whowas**

The response includes the latest known data.
If more than one RPL_WHOWASUSER is returned by the server, older ones
are stored in the same format in the 'historical' array from newest to oldest.
The response root includes the latest data `historical[0]` to maintain backwards compatibility.
The `historical` array contains all RPL_WHOWASUSER responses with the newest being first.

If the requested user was not found, `error` will contain 'no_such_nick'.

> Note: The available data can vary depending on the network.
If the requested user was not found, error will contain 'no_such_nick'.
~~~javascript
{
nick: 'prawnsalad',
ident: 'prawn',
hostname: 'manchester.isp.net',
actual_ip: 'sometimes set when using webirc, could be the same as actual_hostname',
actual_hostname: 'sometimes set when using webirc',
actual_username: 'prawn',
real_name: 'A real prawn',
server: 'irc.server.net',
server_info: 'Thu Jun 14 09:15:51 2018',
Expand Down
10 changes: 2 additions & 8 deletions src/commands/handlers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@ const handlers = {
const host = user_host.substring(mask_sep + 1);

if (host) {
cache.actual_user = user;
cache.actual_host = host;
cache.actual_username = user;
cache.actual_username = host;
}
},

Expand Down Expand Up @@ -392,12 +392,6 @@ const handlers = {
const event = _.cloneDeep(whowas_cache.historical[0]);
event.historical = whowas_cache.historical;

// Should, in theory, never happen.
if (!event.nick) {
event.nick = command.params[1];
event.error = 'no_such_nick';
}

handler.emit('whowas', event);
whois_cache.destroy();
whowas_cache.destroy();
Expand Down

0 comments on commit b9d4fd7

Please sign in to comment.