aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
authorpafcu <pafcu@iki.fi>2014-10-21 00:02:08 +0300
committerpafcu <pafcu@iki.fi>2014-10-21 00:02:08 +0300
commit6fbd77069b8792b48cfbd45bd476b8acb5f98ed6 (patch)
tree7f1303769398dc0862a2941e64e7a42e4e39d10d /include/zot.php
parent6ee514579f85927e60fa5ebd2b89f97cbfe6544d (diff)
parentc080c420ba4e9f216708b63fdddb5c03bbea72c9 (diff)
downloadvolse-hubzilla-6fbd77069b8792b48cfbd45bd476b8acb5f98ed6.tar.gz
volse-hubzilla-6fbd77069b8792b48cfbd45bd476b8acb5f98ed6.tar.bz2
volse-hubzilla-6fbd77069b8792b48cfbd45bd476b8acb5f98ed6.zip
Merge pull request #2 from friendica/master
Sync with upstream
Diffstat (limited to 'include/zot.php')
-rw-r--r--include/zot.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/zot.php b/include/zot.php
index 869bca668..e96eae10d 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -1476,11 +1476,13 @@ function process_delivery($sender,$arr,$deliveries,$relay,$public = false) {
continue;
}
- $r = q("select id, edited from item where mid = '%s' and uid = %d limit 1",
+ $r = q("select id, edited, item_flags, mid, parent_mid from item where mid = '%s' and uid = %d limit 1",
dbesc($arr['mid']),
intval($channel['channel_id'])
);
if($r) {
+ // We already have this post.
+ // Maybe it has been edited?
$item_id = $r[0]['id'];
if($arr['edited'] > $r[0]['edited']) {
$arr['id'] = $r[0]['id'];
@@ -1492,6 +1494,10 @@ function process_delivery($sender,$arr,$deliveries,$relay,$public = false) {
}
else {
$result[] = array($d['hash'],'update ignored',$channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>',$arr['mid']);
+ // We need this line to ensure wall-to-wall comments are relayed (by falling through to the relay bit),
+ // and at the same time not relay any other relayable posts more than once, because to do so is very wasteful.
+ if(! ($r[0]['item_flags'] & ITEM_ORIGIN))
+ continue;
}
}
else {