aboutsummaryrefslogtreecommitdiff
path: root/vnext/server
diff options
context:
space:
mode:
Diffstat (limited to 'vnext/server')
-rw-r--r--vnext/server/common/MessageUtils.js5
-rw-r--r--vnext/server/durov.js2
2 files changed, 4 insertions, 3 deletions
diff --git a/vnext/server/common/MessageUtils.js b/vnext/server/common/MessageUtils.js
index bb3d791f8..d3c6a0f58 100644
--- a/vnext/server/common/MessageUtils.js
+++ b/vnext/server/common/MessageUtils.js
@@ -39,11 +39,12 @@ export function formatTitle(msg) {
/**
* format notification quote
* @param { import('../../src/api').Message } msg message
+ * @param { boolean } isDurov format to Telegram markup
* @returns {string} formatted quote line
*/
-export function formatQuote(msg) {
+export function formatQuote(msg, isDurov = false) {
if (isReply(msg)) {
- return msg.replyQuote || ''
+ return msg.replyQuote ? isDurov ? `<blockquote>${msg.replyQuote.substring(1)}</blockquote>` : msg.replyQuote : ''
} else if (isPM(msg)) {
return ''
}
diff --git a/vnext/server/durov.js b/vnext/server/durov.js
index 6ab1831fd..51996b9e1 100644
--- a/vnext/server/durov.js
+++ b/vnext/server/durov.js
@@ -41,7 +41,7 @@ export const sendTelegramNotification = (msg, subscribers) => {
log(`Telegram event: ${JSON.stringify(msg)}, ${subscribers} ${subscribers.length}`)
if (!msg.service) {
if (subscribers && subscribers.includes(demouser)) {
- const message = `${formatTitle(msg)}\n${formatQuote(msg)}\n${format(msg.body, msg.uid, false)}`
+ const message = `${formatTitle(msg)}\n${formatQuote(msg, true)}\n${format(msg.body, msg.uid, false, true)}`
log(message)
sender.sendMessage(demouser, message, {
parse_mode: 'HTML',