Join rooms when visiting them
BUG: 477261
This commit is contained in:
@@ -82,7 +82,7 @@ Loader {
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<a href=\"" + root.linkPreviewer.url + "\">" + (maximizeButton.checked ? root.linkPreviewer.title : titleTextMetrics.elidedText).replace("–", "—") + "</a>"
|
<a href=\"" + root.linkPreviewer.url + "\">" + (maximizeButton.checked ? root.linkPreviewer.title : titleTextMetrics.elidedText).replace("–", "—") + "</a>"
|
||||||
onLinkActivated: RoomManager.openResource(link)
|
onLinkActivated: RoomManager.openResource(link, "join")
|
||||||
|
|
||||||
TextMetrics {
|
TextMetrics {
|
||||||
id: titleTextMetrics
|
id: titleTextMetrics
|
||||||
|
|||||||
@@ -315,7 +315,7 @@ Loader {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
|
|
||||||
onLinkActivated: RoomManager.openResource(link);
|
onLinkActivated: RoomManager.openResource(link, "join");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ a{
|
|||||||
|
|
||||||
onLinkActivated: link => {
|
onLinkActivated: link => {
|
||||||
spoilerRevealed = true
|
spoilerRevealed = true
|
||||||
RoomManager.openResource(link)
|
RoomManager.openResource(link, "join")
|
||||||
}
|
}
|
||||||
onHoveredLinkChanged: if (hoveredLink.length > 0 && hoveredLink !== "1") {
|
onHoveredLinkChanged: if (hoveredLink.length > 0 && hoveredLink !== "1") {
|
||||||
applicationWindow().hoverLinkIndicator.text = hoveredLink;
|
applicationWindow().hoverLinkIndicator.text = hoveredLink;
|
||||||
|
|||||||
@@ -95,6 +95,12 @@ void RoomManager::openResource(const QString &idOrUri, const QString &action)
|
|||||||
Q_EMIT warning(i18n("Room not found"), i18n("There's no room %1 in the room list. Check the spelling and the account.", idOrUri));
|
Q_EMIT warning(i18n("Room not found"), i18n("There's no room %1 in the room list. Check the spelling and the account.", idOrUri));
|
||||||
} else { // Invalid cases should have been eliminated earlier
|
} else { // Invalid cases should have been eliminated earlier
|
||||||
Q_ASSERT(result == Quotient::UriResolved);
|
Q_ASSERT(result == Quotient::UriResolved);
|
||||||
|
|
||||||
|
if (uri.type() == Uri::RoomAlias || uri.type() == Uri::RoomId) {
|
||||||
|
connectSingleShot(m_connection, &Connection::newRoom, this, [this, uri](Room *room) {
|
||||||
|
enterRoom(dynamic_cast<NeoChatRoom *>(room));
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user