mirror of https://github.com/djcb/mu.git
* fix broken references: don't comma-separate
This commit is contained in:
parent
8b89ff3c90
commit
deb862a488
|
@ -257,7 +257,7 @@ get_str_list_field (MuMsg *self, MuMsgFieldId mfid)
|
||||||
|
|
||||||
if (self->_doc && mu_msg_field_xapian_value (mfid))
|
if (self->_doc && mu_msg_field_xapian_value (mfid))
|
||||||
val = mu_msg_doc_get_str_list_field (self->_doc, mfid);
|
val = mu_msg_doc_get_str_list_field (self->_doc, mfid);
|
||||||
if (!val && !self->_doc) {
|
else if (mu_msg_field_gmime (mfid)) {
|
||||||
/* if we don't have a file object yet, we need to
|
/* if we don't have a file object yet, we need to
|
||||||
* create it from the file on disk */
|
* create it from the file on disk */
|
||||||
if (!mu_msg_load_msg_file (self, NULL))
|
if (!mu_msg_load_msg_file (self, NULL))
|
||||||
|
@ -287,10 +287,8 @@ get_str_field (MuMsg *self, MuMsgFieldId mfid)
|
||||||
if (!mu_msg_load_msg_file (self, NULL))
|
if (!mu_msg_load_msg_file (self, NULL))
|
||||||
return NULL;
|
return NULL;
|
||||||
val = mu_msg_file_get_str_field (self->_file, mfid, &do_free);
|
val = mu_msg_file_get_str_field (self->_file, mfid, &do_free);
|
||||||
} else {
|
} else
|
||||||
g_warning ("%s: cannot retrieve field", __FUNCTION__);
|
|
||||||
val = NULL;
|
val = NULL;
|
||||||
}
|
|
||||||
|
|
||||||
return do_free ? free_later_str (self, val) : val;
|
return do_free ? free_later_str (self, val) : val;
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,13 +71,21 @@ comma-separated string. Normally, this the concatenation of the
|
||||||
existing References (which may be empty) and the message-id. If the
|
existing References (which may be empty) and the message-id. If the
|
||||||
message-id is empty, returns the old References. If both are empty,
|
message-id is empty, returns the old References. If both are empty,
|
||||||
return nil."
|
return nil."
|
||||||
(let ((refs (mu4e-message-field msg :references))
|
(message "REF %S"(mu4e-message-field msg :references))
|
||||||
(old-msgid (mu4e-message-field msg :message-id)))
|
(message "IRT %S"(mu4e-message-field msg :in-reply-to))
|
||||||
(when old-msgid
|
(message "MID %S"(mu4e-message-field msg :message-id))
|
||||||
(setq refs (append refs (list old-msgid)))
|
(let* ( ;; these are the ones from the message being replied to / forwarded
|
||||||
(mapconcat
|
(refs (mu4e-message-field msg :references))
|
||||||
(lambda (msgid) (format "<%s>" msgid))
|
(in-reply-to (mu4e-message-field msg :in-reply-to))
|
||||||
refs ","))))
|
(msgid (mu4e-message-field msg :message-id))
|
||||||
|
;; now, append in
|
||||||
|
(refs (if (and in-reply-to (not (string= in-reply-to "")))
|
||||||
|
(append refs (list in-reply-to)) refs))
|
||||||
|
(refs (if (and msgid (not (string= msgid "")))
|
||||||
|
(append refs (list msgid)) refs))
|
||||||
|
;; no doubles
|
||||||
|
(refs (delete-duplicates refs :test #'equal)))
|
||||||
|
(mapconcat (lambda (id) (format "<%s>" id)) refs " ")))
|
||||||
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
Loading…
Reference in New Issue