-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(plugin): PasswordProtect #2637
base: dev
Are you sure you want to change the base?
Conversation
Use case? |
await openModalLazy(async () => { | ||
return modalProps => <PasswordModal modalProps={modalProps} channelId={channelId} type={ModalType.Access} callback={async password => { | ||
if (password) { | ||
cb(await checkPassword(password, channelId)); | ||
} else { | ||
cb(false); | ||
} | ||
}} />; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await openModalLazy(async () => { | |
return modalProps => <PasswordModal modalProps={modalProps} channelId={channelId} type={ModalType.Access} callback={async password => { | |
if (password) { | |
cb(await checkPassword(password, channelId)); | |
} else { | |
cb(false); | |
} | |
}} />; | |
}); | |
openModal(modalProps => ( | |
<PasswordModal | |
modalProps={modalProps} | |
channelId={channelId} | |
type={ModalType.Access} | |
callback={async password => { | |
if (password) { | |
cb(await checkPassword(password, channelId)); | |
} else { | |
cb(false); | |
} | |
}} | |
/>; | |
)); |
{!isProtected && ( | ||
<> | ||
<Menu.MenuItem | ||
id="vc-password-protect-lock" | ||
label="Lock" | ||
color="brand" | ||
action={() => openLockModal(channelId)} | ||
/> | ||
</> | ||
)} | ||
|
||
{isProtected && ( | ||
<> | ||
<Menu.MenuItem | ||
id="vc-password-protect-unlock" | ||
label="Unlock" | ||
color="danger" | ||
action={() => openUnlockModal(channelId)} | ||
/> | ||
</> | ||
)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{!isProtected && ( | |
<> | |
<Menu.MenuItem | |
id="vc-password-protect-lock" | |
label="Lock" | |
color="brand" | |
action={() => openLockModal(channelId)} | |
/> | |
</> | |
)} | |
{isProtected && ( | |
<> | |
<Menu.MenuItem | |
id="vc-password-protect-unlock" | |
label="Unlock" | |
color="danger" | |
action={() => openUnlockModal(channelId)} | |
/> | |
</> | |
)} | |
{!isProtected | |
? <> | |
<Menu.MenuItem | |
id="vc-password-protect-lock" | |
label="Lock" | |
color="brand" | |
action={() => openLockModal(channelId)} | |
/> | |
</> | |
: <> | |
<Menu.MenuItem | |
id="vc-password-protect-unlock" | |
label="Unlock" | |
color="danger" | |
action={() => openUnlockModal(channelId)} | |
/> | |
</> | |
} |
{ | ||
find: ".gatedContent,", | ||
replacement: { | ||
match: /this.props/, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
too generic
], | ||
|
||
patchProps(props: NSFWBlockProps) { | ||
const channel = getCurrentChannel(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const channel = getCurrentChannel(); | |
const channelId = SelectedChannelStore.getChannelId(); |
export async function reloadChannel() { | ||
const channel = getCurrentChannel(); | ||
NavigationRouter.transitionTo("/channels/@me"); | ||
await new Promise(r => setTimeout(r, 0)); | ||
NavigationRouter.transitionTo(`/channels/${channel.guild_id || "@me"}/${channel.id}`); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what?
bc67db1
to
b333deb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uwu
It'd be better if this plugin encrypted the messages you send and decrypts when a new message is loaded |
out of scope; have you tried using a messaging app designed for encryption? afaik this is designed mostly as a "don't accidentally open the wrong channel" plugin |
fa092cf
to
eb63a54
Compare
PasswordProtect
Allows you to password protect your dms and channels!