[Merge] lp:~phablet-team/messaging-app/mms_settings into lp:messaging-app/staging
Tiago Salem Herrmann
tiago.herrmann at canonical.com
Thu Nov 10 21:39:00 UTC 2016
Review: Needs Fixing
Diff comments:
> === modified file 'po/messaging-app.pot'
I suppose this change was included by mistake. Can you revert it?
>
> === modified file 'src/qml/Messages.qml'
> --- src/qml/Messages.qml 2016-11-10 16:38:13 +0000
> +++ src/qml/Messages.qml 2016-11-10 20:58:41 +0000
> @@ -300,6 +300,42 @@
> multiRecipient.forceActiveFocus()
> }
>
> + function sendMessageSanityCheck(text, participantIds, attachments, properties) {
> + // if MMS is enabled, we don't have to check for anything here
> + if (telepathyHelper.mmsEnabled ) {
> + return true
> + }
> +
> + // in case it is not enabled, we need to check if there will be an overload for sending the message
> + var accounts = telepathyHelper.accountOverload(messages.account)
> + for (var i in accounts) {
> + var account = accounts[i]
> + if (account.active) {
> + return true
> + }
> + }
> +
> + // if the account is not a phone one, we can also send the message
can we move this check before the previous block? just to avoid calling accountOverload() on every message that's sent to accounts other than PhoneAccount.
> + if (messages.account.type != AccountEntry.PhoneAccount) {
> + return true
> + }
> +
> + // now we are here with a phone account that doesn't support MMS
> + // we check if MMS is required or not
> + // for now it is only required in two cases: attachments and MMS groups
> + // so if chatType is not Room and the attachment list is empty, we can send
> + if (messages.chatType != ChatEntry.ChatTypeRoom && attachments.length == 0) {
> + return true
> + }
> +
> + // last but not least, show a warning to the user saying he needs to enable MMS to send the message
> + var props = {}
> + props["title"] = i18n.tr("MMS support required")
> + props["text"] = i18n.tr("MMS support is required to send this message.\nPlease enable it in Settings->Enable MMS messages")
> + PopupUtils.open(Qt.createComponent("Dialogs/InformationDialog.qml").createObject(messages), messages, props)
> + return false
> + }
> +
> function sendMessage(text, participantIds, attachments, properties) {
> if (typeof(properties) === 'undefined') {
> properties = {}
--
https://code.launchpad.net/~phablet-team/messaging-app/mms_settings/+merge/310582
Your team Ubuntu Phablet Team is subscribed to branch lp:messaging-app/staging.
More information about the Ubuntu-reviews
mailing list