Multiple person typing indicators in groups
This commit is contained in:
parent
17ea2b58de
commit
e4238de4db
15 changed files with 342 additions and 115 deletions
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import memoizee from 'memoizee';
|
||||
import { head, sortBy } from 'lodash';
|
||||
import { sortBy } from 'lodash';
|
||||
import type { ConversationModel } from '../models/conversations';
|
||||
import type { ConversationType } from '../state/ducks/conversations';
|
||||
import type { ConversationAttributesType } from '../model-types';
|
||||
|
@ -77,8 +77,11 @@ function sortConversationTitles(
|
|||
// `ATTRIBUTES_THAT_DONT_INVALIDATE_PROPS_CACHE`, remove it from that list.
|
||||
export function getConversation(model: ConversationModel): ConversationType {
|
||||
const { attributes } = model;
|
||||
const typingValues = Object.values(model.contactTypingTimers || {});
|
||||
const typingMostRecent = head(sortBy(typingValues, 'timestamp'));
|
||||
const typingValues = sortBy(
|
||||
Object.values(model.contactTypingTimers || {}),
|
||||
'timestamp'
|
||||
);
|
||||
const typingContactIds = typingValues.map(({ senderId }) => senderId);
|
||||
|
||||
const ourAci = window.textsecure.storage.user.getAci();
|
||||
const ourPni = window.textsecure.storage.user.getPni();
|
||||
|
@ -219,7 +222,7 @@ export function getConversation(model: ConversationModel): ConversationType {
|
|||
timestamp: dropNull(timestamp),
|
||||
title: getTitle(attributes),
|
||||
titleNoDefault: getTitleNoDefault(attributes),
|
||||
typingContactId: typingMostRecent?.senderId,
|
||||
typingContactIds,
|
||||
searchableTitle: isMe(attributes)
|
||||
? window.i18n('icu:noteToSelf')
|
||||
: getTitle(attributes),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue