Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor message2 #1147

Merged
merged 8 commits into from
Nov 25, 2019
Merged

Refactor message2 #1147

merged 8 commits into from
Nov 25, 2019

Conversation

Simon-Laux
Copy link
Member

@Simon-Laux Simon-Laux commented Nov 20, 2019

see commit messages for details.
In essence I moved more stuff between files in hope to make the code more readable and prepare merging of message-wrapper and message.

<MenuItem onClick={onReply}>
{tx('reply_to_message_desktop')}
</MenuItem>
*/}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be in the next release

import logger from '../../../logger'

import { getLogger } from '../../../logger'
const log = getLogger('render/msgList')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed the logger here.

}
}
}

const onClickSetupMessage = setupMessage => openDialog('EnterAutocryptSetupMessage', { setupMessage })
const onShowDetail = message => openDialog('MessageDetail', { message, chat })
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we have to reuse the chat object here? I would appreciate it when that dialog could fetch it from the core again, that would allow us to move this function around and inside of the message.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same on delete message, the dependency to the chatStore is annoying

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I would appreciate if we could call openDialog without a ScreenContext.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we have to reuse the chat object here? I would appreciate it when that dialog could fetch it from the core again, that would allow us to move this function around and inside of the message.

The message object should be enough for both? I think we shouldn't refetch anything that we already have, also because this could introduce inconsistencies if something changed in between. ChatStore is annoying anyways... openDialog without a screenContext sounds not so easy for me, how do you want to achieve this? Global variable?

remote.dialog.showSaveDialog({
defaultPath
}, (filename) => {
if (filename) ipcRenderer.send('saveFile', msg.file, filename)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use the ipcBackend variable from the rendered/ipc file? This makes it easier to switch to websockets/whatever at some point.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't need to be done now IMO, I just copied it over and we need to revisit this soon anyway, to remove the remote thing

Copy link
Contributor

@Jikstra Jikstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Jikstra Jikstra merged commit b30ea6d into master Nov 25, 2019
@Jikstra Jikstra deleted the refactor_message2 branch November 25, 2019 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants