wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[ljcom] r7589: LJSUP-4695

Committer: gprochaev
LJSUP-4695
Users should be able to send 'sponsored' vgifts only to mutual friends


U   trunk/cgi-bin/LJ/Widget/IPPU/AddVGift.pm
Modified: trunk/cgi-bin/LJ/Widget/IPPU/AddVGift.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/IPPU/AddVGift.pm	2009-08-24 01:51:20 UTC (rev 7588)
+++ trunk/cgi-bin/LJ/Widget/IPPU/AddVGift.pm	2009-08-24 09:04:58 UTC (rev 7589)
@@ -133,6 +133,12 @@
     my $vg = LJ::Pay::ShopVGift->new(id => $post->{key}, cart => $cartobj);
     die BML::ml('widget.vgiftadd.cannotpurchase') unless $vg && $vg->can_purchase;
 
+    foreach (@to_list) {
+        my $username = $_;
+        my $recip_u = LJ::load_user($username);
+        die BML::ml('.error.not.mutual') . "\n" if $vg->is_sponsored && !$remote->is_mutual_friend($recip_u);
+    }
+
     # Check length of message
     die BML::ml('widget.vgiftadd.notetoolong')
         if $post->{note} && length $post->{note} > 65535;

Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments