]> git.mxchange.org Git - friendica.git/blobdiff - include/notifier.php
Forgot to commit the changes (regarding fermionic's comments) in notifier.php
[friendica.git] / include / notifier.php
index 171b55fc37425f0fa513be5266cbfeab0933c7ad..2f4120da257c87538d4d09edf29e9d0a22e2cf63 100644 (file)
@@ -134,6 +134,24 @@ function notifier_run($argv, $argc){
                $recipients[] = $suggest[0]['cid'];
                $item = $suggest[0];
        }
+       elseif($cmd === 'removeme') {
+               $r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1", intval($item_id));
+               if (! $r)
+                       return;
+               $user = $r[0];
+               $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1", intval($item_id));
+               if (! $r)
+                       return;
+               $self = $r[0];
+               $r = q("SELECT * FROM `contact` WHERE `self` = 0 AND `uid` = %d", intval($item_id));
+               if(! $r)
+                       return;
+               require_once('include/Contact.php');
+               foreach($r as $contact) {
+                       terminate_friendship($user, $self, $contact);
+               }
+               return;
+       }
        else {
 
                // find ancestors
@@ -575,7 +593,7 @@ function notifier_run($argv, $argc){
                                                        AND `contact`.`pending` = 0
                                                        AND `contact`.`network` = '%s' AND `user`.`nickname` = '%s'
                                                        $sql_extra
-                                                       AND `user`.`account_expired` = 0 LIMIT 1",
+                                                       AND `user`.`account_expired` = 0 AND `user`.`account_removed` = 0 LIMIT 1",
                                                        dbesc(NETWORK_DFRN),
                                                        dbesc($nickname)
                                                );