T7024 fix: implement attachment-based forwarding
ClosedPublic

Authored by rnicole on Feb 20 2018, 11:27 AM.

Details

Summary

Implement attachment-based forwarding.

Some notes:

  • loadAsDraft was removed in favor of new enum loadType in QML, and callback based generic programming in C++

Diff Detail

Repository
R162 Kube
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rnicole requested review of this revision.Feb 20 2018, 11:27 AM
rnicole created this revision.

Great work!

The icons should be added via the copybreeze script, and some minor nitpicks inline.

framework/src/domain/composercontroller.h
50

Instead of the extra class, perhaps the enum could just become part of the ComposerController?

framework/src/domain/mime/mailtemplates.cpp
879

I think the filename can be removed entirely.
There seem to be quite some interoperability pitfalls when choosing one (with/without .eml extension),
and it's not clear what it would be useful for.
There's a huge thread over here about the topic: https://bugzilla.mozilla.org/show_bug.cgi?id=220646

Also, roundcube seems to not set a filename so let's just follow that.

887

Those can be removed I think (or otherwise they should be qDebug)

views/composer/qml/View.qml
68

That comment is no longer necessary since the code is much clearer now.

rnicole planned changes to this revision.Feb 20 2018, 12:52 PM
rnicole marked 4 inline comments as done.
rnicole updated this revision to Diff 27601.Feb 20 2018, 12:59 PM
  • Do not set attachment name to the forwarded mail
  • Move ComposerLoadType inside the ComposerController class
  • Remove useless debug logs

To import the icons you have to modify and run the copyBreeze script in the icons subdirectory.

framework/src/frameworkplugin.cpp
123 ↗(On Diff #27601)

Just use the enum via ComposerController instead, no need for the extra type.

cmollekopf requested changes to this revision.Feb 20 2018, 6:40 PM
This revision now requires changes to proceed.Feb 20 2018, 6:40 PM
rnicole updated this revision to Diff 27635.Feb 20 2018, 7:19 PM

Modified the copyBreeze.sh script to add missing icons.

cmollekopf requested changes to this revision.Feb 20 2018, 8:48 PM

Tried the patch, here's some more feedback:

  • The modification of the copybreeze script is still missing.
  • Not your fault, but please exclude all the mimetype icons. They are unrelated, so let's do that separately.
  • I revised my opinion on the filename, please set it to subject + ".eml" ending.
  • In my tests the attachment doesn't actually render (I have not figured out yet why). Probably try just doing the same like roundcube by looking at the MIME message source.
  • Eventually we'll want a test in framework/src/domain/mime/tests/mailtemplatetest.cpp for the forward part as well.
This revision now requires changes to proceed.Feb 20 2018, 8:48 PM
rnicole updated this revision to Diff 27665.Feb 21 2018, 11:00 AM
  • Add the modifications to copyBreeze.sh, duh
  • Remove mimetype icons
  • Set forwarded message name to original Subject + ".eml"
  • Set forwarded message attachment to "inline" for client automatic display
  • Add unit test

Great work!

The only remaining thing is the removal of the ComposerLoadType as noted in my inline comment (just access the enum via ComposerController).

rnicole updated this revision to Diff 27688.Feb 21 2018, 1:59 PM

Completely remove the "ComposerLoadType" and use "ComposerController" directly for composer switching mode enum

rnicole planned changes to this revision.Feb 21 2018, 2:38 PM

Forwarded mail still isn't displayed in clients (some clients (Evolution) even believe it's an empty message)

rnicole updated this revision to Diff 27720.Feb 21 2018, 6:29 PM
  • Properly forward the message (not an encapsulated attachment)
  • Reference the thread in the new message
This revision was not accepted when it landed; it landed in state Needs Review.Feb 21 2018, 8:22 PM
This revision was automatically updated to reflect the committed changes.