Clear typing indicator after receiving edits
This commit is contained in:
parent
9c325ea724
commit
3abacb25ce
4 changed files with 9 additions and 2 deletions
|
@ -2589,6 +2589,7 @@ export async function startApp(): Promise<void> {
|
|||
const editAttributes: EditAttributesType = {
|
||||
conversationId: message.attributes.conversationId,
|
||||
fromId: fromConversation.id,
|
||||
fromDevice: data.sourceDevice ?? 1,
|
||||
message: copyDataMessageIntoMessage(data.message, message.attributes),
|
||||
targetSentTimestamp: editedMessageTimestamp,
|
||||
};
|
||||
|
@ -2912,6 +2913,7 @@ export async function startApp(): Promise<void> {
|
|||
const editAttributes: EditAttributesType = {
|
||||
conversationId: message.attributes.conversationId,
|
||||
fromId: window.ConversationController.getOurConversationIdOrThrow(),
|
||||
fromDevice: window.storage.user.getDeviceId() ?? 1,
|
||||
message: copyDataMessageIntoMessage(data.message, message.attributes),
|
||||
targetSentTimestamp: editedMessageTimestamp,
|
||||
};
|
||||
|
|
|
@ -14,6 +14,7 @@ import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp';
|
|||
export type EditAttributesType = {
|
||||
conversationId: string;
|
||||
fromId: string;
|
||||
fromDevice: number;
|
||||
message: MessageAttributesType;
|
||||
targetSentTimestamp: number;
|
||||
};
|
||||
|
|
|
@ -272,9 +272,12 @@ export async function handleEditMessage(
|
|||
);
|
||||
|
||||
drop(mainMessageModel.getConversation()?.updateLastMessage());
|
||||
|
||||
// Update notifications
|
||||
if (conversation) {
|
||||
// Clear typing indicator
|
||||
const typingToken = `${editAttributes.fromId}.${editAttributes.fromDevice}`;
|
||||
conversation.clearContactTypingTimer(typingToken);
|
||||
|
||||
// Update notifications
|
||||
if (await shouldReplyNotifyUser(mainMessageModel, conversation)) {
|
||||
await conversation.notify(mainMessageModel);
|
||||
}
|
||||
|
|
|
@ -198,6 +198,7 @@ export async function sendEditedMessage(
|
|||
const editAttributes = {
|
||||
conversationId,
|
||||
fromId,
|
||||
fromDevice: window.storage.user.getDeviceId() ?? 1,
|
||||
message: tmpMessage,
|
||||
targetSentTimestamp,
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue