diff options
author | Vitaly Takmazov | 2023-01-13 10:28:31 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-14 10:06:45 +0300 |
commit | e3c378cbf1d502263c61d3b9c31cd270bc3ae239 (patch) | |
tree | 9e038f42349671407e6f5906681de6448565f8eb /vnext/server/common/MessageUtils.js | |
parent | d94eec89b104e5c839d76c74ce94e83960d49c31 (diff) |
vnext: Telegram bot (WIP)
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}`; +} |