summary refs log tree commit diff
path: root/src/timeline/TimelineModel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/timeline/TimelineModel.cpp')
-rw-r--r--src/timeline/TimelineModel.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp

index 217cd4c8..91400a40 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp
@@ -643,7 +643,7 @@ TimelineModel::data(const mtx::events::collections::TimelineEvents &event, int r // only show read receipts for messages not from us if (acc::sender(event) != http::client()->user_id().to_string()) return qml_mtx_events::Empty; - else if (!id.isEmpty() && id[0] == "m") + else if (!id.isEmpty() && id[0] == 'm') return qml_mtx_events::Sent; else if (read.contains(id) || containsOthers(cache::readReceipts(id, room_id_))) return qml_mtx_events::Read; @@ -1029,7 +1029,7 @@ TimelineModel::setCurrentIndex(int index) if (!ChatPage::instance()->isActiveWindow()) return; - if (!currentId.startsWith("m")) { + if (!currentId.startsWith('m')) { auto oldReadIndex = cache::getEventIndex(roomId().toStdString(), currentReadId.toStdString()); auto nextEventIndexAndId = @@ -1759,16 +1759,16 @@ TimelineModel::formatTypingUsers(const std::vector<QString> &users, const QColor if (startIndex - index != 0) coloredUsername += - prefix + - uncoloredUsername.midRef(index, startIndex > 0 ? startIndex - index : -1) + - "</font>"; + prefix + uncoloredUsername.mid(index, startIndex > 0 ? startIndex - index : -1) + + QStringLiteral("</font>"); auto endIndex = uncoloredUsername.indexOf("</font>", startIndex); if (endIndex > 0) endIndex += sizeof("</font>") - 1; if (endIndex - startIndex != 0) - coloredUsername += uncoloredUsername.midRef(startIndex, endIndex - startIndex); + coloredUsername += + QStringView(uncoloredUsername).mid(startIndex, endIndex - startIndex); index = endIndex; } while (index > 0 && index < uncoloredUsername.size());