From 1ee60d9dd3280f30c27d3eedd33e1c804f73c374 Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Fri, 23 Apr 2021 13:39:12 +0300 Subject: [PATCH] temp fix for pleroma urls --- squeebot.repo.json | 2 +- url-fediverse/plugin.json | 2 +- url-fediverse/plugin.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/squeebot.repo.json b/squeebot.repo.json index 3e24e0b..0c9b17f 100644 --- a/squeebot.repo.json +++ b/squeebot.repo.json @@ -31,7 +31,7 @@ }, { "name": "url-fediverse", - "version": "1.0.0" + "version": "1.0.1" }, { "name": "url-peertube", diff --git a/url-fediverse/plugin.json b/url-fediverse/plugin.json index e6c9ef5..1e9634d 100644 --- a/url-fediverse/plugin.json +++ b/url-fediverse/plugin.json @@ -2,7 +2,7 @@ "main": "plugin.js", "name": "url-fediverse", "description": "URLReply Fediverse", - "version": "1.0.0", + "version": "1.0.1", "tags": ["urlreply"], "dependencies": ["urlreply"], "npmDependencies": [] diff --git a/url-fediverse/plugin.ts b/url-fediverse/plugin.ts index d03525a..d911299 100644 --- a/url-fediverse/plugin.ts +++ b/url-fediverse/plugin.ts @@ -24,7 +24,7 @@ async function mastodonResponse(msg: IMessage, url: string, type = 'Mastodon'): try { data = await httpGET(url2go); if (!data) { - throw new Error('No API response, probably not ' + type + ' after all.') + throw new Error('No API response, probably not ' + type + ' after all.'); } data = JSON.parse(data); } catch (e) { @@ -72,7 +72,7 @@ class FediResponsePlugin extends Plugin { addUrlReply(urlreply: any): void { urlreply.registerHandler(this.name, 'html/mastodon', async (url: string, msg: IMessage, title: string, body: any): Promise => { - const type = title === 'Pleroma' ? 'Pleroma' : 'Mastodon'; + const type = url.match('/notice/') ? 'Pleroma' : 'Mastodon'; let pass = false; if (type === 'Pleroma') {