Make joining remote rooms more reliable
When joining remote rooms we have to specify another homeserver (that is in the
room) to help us join. The matrix documentation is a little unclear what to do
in this scenario, so instead of giving up let's at least brute force it with the
server in the alias or room id.
This *does* work and allows my server to join rooms in NeoChat I otherwise
couldn't.
BUG: 487253
CCBUG: 491359
FIXED-IN: 24.12.3
(cherry picked from commit f1253e4ede)
Co-authored-by: Joshua Goins <josh@redstrate.com>
This commit is contained in:
@@ -323,7 +323,15 @@ void RoomManager::visitRoom(Room *r, const QString &eventId)
|
|||||||
|
|
||||||
void RoomManager::joinRoom(Quotient::Connection *account, const QString &roomAliasOrId, const QStringList &viaServers)
|
void RoomManager::joinRoom(Quotient::Connection *account, const QString &roomAliasOrId, const QStringList &viaServers)
|
||||||
{
|
{
|
||||||
auto job = account->joinRoom(roomAliasOrId, viaServers);
|
QStringList vias = viaServers;
|
||||||
|
|
||||||
|
// If no one gives us a homeserver suggestion, try the server specified in the alias/id.
|
||||||
|
// Otherwise joining a remote room not on our homeserver will fail.
|
||||||
|
if (vias.empty()) {
|
||||||
|
vias.append(roomAliasOrId.mid(roomAliasOrId.lastIndexOf(':'_L1) + 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
auto job = account->joinRoom(roomAliasOrId, vias);
|
||||||
connect(
|
connect(
|
||||||
job.get(),
|
job.get(),
|
||||||
&Quotient::BaseJob::finished,
|
&Quotient::BaseJob::finished,
|
||||||
|
|||||||
Reference in New Issue
Block a user