* mu-store, mu-msg-file: improve flagging
This commit is contained in:
@ -339,7 +339,7 @@ get_flags (MuMsgFile *self)
|
|||||||
|
|
||||||
/* pseudo-flag --> unread means either NEW or NOT SEEN, just
|
/* pseudo-flag --> unread means either NEW or NOT SEEN, just
|
||||||
* for searching convenience */
|
* for searching convenience */
|
||||||
if ((flags & MU_FLAG_NEW) || (!(flags & MU_FLAG_SEEN)))
|
if ((flags & MU_FLAG_NEW) || !(flags & MU_FLAG_SEEN))
|
||||||
flags |= MU_FLAG_UNREAD;
|
flags |= MU_FLAG_UNREAD;
|
||||||
|
|
||||||
return flags;
|
return flags;
|
||||||
|
|||||||
@ -331,22 +331,21 @@ add_terms_values_date (Xapian::Document& doc, MuMsg *msg, MuMsgFieldId mfid)
|
|||||||
G_GNUC_CONST static const std::string&
|
G_GNUC_CONST static const std::string&
|
||||||
flag_val (char flagchar)
|
flag_val (char flagchar)
|
||||||
{
|
{
|
||||||
static const std::string pfx (prefix(MU_MSG_FIELD_ID_PRIO));
|
static const std::string
|
||||||
|
pfx (prefix(MU_MSG_FIELD_ID_FLAGS)),
|
||||||
|
/* xapian wants lowercase */
|
||||||
|
draftstr (pfx + (char)tolower(mu_flag_char(MU_FLAG_DRAFT))),
|
||||||
|
flaggedstr (pfx + (char)tolower(mu_flag_char(MU_FLAG_FLAGGED))),
|
||||||
|
passedstr (pfx + (char)tolower(mu_flag_char(MU_FLAG_PASSED))),
|
||||||
|
repliedstr (pfx + (char)tolower(mu_flag_char(MU_FLAG_REPLIED))),
|
||||||
|
seenstr (pfx + (char)tolower(mu_flag_char(MU_FLAG_SEEN))),
|
||||||
|
trashedstr (pfx + (char)tolower(mu_flag_char(MU_FLAG_TRASHED))),
|
||||||
|
newstr (pfx + (char)tolower(mu_flag_char(MU_FLAG_NEW))),
|
||||||
|
|
||||||
static const std::string draftstr (pfx + mu_flag_char(MU_FLAG_DRAFT));
|
signedstr (pfx + mu_flag_char(MU_FLAG_SIGNED)),
|
||||||
static const std::string flaggedstr (pfx + mu_flag_char(MU_FLAG_FLAGGED));
|
encryptedstr (pfx + mu_flag_char(MU_FLAG_ENCRYPTED)),
|
||||||
static const std::string passedstr (pfx + mu_flag_char(MU_FLAG_PASSED));
|
has_attachstr (pfx + mu_flag_char(MU_FLAG_HAS_ATTACH)),
|
||||||
static const std::string repliedstr (pfx + mu_flag_char(MU_FLAG_REPLIED));
|
unreadstr (pfx + mu_flag_char(MU_FLAG_UNREAD));
|
||||||
static const std::string seenstr (pfx + mu_flag_char(MU_FLAG_SEEN));
|
|
||||||
static const std::string trashedstr (pfx + mu_flag_char(MU_FLAG_TRASHED));
|
|
||||||
|
|
||||||
static const std::string newstr (pfx + mu_flag_char(MU_FLAG_NEW));
|
|
||||||
|
|
||||||
static const std::string signedstr (pfx + mu_flag_char(MU_FLAG_SIGNED));
|
|
||||||
static const std::string encryptedstr (pfx + mu_flag_char(MU_FLAG_ENCRYPTED));
|
|
||||||
static const std::string has_attachstr(pfx + mu_flag_char(MU_FLAG_HAS_ATTACH));
|
|
||||||
|
|
||||||
static const std::string unreadstr (pfx + mu_flag_char(MU_FLAG_UNREAD));
|
|
||||||
|
|
||||||
switch (flagchar) {
|
switch (flagchar) {
|
||||||
|
|
||||||
@ -380,13 +379,10 @@ prio_val (MuMsgPrio prio)
|
|||||||
{
|
{
|
||||||
static const std::string pfx (prefix(MU_MSG_FIELD_ID_PRIO));
|
static const std::string pfx (prefix(MU_MSG_FIELD_ID_PRIO));
|
||||||
|
|
||||||
static const std::string lowstr
|
static const std::string
|
||||||
(pfx + std::string(1, mu_msg_prio_char(MU_MSG_PRIO_LOW)));
|
lowstr (pfx + std::string(1, mu_msg_prio_char(MU_MSG_PRIO_LOW))),
|
||||||
static const std::string normalstr
|
normalstr (pfx + std::string(1, mu_msg_prio_char(MU_MSG_PRIO_NORMAL))),
|
||||||
(pfx + std::string(1, mu_msg_prio_char(MU_MSG_PRIO_NORMAL)));
|
highstr (pfx + std::string(1, mu_msg_prio_char(MU_MSG_PRIO_HIGH)));
|
||||||
static const std::string highstr
|
|
||||||
(pfx + std::string(1, mu_msg_prio_char(MU_MSG_PRIO_HIGH)));
|
|
||||||
|
|
||||||
|
|
||||||
switch (prio) {
|
switch (prio) {
|
||||||
case MU_MSG_PRIO_LOW: return lowstr;
|
case MU_MSG_PRIO_LOW: return lowstr;
|
||||||
|
|||||||
Reference in New Issue
Block a user