Merge branch 'develop' into feat-1714

This commit is contained in:
かっこかり
2024-07-15 10:11:15 +09:00
committed by GitHub
85 changed files with 1222 additions and 831 deletions

View File

@@ -197,7 +197,7 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: IRouter
const canonical = user.host === null ? `@${user.username}` : `@${user.username}@${toUnicode(user.host)}`;
copyToClipboard(`${url}/${canonical}`);
},
}, {
}, ...($i ? [{
icon: 'ti ti-mail',
text: i18n.ts.sendMessage,
action: () => {
@@ -270,7 +270,7 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: IRouter
},
}));
},
}] as any;
}] : [])] as any;
if ($i && meId !== user.id) {
if (iAmModerator) {

View File

@@ -114,6 +114,7 @@ const matchPatterns = (ev: KeyboardEvent, action: Action) => {
const key = ev.key.toLowerCase();
return patterns.some(({ which, ctrl, shift, alt }) => {
if (
options.allowRepeat === false &&
latestHotkey != null &&
latestHotkey.which.includes(key) &&
latestHotkey.ctrl === ctrl &&

View File

@@ -8,12 +8,49 @@ import { $i } from '@/account.js';
import { i18n } from '@/i18n.js';
import { popup } from '@/os.js';
export function pleaseLogin(path?: string) {
export type OpenOnRemoteOptions = {
/**
* 外部のMisskey Webで特定のパスを開く
*/
type: 'web';
/**
* 内部パス(例: `/settings`
*/
path: string;
} | {
/**
* 外部のMisskey Webで照会する
*/
type: 'lookup';
/**
* 照会したいエンティティのURL
*
* (例: `https://misskey.example.com/notes/abcdexxxxyz`
*/
url: string;
} | {
/**
* 外部のMisskeyでートする
*/
type: 'share';
/**
* `/share` ページに渡すクエリストリング
*
* @see https://go.misskey-hub.net/spec/share/
*/
params: Record<string, string>;
};
export function pleaseLogin(path?: string, openOnRemote?: OpenOnRemoteOptions) {
if ($i) return;
const { dispose } = popup(defineAsyncComponent(() => import('@/components/MkSigninDialog.vue')), {
autoSet: true,
message: i18n.ts.signinRequired,
message: openOnRemote ? i18n.ts.signinOrContinueOnRemote : i18n.ts.signinRequired,
openOnRemote,
}, {
cancelled: () => {
if (path) {

View File

@@ -21,3 +21,8 @@ export function query(obj: Record<string, any>): string {
export function appendQuery(url: string, query: string): string {
return `${url}${/\?/.test(url) ? url.endsWith('?') ? '' : '&' : '?'}${query}`;
}
export function extractDomain(url: string) {
const match = url.match(/^(?:https?:)?(?:\/\/)?(?:[^@\n]+@)?([^:\/\n]+)/im);
return match ? match[1] : null;
}