diff --git a/js/models/conversations.js b/js/models/conversations.js index 1dc4e3a34..18dd0129e 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -247,7 +247,7 @@ }, async bumpTyping() { if (this.isPublic()) { - window.console.debug('public conversation... No need to bumpTyping'); + window.log.debug('public conversation... No need to bumpTyping'); return; } // We don't send typing messages if the setting is disabled or we do not have a session @@ -1273,7 +1273,7 @@ // Handle Group Invitation Message if (groupInvitation) { if (conversationType !== Message.PRIVATE) { - window.console.warning('Cannot send groupInvite to group chat'); + window.log.warn('Cannot send groupInvite to group chat'); return null; } @@ -1671,7 +1671,7 @@ ); const recipientPubKey = new libsession.Types.PubKey(recipient); if (!recipientPubKey) { - window.console.warn('sendGroupInfo invalid pubkey:', recipient); + window.log.warn('sendGroupInfo invalid pubkey:', recipient); return; } @@ -1837,7 +1837,7 @@ read = read.filter(item => !item.hasErrors); if (this.isPublic()) { - window.console.debug( + window.log.debug( 'public conversation... No need to send read receipt' ); return; diff --git a/js/views/create_group_dialog_view.js b/js/views/create_group_dialog_view.js index ddc183d2e..5257225c0 100644 --- a/js/views/create_group_dialog_view.js +++ b/js/views/create_group_dialog_view.js @@ -180,7 +180,7 @@ const xor = _.xor(notPresentInNew, notPresentInOld); if (xor.length === 0) { - window.console.log( + window.log.log( 'skipping group update: no detected changes in group member list' ); diff --git a/libloki/api.js b/libloki/api.js index b4dc91d37..c0628747e 100644 --- a/libloki/api.js +++ b/libloki/api.js @@ -19,7 +19,7 @@ const debugLogFn = (...args) => { if (window.lokiFeatureFlags.debugMessageLogs) { - window.console.warn(...args); + window.log.warn(...args); } }; diff --git a/libtextsecure/account_manager.js b/libtextsecure/account_manager.js index 80c53c824..0ef8ae01a 100644 --- a/libtextsecure/account_manager.js +++ b/libtextsecure/account_manager.js @@ -458,7 +458,7 @@ ); if (!secondaryDevicePubKey) { - window.console.error( + window.log.error( 'Invalid secondary pubkey on authoriseSecondaryDevice' ); diff --git a/libtextsecure/sendmessage.js b/libtextsecure/sendmessage.js index 6e1e38975..4ae4ca927 100644 --- a/libtextsecure/sendmessage.js +++ b/libtextsecure/sendmessage.js @@ -201,7 +201,7 @@ MessageSender.prototype = { } if (convosToSync.size === 0) { - window.console.info('No contacts to sync.'); + window.log.info('No contacts to sync.'); return Promise.resolve(); } @@ -229,7 +229,7 @@ MessageSender.prototype = { // primaryDevicePubKey is set to our own number if we are the master device const primaryDeviceKey = window.storage.get('primaryDevicePubKey'); if (!primaryDeviceKey) { - window.console.debug('sendGroupSyncMessage: no primary device pubkey'); + window.log.debug('sendGroupSyncMessage: no primary device pubkey'); return Promise.resolve(); } // We only want to sync across closed groups that we haven't left @@ -237,7 +237,7 @@ MessageSender.prototype = { c => c.isClosedGroup() && !c.get('left') && !c.get('isKickedFromGroup') ); if (activeGroups.length === 0) { - window.console.info('No closed group to sync.'); + window.log.info('No closed group to sync.'); return Promise.resolve(); } diff --git a/ts/components/conversation/UpdateGroupMembersDialog.tsx b/ts/components/conversation/UpdateGroupMembersDialog.tsx index 97ce71de7..cf127286a 100644 --- a/ts/components/conversation/UpdateGroupMembersDialog.tsx +++ b/ts/components/conversation/UpdateGroupMembersDialog.tsx @@ -215,7 +215,7 @@ export class UpdateGroupMembersDialog extends React.Component { private onMemberClicked(selected: any) { if (selected.existingMember && !this.props.isAdmin) { - window.console.warn('Only group admin can remove members!'); + window.log.warn('Only group admin can remove members!'); return; } diff --git a/ts/components/session/LeftPaneMessageSection.tsx b/ts/components/session/LeftPaneMessageSection.tsx index ff53a4047..05676f964 100644 --- a/ts/components/session/LeftPaneMessageSection.tsx +++ b/ts/components/session/LeftPaneMessageSection.tsx @@ -456,12 +456,12 @@ export class LeftPaneMessageSection extends React.Component { openGroupConversation ); } else { - window.console.error( + window.log.error( 'Joined an opengroup but did not find ther corresponding conversation' ); } } catch (e) { - window.console.error('Failed to connect to server:', e); + window.log.error('Failed to connect to server:', e); ToastUtils.pushToastError( 'connectToServerFail', window.i18n('connectToServerFail') diff --git a/ts/components/session/RegistrationTabs.tsx b/ts/components/session/RegistrationTabs.tsx index 8cbef0a83..bc8c9aa88 100644 --- a/ts/components/session/RegistrationTabs.tsx +++ b/ts/components/session/RegistrationTabs.tsx @@ -960,7 +960,7 @@ export class RegistrationTabs extends React.Component<{}, State> { const secretWords = window.mnemonic.pubkey_to_secret_words(pubkey); this.setState({ secretWords }); } catch (e) { - window.console.log(e); + window.log.log(e); await this.resetRegistration(); this.setState({ diff --git a/ts/receiver/contentMessage.ts b/ts/receiver/contentMessage.ts index 2cea00c9b..e578b328f 100644 --- a/ts/receiver/contentMessage.ts +++ b/ts/receiver/contentMessage.ts @@ -80,7 +80,7 @@ async function decryptForMediumGroup( const ourNumber = (await UserUtil.getCurrentDevicePubKey()) as string; const sourceAsStr = StringUtils.decode(source, 'hex'); if (sourceAsStr === ourNumber) { - window.console.info( + window.log.info( 'Dropping message from ourself after decryptForMediumGroup' ); return null; @@ -316,7 +316,7 @@ async function decrypt( } else if (error instanceof window.textsecure.PreKeyMissing) { const convo = window.ConversationController.get(envelope.source); if (!convo) { - window.console.warn( + window.log.warn( 'PreKeyMissing but convo is missing too. Dropping...' ); return; diff --git a/ts/receiver/dataMessage.ts b/ts/receiver/dataMessage.ts index a0b07fa12..1e42317fb 100644 --- a/ts/receiver/dataMessage.ts +++ b/ts/receiver/dataMessage.ts @@ -659,7 +659,7 @@ export async function handleMessageEvent(event: MessageEvent): Promise { } if (!conversationId) { - window.console.warn( + window.log.warn( 'Invalid conversation id for incoming message', conversationId ); diff --git a/ts/receiver/groups.ts b/ts/receiver/groups.ts index 88ec65fa5..c15fb18a8 100644 --- a/ts/receiver/groups.ts +++ b/ts/receiver/groups.ts @@ -40,7 +40,6 @@ export async function preprocessGroupMessage( ); if (conversation.isPublic() || conversation.isMediumGroup()) { - // window.console.log('No need to preprocess public group chat messages'); return; } const GROUP_TYPES = SignalService.GroupContext.Type; diff --git a/ts/receiver/queuedJob.ts b/ts/receiver/queuedJob.ts index d3ffbbbf5..60edb2b4a 100644 --- a/ts/receiver/queuedJob.ts +++ b/ts/receiver/queuedJob.ts @@ -530,7 +530,7 @@ export async function handleMessageJob( if (confirm) { confirm(); } - window.console.log( + window.log.info( 'Dropping ExpireTimerUpdate message as we already have the same one set.' ); return; diff --git a/ts/receiver/sessionHandling.ts b/ts/receiver/sessionHandling.ts index 11350972f..8dc4f0579 100644 --- a/ts/receiver/sessionHandling.ts +++ b/ts/receiver/sessionHandling.ts @@ -31,7 +31,7 @@ export async function handleSessionRequestMessage( ) { const { libsignal, StringView, textsecure, dcodeIO, log } = window; - window.console.log( + window.log.info( `Received SESSION_REQUEST from source: ${envelope.source}` ); @@ -74,7 +74,7 @@ export async function handleSessionRequestMessage( ); } if (preKey === undefined || signedKey === undefined) { - window.console.warn( + window.log.warn( "Couldn't process prekey bundle without preKey or signedKey" ); return; diff --git a/ts/receiver/syncMessages.ts b/ts/receiver/syncMessages.ts index 2d3fb7350..0008a3e26 100644 --- a/ts/receiver/syncMessages.ts +++ b/ts/receiver/syncMessages.ts @@ -102,7 +102,7 @@ async function handleSentMessage( } if (isMessageEmpty(msg as SignalService.DataMessage)) { - window.console.log('dropping empty message synced'); + window.log.info('dropping empty message synced'); await removeFromCache(envelope); return; } @@ -193,11 +193,11 @@ async function handleBlocked( if (conv.isPrivate()) { await BlockedNumberController.setBlocked(n, block); } else { - window.console.warn('Ignoring block/unblock for group:', n); + window.log.warn('Ignoring block/unblock for group:', n); } conv.trigger('change', conv); } else { - window.console.warn( + window.log.warn( 'Did not find corresponding conversation to block', n );