Spam Reporting UI changes
This commit is contained in:
parent
e031d136a1
commit
8387f938eb
88 changed files with 2711 additions and 807 deletions
|
@ -45,12 +45,15 @@ import {
|
|||
isTapToView,
|
||||
isUnsupportedMessage,
|
||||
isConversationMerge,
|
||||
isMessageRequestResponse,
|
||||
} from '../state/selectors/message';
|
||||
import {
|
||||
getContact,
|
||||
messageHasPaymentEvent,
|
||||
getPaymentEventNotificationText,
|
||||
} from '../messages/helpers';
|
||||
import { MessageRequestResponseEvent } from '../types/MessageRequestResponseEvent';
|
||||
import { missingCaseError } from './missingCaseError';
|
||||
|
||||
function getNameForNumber(e164: string): string {
|
||||
const conversation = window.ConversationController.get(e164);
|
||||
|
@ -177,6 +180,34 @@ export function getNotificationDataForMessage(
|
|||
};
|
||||
}
|
||||
|
||||
if (isMessageRequestResponse(attributes)) {
|
||||
const { messageRequestResponseEvent: event } = attributes;
|
||||
strictAssert(
|
||||
event,
|
||||
'getNotificationData: isMessageRequestResponse true, but no messageRequestResponseEvent!'
|
||||
);
|
||||
let text: string;
|
||||
if (event === MessageRequestResponseEvent.ACCEPT) {
|
||||
text = window.i18n(
|
||||
'icu:MessageRequestResponseNotification__Message--Accepted'
|
||||
);
|
||||
} else if (event === MessageRequestResponseEvent.SPAM) {
|
||||
text = window.i18n(
|
||||
'icu:MessageRequestResponseNotification__Message--Reported'
|
||||
);
|
||||
} else if (event === MessageRequestResponseEvent.BLOCK) {
|
||||
text = window.i18n(
|
||||
'icu:MessageRequestResponseNotification__Message--Blocked'
|
||||
);
|
||||
} else {
|
||||
throw missingCaseError(event);
|
||||
}
|
||||
|
||||
return {
|
||||
text,
|
||||
};
|
||||
}
|
||||
|
||||
const { attachments = [] } = attributes;
|
||||
|
||||
if (isTapToView(attributes)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue