]> git.mxchange.org Git - friendica.git/commitdiff
found the missing comment box bug
authorMike Macgirvin <mike@macgirvin.com>
Thu, 9 Sep 2010 12:25:01 +0000 (05:25 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Thu, 9 Sep 2010 12:25:01 +0000 (05:25 -0700)
include/notifier.php
include/poller.php
mod/dfrn_notify.php
mod/item.php

index b94c21e7154dafa55b2c9f302ccf308b797bdd09..24e54373aacee8ddf9a3f86fefc8e196962faf7a 100644 (file)
        }
        else {
 
+               require_once('include/items.php');
+
+               $verb = construct_verb($item);
+               $actobj = construct_activity($item);
+
+
                if($followup) {
                        foreach($items as $item) {
                                if($item['id'] == $item_id) {
                                                        $item['created'] . '+00:00' , 'Y-m-d\TH:i:s\Z')),
                                                '$updated' => xmlify(datetime_convert('UTC', 'UTC', 
                                                        $item['edited'] . '+00:00' , 'Y-m-d\TH:i:s\Z')),
+                                               '$location' => xmlify($item['location']),
+                                               '$type' => 'text',
+                                               '$verb' => xmlify($verb),
+                                               '$actobj' => $actobj,
                                                '$content' => xmlify($item['body']),
                                                '$parent_id' => xmlify($item['parent-uri']),
                                                '$comment_allow' => 0
                                                                        '$updated' => xmlify(datetime_convert('UTC', 'UTC', 
                                                                                $item['edited'] . '+00:00' , 'Y-m-d\TH:i:s\Z')),
                                                                        '$location' => xmlify($item['location']),
+                                                                       '$type' => 'text',
+                                                                       '$verb' => xmlify($verb),
+                                                                       '$actobj' => $actobj,
                                                                        '$content' =>xmlify($item['body']),
                                                                        '$comment_allow' => (($item['last-child'] && strlen($contact['dfrn-id'])) ? 1 : 0)
                                                                ));
                                                                        '$updated' => xmlify(datetime_convert('UTC', 'UTC', 
                                                                                $item['edited'] . '+00:00' , 'Y-m-d\TH:i:s\Z')),
                                                                        '$content' =>xmlify($item['body']),
+                                                                       '$location' =>xmlify($item['location']),
+                                                                       '$type' => 'text',
+                                                                       '$verb' => xmlify($verb),
+                                                                       '$actobj' => $actobj,
                                                                        '$parent_id' => xmlify($item['parent-uri']),
                                                                        '$comment_allow' => (($item['last-child']) ? 1 : 0)
                                                                ));
index 1e0d61337c64be67b5c9445f3425d9175da61218..62bfdf8e30a8fbb1e4da7f33170906e767024fec 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
+       $debugging = true;
 
        require_once('boot.php');
 
@@ -71,6 +72,8 @@
 
                $importer = $r[0];
 
+echo "IMPORTER: {$importer['name']}";
+
                $last_update = (($contact['last-update'] == '0000-00-00 00:00:00') 
                        ? datetime_convert('UTC','UTC','now - 30 days','Y-m-d\TH:i:s\Z')
                        : datetime_convert('UTC','UTC',$contact['last-update'],'Y-m-d\TH:i:s\Z'));
@@ -212,10 +215,11 @@ echo "Length:" . strlen($xml) . "\r\n";
                                        if($item['uri'] == $item['parent-uri']) {
                                                $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s',
                                                        `body` = '', `title` = ''
-                                                       WHERE `parent-uri` = '%s'",
+                                                       WHERE `parent-uri` = '%s' AND `uid` = %d",
                                                        dbesc($when),
                                                        dbesc(datetime_convert()),
-                                                       dbesc($item['uri'])
+                                                       dbesc($item['uri']),
+                                                       intval($importer['uid'])
                                                );
                                        }
                                        else {
@@ -235,9 +239,10 @@ echo "Length:" . strlen($xml) . "\r\n";
                                                                intval($item['uid'])
                                                        );
                                                        // who is the last child now? 
-                                                       $r = q("SELECT `id` FROM `item` WHERE `parent-uri` = '%s' AND `type` != 'activity' AND `deleted` = 0 
+                                                       $r = q("SELECT `id` FROM `item` WHERE `parent-uri` = '%s' AND `type` != 'activity' AND `deleted` = 0 AND `uid` = %d 
                                                                ORDER BY `edited` DESC LIMIT 1",
-                                                                       dbesc($item['parent-uri'])
+                                                                       dbesc($item['parent-uri']),
+                                                                       intval($importer['uid'])
                                                        );
                                                        if(count($r)) {
                                                                q("UPDATE `item` SET `last-child` = 1 WHERE `id` = %d LIMIT 1",
@@ -274,9 +279,10 @@ echo "Length:" . strlen($xml) . "\r\n";
                                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` = 0, `changed` = '%s' WHERE `parent-uri` = '%s'",
+                                               $r = q("UPDATE `item` SET `last-child` = 0, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
                                                        dbesc(datetime_convert()),
-                                                       dbesc($parent_uri)
+                                                       dbesc($parent_uri),
+                                                       intval($importer['uid'])
                                                );
                                                $r = q("UPDATE `item` SET `last-child` = %d , `changed` = '%s'  WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
                                                        intval($allow[0]['data']),
index 433f69d112822ef48dfa2f572a9c226af7df44ae..1164bafe39ccf0029512018478caa956fc627949 100644 (file)
@@ -129,10 +129,11 @@ function dfrn_notify_post(&$a) {
                                $item = $r[0];
                                if($item['uri'] == $item['parent-uri']) {
                                        $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s'
-                                               WHERE `parent-uri` = '%s'",
+                                               WHERE `parent-uri` = '%s' AND `uid` = %d",
                                                dbesc($when),
                                                dbesc(datetime_convert()),
-                                               dbesc($item['uri'])
+                                               dbesc($item['uri']),
+                                               intval($importer['importer_uid'])
                                        );
                                }
                                else {
@@ -151,9 +152,10 @@ function dfrn_notify_post(&$a) {
                                                        intval($item['uid'])
                                                );
                                                // who is the last child now? 
-                                               $r = q("SELECT `id` FROM `item` WHERE `parent-uri` = '%s' AND `type` != 'activity' AND `deleted` = 0 
+                                               $r = q("SELECT `id` FROM `item` WHERE `parent-uri` = '%s' AND `type` != 'activity' AND `deleted` = 0 AND `uid` = %d
                                                        ORDER BY `edited` DESC LIMIT 1",
-                                                               dbesc($item['parent-uri'])
+                                                               dbesc($item['parent-uri']),
+                                                               intval($importer['importer_uid'])
                                                );
                                                if(count($r)) {
                                                        q("UPDATE `item` SET `last-child` = 1 WHERE `id` = %d LIMIT 1",
@@ -261,8 +263,9 @@ function dfrn_notify_post(&$a) {
                        
                                if($importer['notify-flags'] & NOTIFY_COMMENT) {
 
-                                       $myconv = q("SELECT `author-link` FROM `item` WHERE `parent-uri` = '%s'",
-                                               dbesc($parent_uri)
+                                       $myconv = q("SELECT `author-link` FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d",
+                                               dbesc($parent_uri),
+                                               intval($importer['importer_uid'])
                                        );
                                        if(count($myconv)) {
                                                foreach($myconv as $conv) {
index 08f65dca16d19eaa2dfcaaeb978ad7b52f941d99..20a2488c51b869e2586abf3841694a06f03e3256 100644 (file)
@@ -287,8 +287,9 @@ function item_content(&$a) {
                                        intval($item['uid'])
                                );
                                // who is the last child now? 
-                               $r = q("SELECT `id` FROM `item` WHERE `parent-uri` = '%s' AND `type` != 'activity' AND `deleted` = 0 ORDER BY `edited` DESC LIMIT 1",
-                                       dbesc($item['parent-uri'])
+                               $r = q("SELECT `id` FROM `item` WHERE `parent-uri` = '%s' AND `type` != 'activity' AND `deleted` = 0 AND `uid` = %d ORDER BY `edited` DESC LIMIT 1",
+                                       dbesc($item['parent-uri']),
+                                       intval($item['uid'])
                                );
                                if(count($r)) {
                                        q("UPDATE `item` SET `last-child` = 1 WHERE `id` = %d LIMIT 1",