From fcadf7ab9676090344b5bbde38168b9e87ae6a6a Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 9 Sep 2010 16:54:51 -0700 Subject: [PATCH] Salmon the requests --- lib/diaspora/user/friending.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/diaspora/user/friending.rb b/lib/diaspora/user/friending.rb index b249347dd..781eb756a 100644 --- a/lib/diaspora/user/friending.rb +++ b/lib/diaspora/user/friending.rb @@ -1,9 +1,13 @@ module Diaspora module UserModules module Friending - def send_friend_request_to(friend, group) - raise "You are already friends with that person!" if self.friends.detect{ |x| x.receive_url == friend.receive_url} - request = Request.instantiate(:to => friend.receive_url, :from => self.person, :into => group.id) + def send_friend_request_to(desired_friend, group) + raise "You are already friends with that person!" if self.friends.detect{ + |x| x.receive_url == desired_friend.receive_url} + request = Request.instantiate( + :to => desired_friend.receive_url, + :from => self.person, + :into => group.id) if request.save self.pending_requests << request self.save @@ -11,7 +15,7 @@ module Diaspora group.requests << request group.save - request.push_to_url friend.receive_url + salmon request, :to => desired_friend end request end