Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge branch 'matrix-org:develop' into yaya-usman/patch_2
Browse files Browse the repository at this point in the history
  • Loading branch information
yaya-usman authored Apr 13, 2022
2 parents cfbd9fa + d151365 commit 108c4ba
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
9 changes: 9 additions & 0 deletions res/css/views/right_panel/_TimelineCard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ limitations under the License.
overflow: hidden;
position: relative; // offset parent for jump to bottom button
flex: 1;
border-radius: 8px;
}

.mx_AutoHideScrollbar {
Expand Down Expand Up @@ -124,4 +125,12 @@ limitations under the License.
.mx_WhoIsTypingTile_avatars {
flex-basis: 48px; // 12 (padding on message list) + 36 (padding on event lines)
}

&.mx_BaseCard {
// For a chat timeline on the right panel when the widget is maximised
// TODO: rename ThreadPanel
&.mx_ThreadPanel {
padding-right: 8px; // .mx_RightPanel padding
}
}
}
20 changes: 11 additions & 9 deletions src/components/structures/RoomView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1395,15 +1395,17 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
return b.length - a.length;
});

// Process all thread roots returned in this batch of search results
// XXX: This won't work for results coming from Seshat which won't include the bundled relationship
for (const result of results.results) {
for (const event of result.context.getTimeline()) {
const bundledRelationship = event
.getServerAggregatedRelation<IThreadBundledRelationship>(THREAD_RELATION_TYPE.name);
if (!bundledRelationship || event.getThread()) continue;
const room = this.context.getRoom(event.getRoomId());
event.setThread(room.findThreadForEvent(event) ?? room.createThread(event, [], true));
if (this.context.supportsExperimentalThreads()) {
// Process all thread roots returned in this batch of search results
// XXX: This won't work for results coming from Seshat which won't include the bundled relationship
for (const result of results.results) {
for (const event of result.context.getTimeline()) {
const bundledRelationship = event
.getServerAggregatedRelation<IThreadBundledRelationship>(THREAD_RELATION_TYPE.name);
if (!bundledRelationship || event.getThread()) continue;
const room = this.context.getRoom(event.getRoomId());
event.setThread(room.findThreadForEvent(event) ?? room.createThread(event, [], true));
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/EventUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export async function fetchInitialEvent(
initialEvent = null;
}

if (initialEvent?.isThreadRelation) {
if (initialEvent?.isThreadRelation && client.supportsExperimentalThreads()) {
try {
const rootEventData = await client.fetchRoomEvent(roomId, initialEvent.threadRootId);
const rootEvent = new MatrixEvent(rootEventData);
Expand Down

0 comments on commit 108c4ba

Please sign in to comment.