Compare commits

...

4 Commits

Author SHA1 Message Date
Joshua Goins
c9c6db8e04 Prevent users from trying to search in encrypted rooms
I forgot that this has to be handled client-side (duh, we're the only
one who can read the messages!) This has already tripped up at least one
user, and probably more. So until we support that, our UI shouldn't lie
to you.
2026-02-27 15:24:18 -05:00
James Graham
7550b2b000 Apply 1 suggestion(s) to 1 file(s)
Co-authored-by: Tobias Fella <fella@posteo.de>
2026-02-27 14:15:30 +00:00
James Graham
daa66c4abc Treat all text in a code block as plain, i.e. don't format based on markdown. 2026-02-27 14:15:30 +00:00
James Graham
e0b229e040 Focus the charbar when clicking the reply button. 2026-02-27 13:29:04 +00:00
3 changed files with 8 additions and 1 deletions

View File

@@ -188,7 +188,7 @@ void ChatMarkdownHelper::checkMarkdown(int position, int charsRemoved, int chars
// This can happen when formatting is applied.
if (charsAdded == charsRemoved) {
return;
} else if (m_textItem->isCompleting || charsRemoved > charsAdded || charsAdded - charsRemoved > 1) {
} else if ((m_textItem->textFormat() && m_textItem->textFormat() == Qt::TextFormat::PlainText) || m_textItem->isCompleting || charsRemoved > charsAdded || charsAdded - charsRemoved > 1) {
updatePosition(std::max(0, position - charsRemoved + charsAdded));
return;
}

View File

@@ -90,6 +90,7 @@ void ChatBarMessageContentModel::connectCache(ChatBarCache *oldCache)
}
const auto currentCache = m_room->cacheForType(m_type);
updateReplyModel();
refocusCurrentComponent();
if (currentCache->isEditing()) {
initializeFromCache();
}

View File

@@ -30,6 +30,9 @@ SearchPage {
*/
property string senderId
// This requires client-side search we don't implement yet
readonly property bool canSearch: !room.usesEncryption
title: i18nc("@action:title", "Search Messages")
model: SearchModel {
@@ -45,6 +48,9 @@ SearchPage {
searchFieldPlaceholder: i18n("Find messages…")
noSearchPlaceholderMessage: i18n("Enter text to start searching")
noResultPlaceholderMessage: i18n("No messages found")
customPlaceholderIcon: "lock-symbolic"
customPlaceholderText: !canSearch ? i18n("Cannot search in encrypted rooms") : ""
enableSearch: canSearch
listVerticalLayoutDirection: ListView.BottomToTop