]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/DFRN.php
New function to delete items for users
[friendica.git] / src / Protocol / DFRN.php
index c41481872a0be7305f75388b951376765444c5b8..bf943f1a151def57fbb8c830a203409f32af2d4e 100644 (file)
@@ -2140,10 +2140,6 @@ class DFRN
                        Item::update($fields, $condition);
 
                        $changed = true;
-
-                       if ($entrytype == DFRN::REPLY_RC) {
-                               Worker::add(PRIORITY_HIGH, "Notifier", "comment-import", $current["id"]);
-                       }
                }
                return $changed;
        }
@@ -2719,23 +2715,6 @@ class DFRN
                                        Item::distribute($posted_id);
                                }
 
-                               $item["id"] = $posted_id;
-
-                               $r = q(
-                                       "SELECT `parent`, `parent-uri` FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1",
-                                       intval($posted_id),
-                                       intval($importer["importer_uid"])
-                               );
-                               if (DBM::is_result($r)) {
-                                       $parent = $r[0]["parent"];
-                                       $parent_uri = $r[0]["parent-uri"];
-                               }
-
-                               if ($posted_id && $parent && ($entrytype == DFRN::REPLY_RC)) {
-                                       logger("Notifying followers about comment ".$posted_id, LOGGER_DEBUG);
-                                       Worker::add(PRIORITY_HIGH, "Notifier", "comment-import", $posted_id);
-                               }
-
                                return true;
                        }
                } else { // $entrytype == DFRN::TOP_LEVEL
@@ -2828,23 +2807,13 @@ class DFRN
                        }
                }
 
-               $entrytype = self::getEntryType($importer, $item);
-
-               if (!$item["deleted"]) {
-                       logger('deleting item '.$item["id"].' uri='.$uri, LOGGER_DEBUG);
-               } else {
+               if ($item["deleted"]) {
                        return;
                }
 
-               Item::deleteById($item["id"]);
+               logger('deleting item '.$item["id"].' uri='.$uri, LOGGER_DEBUG);
 
-               if ($entrytype != DFRN::TOP_LEVEL) {
-                       // if this is a relayed delete, propagate it to other recipients
-                       if ($entrytype == DFRN::REPLY_RC) {
-                               logger("Notifying followers about deletion of post " . $item["id"], LOGGER_DEBUG);
-                               Worker::add(PRIORITY_HIGH, "Notifier", "drop", $item["id"]);
-                       }
-               }
+               Item::delete(['id' => $item["id"]]);
        }
 
        /**