From cbc4f1bfdcec186d1b1d5823d9a9406c29596f78 Mon Sep 17 00:00:00 2001 From: Dragory Date: Sat, 20 Apr 2019 19:13:40 +0300 Subject: [PATCH] When adding archive links to a case, make them all permanent, not just the first one --- src/plugins/Cases.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/Cases.ts b/src/plugins/Cases.ts index d8070856..b51de8e6 100644 --- a/src/plugins/Cases.ts +++ b/src/plugins/Cases.ts @@ -165,10 +165,11 @@ export class CasesPlugin extends ZeppelinPlugin { }); } - const archiveLinkMatch = body && body.match(/\/archives\/([a-zA-Z0-9\-]+)/); + const archiveLinkMatch = body && body.match(/(?<=\/archives\/)[a-zA-Z0-9\-]+/g); if (archiveLinkMatch) { - const archiveId = archiveLinkMatch[1]; - this.archives.makePermanent(archiveId); + for (const archiveId of archiveLinkMatch) { + this.archives.makePermanent(archiveId); + } } if ((!args.automatic || this.getConfig().log_automatic_actions) && args.postInCaseLogOverride !== false) {