void;
onEdit?: (message: SimpleMessage) => void;
+ onForward?: (message: SimpleMessage) => void;
}
- let { onReply, onEdit }: Props = $props();
+ let { onReply, onEdit, onForward }: Props = $props();
// Check if current room is encrypted
let isRoomEncrypted = $derived(matrixStore.currentSimpleRoom?.isEncrypted ?? false);
@@ -105,6 +106,7 @@
showEncryptionBadge={isRoomEncrypted}
{onReply}
{onEdit}
+ {onForward}
/>
{:else}
diff --git a/apps/matrix/apps/web/src/lib/components/chat/TypingIndicator.svelte b/apps/matrix/apps/web/src/lib/components/chat/TypingIndicator.svelte
index 40cebb2c5..4b34ba135 100644
--- a/apps/matrix/apps/web/src/lib/components/chat/TypingIndicator.svelte
+++ b/apps/matrix/apps/web/src/lib/components/chat/TypingIndicator.svelte
@@ -1,10 +1,25 @@
{#if users.length > 0}
-
+
+
+
+ {#each typingUsers().slice(0, 3) as user, i}
+ {#if user.avatarUrl}
+

+ {:else}
+
+
+
+ {/if}
+ {/each}
+
+
-
-
-
-
-
-
{text()}
+
+
+
+
+
+
+
+
{text()}
{/if}
diff --git a/apps/matrix/apps/web/src/lib/matrix/store.svelte.ts b/apps/matrix/apps/web/src/lib/matrix/store.svelte.ts
index 150795d6c..be806daf8 100644
--- a/apps/matrix/apps/web/src/lib/matrix/store.svelte.ts
+++ b/apps/matrix/apps/web/src/lib/matrix/store.svelte.ts
@@ -569,6 +569,21 @@ class MatrixStore {
}
}
+ /**
+ * Send a message to a specific room (for forwarding)
+ */
+ async sendMessageToRoom(roomId: string, body: string): Promise
{
+ if (!this._client) return false;
+
+ try {
+ await this._client.sendTextMessage(roomId, body);
+ return true;
+ } catch (err) {
+ this._error = err instanceof Error ? err.message : 'Failed to send message';
+ return false;
+ }
+ }
+
/**
* Send typing indicator
*/
diff --git a/apps/matrix/apps/web/src/routes/(app)/chat/+page.svelte b/apps/matrix/apps/web/src/routes/(app)/chat/+page.svelte
index 17778ee78..917aef49a 100644
--- a/apps/matrix/apps/web/src/routes/(app)/chat/+page.svelte
+++ b/apps/matrix/apps/web/src/routes/(app)/chat/+page.svelte
@@ -4,6 +4,7 @@
import CreateRoomDialog from '$lib/components/chat/CreateRoomDialog.svelte';
import RoomSettingsPanel from '$lib/components/chat/RoomSettingsPanel.svelte';
import SearchDialog from '$lib/components/chat/SearchDialog.svelte';
+ import ForwardMessageDialog from '$lib/components/chat/ForwardMessageDialog.svelte';
import { CallView, IncomingCallDialog } from '$lib/components/call';
import { ChatCircle, Plus, Gear } from '@manacore/shared-icons';
import { browser } from '$app/environment';
@@ -17,10 +18,12 @@
let showCreateRoom = $state(false);
let showRoomSettings = $state(false);
let showSearch = $state(false);
+ let showForward = $state(false);
- // Reply/Edit state
+ // Reply/Edit/Forward state
let replyTo = $state(null);
let editMessage = $state(null);
+ let forwardMessage = $state(null);
// Check if mobile
let isMobile = $state(browser ? window.innerWidth < 1024 : false);
@@ -71,6 +74,11 @@
editMessage = message;
}
+ function handleForward(message: SimpleMessage) {
+ forwardMessage = message;
+ showForward = true;
+ }
+
function handleRoomCreated(roomId: string) {
matrixStore.selectRoom(roomId);
}
@@ -174,7 +182,7 @@
/>
-
+
{/if}
+
+
+ {
+ showForward = false;
+ forwardMessage = null;
+ }}
+/>