diff --git a/docs/events.md b/docs/events.md index ebc4bbc..caec0b7 100644 --- a/docs/events.md +++ b/docs/events.md @@ -596,8 +596,8 @@ Not all of these options will be available. Some will be missing depending on th **whowas** -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. +The response root includes the latest data from `whowas[0]` to maintain backwards compatibility. +The `whowas` array contains all RPL_WHOWASUSER responses with the newest being first. If the requested user was not found, `error` will contain 'no_such_nick'. @@ -616,7 +616,7 @@ If the requested user was not found, `error` will contain 'no_such_nick'. server_info: 'Thu Jun 14 09:15:51 2018', account: 'logged on account', error: '' - historical: [ + whowas: [ { ... }, { ... }, ] diff --git a/src/commands/handlers/user.js b/src/commands/handlers/user.js index 7f50f9b..99625d6 100644 --- a/src/commands/handlers/user.js +++ b/src/commands/handlers/user.js @@ -367,8 +367,8 @@ const handlers = { // after all prior RPL_WHOWASUSER pushed newer events onto the history stack // push the last one to complete the set (server returns from newest to oldest) + whowas_cache.whowas = whowas_cache.whowas || []; if (!whois_cache.error) { - whowas_cache.whowas = whowas_cache.whowas || []; whowas_cache.whowas.push(_.cloneDeep(whois_cache)); Object.assign(whowas_cache, _.cloneDeep(whowas_cache.whowas[0])); } else {