Merge branch 'next-minor' into develop
This commit is contained in:
commit
0e7c91aeac
3 changed files with 18 additions and 4 deletions
|
|
@ -53,6 +53,7 @@ Although the chat was never enabled per default and was marked as experimental,
|
||||||
* Add blocks to the archive export [#8263](https://github.com/diaspora/diaspora/pull/8263)
|
* Add blocks to the archive export [#8263](https://github.com/diaspora/diaspora/pull/8263)
|
||||||
* Allow points and dashes in the username [#8266](https://github.com/diaspora/diaspora/pull/8266)
|
* Allow points and dashes in the username [#8266](https://github.com/diaspora/diaspora/pull/8266)
|
||||||
* Add support for footnotes in markdown [#8277](https://github.com/diaspora/diaspora/pull/8277)
|
* Add support for footnotes in markdown [#8277](https://github.com/diaspora/diaspora/pull/8277)
|
||||||
|
* Send `AccountMigration` if receiving message to a migrated account [#8288](https://github.com/diaspora/diaspora/pull/8288)
|
||||||
|
|
||||||
# 0.7.15.0
|
# 0.7.15.0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,17 @@ DiasporaFederation.configure do |config|
|
||||||
|
|
||||||
on :receive_entity do |entity, sender, recipient_id|
|
on :receive_entity do |entity, sender, recipient_id|
|
||||||
Person.by_account_identifier(sender).pod.try(:schedule_check_if_needed)
|
Person.by_account_identifier(sender).pod.try(:schedule_check_if_needed)
|
||||||
|
unless recipient_id.nil?
|
||||||
|
User.find_by(id: recipient_id).tap do |user|
|
||||||
|
next unless user.person.account_migration
|
||||||
|
|
||||||
|
Diaspora::Federation::Dispatcher.build(
|
||||||
|
user,
|
||||||
|
user.person.account_migration,
|
||||||
|
subscribers: [Person.by_account_identifier(sender)]
|
||||||
|
).dispatch
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
case entity
|
case entity
|
||||||
when DiasporaFederation::Entities::AccountDeletion
|
when DiasporaFederation::Entities::AccountDeletion
|
||||||
|
|
|
||||||
|
|
@ -354,11 +354,12 @@ describe "diaspora federation callbacks" do
|
||||||
|
|
||||||
it "receives a Retraction" do
|
it "receives a Retraction" do
|
||||||
retraction = Fabricate(:retraction_entity, author: remote_person.diaspora_handle)
|
retraction = Fabricate(:retraction_entity, author: remote_person.diaspora_handle)
|
||||||
|
recipient_id = FactoryBot.create(:user).id
|
||||||
|
|
||||||
expect(Diaspora::Federation::Receive).to receive(:retraction).with(retraction, 42)
|
expect(Diaspora::Federation::Receive).to receive(:retraction).with(retraction, recipient_id)
|
||||||
expect(Workers::ReceiveLocal).not_to receive(:perform_async)
|
expect(Workers::ReceiveLocal).not_to receive(:perform_async)
|
||||||
|
|
||||||
DiasporaFederation.callbacks.trigger(:receive_entity, retraction, retraction.author, 42)
|
DiasporaFederation.callbacks.trigger(:receive_entity, retraction, retraction.author, recipient_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "receives a entity" do
|
it "receives a entity" do
|
||||||
|
|
@ -386,11 +387,12 @@ describe "diaspora federation callbacks" do
|
||||||
it "receives a entity for a recipient" do
|
it "receives a entity for a recipient" do
|
||||||
received = Fabricate(:status_message_entity, author: remote_person.diaspora_handle)
|
received = Fabricate(:status_message_entity, author: remote_person.diaspora_handle)
|
||||||
persisted = FactoryBot.create(:status_message)
|
persisted = FactoryBot.create(:status_message)
|
||||||
|
recipient_id = FactoryBot.create(:user).id
|
||||||
|
|
||||||
expect(Diaspora::Federation::Receive).to receive(:perform).with(received).and_return(persisted)
|
expect(Diaspora::Federation::Receive).to receive(:perform).with(received).and_return(persisted)
|
||||||
expect(Workers::ReceiveLocal).to receive(:perform_async).with(persisted.class.to_s, persisted.id, [42])
|
expect(Workers::ReceiveLocal).to receive(:perform_async).with(persisted.class.to_s, persisted.id, [recipient_id])
|
||||||
|
|
||||||
DiasporaFederation.callbacks.trigger(:receive_entity, received, received.author, 42)
|
DiasporaFederation.callbacks.trigger(:receive_entity, received, received.author, recipient_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "does not trigger a ReceiveLocal job if Receive.perform returned nil" do
|
it "does not trigger a ReceiveLocal job if Receive.perform returned nil" do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue