]> git.mxchange.org Git - friendica.git/blobdiff - include/notifier.php
repeated items from ostatus and diaspora are now using the share-element.
[friendica.git] / include / notifier.php
index b685e1b99872a32518558d4ad6fd0e603a5efef6..c522bcb6bc1ec00c457b51a0e5aadd26525c3e02 100644 (file)
@@ -791,12 +791,21 @@ function notifier_run(&$argv, &$argc){
 
                                                if($it['uri'] !== $it['parent-uri']) {
                                                        $headers .= 'References: <' . iri2msgid($it['parent-uri']) . '>' . "\n";
-                                                       if(!strlen($it['title'])) {
-                                                               $r = q("SELECT `title` FROM `item` WHERE `parent-uri` = '%s' LIMIT 1",
-                                                                       dbesc($it['parent-uri']));
+                                                       if(!$it['title']) {
+                                                               $r = q("SELECT `title` FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
+                                                                       dbesc($it['parent-uri']),
+                                                                       intval($uid));
 
-                                                               if(count($r) AND ($r[0]['title'] != ''))  
+                                                               if(count($r) AND ($r[0]['title'] != ''))
                                                                        $subject = $r[0]['title'];
+                                                               else {
+                                                                       $r = q("SELECT `title` FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d LIMIT 1",
+                                                                               dbesc($it['parent-uri']),
+                                                                               intval($uid));
+
+                                                                       if(count($r) AND ($r[0]['title'] != ''))
+                                                                               $subject = $r[0]['title'];
+                                                               }
                                                        }
                                                        if(strncasecmp($subject,'RE:',3))
                                                                $subject = 'Re: '.$subject;