Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider 35711606 rédigé par Benjamin Neff's avatar Benjamin Neff
Parcourir les fichiers

Remove public and provider_display_name from reshares

parent bb97aa85
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -176,13 +176,11 @@ module Diaspora ...@@ -176,13 +176,11 @@ module Diaspora
def self.reshare(reshare) def self.reshare(reshare)
DiasporaFederation::Entities::Reshare.new( DiasporaFederation::Entities::Reshare.new(
root_author: reshare.root_diaspora_id, root_author: reshare.root_diaspora_id,
root_guid: reshare.root_guid, root_guid: reshare.root_guid,
author: reshare.diaspora_handle, author: reshare.diaspora_handle,
guid: reshare.guid, guid: reshare.guid,
public: reshare.public, created_at: reshare.created_at
created_at: reshare.created_at,
provider_display_name: reshare.provider_display_name
) )
end end
......
...@@ -142,12 +142,10 @@ module Diaspora ...@@ -142,12 +142,10 @@ module Diaspora
author = author_of(entity) author = author_of(entity)
ignore_existing_guid(Reshare, entity.guid, author) do ignore_existing_guid(Reshare, entity.guid, author) do
Reshare.create!( Reshare.create!(
author: author, author: author,
guid: entity.guid, guid: entity.guid,
created_at: entity.created_at, created_at: entity.created_at,
provider_display_name: entity.provider_display_name, root_guid: entity.root_guid
public: entity.public,
root_guid: entity.root_guid
) )
end end
end end
......
...@@ -81,7 +81,8 @@ ...@@ -81,7 +81,8 @@
{ {
"oneOf": [ "oneOf": [
{ "$ref": "#/definitions/remote_subscription/public" }, { "$ref": "#/definitions/remote_subscription/public" },
{ "$ref": "#/definitions/remote_subscription/private" } { "$ref": "#/definitions/remote_subscription/private" },
{ "$ref": "#/definitions/remote_subscription/reshare" }
] ]
} }
] ]
...@@ -223,7 +224,7 @@ ...@@ -223,7 +224,7 @@
} }
}, },
"required": [ "required": [
"entity_data" "entity_data", "subscribed_pods_uris"
] ]
}, },
...@@ -248,7 +249,29 @@ ...@@ -248,7 +249,29 @@
"public" "public"
] ]
} }
} },
"required": [
"entity_data", "subscribed_users_ids"
]
},
"reshare": {
"type": "object",
"properties": {
"entity_type": {
"type": "string",
"pattern": "^reshare$"
},
"subscribed_pods_uris": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"entity_type", "subscribed_pods_uris"
]
} }
} }
} }
......
...@@ -428,7 +428,6 @@ describe "diaspora federation callbacks" do ...@@ -428,7 +428,6 @@ describe "diaspora federation callbacks" do
expect(entity.guid).to eq(post.guid) expect(entity.guid).to eq(post.guid)
expect(entity.author).to eq(alice.diaspora_handle) expect(entity.author).to eq(alice.diaspora_handle)
expect(entity.public).to be_truthy
end end
it "does not fetch a private post" do it "does not fetch a private post" do
......
...@@ -210,7 +210,6 @@ describe Diaspora::Exporter do ...@@ -210,7 +210,6 @@ describe Diaspora::Exporter do
"author": user.diaspora_handle, "author": user.diaspora_handle,
"guid": reshare.guid, "guid": reshare.guid,
"created_at": reshare.created_at.iso8601, "created_at": reshare.created_at.iso8601,
"public": true,
"root_author": reshare.root_author.diaspora_handle, "root_author": reshare.root_author.diaspora_handle,
"root_guid": reshare.root_guid "root_guid": reshare.root_guid
} }
......
...@@ -212,9 +212,7 @@ describe Diaspora::Federation::Entities do ...@@ -212,9 +212,7 @@ describe Diaspora::Federation::Entities do
expect(federation_entity.guid).to eq(diaspora_entity.guid) expect(federation_entity.guid).to eq(diaspora_entity.guid)
expect(federation_entity.root_author).to eq(diaspora_entity.root.author.diaspora_handle) expect(federation_entity.root_author).to eq(diaspora_entity.root.author.diaspora_handle)
expect(federation_entity.root_guid).to eq(diaspora_entity.root.guid) expect(federation_entity.root_guid).to eq(diaspora_entity.root.guid)
expect(federation_entity.public).to be_truthy
expect(federation_entity.created_at).to eq(diaspora_entity.created_at) expect(federation_entity.created_at).to eq(diaspora_entity.created_at)
expect(federation_entity.provider_display_name).to eq(diaspora_entity.provider_display_name)
end end
context "Retraction" do context "Retraction" do
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter