Fix for sending unlimited duplicate friend requests
This commit is contained in:
parent
aaa4d75a5e
commit
de90923631
1 changed files with 3 additions and 0 deletions
|
|
@ -8,6 +8,9 @@ module Diaspora
|
||||||
module UserModules
|
module UserModules
|
||||||
module Friending
|
module Friending
|
||||||
def send_friend_request_to(desired_friend, aspect)
|
def send_friend_request_to(desired_friend, aspect)
|
||||||
|
# should have different exception types for these?
|
||||||
|
raise "You have already sent a friend request to that person!" if self.pending_requests.detect{
|
||||||
|
|x| x.destination_url == desired_friend.receive_url }
|
||||||
raise "You are already friends with that person!" if self.friends.detect{
|
raise "You are already friends with that person!" if self.friends.detect{
|
||||||
|x| x.receive_url == desired_friend.receive_url}
|
|x| x.receive_url == desired_friend.receive_url}
|
||||||
request = Request.instantiate(
|
request = Request.instantiate(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue