From 6576d7f9bdda08d18b81c55ff7760f174a4da923 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Sat, 24 Aug 2024 09:50:20 -0600 Subject: [PATCH 1/2] add new app flags --- src/util/dconstants.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/dconstants.js b/src/util/dconstants.js index 5ab21b8..63842fe 100644 --- a/src/util/dconstants.js +++ b/src/util/dconstants.js @@ -63,6 +63,8 @@ module.exports.ApplicationFlags.EMBEDDED_FIRST_PARTY = 1 << 20; // module.exports.ApplicationFlags.ACTIVE = 1 << 24; // prettier-ignore module.exports.ApplicationFlags.IFRAME_MODAL = 1 << 26; // prettier-ignore module.exports.ApplicationFlags.SOCIAL_LAYER_INTEGRATION = 1 << 27; // prettier-ignore +module.exports.ApplicationFlags.PROMOTED = 1 << 29; // prettier-ignore +module.exports.ApplicationFlags.PARTNER = 1 << 30; // prettier-ignore module.exports.ApplicationTypes = ["Normal", "Game", "Music", "Ticketed Event", "Creator Monetization"]; From 9cd4c3a98c6b1fe5d8b695b0d39e4f93e974d0ab Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Sat, 24 Aug 2024 09:51:28 -0600 Subject: [PATCH 2/2] fedimbed: escape || in sensitive content --- src/modules/fedimbed.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/fedimbed.js b/src/modules/fedimbed.js index 2d883be..9c12ebd 100644 --- a/src/modules/fedimbed.js +++ b/src/modules/fedimbed.js @@ -575,7 +575,9 @@ async function processUrl(msg, url, spoiler = false) { let desc = ""; let MAX_LENGTH = 3999; if ((cw != "" || sensitive) && images.length == 0 && videos.length == 0 && audios.length == 0) { - desc += "||" + content + "||"; + const ors = content.split("||"); + desc += `||${content.replaceAll("||", "|\u200b|")}||`; + MAX_LENGTH -= ors.length - 1; MAX_LENGTH -= 4; if (cw != "") {