From 8d20eacaff2982463a78067d3725987eb84c7cc3 Mon Sep 17 00:00:00 2001 From: Joan Reyero Date: Wed, 5 Apr 2023 13:51:27 +0200 Subject: [PATCH 1/2] Changed integration to always put channel as channel and keep the child channel in attributes.childchannel --- .../services/integrations/discordIntegrationService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/serverless/integrations/services/integrations/discordIntegrationService.ts b/backend/src/serverless/integrations/services/integrations/discordIntegrationService.ts index ee9be81ff2..965624a6bb 100644 --- a/backend/src/serverless/integrations/services/integrations/discordIntegrationService.ts +++ b/backend/src/serverless/integrations/services/integrations/discordIntegrationService.ts @@ -525,9 +525,9 @@ export class DiscordIntegrationService extends IntegrationServiceBase { ? DiscordIntegrationService.replaceMentions(record.content, record.mentions) : '', url: `https://discordapp.com/channels/${channel.guild_id}/${channel.id}/${record.id}`, - channel: channel.name, + channel: parentChannel, attributes: { - parentChannel, + childChannel: channel.name, thread: isThread, reactions: record.reactions ? record.reactions : [], attachments: record.attachments ? record.attachments : [], From 2ce27617c1b9fc9fcf518cc0e372eed27f2ff810 Mon Sep 17 00:00:00 2001 From: Joan Reyero Date: Wed, 5 Apr 2023 14:04:14 +0200 Subject: [PATCH 2/2] FIxed channel layout --- .../services/integrations/discordIntegrationService.ts | 4 ++-- backend/src/types/activityTypes.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/serverless/integrations/services/integrations/discordIntegrationService.ts b/backend/src/serverless/integrations/services/integrations/discordIntegrationService.ts index 965624a6bb..8f992eefb5 100644 --- a/backend/src/serverless/integrations/services/integrations/discordIntegrationService.ts +++ b/backend/src/serverless/integrations/services/integrations/discordIntegrationService.ts @@ -525,9 +525,9 @@ export class DiscordIntegrationService extends IntegrationServiceBase { ? DiscordIntegrationService.replaceMentions(record.content, record.mentions) : '', url: `https://discordapp.com/channels/${channel.guild_id}/${channel.id}/${record.id}`, - channel: parentChannel, + channel: parentChannel || channel.name, attributes: { - childChannel: channel.name, + childChannel: parentChannel ? channel.name : undefined, thread: isThread, reactions: record.reactions ? record.reactions : [], attachments: record.attachments ? record.attachments : [], diff --git a/backend/src/types/activityTypes.ts b/backend/src/types/activityTypes.ts index 0f2e3cf76e..f0a727cd18 100644 --- a/backend/src/types/activityTypes.ts +++ b/backend/src/types/activityTypes.ts @@ -293,10 +293,10 @@ export const DEFAULT_ACTIVITY_TYPE_SETTINGS: DefaultActivityTypes = { [DiscordtoActivityType.THREAD_MESSAGE]: { display: { default: - 'replied to a message in thread #{channel} -> {attributes.parentChannel}', + 'replied to a message in thread #{channel} -> {attributes.childChannel}', short: 'replied to a message', channel: - 'thread #{channel} -> #{attributes.parentChannel}', + 'thread #{channel} -> #{attributes.childChannel}', }, isContribution: DiscordGrid.message.isContribution, },