Skip to content

Commit

Permalink
enhance(phase 1): deprecate messaging feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Esurio committed Aug 4, 2024
1 parent 1877056 commit 8267aa2
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 31 deletions.
1 change: 1 addition & 0 deletions locales/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ termsOfService: "Terms of Service"
start: "Begin"
home: "Home"
remoteUserCaution: "As this user is from a remote instance, the shown information may be incomplete."
deprecatedCaution: "This feature is deprecated and will remove in the future. \n If you needed, please take a backup."
activity: "Activity"
images: "Images"
image: "Image"
Expand Down
8 changes: 8 additions & 0 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1590,6 +1590,11 @@ export interface Locale extends ILocale {
* センシティブなユーザーです。
*/
"sensitiveUserCaution": string;
/**
* この機能は非推奨です。
* 必要であれば、バックアップを取ることをお勧めします。
*/
"deprecatedCaution": string;
/**
* アクティビティ
*/
Expand Down Expand Up @@ -9749,6 +9754,9 @@ export interface Locale extends ILocale {
* サイコロ
*/
"dice": string;
/**
* 検索
*/
"search": string;
};
"_cw": {
Expand Down
1 change: 1 addition & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ start: "始める"
home: "ホーム"
remoteUserCaution: "リモートユーザーのため、情報が不完全です。"
sensitiveUserCaution: "センシティブなユーザーです。"
deprecatedCaution: "この機能は非推奨です。\n 必要であれば、バックアップを取ることをお勧めします。"
activity: "アクティビティ"
images: "画像"
image: "画像"
Expand Down
22 changes: 22 additions & 0 deletions packages/frontend/src/components/MkDeprecatedWarning.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<template>
<div :class="$style.root">
<i class="ti ti-exclamation-circle"></i>
{{ i18n.ts.deprecatedCaution }}
</div>
</template>

<script lang="ts" setup>
import { i18n } from '@/i18n.js';
</script>

<style lang="scss" module>
.root {
font-size: 0.8em;
padding: 16px;
background-color: var(--infoWarnBg);
color: var(--error);
border-radius: var(--radius);
}
</style>
33 changes: 2 additions & 31 deletions packages/frontend/src/pages/messaging/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #header><MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :contentMax="800">
<div>
<MkDeprecatedWarning />
<div v-if="tab === 'direct'">
<MkPagination v-slot="{ items }" ref="pagingComponent" :pagination="directPagination">
<MkChatPreview v-for="message in items" :key="message.id" :message="message"/>
Expand Down Expand Up @@ -36,7 +37,7 @@ import { $i } from '@/account.js';
import { globalEvents } from '@/events.js';
import MkChatPreview from '@/components/MkChatPreview.vue';
import MkPagination from '@/components/MkPagination.vue';
import MkSearchInput from '@/components/MkSearchInput.vue';
import MkDeprecatedWarning from '@/components/MkDeprecatedWarning.vue';

const pagingComponent = shallowRef<InstanceType<typeof MkPagination>>();

Expand Down Expand Up @@ -67,36 +68,6 @@ const groupsPagination = {
},
};

async function search() {
const query = searchQuery.value.toString().trim();

if (query == null || query === '') return;

if (query.startsWith('https://')) {
const promise = misskeyApi('ap/show', {
uri: query,
});

os.promiseDialog(promise, null, null, i18n.ts.fetchingAsApObject);

const res = await promise;

if (res.type === 'User') {
router.push(`/@${res.object.username}@${res.object.host}`);
} else if (res.type === 'Note') {
router.push(`/notes/${res.object.id}`);
}

return;
}
messagePagination.value = {
endpoint: 'messaging/message/search',
recipientId: recipientId.value,
groupId: groupId.value,
};
key.value++;
}

function onMessage(message) {
if (message.recipientId) {
messages = messages.filter(m => !(
Expand Down

0 comments on commit 8267aa2

Please sign in to comment.