fix more typing errors of conversation object

pull/1387/head
Audric Ackermann 5 years ago
parent c41eaada25
commit 3998bbc97d
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -615,16 +615,15 @@ export class Message extends React.PureComponent<Props, State> {
const { const {
conversationType, conversationType,
direction, direction,
i18n,
quote, quote,
text,
isPublic, isPublic,
convoId, convoId,
} = this.props; } = this.props;
if (!quote) { if (!quote || !quote.authorPhoneNumber) {
return null; return null;
} }
// console.warn('quote render ' , quote)
const withContentAbove = const withContentAbove =
conversationType === 'group' && direction === 'incoming'; conversationType === 'group' && direction === 'incoming';

@ -437,7 +437,7 @@ async function onContactReceived(details: any) {
} }
conversation.updateTextInputState(); conversation.updateTextInputState();
await conversation.trigger('change', conversation); conversation.trigger('change', conversation);
} catch (error) { } catch (error) {
window.log.error('onContactReceived error:', Errors.toLogFormat(error)); window.log.error('onContactReceived error:', Errors.toLogFormat(error));
} }

@ -207,7 +207,7 @@ async function copyFromQuotedMessage(
} }
// Handle expiration timer as part of a regular message // Handle expiration timer as part of a regular message
function handleExpireTimer( async function handleExpireTimer(
source: string, source: string,
message: MessageModel, message: MessageModel,
expireTimer: number, expireTimer: number,
@ -219,7 +219,7 @@ function handleExpireTimer(
message.set({ expireTimer }); message.set({ expireTimer });
if (expireTimer !== oldValue) { if (expireTimer !== oldValue) {
conversation.updateExpirationTimer( await conversation.updateExpirationTimer(
expireTimer, expireTimer,
source, source,
message.get('received_at'), message.get('received_at'),
@ -230,7 +230,7 @@ function handleExpireTimer(
} }
} else if (oldValue && !message.isGroupUpdate()) { } else if (oldValue && !message.isGroupUpdate()) {
// We only turn off timers if it's not a group update // We only turn off timers if it's not a group update
conversation.updateExpirationTimer( await conversation.updateExpirationTimer(
null, null,
source, source,
message.get('received_at'), message.get('received_at'),
@ -262,7 +262,7 @@ function handleLinkPreviews(
message.set({ preview }); message.set({ preview });
} }
function processProfileKey( async function processProfileKey(
source: string, source: string,
conversation: ConversationModel, conversation: ConversationModel,
sendingDeviceConversation: ConversationModel, sendingDeviceConversation: ConversationModel,
@ -274,9 +274,9 @@ function processProfileKey(
if (source === ourNumber) { if (source === ourNumber) {
conversation.set({ profileSharing: true }); conversation.set({ profileSharing: true });
} else if (conversation.isPrivate()) { } else if (conversation.isPrivate()) {
conversation.setProfileKey(profileKey); await conversation.setProfileKey(profileKey);
} else { } else {
sendingDeviceConversation.setProfileKey(profileKey); await sendingDeviceConversation.setProfileKey(profileKey);
} }
} }
@ -428,7 +428,12 @@ async function handleRegularMessage(
conversation.updateTextInputState(); conversation.updateTextInputState();
// Handle expireTimer found directly as part of a regular message // Handle expireTimer found directly as part of a regular message
handleExpireTimer(source, message, dataMessage.expireTimer, conversation); await handleExpireTimer(
source,
message,
dataMessage.expireTimer,
conversation
);
const ourPrimary = await MultiDeviceProtocol.getPrimaryDevice(ourNumber); const ourPrimary = await MultiDeviceProtocol.getPrimaryDevice(ourNumber);
@ -459,7 +464,7 @@ async function handleRegularMessage(
); );
if (dataMessage.profileKey) { if (dataMessage.profileKey) {
processProfileKey( await processProfileKey(
source, source,
conversation, conversation,
sendingDeviceConversation, sendingDeviceConversation,
@ -472,7 +477,7 @@ async function handleRegularMessage(
} }
} }
function handleExpirationTimerUpdate( async function handleExpirationTimerUpdate(
conversation: ConversationModel, conversation: ConversationModel,
message: MessageModel, message: MessageModel,
source: string, source: string,
@ -494,7 +499,7 @@ function handleExpirationTimerUpdate(
source: 'handleDataMessage', source: 'handleDataMessage',
}); });
conversation.updateExpirationTimer( await conversation.updateExpirationTimer(
expireTimer, expireTimer,
source, source,
message.get('received_at'), message.get('received_at'),
@ -534,7 +539,12 @@ export async function handleMessageJob(
); );
return; return;
} }
handleExpirationTimerUpdate(conversation, message, source, expireTimer); await handleExpirationTimerUpdate(
conversation,
message,
source,
expireTimer
);
} else { } else {
await handleRegularMessage( await handleRegularMessage(
conversation, conversation,

Loading…
Cancel
Save