Shorten room subtitles for direct chats

Direct chats by their very nature is between two users, and you usually
can keep track of who said what. There's no point in including the
sender's name here, and most other chat applications exclude it for this
reason (including Element X.)
This commit is contained in:
Joshua Goins
2025-12-22 15:02:24 -05:00
parent 6fcb1cc1e3
commit 092980c0ff

View File

@@ -697,6 +697,9 @@ QString EventHandler::subtitleText(const NeoChatRoom *room, const Quotient::Room
qCWarning(EventHandling) << "subtitleText called with event set to nullptr.";
return {};
}
if (room->isDirectChat()) {
return plainBody(room, event, true);
}
return singleLineAuthorDisplayname(room, event) + (event->isStateEvent() ? u" "_s : u": "_s) + plainBody(room, event, true);
}