Merge pull request #459 from w3irdrobot/rewrite-twitter-to-nitter
add setting for rewriting twitter links to nitter
This commit is contained in:
commit
1bf6c7031e
@ -111,12 +111,25 @@ export default function HyperText({ link, creator }: { link: string; creator: He
|
|||||||
</a>
|
</a>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else if (tweetId) {
|
} else if (tweetId && !pref.rewriteTwitterPosts) {
|
||||||
return (
|
return (
|
||||||
<div className="tweet" key={tweetId}>
|
<div className="tweet" key={tweetId}>
|
||||||
<TwitterTweetEmbed tweetId={tweetId} />
|
<TwitterTweetEmbed tweetId={tweetId} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
} else if (pref.rewriteTwitterPosts && url.hostname == "twitter.com") {
|
||||||
|
url.host = "nitter.net";
|
||||||
|
return (
|
||||||
|
<a
|
||||||
|
key={url.toString()}
|
||||||
|
href={url.toString()}
|
||||||
|
onClick={e => e.stopPropagation()}
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
className="ext">
|
||||||
|
{url.toString()}
|
||||||
|
</a>
|
||||||
|
);
|
||||||
} else if (youtubeId) {
|
} else if (youtubeId) {
|
||||||
return (
|
return (
|
||||||
<iframe
|
<iframe
|
||||||
|
@ -401,6 +401,23 @@ const PreferencesPage = () => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="card flex">
|
||||||
|
<div className="flex f-col f-grow">
|
||||||
|
<div>
|
||||||
|
<FormattedMessage {...messages.RewriteTwitterPosts} />
|
||||||
|
</div>
|
||||||
|
<small>
|
||||||
|
<FormattedMessage {...messages.RewriteTwitterPostsHelp} />
|
||||||
|
</small>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
checked={perf.rewriteTwitterPosts}
|
||||||
|
onChange={e => dispatch(setPreferences({ ...perf, rewriteTwitterPosts: e.target.checked }))}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div className="card flex">
|
<div className="card flex">
|
||||||
<div className="flex f-col f-grow">
|
<div className="flex f-col f-grow">
|
||||||
<div>
|
<div>
|
||||||
|
@ -61,4 +61,6 @@ export default defineMessages({
|
|||||||
Nip05: { defaultMessage: "NIP-05" },
|
Nip05: { defaultMessage: "NIP-05" },
|
||||||
ReactionEmoji: { defaultMessage: "Reaction emoji" },
|
ReactionEmoji: { defaultMessage: "Reaction emoji" },
|
||||||
ReactionEmojiHelp: { defaultMessage: "Emoji to send when reactiong to a note" },
|
ReactionEmojiHelp: { defaultMessage: "Emoji to send when reactiong to a note" },
|
||||||
|
RewriteTwitterPosts: { defaultMessage: "Nitter Rewrite" },
|
||||||
|
RewriteTwitterPostsHelp: { defaultMessage: "Rewrite Twitter links to Nitter links" },
|
||||||
});
|
});
|
||||||
|
@ -51,6 +51,11 @@ export interface UserPreferences {
|
|||||||
*/
|
*/
|
||||||
confirmReposts: boolean;
|
confirmReposts: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rewrite Twitter links to Nitter links
|
||||||
|
*/
|
||||||
|
rewriteTwitterPosts: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Automatically show the latests notes
|
* Automatically show the latests notes
|
||||||
*/
|
*/
|
||||||
@ -245,6 +250,7 @@ export const InitState = {
|
|||||||
confirmReposts: false,
|
confirmReposts: false,
|
||||||
showDebugMenus: false,
|
showDebugMenus: false,
|
||||||
autoShowLatest: false,
|
autoShowLatest: false,
|
||||||
|
rewriteTwitterPosts: false,
|
||||||
fileUploader: "void.cat",
|
fileUploader: "void.cat",
|
||||||
imgProxyConfig: DefaultImgProxy,
|
imgProxyConfig: DefaultImgProxy,
|
||||||
defaultRootTab: "posts",
|
defaultRootTab: "posts",
|
||||||
|
@ -75,6 +75,9 @@
|
|||||||
"2k0Cv+": {
|
"2k0Cv+": {
|
||||||
"defaultMessage": "Dislikes ({n})"
|
"defaultMessage": "Dislikes ({n})"
|
||||||
},
|
},
|
||||||
|
"3LAxQH": {
|
||||||
|
"defaultMessage": "Rewrite Twitter links to Nitter links"
|
||||||
|
},
|
||||||
"3cc4Ct": {
|
"3cc4Ct": {
|
||||||
"defaultMessage": "Light"
|
"defaultMessage": "Light"
|
||||||
},
|
},
|
||||||
@ -522,6 +525,9 @@
|
|||||||
"X7xU8J": {
|
"X7xU8J": {
|
||||||
"defaultMessage": "nsec, npub, nip-05, hex, mnemonic"
|
"defaultMessage": "nsec, npub, nip-05, hex, mnemonic"
|
||||||
},
|
},
|
||||||
|
"XSoRjZ": {
|
||||||
|
"defaultMessage": "Nitter Rewrite"
|
||||||
|
},
|
||||||
"XgWvGA": {
|
"XgWvGA": {
|
||||||
"defaultMessage": "Reactions"
|
"defaultMessage": "Reactions"
|
||||||
},
|
},
|
||||||
@ -666,6 +672,9 @@
|
|||||||
"iNWbVV": {
|
"iNWbVV": {
|
||||||
"defaultMessage": "Handle"
|
"defaultMessage": "Handle"
|
||||||
},
|
},
|
||||||
|
"iXPL0Z": {
|
||||||
|
"defaultMessage": "Can't login with private key on an insecure connection, please use a Nostr key manager extension instead"
|
||||||
|
},
|
||||||
"ieGrWo": {
|
"ieGrWo": {
|
||||||
"defaultMessage": "Follow"
|
"defaultMessage": "Follow"
|
||||||
},
|
},
|
||||||
@ -855,9 +864,6 @@
|
|||||||
"uSV4Ti": {
|
"uSV4Ti": {
|
||||||
"defaultMessage": "Reposts need to be manually confirmed"
|
"defaultMessage": "Reposts need to be manually confirmed"
|
||||||
},
|
},
|
||||||
"ubtr9S": {
|
|
||||||
"defaultMessage": "Can't login with private key on 'http://' connection, please use a Nostr key manager extension instead"
|
|
||||||
},
|
|
||||||
"usAvMr": {
|
"usAvMr": {
|
||||||
"defaultMessage": "Edit Profile"
|
"defaultMessage": "Edit Profile"
|
||||||
},
|
},
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
"2LbrkB": "Enter password",
|
"2LbrkB": "Enter password",
|
||||||
"2a2YiP": "{n} Bookmarks",
|
"2a2YiP": "{n} Bookmarks",
|
||||||
"2k0Cv+": "Dislikes ({n})",
|
"2k0Cv+": "Dislikes ({n})",
|
||||||
|
"3LAxQH": "Rewrite Twitter links to Nitter links",
|
||||||
"3cc4Ct": "Light",
|
"3cc4Ct": "Light",
|
||||||
"3gOsZq": "Translators",
|
"3gOsZq": "Translators",
|
||||||
"3t3kok": "{n,plural,=1{{n} new note} other{{n} new notes}}",
|
"3t3kok": "{n,plural,=1{{n} new note} other{{n} new notes}}",
|
||||||
@ -169,6 +170,7 @@
|
|||||||
"WONP5O": "Find your twitter follows on nostr (Data provided by {provider})",
|
"WONP5O": "Find your twitter follows on nostr (Data provided by {provider})",
|
||||||
"WxthCV": "e.g. Jack",
|
"WxthCV": "e.g. Jack",
|
||||||
"X7xU8J": "nsec, npub, nip-05, hex, mnemonic",
|
"X7xU8J": "nsec, npub, nip-05, hex, mnemonic",
|
||||||
|
"XSoRjZ": "Nitter Rewrite",
|
||||||
"XgWvGA": "Reactions",
|
"XgWvGA": "Reactions",
|
||||||
"XzF0aC": "Key manager extensions are more secure and allow you to easily login to any Nostr client, here are some well known extensions:",
|
"XzF0aC": "Key manager extensions are more secure and allow you to easily login to any Nostr client, here are some well known extensions:",
|
||||||
"Y31HTH": "Help fund the development of Snort",
|
"Y31HTH": "Help fund the development of Snort",
|
||||||
@ -216,6 +218,7 @@
|
|||||||
"iDGAbc": "Get a Snort identifier",
|
"iDGAbc": "Get a Snort identifier",
|
||||||
"iGT1eE": "Prevent fake accounts from imitating you",
|
"iGT1eE": "Prevent fake accounts from imitating you",
|
||||||
"iNWbVV": "Handle",
|
"iNWbVV": "Handle",
|
||||||
|
"iXPL0Z": "Can't login with private key on an insecure connection, please use a Nostr key manager extension instead",
|
||||||
"ieGrWo": "Follow",
|
"ieGrWo": "Follow",
|
||||||
"itPgxd": "Profile",
|
"itPgxd": "Profile",
|
||||||
"izWS4J": "Unfollow",
|
"izWS4J": "Unfollow",
|
||||||
@ -278,7 +281,6 @@
|
|||||||
"u4bHcR": "Check out the code here: {link}",
|
"u4bHcR": "Check out the code here: {link}",
|
||||||
"uD/N6c": "Zap {target} {n} sats",
|
"uD/N6c": "Zap {target} {n} sats",
|
||||||
"uSV4Ti": "Reposts need to be manually confirmed",
|
"uSV4Ti": "Reposts need to be manually confirmed",
|
||||||
"ubtr9S": "Can't login with private key on 'http://' connection, please use a Nostr key manager extension instead",
|
|
||||||
"usAvMr": "Edit Profile",
|
"usAvMr": "Edit Profile",
|
||||||
"ut+2Cd": "Get a partner identifier",
|
"ut+2Cd": "Get a partner identifier",
|
||||||
"vOKedj": "{n,plural,=1{& {n} other} other{& {n} others}}",
|
"vOKedj": "{n,plural,=1{& {n} other} other{& {n} others}}",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user