Skip to content

Commit

Permalink
Replace newlines with ". " so we can fit them on.
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot committed Aug 14, 2018
1 parent e8c6a32 commit 6e0ac53
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/bridge/MatrixHandler.js
Expand Up @@ -1287,6 +1287,9 @@ MatrixHandler.prototype._sendIrcAction = Promise.coroutine(
rplName = this._eventCache.get(eventId).sender;
rplSource = this._eventCache.get(eventId).body;
}
// Replace newlines so we can fit this in the message body.
// It's not a perfect solution but it's legible.
rplSource = rplSource.replace(/\v/, '. ');
rplSource = rplSource.substr(0, REPLY_SOURCE_MAX_LENGTH) +
(rplSource.length > REPLY_SOURCE_MAX_LENGTH ? "..." : "");
const rplText = match[3];
Expand Down

0 comments on commit 6e0ac53

Please sign in to comment.