Link rooms with `?via` query paramter from room directory landing page (#104)
Fix https://github.com/matrix-org/matrix-public-archive/issues/91 So we're always able to join the room from our origin homeserver to the remote room we don't know about yet.
This commit is contained in:
parent
3b4fb52bfe
commit
d2d6c5a580
|
@ -34,20 +34,6 @@ class RoomDirectoryViewModel extends ViewModel {
|
||||||
this._homeserverUrl = homeserverUrl;
|
this._homeserverUrl = homeserverUrl;
|
||||||
this._homeserverName = homeserverName;
|
this._homeserverName = homeserverName;
|
||||||
this._matrixPublicArchiveURLCreator = matrixPublicArchiveURLCreator;
|
this._matrixPublicArchiveURLCreator = matrixPublicArchiveURLCreator;
|
||||||
this._rooms = new ObservableArray(
|
|
||||||
rooms.map((room) => {
|
|
||||||
return {
|
|
||||||
roomId: room.room_id,
|
|
||||||
canonicalAlias: room.canonical_alias,
|
|
||||||
name: room.name,
|
|
||||||
mxcAvatarUrl: room.avatar_url,
|
|
||||||
homeserverUrlToPullMediaFrom: homeserverUrl,
|
|
||||||
numJoinedMembers: room.num_joined_members,
|
|
||||||
topic: room.topic,
|
|
||||||
archiveRoomUrl: matrixPublicArchiveURLCreator.archiveUrlForRoom(room.room_id),
|
|
||||||
};
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
this._pageSearchParameters = pageSearchParameters;
|
this._pageSearchParameters = pageSearchParameters;
|
||||||
// Default to what the page started with
|
// Default to what the page started with
|
||||||
|
@ -78,6 +64,23 @@ class RoomDirectoryViewModel extends ViewModel {
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
this._rooms = new ObservableArray(
|
||||||
|
rooms.map((room) => {
|
||||||
|
return {
|
||||||
|
roomId: room.room_id,
|
||||||
|
canonicalAlias: room.canonical_alias,
|
||||||
|
name: room.name,
|
||||||
|
mxcAvatarUrl: room.avatar_url,
|
||||||
|
homeserverUrlToPullMediaFrom: homeserverUrl,
|
||||||
|
numJoinedMembers: room.num_joined_members,
|
||||||
|
topic: room.topic,
|
||||||
|
archiveRoomUrl: matrixPublicArchiveURLCreator.archiveUrlForRoom(room.room_id, {
|
||||||
|
viaServers: [this.pageSearchParameters.homeserver],
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
this.#setupNavigation();
|
this.#setupNavigation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue