]> git.mxchange.org Git - friendica.git/commitdiff
edited comments weren't being relayed
authorfriendica <info@friendica.com>
Mon, 16 Apr 2012 08:35:27 +0000 (01:35 -0700)
committerfriendica <info@friendica.com>
Mon, 16 Apr 2012 08:35:27 +0000 (01:35 -0700)
include/items.php

index 85df340d3f65a5ffc89098588ab2447b1cab3c27..c55a557045c7affb8288b730a214078e4d16ee9d 100644 (file)
@@ -2229,6 +2229,30 @@ function local_delivery($importer,$data) {
                                $datarray = get_atom_elements($feed,$item);
 
 
+                               $r = q("SELECT `uid`, `last-child`, `edited`, `body` FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
+                                       dbesc($item_id),
+                                       intval($importer['importer_uid'])
+                               );
+
+                               // Update content if 'updated' changes
+
+                               if(count($r)) {
+                                       if((x($datarray,'edited') !== false) && (datetime_convert('UTC','UTC',$datarray['edited']) !== $r[0]['edited'])) {  
+                                               $r = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `tag` = '%s', `edited` = '%s' WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
+                                                       dbesc($datarray['title']),
+                                                       dbesc($datarray['body']),
+                                                       dbesc($datarray['tag']),
+                                                       dbesc(datetime_convert('UTC','UTC',$datarray['edited'])),
+                                                       dbesc($item_id),
+                                                       intval($importer['importer_uid'])
+                                               );
+                                       }
+                                       proc_run('php',"include/notifier.php","comment-import",$r[0]['id']);
+
+                                       continue;
+                               }
+
+
                                // TODO: make this next part work against both delivery threads of a community post
 
 //                             if((! link_compare($datarray['author-link'],$importer['url'])) && (! $community)) {