feat(frontend): feed of deleted and edited messages above the chat list and per chat in the changes panel
This commit is contained in:
1 parent
010fa29ce0
commit
9f16e2aa56
23 files changed
+1915
-71
No files matched your search
@@ -5,6 +5,7 @@
|
||||
import ContextMenu from "#lib/components/ui/ContextMenu.svelte";
|
||||
import ContextMenuItem from "#lib/components/ui/ContextMenuItem.svelte";
|
||||
import { formatListDate } from "#lib/format/datetime.js";
|
||||
import { t } from "#lib/i18n/locale.svelte.js";
|
||||
import { accounts } from "#lib/stores/accounts.svelte.js";
|
||||
import { peers } from "#lib/stores/peers.svelte.js";
|
||||
import { policyUi } from "#lib/stores/policy.svelte.js";
|
||||
@@ -26,7 +27,9 @@
|
||||
|
||||
const title = $derived(
|
||||
chat.title ??
|
||||
(chat.chat_id > 0 ? "Удалённый аккаунт" : `Chat ${chat.chat_id}`)
|
||||
(chat.chat_id > 0
|
||||
? t("chat.deletedAccount")
|
||||
: t("chat.fallbackTitle", { id: chat.chat_id }))
|
||||
);
|
||||
const avatarKind = $derived(chat.chat_id > 0 ? "peer" : "chat");
|
||||
const ownId = $derived(accounts.selected?.tg_user_id ?? null);
|
||||
@@ -45,7 +48,7 @@
|
||||
return "";
|
||||
}
|
||||
if (chat.last_sender_id === ownId) {
|
||||
return "You: ";
|
||||
return `${t("chat.you")}: `;
|
||||
}
|
||||
const peer = peers.get(chat.last_sender_id as number);
|
||||
if (!peer) {
|
||||
@@ -55,7 +58,7 @@
|
||||
});
|
||||
|
||||
const preview = $derived(
|
||||
chat.last_text ?? (chat.message_count > 0 ? "Media" : "")
|
||||
chat.last_text ?? (chat.message_count > 0 ? t("chat.media") : "")
|
||||
);
|
||||
</script>
|
||||
|
||||
@@ -95,24 +98,27 @@
|
||||
{/snippet}
|
||||
{#snippet menu()}
|
||||
<ContextMenuItem icon="open-in-new-tab" onselect={onclick}
|
||||
>Открыть</ContextMenuItem
|
||||
>{t("chat.open")}</ContextMenuItem
|
||||
>
|
||||
<ContextMenuItem icon="info" onselect={() => openWith("profile")}
|
||||
>Профиль</ContextMenuItem
|
||||
>{t("chat.profile")}</ContextMenuItem
|
||||
>
|
||||
<ContextMenuItem icon="search" onselect={() => openWith("search")}
|
||||
>Поиск в чате</ContextMenuItem
|
||||
>{t("chat.search")}</ContextMenuItem
|
||||
>
|
||||
<ContextMenuItem icon="recent" onselect={() => openWith("changes")}
|
||||
>{t("feed.changes")}</ContextMenuItem
|
||||
>
|
||||
<ContextMenuItem icon="stats" onselect={() => openWith("presence")}
|
||||
>Аналитика</ContextMenuItem
|
||||
>{t("chat.analytics")}</ContextMenuItem
|
||||
>
|
||||
<ContextMenuItem icon="play-story" onselect={() => openWith("stories")}
|
||||
>Сторис</ContextMenuItem
|
||||
>{t("settings.stories")}</ContextMenuItem
|
||||
>
|
||||
<ContextMenuItem
|
||||
icon="settings"
|
||||
onselect={() => policyUi.edit({ chatId: chat.chat_id }, title)}
|
||||
>Политика захвата</ContextMenuItem
|
||||
>{t("settings.policy")}</ContextMenuItem
|
||||
>
|
||||
{/snippet}
|
||||
</ContextMenu>
|
||||
|
||||
Reference in new issue
Block a user