From 1a44cf5ab32080f76dd1916d57fcf2fd1d659cb2 Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 6 Jul 2010 15:11:24 -0400 Subject: [PATCH] DG IZ push to wrapped to check before sending off a friend req --- app/models/friend_request.rb | 2 +- lib/common.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/friend_request.rb b/app/models/friend_request.rb index a977144a0..3c9cd0e0c 100644 --- a/app/models/friend_request.rb +++ b/app/models/friend_request.rb @@ -26,7 +26,7 @@ class FriendRequest end def send_off - push_to [self.recipient] + push_to_recipient self.recipient end end diff --git a/lib/common.rb b/lib/common.rb index 786a711c5..aa4034dcf 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -66,6 +66,11 @@ module Diaspora end end + def push_to_recipient(recipient) + if self.sender_id == User.first.id + push_to( [recipient] ) + end + end def prep_webhook "#{self.to_xml.to_s}"