Remove public and provider_display_name from reshares

This commit is contained in:
Benjamin Neff 2017-09-23 02:53:25 +02:00
parent bb97aa8538
commit 35711606e4
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
6 changed files with 35 additions and 20 deletions

View file

@ -176,13 +176,11 @@ module Diaspora
def self.reshare(reshare)
DiasporaFederation::Entities::Reshare.new(
root_author: reshare.root_diaspora_id,
root_guid: reshare.root_guid,
author: reshare.diaspora_handle,
guid: reshare.guid,
public: reshare.public,
created_at: reshare.created_at,
provider_display_name: reshare.provider_display_name
root_author: reshare.root_diaspora_id,
root_guid: reshare.root_guid,
author: reshare.diaspora_handle,
guid: reshare.guid,
created_at: reshare.created_at
)
end

View file

@ -142,12 +142,10 @@ module Diaspora
author = author_of(entity)
ignore_existing_guid(Reshare, entity.guid, author) do
Reshare.create!(
author: author,
guid: entity.guid,
created_at: entity.created_at,
provider_display_name: entity.provider_display_name,
public: entity.public,
root_guid: entity.root_guid
author: author,
guid: entity.guid,
created_at: entity.created_at,
root_guid: entity.root_guid
)
end
end

View file

@ -81,7 +81,8 @@
{
"oneOf": [
{ "$ref": "#/definitions/remote_subscription/public" },
{ "$ref": "#/definitions/remote_subscription/private" }
{ "$ref": "#/definitions/remote_subscription/private" },
{ "$ref": "#/definitions/remote_subscription/reshare" }
]
}
]
@ -223,7 +224,7 @@
}
},
"required": [
"entity_data"
"entity_data", "subscribed_pods_uris"
]
},
@ -248,7 +249,29 @@
"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"
]
}
}
}

View file

@ -428,7 +428,6 @@ describe "diaspora federation callbacks" do
expect(entity.guid).to eq(post.guid)
expect(entity.author).to eq(alice.diaspora_handle)
expect(entity.public).to be_truthy
end
it "does not fetch a private post" do

View file

@ -210,7 +210,6 @@ describe Diaspora::Exporter do
"author": user.diaspora_handle,
"guid": reshare.guid,
"created_at": reshare.created_at.iso8601,
"public": true,
"root_author": reshare.root_author.diaspora_handle,
"root_guid": reshare.root_guid
}

View file

@ -212,9 +212,7 @@ describe Diaspora::Federation::Entities do
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_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.provider_display_name).to eq(diaspora_entity.provider_display_name)
end
context "Retraction" do