From 5faad9ea56dcf2d715c9e11e07490f50115d25bb Mon Sep 17 00:00:00 2001 From: Darius Kazemi Date: Wed, 11 Dec 2019 18:11:09 -0800 Subject: First pass at federation! --- models/Event.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'models') diff --git a/models/Event.js b/models/Event.js index 3c0bb8c..1de6088 100755 --- a/models/Event.js +++ b/models/Event.js @@ -159,7 +159,19 @@ const EventSchema = new mongoose.Schema({ maxAttendees: { type: Number }, - comments: [CommentSchema] + comments: [CommentSchema], + activityPubActor: { + type: String, + trim: true + }, + publicKey: { + type: String, + trim: true + }, + privateKey: { + type: String, + trim: true + } }); module.exports = mongoose.model('Event', EventSchema); -- cgit v1.2.3 From 821017e5337612a37179b586d5506666ab70ab77 Mon Sep 17 00:00:00 2001 From: Darius Kazemi Date: Wed, 11 Dec 2019 22:13:39 -0800 Subject: follow Undo now works --- models/Event.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'models') diff --git a/models/Event.js b/models/Event.js index 1de6088..d68621a 100755 --- a/models/Event.js +++ b/models/Event.js @@ -15,6 +15,17 @@ const Attendees = new mongoose.Schema({ } }) +const Followers = new mongoose.Schema({ + followId: { + type: String, + trim: true + }, + account: { + type: String, + trim: true + } +}, {_id: false}) + const ReplySchema = new mongoose.Schema({ id: { type: String, @@ -171,7 +182,8 @@ const EventSchema = new mongoose.Schema({ privateKey: { type: String, trim: true - } + }, + followers: [Followers], }); module.exports = mongoose.model('Event', EventSchema); -- cgit v1.2.3 From f1e62ef6fa94c3cfb6afadd0dc865f5c502a6a60 Mon Sep 17 00:00:00 2001 From: Darius Kazemi Date: Sun, 15 Dec 2019 13:07:50 -0800 Subject: Big refactor and new features --- models/Event.js | 52 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) (limited to 'models') diff --git a/models/Event.js b/models/Event.js index d68621a..9ab455f 100755 --- a/models/Event.js +++ b/models/Event.js @@ -12,18 +12,33 @@ const Attendees = new mongoose.Schema({ email: { type: String, trim: true - } + }, + id: { + type: String, + trim: true + } }) const Followers = new mongoose.Schema({ + // this is the id of the original follow *request*, which we use to validate Undo events followId: { type: String, trim: true }, - account: { + // this is the actual remote user profile id + actorId: { type: String, trim: true - } + }, + // this is the stringified JSON of the entire user profile + actorJson: { + type: String, + trim: true + }, + name: { + type: String, + trim: true + }, }, {_id: false}) const ReplySchema = new mongoose.Schema({ @@ -50,6 +65,20 @@ const ReplySchema = new mongoose.Schema({ } }) +const ActivityPubMessages = new mongoose.Schema({ + id: { + type: String, + required: true, + unique: true, + sparse: true + }, + content: { + type: String, + trim: true, + required: true + } +}) + const CommentSchema = new mongoose.Schema({ id: { type: String, @@ -72,6 +101,22 @@ const CommentSchema = new mongoose.Schema({ trim: true, required: true }, + activityJson: { + type: String, + trim: true + }, + actorJson: { + type: String, + trim: true + }, + activityId: { + type: String, + trim: true + }, + actorId: { + type: String, + trim: true + }, replies: [ReplySchema] }) @@ -184,6 +229,7 @@ const EventSchema = new mongoose.Schema({ trim: true }, followers: [Followers], + activityPubMessages: [ActivityPubMessages] }); module.exports = mongoose.model('Event', EventSchema); -- cgit v1.2.3 From ef5aadc56f821c31d324fd3ec29f646a331b4612 Mon Sep 17 00:00:00 2001 From: Darius Kazemi Date: Sat, 4 Jan 2020 21:59:57 -0800 Subject: Enhancements to AP and one-click removal This adds AP Delete/Event, AP Delete/Actor, and one-click removal from RSVP lists that can be included in the "you have rsvped" confirmation message. --- models/Event.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'models') diff --git a/models/Event.js b/models/Event.js index 9ab455f..19505ea 100755 --- a/models/Event.js +++ b/models/Event.js @@ -220,6 +220,10 @@ const EventSchema = new mongoose.Schema({ type: String, trim: true }, + activityPubEvent: { + type: String, + trim: true + }, publicKey: { type: String, trim: true -- cgit v1.2.3