aboutsummaryrefslogtreecommitdiffstats
path: root/mod/item.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/item.php')
-rw-r--r--mod/item.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/mod/item.php b/mod/item.php
index b66d71797..1e39ca9c9 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -703,6 +703,10 @@ function item_post(&$a) {
$plink = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $mid;
}
+
+
+
+
$datarray['aid'] = $channel['channel_account_id'];
$datarray['uid'] = $profile_uid;
@@ -781,6 +785,22 @@ function item_post(&$a) {
if($orig_post)
$datarray['edit'] = true;
+
+
+ if(feature_enabled($profile_uid,'suppress_duplicates')) {
+
+ $z = q("select created from item where uid = %d and body = '%s'",
+ intval($profile_uid),
+ dbesc($body)
+ );
+
+ if($z && $z[0]['created'] > datetime_convert('UTC','UTC', 'now - 2 minutes')) {
+ $datarray['cancel'] = 1;
+ notice( t('Duplicate post suppressed.') . EOL);
+ logger('Duplicate post. Faking plugin cancel.');
+ }
+ }
+
call_hooks('post_local',$datarray);
if(x($datarray,'cancel')) {