Export/import simple update messages

This commit is contained in:
Fedor Indutny 2024-05-22 09:34:19 -07:00 committed by GitHub
parent 19083cadf7
commit 9df3c63ca6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 1604 additions and 386 deletions

View file

@ -26,6 +26,7 @@ import type { PropsData as TimelineMessagePropsData } from '../../components/con
import { TextDirection } from '../../components/conversation/Message';
import type { PropsData as TimerNotificationProps } from '../../components/conversation/TimerNotification';
import type { PropsData as ChangeNumberNotificationProps } from '../../components/conversation/ChangeNumberNotification';
import type { PropsData as JoinedSignalNotificationProps } from '../../components/conversation/JoinedSignalNotification';
import type { PropsData as SafetyNumberNotificationProps } from '../../components/conversation/SafetyNumberNotification';
import type { PropsData as VerificationNotificationProps } from '../../components/conversation/VerificationNotification';
import type { PropsData as TitleTransitionNotificationProps } from '../../components/conversation/TitleTransitionNotification';
@ -925,6 +926,13 @@ export function getPropsForBubble(
timestamp,
};
}
if (isJoinedSignalNotification(message)) {
return {
type: 'joinedSignalNotification',
data: getPropsForJoinedSignalNotification(message),
timestamp,
};
}
if (isTitleTransitionNotification(message)) {
return {
type: 'titleTransitionNotification',
@ -1006,7 +1014,10 @@ export function isNormalBubble(message: MessageWithUIFieldsType): boolean {
!isProfileChange(message) &&
!isUniversalTimerNotification(message) &&
!isUnsupportedMessage(message) &&
!isVerifiedChange(message)
!isVerifiedChange(message) &&
!isChangeNumberNotification(message) &&
!isJoinedSignalNotification(message) &&
!isDeliveryIssue(message)
);
}
@ -1560,6 +1571,22 @@ function getPropsForChangeNumberNotification(
};
}
// Joined Signal Notification
export function isJoinedSignalNotification(
message: MessageWithUIFieldsType
): boolean {
return message.type === 'joined-signal-notification';
}
function getPropsForJoinedSignalNotification(
message: MessageWithUIFieldsType
): JoinedSignalNotificationProps {
return {
timestamp: message.sent_at,
};
}
// Title Transition Notification
export function isTitleTransitionNotification(