Skip to content

Commit 29282cb

Browse files
committed
Merge remote-tracking branch 'upstream/dev' into feat/thread-enhancements
# Conflicts: # src/app/hooks/timeline/useTimelineEventRenderer.tsx
2 parents 27f5cde + f0ad4f5 commit 29282cb

15 files changed

Lines changed: 205 additions & 103 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
default: minor
3+
---
4+
5+
# Add ability to click on usernames in member and state events to view user info
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
default: minor
3+
---
4+
5+
# Adds a `/html` command to send HTML messages
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
default: note
3+
---
4+
5+
new/changed bios will now also be saved in the format MSC4440 expects
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
default: patch
3+
---
4+
5+
# Fix confusing ui with `Client Side Embeds in Encrypted Rooms` setting
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
default: patch
3+
---
4+
5+
fix forwarding issue for users on synapse homeservers, by removing the relation

pnpm-lock.yaml

Lines changed: 88 additions & 86 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/components/message/modals/MessageForward.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ export function MessageForwardInternal({
224224
}
225225
: {};
226226
const baseContent = { ...mEvent.getContent() };
227+
delete baseContent['m.relates_to']; // remove relations from the forwarded message
228+
delete baseContent['m.mentions']; // remove mentions from forwarded message
227229
delete baseContent['com.beeper.per_message_profile']; // remove per-message profile as that could confuse clients in the target room
228230
let content;
229231
// handle privacy stuff
@@ -232,8 +234,6 @@ export function MessageForwardInternal({
232234
// we can still include the original message content in the body of the message, so we'll just use a fallback text/plain content with the original message body
233235
content = {
234236
...baseContent,
235-
'm.relates_to': null, // remove any relations to avoid confusion in the target room
236-
'm.mentions': null, // remove mentions to avoid leaking information about users in the original room
237237
...forwardedTextContent,
238238
'moe.sable.message.forward': {
239239
v: 1,
@@ -249,10 +249,6 @@ export function MessageForwardInternal({
249249
content = {
250250
...baseContent,
251251
...forwardedTextContent,
252-
'm.relates_to': {
253-
rel_type: 'm.reference',
254-
event_id: eventId,
255-
},
256252
'moe.sable.message.forward': {
257253
v: 1,
258254
is_forwarded: true,

src/app/features/room/RoomTimeline.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export function RoomTimeline({
150150

151151
const showUrlPreview = room.hasEncryptionStateEvent() ? encUrlPreview : urlPreview;
152152
const showClientUrlPreview = room.hasEncryptionStateEvent()
153-
? encClientUrlPreview
153+
? clientUrlPreview && encClientUrlPreview
154154
: clientUrlPreview;
155155

156156
const nicknames = useAtomValue(nicknamesAtom);

src/app/features/settings/account/BioEditor.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type BioEditorProps = {
4444
value?: string | any;
4545
isSaving?: boolean;
4646
imagePackRooms?: any[];
47-
onSave: (htmlContent: string) => void;
47+
onSave: (htmlContent: string, plainText: string) => void;
4848
};
4949

5050
const BIO_LIMIT = 1024;
@@ -81,7 +81,7 @@ export function BioEditor({ value, isSaving, imagePackRooms, onSave }: BioEditor
8181
})
8282
);
8383

84-
onSave(customHtml || plainText);
84+
onSave(customHtml || plainText, plainText);
8585
setHasChanged(false);
8686
}, [editor, isMarkdown, onSave]);
8787

src/app/features/settings/account/Profile.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { useSetAtom } from 'jotai';
2929
import { SequenceCard } from '$components/sequence-card';
3030
import { SettingTile } from '$components/setting-tile';
3131
import { useMatrixClient } from '$hooks/useMatrixClient';
32-
import { UserProfile, useUserProfile } from '$hooks/useUserProfile';
32+
import { UserProfile, useUserProfile, MSC4440Bio } from '$hooks/useUserProfile';
3333
import { getMxIdLocalPart, mxcUrlToHttp } from '$utils/matrix';
3434
import { UserAvatar } from '$components/user-avatar';
3535
import { useMediaAuthentication } from '$hooks/useMediaAuthentication';
@@ -46,6 +46,7 @@ import { useCapabilities } from '$hooks/useCapabilities';
4646
import { profilesCacheAtom } from '$state/userRoomProfile';
4747
import { SequenceCardStyle } from '$features/settings/styles.css';
4848
import { useUserPresence } from '$hooks/useUserPresence';
49+
import { MSC1767Text } from '$types/matrix/common';
4950
import { TimezoneEditor } from './TimezoneEditor';
5051
import { PronounEditor } from './PronounEditor';
5152
import { BioEditor } from './BioEditor';
@@ -576,13 +577,27 @@ function ProfileExtended({ profile, userId }: Readonly<ProfileProps>) {
576577
>
577578
<BioEditor
578579
value={
580+
(profile.extended?.['gay.fomx.biography'] satisfies MSC4440Bio)?.formatted_body ||
579581
profile.extended?.['moe.sable.app.bio'] ||
580582
profile.extended?.['chat.commet.profile_bio'] ||
581583
profile.bio
582584
}
583-
onSave={(htmlBio) => {
585+
onSave={(htmlBio, plainTextBio) => {
584586
handleSaveField('moe.sable.app.bio', htmlBio);
585587

588+
// MSC4440
589+
handleSaveField('gay.fomx.biography', {
590+
'm.text': [
591+
{
592+
body: htmlBio,
593+
mimetype: 'text/html',
594+
} satisfies MSC1767Text,
595+
{
596+
body: plainTextBio,
597+
} satisfies MSC1767Text,
598+
],
599+
} satisfies MSC4440Bio);
600+
586601
const cleanedHtml = htmlBio.replaceAll('<br/></blockquote>', '</blockquote>');
587602
handleSaveField('chat.commet.profile_bio', {
588603
format: 'org.matrix.custom.html',

0 commit comments

Comments
 (0)