]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/Delivery.php
Merge pull request #5780 from annando/fix-relocation
[friendica.git] / src / Worker / Delivery.php
index 2dd87e463cccefb56a792a51f22d33703ff47d51..3a93d92f7b37366047dfc551e4c792081c9fb65e 100644 (file)
@@ -292,8 +292,10 @@ class Delivery extends BaseObject
                                self::deliverDiaspora($cmd, $contact, $owner, $items, $target_item, $public_message, $top_level, $followup);
                                return;
                        }
-               } else {
+               } elseif ($cmd != self::RELOCATION) {
                        $deliver_status = DFRN::deliver($owner, $contact, $atom);
+               } else {
+                       $deliver_status = DFRN::deliver($owner, $contact, $atom, false, true);
                }
 
                logger('Delivery to ' . $contact["url"] . ' with guid ' . $target_item["guid"] . ' returns ' . $deliver_status);
@@ -444,25 +446,30 @@ class Delivery extends BaseObject
                        if (($target_item["thr-parent"] != "") && ($target_item["thr-parent"] != $target_item["parent-uri"])) {
                                $headers .= " <".Email::iri2msgid($target_item["thr-parent"]).">";
                        }
+
                        $headers .= "\n";
 
                        if (empty($target_item['title'])) {
                                $condition = ['uri' => $target_item['parent-uri'], 'uid' => $owner['uid']];
                                $title = Item::selectFirst(['title'], $condition);
+
                                if (DBA::isResult($title) && ($title['title'] != '')) {
                                        $subject = $title['title'];
                                } else {
                                        $condition = ['parent-uri' => $target_item['parent-uri'], 'uid' => $owner['uid']];
                                        $title = Item::selectFirst(['title'], $condition);
+
                                        if (DBA::isResult($title) && ($title['title'] != '')) {
                                                $subject = $title['title'];
                                        }
                                }
                        }
+
                        if (strncasecmp($subject, 'RE:', 3)) {
                                $subject = 'Re: ' . $subject;
                        }
                }
+
                Email::send($addr, $subject, $headers, $target_item);
        }
 }