Direct typing and presence (#10147)

Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
Kristina
2025-10-24 21:52:42 +07:00
committed by GitHub
parent 5def0cb231
commit 28fb9a4baf
36 changed files with 256 additions and 211 deletions
@@ -25,6 +25,7 @@
import communication from '../plugin'
export let cardId: CardID
export let peerId: string | undefined
const maxTypingPersons = 3
const acc = getCurrentAccount()
@@ -40,6 +41,8 @@
let typingInfo = new Map<string, TypingInfo>()
let typingGroups: TypingGroup[] = []
$: objectId = peerId ? `peer${peerId}` : cardId
$: void updateTypingPersons(typingInfo)
async function updateTypingPersons (typingInfo: Map<string, TypingInfo>): Promise<void> {
@@ -91,7 +94,7 @@
class="root h-4 mt-1 mb-1 ml-0-5 overflow-label"
use:typing={{
socialId: acc.primarySocialId,
objectId: cardId,
objectId,
onTyping: handleTyping
}}
>
@@ -461,7 +461,7 @@
if (message !== undefined) return
if (!isEmptyMarkup(draft.content)) {
throttle.call(() => {
void setTyping(acc.primarySocialId, card._id)
void setTyping(acc.primarySocialId, card.peerId ? `peer:${card.peerId}` : card._id)
})
}
}
@@ -705,7 +705,7 @@
</div>
{#if message === undefined}
<TypingPresenter cardId={card._id} />
<TypingPresenter cardId={card._id} peerId={card.peerId} />
{/if}
<style lang="scss">