temp fix for pleroma urls
This commit is contained in:
parent
344cf309d6
commit
1ee60d9dd3
@ -31,7 +31,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "url-fediverse",
|
"name": "url-fediverse",
|
||||||
"version": "1.0.0"
|
"version": "1.0.1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "url-peertube",
|
"name": "url-peertube",
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"main": "plugin.js",
|
"main": "plugin.js",
|
||||||
"name": "url-fediverse",
|
"name": "url-fediverse",
|
||||||
"description": "URLReply Fediverse",
|
"description": "URLReply Fediverse",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"tags": ["urlreply"],
|
"tags": ["urlreply"],
|
||||||
"dependencies": ["urlreply"],
|
"dependencies": ["urlreply"],
|
||||||
"npmDependencies": []
|
"npmDependencies": []
|
||||||
|
@ -24,7 +24,7 @@ async function mastodonResponse(msg: IMessage, url: string, type = 'Mastodon'):
|
|||||||
try {
|
try {
|
||||||
data = await httpGET(url2go);
|
data = await httpGET(url2go);
|
||||||
if (!data) {
|
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);
|
data = JSON.parse(data);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -72,7 +72,7 @@ class FediResponsePlugin extends Plugin {
|
|||||||
addUrlReply(urlreply: any): void {
|
addUrlReply(urlreply: any): void {
|
||||||
urlreply.registerHandler(this.name, 'html/mastodon',
|
urlreply.registerHandler(this.name, 'html/mastodon',
|
||||||
async (url: string, msg: IMessage, title: string, body: any): Promise<boolean> => {
|
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;
|
let pass = false;
|
||||||
|
|
||||||
if (type === 'Pleroma') {
|
if (type === 'Pleroma') {
|
||||||
|
Loading…
Reference in New Issue
Block a user