aboutsummaryrefslogtreecommitdiffstats
path: root/mod/dfrn_notify.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-08-22 20:57:20 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-08-22 20:57:20 -0700
commitb02e30f1cfb3e92c65a5b8783256260a2e72ecc2 (patch)
tree96d9195ed0fb9d0b12a77451dd771293fba1421b /mod/dfrn_notify.php
parent024f2019e6a3f23bec88d3c1100d67456e34adc9 (diff)
downloadvolse-hubzilla-b02e30f1cfb3e92c65a5b8783256260a2e72ecc2.tar.gz
volse-hubzilla-b02e30f1cfb3e92c65a5b8783256260a2e72ecc2.tar.bz2
volse-hubzilla-b02e30f1cfb3e92c65a5b8783256260a2e72ecc2.zip
sort out notify x-domain
Diffstat (limited to 'mod/dfrn_notify.php')
-rw-r--r--mod/dfrn_notify.php20
1 files changed, 13 insertions, 7 deletions
diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php
index 2ac98af59..089e508ad 100644
--- a/mod/dfrn_notify.php
+++ b/mod/dfrn_notify.php
@@ -68,7 +68,7 @@ function dfrn_notify_post(&$a) {
$msg['uri'] = notags(unxmlify($base['id'][0]['data']));
$msg['parent-uri'] = notags(unxmlify($base['in-reply-to'][0]['data']));
$msg['created'] = datetime_convert(notags(unxmlify('UTC','UTC',$base['sentdate'][0]['data'])));
-
+
dbesc_array($msg);
$r = q("INSERT INTO `mail` (`" . implode("`, `", array_keys($msg))
@@ -124,16 +124,18 @@ function dfrn_notify_post(&$a) {
);
if(count($r)) {
if($r[0]['uri'] == $r[0]['parent-uri']) {
- $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s'
+ $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s'
WHERE `parent-uri` = '%s'",
dbesc($when),
+ dbesc(datetime_convert()),
dbesc($r[0]['uri'])
);
}
else {
- $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s'
+ $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s'
WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
dbesc($when),
+ dbesc(datetime_convert()),
dbesc($uri),
intval($importer['importer_uid'])
);
@@ -166,12 +168,14 @@ function dfrn_notify_post(&$a) {
intval($importer['importer_uid'])
);
if(count($r)) {
- $r1 = q("UPDATE `item` SET `last-child` = 0 WHERE `uid` = %d AND `parent` = %d",
+ $r1 = q("UPDATE `item` SET `last-child` = 0, `changed` = '%s' WHERE `uid` = %d AND `parent` = %d",
+ dbesc(datetime_convert()),
intval($importer['importer_uid']),
intval($r[0]['parent'])
);
}
- $r2 = q("UPDATE `item` SET `last-child` = 1 WHERE `uid` = %d AND `id` = %d LIMIT 1",
+ $r2 = q("UPDATE `item` SET `last-child` = 1, `changed` = '%s' WHERE `uid` = %d AND `id` = %d LIMIT 1",
+ dbesc(datetime_convert()),
intval($importer['importer_uid']),
intval($posted_id)
);
@@ -214,8 +218,9 @@ function dfrn_notify_post(&$a) {
if(count($r)) {
$allow = $item->get_item_tags( NAMESPACE_DFRN, 'comment-allow');
if($allow && $allow[0]['data'] != $r[0]['last-child']) {
- $r = q("UPDATE `item` SET `last-child` = %d WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
+ $r = q("UPDATE `item` SET `last-child` = %d, `changed` = '%s' WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
intval($allow[0]['data']),
+ dbesc(datetime_convert()),
dbesc($item_id),
intval($importer['importer_uid'])
);
@@ -272,8 +277,9 @@ function dfrn_notify_post(&$a) {
if(count($r)) {
$allow = $item->get_item_tags( NAMESPACE_DFRN, 'comment-allow');
if($allow && $allow[0]['data'] != $r[0]['last-child']) {
- $r = q("UPDATE `item` SET `last-child` = %d WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
+ $r = q("UPDATE `item` SET `last-child` = %d, `changed` = '%s' WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
intval($allow[0]['data']),
+ dbesc(datetime_convert()),
dbesc($item_id),
intval($importer['importer_uid'])
);