temp fix for pleroma urls

This commit is contained in:
Evert Prants 2021-04-23 13:39:12 +03:00
parent 344cf309d6
commit 1ee60d9dd3
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
3 changed files with 4 additions and 4 deletions

View File

@ -31,7 +31,7 @@
},
{
"name": "url-fediverse",
"version": "1.0.0"
"version": "1.0.1"
},
{
"name": "url-peertube",

View File

@ -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": []

View File

@ -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<boolean> => {
const type = title === 'Pleroma' ? 'Pleroma' : 'Mastodon';
const type = url.match('/notice/') ? 'Pleroma' : 'Mastodon';
let pass = false;
if (type === 'Pleroma') {