feat: backup/restore, user profile popover, image compress, video blur, wake lock
- backup/restore dialog + user profile popover components - image compression, video blur, wake lock utilities - message cache + conversation messages hook refinements - call context, active speakers, screen share dialog tweaks - audio + screen share settings persistence - refreshed app icons (smaller sizes) across all platforms
This commit is contained in:
@@ -473,6 +473,35 @@ export function useConversationMessages({ conversationId, userId, deviceId }: Ar
|
||||
const priv = privateKeyRef.current;
|
||||
if (!priv) throw new Error('private key not loaded');
|
||||
|
||||
// Slash-command: /tempmsg <seconds> <text> sends an ephemeral message
|
||||
// that the sender auto-deletes after the window elapses. Both peers
|
||||
// see the countdown via the expireMs field embedded in the plaintext
|
||||
// payload — no server support required.
|
||||
const tempMatch = /^\/tempmsg\s+(\d+)\s+([\s\S]+)$/i.exec(trimmed);
|
||||
if (tempMatch && images.length === 0) {
|
||||
const seconds = Math.min(3600, Math.max(5, parseInt(tempMatch[1]!, 10)));
|
||||
const body = tempMatch[2]!.trim();
|
||||
const payload = JSON.stringify({
|
||||
v: 1,
|
||||
type: 'text',
|
||||
text: body,
|
||||
attachments: [],
|
||||
expireMs: seconds * 1000,
|
||||
});
|
||||
try {
|
||||
await sendText(conversationId, userId, deviceId, priv, payload, replyToId);
|
||||
} catch (err: unknown) {
|
||||
const msg = err instanceof Error ? err.message : 'send failed';
|
||||
enqueueOutbox({
|
||||
conversationId,
|
||||
text: payload,
|
||||
replyToId,
|
||||
error: msg,
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Text-only path is retryable — if the network is down or the server
|
||||
// rejects transiently, stash in the outbox and keep the UI optimistic.
|
||||
// Attachments can't be deferred (large payloads, uploaded separately),
|
||||
|
||||
Reference in New Issue
Block a user