Strip codes from auto sig for summary
This commit is contained in:
parent
97f3a1e63a
commit
0b59d0e3b5
|
@ -13,6 +13,8 @@ const ActivityPubSettings = require('./settings');
|
||||||
const ActivityPubObject = require('./object');
|
const ActivityPubObject = require('./object');
|
||||||
const { ActivityStreamMediaType, Collections } = require('./const');
|
const { ActivityStreamMediaType, Collections } = require('./const');
|
||||||
const Config = require('../config').get;
|
const Config = require('../config').get;
|
||||||
|
const { stripMciColorCodes } = require('../color_codes');
|
||||||
|
const { stripAnsiControlCodes } = require('../string_util');
|
||||||
|
|
||||||
// deps
|
// deps
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
|
@ -107,6 +109,11 @@ module.exports = class Actor extends ActivityPubObject {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const summary = stripMciColorCodes(
|
||||||
|
stripAnsiControlCodes(user.getProperty(UserProps.AutoSignature) || ''),
|
||||||
|
{ mode: 'nonAsciiPrintable' }
|
||||||
|
);
|
||||||
|
|
||||||
const obj = {
|
const obj = {
|
||||||
id: userActorId,
|
id: userActorId,
|
||||||
type: 'Person',
|
type: 'Person',
|
||||||
|
@ -121,7 +128,7 @@ module.exports = class Actor extends ActivityPubObject {
|
||||||
outbox: Endpoints.outbox(user),
|
outbox: Endpoints.outbox(user),
|
||||||
followers: Endpoints.followers(user),
|
followers: Endpoints.followers(user),
|
||||||
following: Endpoints.following(user),
|
following: Endpoints.following(user),
|
||||||
summary: user.getProperty(UserProps.AutoSignature) || '',
|
summary,
|
||||||
url: Endpoints.profile(user),
|
url: Endpoints.profile(user),
|
||||||
manuallyApprovesFollowers: userSettings.manuallyApprovesFollowers,
|
manuallyApprovesFollowers: userSettings.manuallyApprovesFollowers,
|
||||||
discoverable: userSettings.discoverable,
|
discoverable: userSettings.discoverable,
|
||||||
|
|
Loading…
Reference in New Issue