message: De-op users who are leaving the room on the IRC side.
diff: @@ -65,6 +65,7 @@ function IrcHandler(ircBridge, config) {
  // kickReason: string,
  // retry: boolean,
  // req: Request,
  + // deop: boolean,
  //}
  this._leaveQueue = new QueuePool(
  config.leaveConcurrency || LEAVE_CONCURRENCY,
  @@ -746,6 +747,7 @@ IrcHandler.prototype.onKick = Promise.coroutine(function*(req, server,
  shouldKick: false,
  retry: true,
  req,
  + deop: true, // deop real irc users, likereal irc.
  });
  }
  });
  @@ -820,6 +822,7 @@ IrcHandler.prototype.onPart = Promise.coroutine(function*(req, server, leavingUs
  req,
  kickReason: "Client PARTed from channel", // this will only be used if shouldKick is true
  retry: true, // We must retry these so that membership isn't leaked.
  + deop: !leavingUser.isVirtual, // deop real irc users, likereal irc.
  });
  stats.membership(true, "part");
  yield promise;
  @@ -941,6 +944,15 @@ IrcHandler.prototype._handleLeaveQueue = async function(item) {
  else {
  await bridge.getIntent(item.userId).leave(roomId);
  }
  + if (item.deop) {
  + try {
  + await this.powerlevelSyncer.removePowerLevels(roomId, [item.userId]);
  + }
  + catch (ex) {
  + // This is non-critical but annoying.
  + item.req.log.warn("Failed to remove power levels for leaving user.");
  + }
  + }
  }
  catch (ex) {
  item.req.log.warn(
  