From: martin f. krafft Date: Tue, 22 Aug 2023 20:40:20 +0000 (+1200) Subject: buildmimetree.py: unified item dscription setting X-Git-Url: https://git.madduck.net/etc/neomutt.git/commitdiff_plain/242d85bf08cd36625c80d1aaad49d9932e634b81?hp=511e5af574f774aa14b19034f00f3ac5ad987c8b buildmimetree.py: unified item dscription setting --- diff --git a/.config/neomutt/buildmimetree.py b/.config/neomutt/buildmimetree.py index 2dac39c..57fc21a 100755 --- a/.config/neomutt/buildmimetree.py +++ b/.config/neomutt/buildmimetree.py @@ -370,8 +370,6 @@ def do_massage( # tree now: if item.cid: cmds.push(f"\\Ca\\Ck{item.cid}") - if item.desc: - cmds.push(f"\\Ca\\Ck{item.desc}") elif isinstance(item, Multipart): # This node has children, but we already visited them (see @@ -385,14 +383,14 @@ def do_massage( elif item.subtype == "multilingual": cmds.push("") - # Again, if there is a description, we might just as well: - if item.desc: - cmds.push(f"\\Ca\\Ck{item.desc}") - else: # We should never get here assert not "is valid part" + # If the item has a description, we might just as well add it + if item.desc: + cmds.push(f"\\Ca\\Ck{item.desc}") + # Finally, if we're at non-root level, tag the new container, # as it might itself be part of a container, to be processed # one level up: