summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/UserFlag/UserFlagPlugin.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/plugins/UserFlag/UserFlagPlugin.php b/plugins/UserFlag/UserFlagPlugin.php
index 21af506a9..0fca5f9cf 100644
--- a/plugins/UserFlag/UserFlagPlugin.php
+++ b/plugins/UserFlag/UserFlagPlugin.php
@@ -46,6 +46,8 @@ class UserFlagPlugin extends Plugin
const REVIEWFLAGS = 'UserFlagPlugin::reviewflags';
const CLEARFLAGS = 'UserFlagPlugin::clearflags';
+ public $flagOnBlock = true;
+
/**
* Hook for ensuring our tables are created
*
@@ -235,4 +237,23 @@ class UserFlagPlugin extends Plugin
return true; // unchanged!
}
+
+ /**
+ * Optionally flag profile when a block happens
+ *
+ * We optionally add a flag when a profile has been blocked
+ *
+ * @param User $user User doing the block
+ * @param Profile $profile Profile being blocked
+ *
+ * @return boolean hook result
+ */
+
+ function onEndBlockProfile($user, $profile)
+ {
+ if ($this->flagOnBlock) {
+ User_flag_profile::create($user->id, $profile->id);
+ }
+ return true;
+ }
}