fix minor bugs in various plugins
- FriendsSince: Don't show for friend requests - FakeNitro: Fix attempting to bypass unicode emojis #2503 - MessageLatency: ignore bots #2504 - CtrlEnterSend: use cmd+enter on macOS #2502 - ReplaceGoogleSearch: trim LF character #2488 Co-authored-by: AutumnVN <autumnvnchino@gmail.com> Co-authored-by: rushiiMachine <33725716+rushiiMachine@users.noreply.github.com> Co-authored-by: Lumap <lumap@duck.com> Co-authored-by: Mylloon <kennel.anri@tutanota.com>
This commit is contained in:
parent
4f2c2b8e4a
commit
c836270320
|
@ -18,7 +18,7 @@ export default definePlugin({
|
|||
type: OptionType.SELECT,
|
||||
options: [
|
||||
{
|
||||
label: "Ctrl+Enter (Enter or Shift+Enter for new line)",
|
||||
label: "Ctrl+Enter (Enter or Shift+Enter for new line) (cmd+enter on macOS)",
|
||||
value: "ctrl+enter"
|
||||
},
|
||||
{
|
||||
|
@ -54,7 +54,7 @@ export default definePlugin({
|
|||
result = event.shiftKey;
|
||||
break;
|
||||
case "ctrl+enter":
|
||||
result = event.ctrlKey;
|
||||
result = navigator.platform.includes("Mac") ? event.metaKey : event.ctrlKey;
|
||||
break;
|
||||
case "enter":
|
||||
result = !event.shiftKey && !event.ctrlKey;
|
||||
|
|
|
@ -813,7 +813,7 @@ export default definePlugin({
|
|||
},
|
||||
|
||||
canUseEmote(e: Emoji, channelId: string) {
|
||||
if (e.type === "UNICODE") return true;
|
||||
if (e.type === 0) return true;
|
||||
if (e.available === false) return false;
|
||||
|
||||
const isUnusableRoleSubEmoji = RoleSubscriptionEmojiUtils.isUnusableRoleSubscriptionEmojiOriginal ?? RoleSubscriptionEmojiUtils.isUnusableRoleSubscriptionEmoji;
|
||||
|
|
|
@ -52,6 +52,8 @@ export default definePlugin({
|
|||
|
||||
getFriendSince(userId: string) {
|
||||
try {
|
||||
if (!RelationshipStore.isFriend(userId)) return null;
|
||||
|
||||
return RelationshipStore.getSince(userId);
|
||||
} catch (err) {
|
||||
new Logger("FriendsSince").error(err);
|
||||
|
@ -60,6 +62,8 @@ export default definePlugin({
|
|||
},
|
||||
|
||||
friendsSince: ErrorBoundary.wrap(({ userId, textClassName }: { userId: string; textClassName?: string; }) => {
|
||||
if (!RelationshipStore.isFriend(userId)) return null;
|
||||
|
||||
const friendsSince = RelationshipStore.getSince(userId);
|
||||
if (!friendsSince) return null;
|
||||
|
||||
|
|
|
@ -97,6 +97,9 @@ export default definePlugin({
|
|||
// Message wasn't received through gateway
|
||||
if (!isNonNullish(nonce)) return null;
|
||||
|
||||
// Bots basically never send a nonce, and if someone does do it then it's usually not a snowflake
|
||||
if (message.bot) return null;
|
||||
|
||||
let isDiscordKotlin = false;
|
||||
let delta = SnowflakeUtils.extractTimestamp(id) - SnowflakeUtils.extractTimestamp(nonce); // milliseconds
|
||||
if (!showMillis) {
|
||||
|
|
|
@ -37,7 +37,7 @@ const settings = definePluginSettings({
|
|||
});
|
||||
|
||||
function search(src: string, engine: string) {
|
||||
open(engine + encodeURIComponent(src), "_blank");
|
||||
open(engine + encodeURIComponent(src.trim()), "_blank");
|
||||
}
|
||||
|
||||
function makeSearchItem(src: string) {
|
||||
|
|
4
src/webpack/common/types/stores.d.ts
vendored
4
src/webpack/common/types/stores.d.ts
vendored
|
@ -63,7 +63,7 @@ export interface CustomEmoji {
|
|||
originalName?: string;
|
||||
require_colons: boolean;
|
||||
roles: string[];
|
||||
type: "GUILD_EMOJI";
|
||||
type: 1;
|
||||
}
|
||||
|
||||
export interface UnicodeEmoji {
|
||||
|
@ -75,7 +75,7 @@ export interface UnicodeEmoji {
|
|||
};
|
||||
index: number;
|
||||
surrogates: string;
|
||||
type: "UNICODE";
|
||||
type: 0;
|
||||
uniqueName: string;
|
||||
useSpriteSheet: boolean;
|
||||
get allNamesString(): string;
|
||||
|
|
Loading…
Reference in a new issue