diff --git a/src/LoginPage.cpp b/src/LoginPage.cpp
index ea295136..9b48730d 100644
--- a/src/LoginPage.cpp
+++ b/src/LoginPage.cpp
@@ -184,13 +184,14 @@ LoginPage::checkHomeserverVersion()
"v1.7",
"v1.8",
"v1.9",
+ "v1.10",
};
return supported.count(v) != 0;
}) == versions.versions.cend()) {
emit versionErrorCb(
tr("The selected server does not support a version of the Matrix protocol, that this "
"client understands (%1 to %2). You can't sign in.")
- .arg(u"v1.1", u"v1.9"));
+ .arg(u"v1.1", u"v1.10"));
return;
}
diff --git a/src/RegisterPage.cpp b/src/RegisterPage.cpp
index 824547bc..93e2cf1b 100644
--- a/src/RegisterPage.cpp
+++ b/src/RegisterPage.cpp
@@ -139,13 +139,14 @@ RegisterPage::versionsCheck()
"v1.7",
"v1.8",
"v1.9",
+ "v1.10",
};
return supported.count(v) != 0;
}) == versions.versions.cend()) {
emit setHsError(
tr("The selected server does not support a version of the Matrix protocol that "
"this client understands (%1 to %2). You can't register.")
- .arg(u"v1.1", u"v1.9"));
+ .arg(u"v1.1", u"v1.10"));
emit hsErrorChanged();
return;
}
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp
index 2d15d01a..57c1263b 100644
--- a/src/timeline/InputBar.cpp
+++ b/src/timeline/InputBar.cpp
@@ -187,9 +187,6 @@ InputBar::addMention(QString mention, QString text)
mentionTexts_.push_back(text);
emit mentionsChanged();
- if (mention == u"@room") {
- this->containsAtRoom_ = true;
- }
}
}
@@ -200,9 +197,6 @@ InputBar::removeMention(QString mention)
mentions_.removeAt(idx);
mentionTexts_.removeAt(idx);
emit mentionsChanged();
- if (mention == u"@room") {
- this->containsAtRoom_ = false;
- }
}
}
@@ -244,6 +238,7 @@ InputBar::updateTextContentProperties(const QString &t, bool charDeleted)
auto roomMention = containsRoomMention(t) && this->room->permissions()->canPingRoom();
if (roomMention != this->containsAtRoom_) {
+ this->containsAtRoom_ = roomMention;
if (roomMention)
addMention(QStringLiteral(u"@room"), QStringLiteral(u"@room"));
else
@@ -500,8 +495,11 @@ mtx::common::Mentions
InputBar::generateMentions()
{
std::vector<std::string> userMentions;
+ bool atRoom = false;
for (const auto &m : mentions_)
- if (m != u"@room")
+ if (m == u"@room")
+ atRoom = true;
+ else
userMentions.push_back(m.toStdString());
if (!room->reply().isEmpty()) {
@@ -515,7 +513,8 @@ InputBar::generateMentions()
auto mention = mtx::common::Mentions{
.user_ids = userMentions,
- .room = containsAtRoom_,
+ // We use the atRoom from the mentions list to allow suppressing a room mention
+ .room = atRoom,
};
// this->containsAtRoom_ = false;
diff --git a/src/timeline/InputBar.h b/src/timeline/InputBar.h
index c38de662..5e885d4f 100644
--- a/src/timeline/InputBar.h
+++ b/src/timeline/InputBar.h
@@ -194,15 +194,17 @@ public slots:
void storeForEdit()
{
- textBeforeEdit = text();
- mentionsBefore = mentions_;
- mentionTextsBefore = mentionTexts_;
+ textBeforeEdit = text();
+ mentionsBefore = mentions_;
+ mentionTextsBefore = mentionTexts_;
+ containsAtRoomBefore = containsAtRoom_;
emit mentionsChanged();
}
void restoreAfterEdit()
{
- mentions_ = mentionsBefore;
- mentionTexts_ = mentionTextsBefore;
+ mentions_ = mentionsBefore;
+ mentionTexts_ = mentionTextsBefore;
+ containsAtRoom_ = containsAtRoomBefore;
mentionsBefore.clear();
mentionTextsBefore.clear();
setText(textBeforeEdit);
@@ -216,6 +218,9 @@ public slots:
mentions_ = newMentions;
mentionTexts_ = newMentionTexts;
+
+ this->containsAtRoom_ = newMentions.contains(u"@room");
+
emit mentionsChanged();
}
@@ -331,6 +336,7 @@ private:
// store stuff during edits
QStringList mentionsBefore, mentionTextsBefore;
QString textBeforeEdit;
+ bool containsAtRoomBefore = false;
using UploadHandle = std::unique_ptr<MediaUpload, DeleteLaterDeleter>;
std::vector<UploadHandle> unconfirmedUploads;
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp
index 14fd574b..48b58ee5 100644
--- a/src/timeline/TimelineModel.cpp
+++ b/src/timeline/TimelineModel.cpp
@@ -736,7 +736,9 @@ TimelineModel::data(const mtx::events::collections::TimelineEvents &event, int r
.arg(displayName(QString::fromStdString(e.sender)))
.arg(QStringLiteral("<img height=\"32\" src=\"%1\">")
.arg(QUrl::toPercentEncoding(
- QString::fromStdString(e.content.url))));
+ QString::fromStdString(e.content.url)
+ .replace("mxc://", "image://MxcImage/"),
+ ":/")));
else
return tr("%1 removed the room avatar.")
.arg(displayName(QString::fromStdString(e.sender)));
@@ -2244,8 +2246,9 @@ TimelineModel::getRoomVias(const QString &roomId)
void
TimelineModel::copyLinkToEvent(const QString &eventId) const
{
- auto link = QStringLiteral("%1/%2?%3")
- .arg(getBareRoomLink(room_id_),
+ // Event links shouldn't use an alias, since that can be repointed.
+ auto link = QStringLiteral("https://matrix.to/#/%1/%2?%3")
+ .arg(QUrl::toPercentEncoding(room_id_),
QString(QUrl::toPercentEncoding(eventId)),
getRoomVias(room_id_));
QGuiApplication::clipboard()->setText(link);
|