message: Store the reply text in the cache, not the whole message
diff: @@ -1263,24 +1263,27 @@ MatrixHandler.prototype._sendIrcAction = Promise.coroutine(
  yield this.ircBridge.sendIrcAction(ircRoom, ircClient, ircAction);
  return;
  }
  +
  + let text = event.content.body;
  + let cacheText = text;
  + if (event.content["m.relates_to"] && event.content["m.relates_to"]["m.in_reply_to"]) {
  + const reply = yield this._textForReplyEvent(event, ircRoom);
  + ircAction.text = text = reply.formatted;
  + cacheText = reply.reply;
  + }
  + this._eventCache.set(event.event_id, {
  + body: cacheText.substr(0, REPLY_SOURCE_MAX_LENGTH),
  + sender: event.sender
  + });
  +
  /**
  * Cache events in here so we can refer to them for replies.
  */
  - this._eventCache.set(event.event_id, {
  - body: event.content.body.substr(0, REPLY_SOURCE_MAX_LENGTH),
  - sender: event.sender }
  - );
  if (this._eventCache.size > this._eventCacheMaxSize) {
  const delKey = this._eventCache.entries().next().value[0];
  this._eventCache.delete(delKey);
  }
  - let text = event.content.body;
  - if (event.content["m.relates_to"] && event.content["m.relates_to"]["m.in_reply_to"]) {
  - text = yield this._textForReplyEvent(event, ircRoom);
  - ircAction.text = text;
  - }
  -
  // Check for the existance of the getSplitMessages method.
  if (!(ircClient.unsafeClient && ircClient.unsafeClient.getSplitMessages)) {
  yield this.ircBridge.sendIrcAction(ircRoom, ircClient, ircAction);
  @@ -1527,7 +1530,10 @@ MatrixHandler.prototype._textForReplyEvent = Promise.coroutine(function*(event,
  this._eventCache.set(eventId, {sender: rplName, body: rplSource});
  } catch (err) {
  // If we couldn't find the event, then frankly we can't trust it and we won't treat it as a reply.
  - return rplText;
  + return {
  + formatted: rplText,
  + reply: rplText,
  + };
  }
  }
  @@ -1560,7 +1566,10 @@ MatrixHandler.prototype._textForReplyEvent = Promise.coroutine(function*(event,
  );
  }
  - return `<${rplName}${rplSource}> ${rplText}`;
  + return {
  + formatted: `<${rplName}${rplSource}> ${rplText}`,
  + reply: rplText,
  + };
  }
  });
  