aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-01-21 10:42:41 +0100
committerMario Vavti <mario@mariovavti.com>2016-01-21 10:42:41 +0100
commit2b3b6268ddd73d4a438cc6c9431ab3577b218fd1 (patch)
tree3b2f0606d912a5c9fb846d804e04fcb20eaa3de6
parent97ebf9021c5297a7ab2e3685bf920458d4bd3181 (diff)
parent1d891984441fa2f4aa8e311191da23e9ddd6e928 (diff)
downloadvolse-hubzilla-2b3b6268ddd73d4a438cc6c9431ab3577b218fd1.tar.gz
volse-hubzilla-2b3b6268ddd73d4a438cc6c9431ab3577b218fd1.tar.bz2
volse-hubzilla-2b3b6268ddd73d4a438cc6c9431ab3577b218fd1.zip
Merge branch 'master' of https://github.com/redmatrix/hubzilla
-rw-r--r--include/Contact.php6
-rw-r--r--mod/item.php21
-rw-r--r--version.inc2
3 files changed, 15 insertions, 14 deletions
diff --git a/include/Contact.php b/include/Contact.php
index 3bd5f9936..611371db6 100644
--- a/include/Contact.php
+++ b/include/Contact.php
@@ -331,6 +331,7 @@ function channel_remove($channel_id, $local = true, $unset_session=true) {
dbesc(datetime_convert()),
intval($channel_id)
);
+
// if this was the default channel, set another one as default
if($a->account['account_default_channel'] == $channel_id) {
$r = q("select channel_id from channel where channel_account_id = %d and channel_removed = 0 limit 1",
@@ -344,12 +345,11 @@ function channel_remove($channel_id, $local = true, $unset_session=true) {
}
else {
$rr = q("update account set account_default_channel = 0 where account_id = %d",
- intval($r[0]['channel_id']),
- intval($a->account['account_id']));
+ intval($a->account['account_id'])
+ );
}
}
-
logger('deleting hublocs',LOGGER_DEBUG);
$r = q("update hubloc set hubloc_deleted = 1 where hubloc_hash = '%s' and hubloc_url = '%s' ",
diff --git a/mod/item.php b/mod/item.php
index f100c9dfe..fdc768c67 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -817,25 +817,26 @@ function item_post(&$a) {
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.');
+ if($z) {
+ foreach($z as $zz) {
+ if($zz['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')) {
- logger('mod_item: post cancelled by plugin.');
- if($return_path) {
+ logger('mod_item: post cancelled by plugin or duplicate suppressed.');
+ if($return_path)
goaway($a->get_baseurl() . "/" . $return_path);
- }
$json = array('cancel' => 1);
- if(x($_REQUEST,'jsreload') && strlen($_REQUEST['jsreload']))
- $json['reload'] = $a->get_baseurl() . '/' . $_REQUEST['jsreload'];
-
+ $json['reload'] = $a->get_baseurl() . '/' . $_REQUEST['jsreload'];
echo json_encode($json);
killme();
}
diff --git a/version.inc b/version.inc
index fb02d7c69..f5b62614f 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2016-01-19.1283H
+2016-01-20.1284H