From 8eed16c2454a2b3d85c1145351c8bab1081a3963 Mon Sep 17 00:00:00 2001 From: L3MNcakes Date: Sat, 23 Mar 2013 22:06:12 +0000 Subject: [PATCH] Issue #3976: Send a profile update alongside a sharing notification Issue #3976: Send a profile update alongside a sharing notification --- Changelog.md | 1 + app/models/user/connecting.rb | 7 ++++++- spec/models/user/connecting_spec.rb | 7 +++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 727e72c6d..eebf16e75 100644 --- a/Changelog.md +++ b/Changelog.md @@ -12,6 +12,7 @@ * Fix reshares in single post-view [#4056](https://github.com/diaspora/diaspora/issues/4056) * Fix mobile view of deleted reshares. [#4063](https://github.com/diaspora/diaspora/issues/4063) * Hide comment button in the mobile view when not signed in. [#4065](https://github.com/diaspora/diaspora/issues/4065) +* Send profile alongside notification [#3976] (https://github.com/diaspora/diaspora/issues/3976) ## Refactor diff --git a/app/models/user/connecting.rb b/app/models/user/connecting.rb index 5fa7588d1..d48b62fa2 100644 --- a/app/models/user/connecting.rb +++ b/app/models/user/connecting.rb @@ -22,11 +22,16 @@ module User::Connecting if notification = Notification.where(:target_id => person.id).first notification.update_attributes(:unread=>false) end - + + deliver_profile_update register_share_visibilities(contact) contact end + def deliver_profile_update + Postzord::Dispatcher.build(self, profile).post + end + # This puts the last 100 public posts by the passed in contact into the user's stream. # @param [Contact] contact # @return [void] diff --git a/spec/models/user/connecting_spec.rb b/spec/models/user/connecting_spec.rb index f4f22bad4..ad063674f 100644 --- a/spec/models/user/connecting_spec.rb +++ b/spec/models/user/connecting_spec.rb @@ -147,6 +147,13 @@ describe User::Connecting do contact.should_not_receive(:dispatch_request) alice.share_with(eve.person, a2) end + + it 'posts profile' do + m = mock() + Postzord::Dispatcher.should_receive(:build).twice.and_return(m) + m.should_receive(:post).twice + alice.share_with(eve.person, alice.aspects.first) + end end it 'sets receiving' do