
//import webfinger from '../lib/webfinger/lib/webfinger.js';

Meteor.methods({
    getActivityJSONFromUrl: function(url) {
        return getActivityFromUrl(url)
        .then((response) => {
            return response.json();
        })
        .then((json) => {
            Meteor.call('importFromActivityPubJSON', json);

            return json;
        });
    },
    importFromActivityPubJSON: function(json) {
        if (!json.type) throw new Meteor.Error('untyped ActivityPub JSON');

        if (actorTypes.includes(json.type))
            importActorFromActivityPubJSON(json);

        else if (json.type == 'Note')
            importPostFromActivityPubJSON(json);
    }
});

importActorFromActivityPubJSON = function(json) {
    let actor = Actors.findOne({id: json.id}); //Is actor already present?
    if (!actor) {                              //If not,
        Actors.insert(json);                   //add it.
    }
};

importPostFromActivityPubJSON = function(json) {
    console.log("!!!");
};

@@ -504,16 +504,27 @@
  if (act
+ivityPubAct
 orTypes.
@@ -616,27 +616,50 @@
 if (
-json.type == 'Note'
+activityPubObjectTypes.includes(json.type)
 )%0A  
@@ -1018,31 +1018,7 @@
 ) %7B%0A
-    console.log(%22!!!%22);%0A
 %7D;%0A

fix federation code to work with new names for activity pub variables