From b1bd7cef651f2d4c56e65faec531d1e055e878c5 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Sat, 19 Aug 2017 15:25:05 -0600 Subject: [PATCH] If reply is ANSI, ensure first few chars of message show that -- for detection --- core/fse.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/fse.js b/core/fse.js index 6d29fce2..32a7bdb3 100644 --- a/core/fse.js +++ b/core/fse.js @@ -319,7 +319,7 @@ exports.FullScreenEditorModule = exports.getModule = class FullScreenEditorModul buildMessage() { const headerValues = this.viewControllers.header.getFormData().value; - var msgOpts = { + const msgOpts = { areaTag : this.messageAreaTag, toUserName : headerValues.to, fromUserName : this.client.user.username, @@ -329,6 +329,14 @@ exports.FullScreenEditorModule = exports.getModule = class FullScreenEditorModul if(this.isReply()) { msgOpts.replyToMsgId = this.replyToMessage.messageId; + + if(this.replyIsAnsi) { + // + // Ensure first characters indicate ANSI for detection down + // the line (other boards/etc.) + // + msgOpts.message = `${ansi.normal()}${msgOpts.message}`; + } } this.message = new Message(msgOpts); @@ -875,11 +883,13 @@ exports.FullScreenEditorModule = exports.getModule = class FullScreenEditorModul ansiResetSgr : bodyView.styleSGR1, ansiFocusPrefixSgr : quoteView.styleSGR2, }, - (err, quoteLines, focusQuoteLines) => { + (err, quoteLines, focusQuoteLines, replyIsAnsi) => { if(err) { return callback(err); } + self.replyIsAnsi = replyIsAnsi; + quoteView.setItems(quoteLines); quoteView.setFocusItems(focusQuoteLines);