From 780f8ca2f5b4436aeeb760fa3f8ee06c5e4bdb43 Mon Sep 17 00:00:00 2001 From: Bat Date: Fri, 4 May 2018 11:16:04 +0100 Subject: [PATCH] Add context before sending activities --- src/activity_pub/actor.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/activity_pub/actor.rs b/src/activity_pub/actor.rs index 25f4eff..9a614b1 100644 --- a/src/activity_pub/actor.rs +++ b/src/activity_pub/actor.rs @@ -3,7 +3,7 @@ use reqwest::Client; use serde_json; use BASE_URL; -use activity_pub::{activity_pub, ActivityPub, context, ap_url}; +use activity_pub::{activity_pub, ActivityPub, context, ap_url, CONTEXT}; use activity_pub::activity::Activity; use activity_pub::sign::*; use models::instance::Instance; @@ -83,6 +83,7 @@ pub trait Actor: Sized { fn send_to_inbox(&self, conn: &PgConnection, sender: &S, act: A) { let mut act = act.serialize(); + act["@context"] = CONTEXT; let signed = act.sign(sender, conn); let res = Client::new() .post(&self.compute_inbox(conn)[..])