The option to set "Select html part of multipart/alternative message" is already in global preferences (Configuration>Preferences>TextOptions>HTMLMessages). It would be nice if we can set only on spesific folder properties (right click on folder>properties). Thank you.
This would be an excellent feature. I would sure appreciate it here too.
I was considering enabling this on a per-folderclass basis, so that clawsmail would select HTML part for e.g my RSS feeds, but not for e-mails. But per-folder sounds good as well, with possibility to apply this also to subfolders.
Adding my vote to this as well, This would be excellent.
I was thinking of implementing this, but am still not sure how to handle the user preferences. Right now, there's a simple global on/off switch for selecting HTML part automatically. What happens when we add such option per-folder? Remove the global switch? What would be the default ? (NOT selecting HTML part, I guess) How to handle the migration from previous CM version?
Yes, that's an interesting feature. It would allow to select HTML only for folders like RSS feeds or similar. General preference can be overridden by the local folder one i think. I haven't gone thought the code but it's something interesting to be done.
I don't know the code/internals here, but I think changing the existing pref into the 'global' one (and noting it could be changed on a per folder basis) would be the best way. Then you honor that setting as global unless it's changed in the per folder pref.
Kevin, right now, it *is* a global preference. :) The thing is, if we add it also as a per-folder preference, the global preference loses its meaning, because in effect, whether or not to select HTML part would be controlled by that folder's switch. A checkbox can only have two values, there is no space for "yes"/"no"/"obey global preference". I guess best way would be to remove the global preference option, and write a small routine which will run only if the global option is found in config, and would: - remove the option from config - apply its last value to all existing folders Any comments?
I think it's just easier and logical to let the local preference overrides the global one. Much the same as it works with global and local variables.
Perhaps it's better to not try and get really specific, but instead think about use cases? I would prefer everything prefer text by default, except for specific folders, and thinking about it, perhaps it's not even per folder, perhaps it could be a per contact preference? I might like to prefer the html for bugzilla bugs, and I might like to prefer the plain text for some friend that sends crazy htmls that are hard to read. Would it make more sense to have this as a per contact pref?
There was an interesting idea by Woody on IRC today - instead of a checkbox, make the preference a combobox with three options: - select HTML part - do not select HTML part - obey global preference In this form, this could be added to folder preferences, as well as to contact preferences (if the addressbook allows it, I'm not really sure now), and figure out which one gets priority. Possibly contact > folder > global. By the way, I don't think such per-contact option is that useful, but if more people want it, and if the addressbook allows it, I have no objections.
isn't it better to use checkbox like any other properties ? Just like Salvatore comment #8. Example : Apply to subfolder [ ] Select html part of multipart/alternative message [ ] if not checked, use global preference.
That doesn't take care of the scenario where the user wants to see HTML version by default (set in app preferences) except a few folders where they want to see mails only in text.
Ah sorry, it's because I use text by default :P Then I guess combobox is the best choice.
Created attachment 1114 [details] A per-folder option to "select HTML part" on message open Attached patch adds a "Yes"/"No"/"Obey global preference" combobox to folder prefs, and selects HTML part accordingly. Comments are welcome. Please note that this won't have any effect on RSSyl folders, because RSSyl doesn't create multipart/alternative messages, just text/html messages. Therefore you need to have the global "Render HTML-only messages with plugin if possible" option enabled to view HTML-rendered output by default.
Created attachment 1115 [details] A per-folder option to "select HTML part" on message open Updated patch adds "apply to subfolders checkbox", changes the long "Obey ..." option wording to simple "Default", and adds a tooltip explaining what exactly "Default" does.
I image from a users perspective, it seems weird to treat html only mails differently from multipart/alternative with a html part. Either I want to see html, or I don't. Whether that's multipart or html only doesn't really matter.
I agree with you, but that is somewhat outside of scope for this particular bug. Right now, there are two separate toggles for: - selecting HTML part automatically for multipart messages - rendering HTML with a plugin, regardless of how it happened to be selected I agree that it is a good idea to have this unified somehow.
Created attachment 1158 [details] A per-folder option to "select HTML part" on message open Updated the patch to work with current cvs (3.8.1cvs57). I have noticed that our multipart parsing logic is a bit limited. The html part of following message will not be selected automatically, because the parser is not looking for multipart/related inside a multipart/alternative (messageview.c, around line 1500). multipart/alternative text/plain multipart/related text/html image/jpg It could use a rewrite, a truly recursive parser could probably be better. Of course, this is also outside of scope of this bug. :)
Created attachment 1159 [details] A per-folder option to "select HTML part" on message open Once again, this time a complete patch, not just for one file. Sorry about that.
Hi Andrej, Thanks! Just one nitpick: I'd love to have promote_html_part as an enum so that it's more clear which value does what. :)
Created attachment 1178 [details] A per-folder option to "select HTML part" on message open Fourth version with an enum. I'll commit it if Andrej's happy with it...
Changes related to this bug have been committed. Please check latest CVS and update the bug accordingly. You can also get the patch from: http://www.claws-mail.org/tracker/ 2012-10-31 [colin] 3.8.1cvs109 * src/folder_item_prefs.c * src/folder_item_prefs.h * src/messageview.c * src/prefs_folder_item.c Implement feature from bug #2569, "select html part on folder specific properties" Patch based on Andrej's patch.