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 = {
|
const editAttributes: EditAttributesType = {
|
||||||
conversationId: message.attributes.conversationId,
|
conversationId: message.attributes.conversationId,
|
||||||
fromId: fromConversation.id,
|
fromId: fromConversation.id,
|
||||||
|
fromDevice: data.sourceDevice ?? 1,
|
||||||
message: copyDataMessageIntoMessage(data.message, message.attributes),
|
message: copyDataMessageIntoMessage(data.message, message.attributes),
|
||||||
targetSentTimestamp: editedMessageTimestamp,
|
targetSentTimestamp: editedMessageTimestamp,
|
||||||
};
|
};
|
||||||
|
@ -2912,6 +2913,7 @@ export async function startApp(): Promise<void> {
|
||||||
const editAttributes: EditAttributesType = {
|
const editAttributes: EditAttributesType = {
|
||||||
conversationId: message.attributes.conversationId,
|
conversationId: message.attributes.conversationId,
|
||||||
fromId: window.ConversationController.getOurConversationIdOrThrow(),
|
fromId: window.ConversationController.getOurConversationIdOrThrow(),
|
||||||
|
fromDevice: window.storage.user.getDeviceId() ?? 1,
|
||||||
message: copyDataMessageIntoMessage(data.message, message.attributes),
|
message: copyDataMessageIntoMessage(data.message, message.attributes),
|
||||||
targetSentTimestamp: editedMessageTimestamp,
|
targetSentTimestamp: editedMessageTimestamp,
|
||||||
};
|
};
|
||||||
|
|
|
@ -14,6 +14,7 @@ import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp';
|
||||||
export type EditAttributesType = {
|
export type EditAttributesType = {
|
||||||
conversationId: string;
|
conversationId: string;
|
||||||
fromId: string;
|
fromId: string;
|
||||||
|
fromDevice: number;
|
||||||
message: MessageAttributesType;
|
message: MessageAttributesType;
|
||||||
targetSentTimestamp: number;
|
targetSentTimestamp: number;
|
||||||
};
|
};
|
||||||
|
|
|
@ -272,9 +272,12 @@ export async function handleEditMessage(
|
||||||
);
|
);
|
||||||
|
|
||||||
drop(mainMessageModel.getConversation()?.updateLastMessage());
|
drop(mainMessageModel.getConversation()?.updateLastMessage());
|
||||||
|
|
||||||
// Update notifications
|
|
||||||
if (conversation) {
|
if (conversation) {
|
||||||
|
// Clear typing indicator
|
||||||
|
const typingToken = `${editAttributes.fromId}.${editAttributes.fromDevice}`;
|
||||||
|
conversation.clearContactTypingTimer(typingToken);
|
||||||
|
|
||||||
|
// Update notifications
|
||||||
if (await shouldReplyNotifyUser(mainMessageModel, conversation)) {
|
if (await shouldReplyNotifyUser(mainMessageModel, conversation)) {
|
||||||
await conversation.notify(mainMessageModel);
|
await conversation.notify(mainMessageModel);
|
||||||
}
|
}
|
||||||
|
|
|
@ -198,6 +198,7 @@ export async function sendEditedMessage(
|
||||||
const editAttributes = {
|
const editAttributes = {
|
||||||
conversationId,
|
conversationId,
|
||||||
fromId,
|
fromId,
|
||||||
|
fromDevice: window.storage.user.getDeviceId() ?? 1,
|
||||||
message: tmpMessage,
|
message: tmpMessage,
|
||||||
targetSentTimestamp,
|
targetSentTimestamp,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue