diff options
Diffstat (limited to 'vnext/server/common/MessageUtils.js')
-rw-r--r-- | vnext/server/common/MessageUtils.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/vnext/server/common/MessageUtils.js b/vnext/server/common/MessageUtils.js index f766faf2..74638c02 100644 --- a/vnext/server/common/MessageUtils.js +++ b/vnext/server/common/MessageUtils.js @@ -1,3 +1,5 @@ +import config from 'config'; + /** * check if message is PM * @@ -64,3 +66,17 @@ export function formatQuote(msg) { export function formatMessage(msg) { return msg.body || 'Sent an image'; } + +const baseURL = 'https://juick.com'; + +/** + * @param {import('../api').Message} msg message + */ +export function formatUrl(msg) { + if (isReply(msg)) { + return `${baseURL}/m/${msg.mid}#${msg.rid}`; + } else if (isPM(msg)) { + return `${baseURL}/pm/inbox`; + } + return `${baseURL}/m/${msg.mid}`; +} |