[Patchew-devel] [PATCH] mbox: fall back to References header if In-Reply-To is missing

Paolo Bonzini posted 1 patch 2 years, 6 months ago
Failed in applying to current master (apply log)
mbox.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
[Patchew-devel] [PATCH] mbox: fall back to References header if In-Reply-To is missing
Posted by Paolo Bonzini 2 years, 6 months ago
Observed at https://patchew.org/linux/20220324134548.432837672@linutronix.de/.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 mbox.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/mbox.py b/mbox.py
index 29a7570..8466f00 100644
--- a/mbox.py
+++ b/mbox.py
@@ -142,7 +142,12 @@ class MboxMessage(object):
         return msgid
 
     def get_in_reply_to(self):
-        return self.trim_message_id(self._m["in-reply-to"])
+        msgid = self._m["in-reply-to"]
+        if not msgid:
+            refs = self._m["references"]
+            if refs:
+                msgid = refs.split()[0]
+        return self.trim_message_id(msgid)
 
     def get_date(self, timestamp=False):
         tup = email.utils.parsedate_tz(self._m["date"])
-- 
2.35.1

_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/patchew-devel