Spam Reporting UI changes

This commit is contained in:
Jamie Kyle 2024-03-12 09:29:31 -07:00 committed by GitHub
parent e031d136a1
commit 8387f938eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
88 changed files with 2711 additions and 807 deletions

View file

@ -140,6 +140,7 @@ import { CallMode } from '../../types/Calling';
import { CallDirection } from '../../types/CallDisposition';
import { getCallIdFromEra } from '../../util/callDisposition';
import { LONG_MESSAGE } from '../../types/MIME';
import type { MessageRequestResponseNotificationData } from '../../components/conversation/MessageRequestResponseNotification';
export { isIncoming, isOutgoing, isStory };
@ -971,6 +972,14 @@ export function getPropsForBubble(
};
}
if (isMessageRequestResponse(message)) {
return {
type: 'messageRequestResponse',
data: getPropsForMessageRequestResponse(message),
timestamp,
};
}
const data = getPropsForMessage(message, options);
return {
@ -1461,6 +1470,24 @@ function getPropsForProfileChange(
} as ProfileChangeNotificationPropsType;
}
// Message Request Response Event
export function isMessageRequestResponse(
message: MessageAttributesType
): boolean {
return message.type === 'message-request-response-event';
}
function getPropsForMessageRequestResponse(
message: MessageAttributesType
): MessageRequestResponseNotificationData {
const { messageRequestResponseEvent } = message;
if (!messageRequestResponseEvent) {
throw new Error('getPropsForMessageRequestResponse: event is missing!');
}
return { messageRequestResponseEvent };
}
// Universal Timer Notification
// Note: smart, so props not generated here