diff options
Diffstat (limited to 'activitypub.js')
-rw-r--r-- | activitypub.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/activitypub.js b/activitypub.js index 765bee1..8ec2ee5 100644 --- a/activitypub.js +++ b/activitypub.js @@ -5,7 +5,10 @@ const isFederated = require('./config/domain.js').isFederated; const request = require('request'); const addToLog = require('./helpers.js').addToLog; const crypto = require('crypto'); -const shortid = require('shortid'); +// This alphabet (used to generate all event, group, etc. IDs) is missing '-' +// because ActivityPub doesn't like it in IDs +const nanoid = require('nanoid/generate'); +const alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'; var moment = require('moment-timezone'); const mongoose = require('mongoose'); const Event = mongoose.model('Event'); @@ -802,7 +805,7 @@ function _handleCreateNoteComment(req, res) { if (ourEvents.length === 1) { let eventID = ourEvents[0]; // add comment - let commentID = shortid.generate(); + let commentID = nanoid(alphabet, 21); // get the actor for the commenter request({ url: req.body.actor, |