message: Use the sender's virtual user to set topics
  And fallback to the bot if that doesn't work
diff: @@ -382,18 +382,22 @@ IrcHandler.prototype._serviceTopicQueue = Promise.coroutine(function*(item) {
  );
  return Promise.resolve();
  }
  - return this.ircBridge.getAppServiceBridge().getIntent().setRoomTopic(
  - entry.matrix.getId(),
  - item.topic
  - ).then(
  + return this.ircBridge.getAppServiceBridge().getIntent(
  + item.matrixUser.getId()
  + ).setRoomTopic(
  + entry.matrix.getId(), item.topic
  + ).catch(() => {
  + // Setter might not have powerlevels, trying again.
  + return this.ircBridge.getAppServiceBridge().getIntent()
  + .setRoomTopic(entry.matrix.getId(), item.topic);
  + }).then(
  () => {
  entry.matrix.topic = item.topic;
  return this.ircBridge.getStore().upsertRoomStoreEntry(entry);
  },
  (err) => {
  item.req.log.error(`Error storing room ${entry.matrix.getId()} (${err.message})`);
  - }
  - );
  + });
  });
  try {
  yield Promise.all(promises);
  @@ -422,18 +426,18 @@ IrcHandler.prototype.onTopic = Promise.coroutine(function*(req, server, fromUser
  server.domain, fromUser, channel, JSON.stringify(action).substring(0, 80)
  );
  - let topic = action.text;
  + const ALLOWED_ORIGINS = ["join", "alias"];
  + const topic = action.text;
  // Only bridge topics for rooms created by the bridge, via !join or an alias
  - let origins = ["join", "alias"];
  - let entries = yield this.ircBridge.getStore().getMappingsForChannelByOrigin(
  - server, channel, origins, true
  + const entries = yield this.ircBridge.getStore().getMappingsForChannelByOrigin(
  + server, channel, ALLOWED_ORIGINS, true
  );
  if (entries.length === 0) {
  req.log.info(
  "No mapped matrix rooms for IRC channel %s with origin = [%s]",
  channel,
  - origins
  + ALLOWED_ORIGINS
  );
  return;
  }
  @@ -443,12 +447,17 @@ IrcHandler.prototype.onTopic = Promise.coroutine(function*(req, server, fromUser
  channel,
  entries.map((e) => e.matrix.getId())
  );
  +
  + const matrixUser = new MatrixUser(
  + server.getUserIdFromNick(fromUser.nick)
  + );
  +
  if (!this.topicQueues[channel]) {
  this.topicQueues[channel] = new Queue(this._serviceTopicQueue.bind(this));
  }
  yield this.topicQueues[channel].enqueue(
  server.domain + " " + channel + " " + topic,
  - {req: req, entries: entries, topic: topic}
  + {req: req, entries: entries, topic: topic, matrixUser}
  );
  });
  