aboutsummaryrefslogtreecommitdiffstats
path: root/src/threadlistmodel.cpp
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-26 15:55:13 +0200
committerDanilo M. <danix@danix.xyz>2026-08-26 15:55:13 +0200
commitca5b6ca711e73bc22fdf108e06d82241e059c6ee (patch)
tree26fc84fb4f5de11fbf71179fe2f3dc7eb9c01f2e /src/threadlistmodel.cpp
parent5e769b073062a8913d2c4250d079aeb2d7d7b0e8 (diff)
downloadqtmaildir-ca5b6ca711e73bc22fdf108e06d82241e059c6ee.tar.gz
qtmaildir-ca5b6ca711e73bc22fdf108e06d82241e059c6ee.zip
feat: expose a row's sender to the delegate
Diffstat (limited to 'src/threadlistmodel.cpp')
-rw-r--r--src/threadlistmodel.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/threadlistmodel.cpp b/src/threadlistmodel.cpp
index fcd8e4f..a6fada3 100644
--- a/src/threadlistmodel.cpp
+++ b/src/threadlistmodel.cpp
@@ -383,6 +383,13 @@ QVariant ThreadListModel::data(const QModelIndex &index, int role) const
}
case AccountLabelRole:
return QString();
+ case SenderAddressRole:
+ // The REPLY's own sender, exactly as SendersRole serves the node's
+ // `from` and not the thread's summary. The bare address is what
+ // the avatar hashes and the business-senders list matches.
+ return node.senderAddress;
+ case SenderNameRole:
+ return node.from;
case Qt::DisplayRole:
case SubjectRole:
return node.subject;
@@ -678,6 +685,16 @@ QVariant ThreadListModel::data(const QModelIndex &index, int role) const
if (!thread.recipients.isEmpty())
return thread.recipients;
return thread.authors;
+ case SenderAddressRole:
+ // The bare address of the message this card stands for, carried from
+ // the query. This is what the avatar's hash and the business-senders
+ // lookup consume; the display name below is what the card draws.
+ return thread.firstMessageSender;
+ case SenderNameRole:
+ // The same string the card's first line shows: recipients in a flat
+ // view, where `authors` is the user on every row and says nothing.
+ return !thread.recipients.isEmpty() ? thread.recipients
+ : thread.authors;
case DateRole:
// The QDateTime itself. Formatting belongs to the delegate now: the
// card decides how much of a date it has room for, and a pre-formatted