Sort by inbox position to match phone after link
This commit is contained in:
parent
1f5cb9e8af
commit
4830213a12
25 changed files with 707 additions and 1029 deletions
|
@ -26,13 +26,16 @@ export const createLastMessageUpdate = ({
|
|||
}
|
||||
|
||||
const { type, expirationTimerUpdate } = lastMessage;
|
||||
const isMessageHistoryUnsynced = type === 'message-history-unsynced';
|
||||
const isVerifiedChangeMessage = type === 'verified-change';
|
||||
const isExpireTimerUpdateFromSync = Boolean(
|
||||
expirationTimerUpdate && expirationTimerUpdate.fromSync
|
||||
);
|
||||
|
||||
const shouldUpdateTimestamp = Boolean(
|
||||
!isVerifiedChangeMessage && !isExpireTimerUpdateFromSync
|
||||
!isMessageHistoryUnsynced &&
|
||||
!isVerifiedChangeMessage &&
|
||||
!isExpireTimerUpdateFromSync
|
||||
);
|
||||
const newTimestamp = shouldUpdateTimestamp
|
||||
? lastMessage.sent_at
|
||||
|
|
|
@ -2,7 +2,10 @@ import { Attachment } from './Attachment';
|
|||
import { ContactType } from './Contact';
|
||||
import { IndexableBoolean, IndexablePresence } from './IndexedDB';
|
||||
|
||||
export type Message = UserMessage | VerifiedChangeMessage;
|
||||
export type Message =
|
||||
| UserMessage
|
||||
| VerifiedChangeMessage
|
||||
| MessageHistoryUnsyncedMessage;
|
||||
export type UserMessage = IncomingMessage | OutgoingMessage;
|
||||
|
||||
export type IncomingMessage = Readonly<
|
||||
|
@ -65,6 +68,14 @@ export type VerifiedChangeMessage = Readonly<
|
|||
ExpirationTimerUpdate
|
||||
>;
|
||||
|
||||
export type MessageHistoryUnsyncedMessage = Readonly<
|
||||
{
|
||||
type: 'message-history-unsynced';
|
||||
} & SharedMessageProperties &
|
||||
MessageSchemaVersion5 &
|
||||
ExpirationTimerUpdate
|
||||
>;
|
||||
|
||||
type SharedMessageProperties = Readonly<{
|
||||
conversationId: string;
|
||||
sent_at: number;
|
||||
|
|
|
@ -16,6 +16,9 @@ export const initializeAttachmentMetadata = async (
|
|||
if (message.type === 'verified-change') {
|
||||
return message;
|
||||
}
|
||||
if (message.type === 'message-history-unsynced') {
|
||||
return message;
|
||||
}
|
||||
if (message.messageTimer || message.isViewOnce) {
|
||||
return message;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue