]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
don't add flag if it's already there at block time
authorEvan Prodromou <evan@status.net>
Tue, 29 Dec 2009 00:35:29 +0000 (16:35 -0800)
committerEvan Prodromou <evan@status.net>
Tue, 29 Dec 2009 00:35:29 +0000 (16:35 -0800)
plugins/UserFlag/UserFlagPlugin.php

index 0fca5f9cf90c22111773e667fe5e1654bb5f63c4..602a5bfa881d20c6739b71269a09fcc6b87f2803 100644 (file)
@@ -251,7 +251,9 @@ class UserFlagPlugin extends Plugin
 
     function onEndBlockProfile($user, $profile)
     {
-        if ($this->flagOnBlock) {
+        if ($this->flagOnBlock && !User_flag_profile::exists($profile->id,
+                                                             $user->id)) {
+
             User_flag_profile::create($user->id, $profile->id);
         }
         return true;