Bug 447742 - Make URL-containg List headers available to grantlee for header themeing
Summary: Make URL-containg List headers available to grantlee for header themeing
Status: REPORTED
Alias: None
Product: kdepim
Classification: Applications
Component: messageviewer (show other bugs)
Version: GIT (master)
Platform: unspecified All
: NOR wishlist
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-31 13:56 UTC by Erik Quaeghebeur
Modified: 2021-12-31 13:57 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Quaeghebeur 2021-12-31 13:56:19 UTC
AFAICT, all variables available to grantlee header theme editors are listed in

https://invent.kde.org/pim/messagelib/-/blob/master/messageviewer/src/header/grantleeheaderformatter.cpp

There, it seems some standard (although less common) headers are missing. Some of these likely require some extra parsing before they can be made available. Namely, the URL-containg List-* headers (https://datatracker.ietf.org/doc/html/rfc2369) are not exposed to grantlee. Would it be possible to make List-Help, List-Unsubscribe, List-Subscribe, List-Owner, and List-Archive available to grantlee for header themeing?

As per the RFC, the information in the headers is a list of URLs (between angle brackets <…>, other content can be ignored), possibly both http and mailto ones. The preference is from left to right. List-Post has a special value ‘NO’ for lists that can't be posted to.

For header theme designers, it would be useful to have, e.g., header.listUnsubscribe be a list of items that can be iterated over using grantlee. Each item would then contain a URL header.listUnsubscribe.k.url and type information header.listUnsubscribe.k.protocol (http or mailto), where k is the current list index (normal usage: {% for item in header.listUnsubscribe %}do something with {{ item }} to create output{% endfor %}).