Generate event links only using room ids

This commit is contained in:
Nicolas Werner 2024-06-14 14:53:27 +02:00
parent 20f17aaa36
commit 1d252ae66f
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -2246,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);