message: Use pending to store potential nicks
diff: @@ -124,7 +124,8 @@ ClientPool.prototype.createIrcClient = function(ircClientConfig, matrixUser, isB
  if (this._virtualClients[server.domain] === undefined) {
  this._virtualClients[server.domain] = {
  nicks: Object.create(null),
  - userIds: Object.create(null)
  + userIds: Object.create(null),
  + pending: {},
  };
  this._virtualClientCounts[server.domain] = 0;
  }
  @@ -132,6 +133,14 @@ ClientPool.prototype.createIrcClient = function(ircClientConfig, matrixUser, isB
  this._botClients[server.domain] = bridgedClient;
  }
  + // `pending` is used to ensure that we know if a nick belongs to a userId
  + // before they have been connected. It's impossible to know for sure
  + // what nick they will be assigned before being connected, but this
  + // should catch most cases. Knowing the nick is important, because
  + // slow clients may not send a 'client-connected' signal before a join is
  + // emitted, which means ghost users may join with their nickname into matrix.
  + this._virtualClients[server.domain].pending[bridgedClient.nick] = bridgedClient.userId;
  +
  // add event listeners
  bridgedClient.on("client-connected", this._onClientConnected.bind(this));
  bridgedClient.on("client-disconnected", this._onClientDisconnected.bind(this));
  @@ -338,6 +347,9 @@ ClientPool.prototype._onClientConnected = function(bridgedClient) {
  var oldNick = bridgedClient.nick;
  var actualNick = bridgedClient.unsafeClient.nick;
  + // remove the pending nick we had set for this user
  + delete this._virtualClients[server.domain].pending[oldNick];
  +
  // assign a nick to this client
  this._virtualClients[server.domain].nicks[actualNick] = bridgedClient;
  @@ -352,6 +364,9 @@ ClientPool.prototype._onClientDisconnected = function(bridgedClient) {
  this._removeBridgedClient(bridgedClient);
  this._sendConnectionMetric(bridgedClient.server);
  + // remove the pending nick we had set for this user
  + delete this._virtualClients[bridgedClient.nick].pending[oldNick];
  +
  if (bridgedClient.disconnectReason === "banned") {
  const req = new BridgeRequest(this._ircBridge._bridge.getRequestFactory().newRequest());
  this._ircBridge.matrixHandler.quitUser(
  