1
0
Fork 0

Merge pull request #3575 from annando/dfrn-update-copy

DFRN: Update the public item copy as well
This commit is contained in:
Tobias Diekershoff 2017-07-09 10:17:22 +02:00 committed by GitHub
commit 6bbc1ac602

View file

@ -1958,7 +1958,7 @@ class dfrn {
return false; return false;
} }
$r = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `tag` = '%s', `edited` = '%s', `changed` = '%s' WHERE `uri` = '%s' AND `uid` = %d", $r = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `tag` = '%s', `edited` = '%s', `changed` = '%s' WHERE `uri` = '%s' AND `uid` IN (0, %d)",
dbesc($item["title"]), dbesc($item["title"]),
dbesc($item["body"]), dbesc($item["body"]),
dbesc($item["tag"]), dbesc($item["tag"]),
@ -1979,12 +1979,12 @@ class dfrn {
// update last-child if it changes // update last-child if it changes
if ($item["last-child"] && ($item["last-child"] != $current["last-child"])) { if ($item["last-child"] && ($item["last-child"] != $current["last-child"])) {
$r = q("UPDATE `item` SET `last-child` = 0, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d", $r = q("UPDATE `item` SET `last-child` = 0, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` IN (0, %d)",
dbesc(datetime_convert()), dbesc(datetime_convert()),
dbesc($item["parent-uri"]), dbesc($item["parent-uri"]),
intval($importer["importer_uid"]) intval($importer["importer_uid"])
); );
$r = q("UPDATE `item` SET `last-child` = %d , `changed` = '%s' WHERE `uri` = '%s' AND `uid` = %d", $r = q("UPDATE `item` SET `last-child` = %d , `changed` = '%s' WHERE `uri` = '%s' AND `uid` IN (0, %d)",
intval($item["last-child"]), intval($item["last-child"]),
dbesc(datetime_convert()), dbesc(datetime_convert()),
dbesc($item["uri"]), dbesc($item["uri"]),
@ -2744,7 +2744,7 @@ class dfrn {
if ($entrytype == DFRN_TOP_LEVEL) { if ($entrytype == DFRN_TOP_LEVEL) {
$r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s', $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s',
`body` = '', `title` = '' `body` = '', `title` = ''
WHERE `parent-uri` = '%s' AND `uid` = %d", WHERE `parent-uri` = '%s' AND `uid` IN (0, %d)",
dbesc($when), dbesc($when),
dbesc(datetime_convert()), dbesc(datetime_convert()),
dbesc($uri), dbesc($uri),
@ -2756,7 +2756,7 @@ class dfrn {
} else { } else {
$r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s', $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s',
`body` = '', `title` = '' `body` = '', `title` = ''
WHERE `uri` = '%s' AND `uid` = %d", WHERE `uri` = '%s' AND `uid` IN (0, %d)",
dbesc($when), dbesc($when),
dbesc(datetime_convert()), dbesc(datetime_convert()),
dbesc($uri), dbesc($uri),
@ -2767,7 +2767,7 @@ class dfrn {
update_thread_uri($uri, $importer["importer_uid"]); update_thread_uri($uri, $importer["importer_uid"]);
if ($item["last-child"]) { if ($item["last-child"]) {
// ensure that last-child is set in case the comment that had it just got wiped. // ensure that last-child is set in case the comment that had it just got wiped.
q("UPDATE `item` SET `last-child` = 0, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d ", q("UPDATE `item` SET `last-child` = 0, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` IN (0, %d)",
dbesc(datetime_convert()), dbesc(datetime_convert()),
dbesc($item["parent-uri"]), dbesc($item["parent-uri"]),
intval($item["uid"]) intval($item["uid"])