Skip to content

Commit 5ceef6f

Browse files
authored
fix(federation): restore quoted messages reception (#37165)
1 parent 11e3e0f commit 5ceef6f

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

apps/meteor/server/services/meteor/service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ export class MeteorService extends ServiceClassInternal implements IMeteor {
294294
return getURL(path, params, cloudDeepLinkUrl);
295295
}
296296

297-
async getMessageURLToReplyTo(roomType: string, roomId: string, roomName: string, messageIdToReplyTo: string): Promise<string> {
298-
return getURL(`${roomCoordinator.getRouteLink(roomType, { rid: roomId, name: roomName })}?msg=${messageIdToReplyTo}`, { full: true });
297+
async getMessageURLToReplyTo(roomType: string, roomId: string, messageIdToReplyTo: string): Promise<string> {
298+
return getURL(`${roomCoordinator.getRouteLink(roomType, { rid: roomId })}?msg=${messageIdToReplyTo}`, { full: true });
299299
}
300300
}

ee/packages/federation-matrix/src/events/message.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,8 @@ export function message(emitter: Emitter<HomeserverEventSignatures>, serverName:
167167
return;
168168
}
169169

170-
if (quoteMessageEventId && room.name) {
171-
const messageToReplyToUrl = await MeteorService.getMessageURLToReplyTo(
172-
room.t as string,
173-
room._id,
174-
room.name,
175-
originalMessage._id,
176-
);
170+
if (quoteMessageEventId) {
171+
const messageToReplyToUrl = await MeteorService.getMessageURLToReplyTo(room.t as string, room._id, originalMessage._id);
177172
const formatted = await toInternalQuoteMessageFormat({
178173
messageToReplyToUrl,
179174
formattedMessage: data.content.formatted_body || '',
@@ -209,13 +204,13 @@ export function message(emitter: Emitter<HomeserverEventSignatures>, serverName:
209204
return;
210205
}
211206

212-
if (quoteMessageEventId && room.name) {
207+
if (quoteMessageEventId) {
213208
const originalMessage = await Messages.findOneByFederationId(quoteMessageEventId);
214209
if (!originalMessage) {
215210
logger.error('Original message not found for quote:', quoteMessageEventId);
216211
return;
217212
}
218-
const messageToReplyToUrl = await MeteorService.getMessageURLToReplyTo(room.t as string, room._id, room.name, originalMessage._id);
213+
const messageToReplyToUrl = await MeteorService.getMessageURLToReplyTo(room.t as string, room._id, originalMessage._id);
219214
const formatted = await toInternalQuoteMessageFormat({
220215
messageToReplyToUrl,
221216
formattedMessage: data.content.formatted_body || '',

packages/core-services/src/types/IMeteor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ export interface IMeteor extends IServiceClass {
2727
}>;
2828
notifyGuestStatusChanged(token: string, status: string): Promise<void>;
2929
getURL(path: string, params?: Record<string, any>, cloudDeepLinkUrl?: string): Promise<string>;
30-
getMessageURLToReplyTo(roomType: string, roomId: string, roomName: string, messageIdToReplyTo: string): Promise<string>;
30+
getMessageURLToReplyTo(roomType: string, roomId: string, messageIdToReplyTo: string): Promise<string>;
3131
}

0 commit comments

Comments
 (0)