Outgoing: Ensure that sends still succeed without CDS
This commit is contained in:
parent
ce067258a0
commit
ec8ac1db58
4 changed files with 30 additions and 18 deletions
|
@ -204,6 +204,12 @@ export class Lightbox extends React.Component<Props, State> {
|
|||
|
||||
public previousFocus: HTMLElement | null = null;
|
||||
|
||||
public constructor(props: Props) {
|
||||
super(props);
|
||||
|
||||
this.state = {};
|
||||
}
|
||||
|
||||
public componentDidMount(): void {
|
||||
this.previousFocus = document.activeElement as HTMLElement;
|
||||
|
||||
|
|
|
@ -302,7 +302,7 @@ export async function maybeUpdateGroup({
|
|||
newRevision,
|
||||
receivedAt,
|
||||
sentAt,
|
||||
}: MaybeUpdatePropsType) {
|
||||
}: MaybeUpdatePropsType): Promise<void> {
|
||||
const logId = conversation.idForLogging();
|
||||
|
||||
try {
|
||||
|
|
|
@ -23,10 +23,9 @@ export const SmartContactName: React.ComponentType<ExternalProps> = props => {
|
|||
getConversationSelector
|
||||
);
|
||||
|
||||
const conversation = getConversation(conversationId);
|
||||
if (!conversation) {
|
||||
throw new Error(`Conversation id ${conversationId} not found!`);
|
||||
}
|
||||
const conversation = getConversation(conversationId) || {
|
||||
title: i18n('unknownContact'),
|
||||
};
|
||||
|
||||
return <ContactName i18n={i18n} {...conversation} />;
|
||||
};
|
||||
|
|
|
@ -584,20 +584,27 @@ export default class OutgoingMessage {
|
|||
'sendToIdentifier: window.textsecure.messaging is not available!'
|
||||
);
|
||||
}
|
||||
const lookup = await window.textsecure.messaging.getUuidsForE164s([
|
||||
identifier,
|
||||
]);
|
||||
const uuid = lookup[identifier];
|
||||
if (uuid) {
|
||||
this.discoveredIdentifierPairs.push({
|
||||
uuid,
|
||||
e164: identifier,
|
||||
});
|
||||
identifier = uuid;
|
||||
} else {
|
||||
throw new UnregisteredUserError(
|
||||
try {
|
||||
const lookup = await window.textsecure.messaging.getUuidsForE164s([
|
||||
identifier,
|
||||
new Error('User is not registered')
|
||||
]);
|
||||
const uuid = lookup[identifier];
|
||||
if (uuid) {
|
||||
this.discoveredIdentifierPairs.push({
|
||||
uuid,
|
||||
e164: identifier,
|
||||
});
|
||||
identifier = uuid;
|
||||
} else {
|
||||
throw new UnregisteredUserError(
|
||||
identifier,
|
||||
new Error('User is not registered')
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
window.log.error(
|
||||
`sentToIdentifier: Failed to fetch UUID for identifier ${identifier}`,
|
||||
error && error.stack ? error.stack : error
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue