Skip to content

Commit

Permalink
disable twitter link replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
slugalisk committed Jan 28, 2024
1 parent 820297b commit d0e2e44
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions assets/chat/js/formatters.js
Original file line number Diff line number Diff line change
Expand Up @@ -710,15 +710,16 @@ class UrlFormatter {
if (self.discordmp4Regex.test(decodedUrl)) {
decodedUrl = location.origin + "/discordmedia.html?v=" + encodeURIComponent(decodedUrl);
}
const tm = decodedUrl.match(self.twitterRegex);
if (tm) {
url = self.encodeUrl(tm[0]);
const href = scheme + url;
if (tm) {
const embedHref = `${NITTER_URL}/${self.encodeUrl(tm[1])}`;
return `<a target="_blank" class="embed-internallink ${extraclass}" href="${embedHref}">${embedHref}</a><a target="_blank" class="embed-externallink" href="${href}" rel="nofollow" title="${url}"></a>`;
}
}
// TODO: reenable or clean up if nitter shuts down
// const tm = decodedUrl.match(self.twitterRegex);
// if (tm) {
// url = self.encodeUrl(tm[0]);
// const href = scheme + url;
// if (tm) {
// const embedHref = `${NITTER_URL}/${self.encodeUrl(tm[1])}`;
// return `<a target="_blank" class="embed-internallink ${extraclass}" href="${embedHref}">${embedHref}</a><a target="_blank" class="embed-externallink" href="${href}" rel="nofollow" title="${url}"></a>`;
// }
// }
if(self.refLinkRegex.test(decodedUrl)){
if( decodedUrl.includes("?ref")){
decodedUrl = decodedUrl.split('?ref')[0];
Expand Down

0 comments on commit d0e2e44

Please sign in to comment.