]> git.mxchange.org Git - friendica.git/commitdiff
mostly cosmetic changes to make DB tables accurately reflect the conversation members
authorFriendika <info@friendika.com>
Thu, 6 Oct 2011 02:16:05 +0000 (19:16 -0700)
committerFriendika <info@friendika.com>
Thu, 6 Oct 2011 02:16:05 +0000 (19:16 -0700)
include/conversation.php
include/diaspora.php
include/notifier.php
mod/dfrn_notify.php

index 10b34ebe68a6eec0e8a0f104bf6ea935bf4ee9ae..18f6d080bedf8eb4c6ccd29593e22f1f05ee9221 100644 (file)
@@ -540,7 +540,7 @@ function conversation(&$a, $items, $mode, $update) {
                                        '$osparkle' => $osparkle,
                                        '$sparkle' => $sparkle,
                                        '$title' => template_escape($item['title']),
-                                       '$ago' => ((($item['app']) && ($item['id'] == $item['parent'])) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])),
+                                       '$ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])),
                                        '$lock' => $lock,
                                        '$location' => template_escape($location),
                                        '$indent' => $indent,
index 1ae8ca8006e3d4f3cf3551d7ac3e27c4266e1129..33b8336f3af562593335cc411d20481630748f69 100644 (file)
@@ -613,7 +613,6 @@ function diaspora_comment($importer,$xml,$msg) {
                return;
        }
 
-
        if($parent_author_signature) {
                $owner_signed_data = $guid . ';' . $parent_guid . ';' . $text . ';' . $diaspora_handle;
 
@@ -646,9 +645,9 @@ function diaspora_comment($importer,$xml,$msg) {
        $datarray['created'] = $datarray['edited'] = datetime_convert();
        $datarray['private'] = $parent_item['private'];
 
-       $datarray['owner-name'] = $contact['name'];
-       $datarray['owner-link'] = $contact['url'];
-       $datarray['owner-avatar'] = $contact['thumb'];
+       $datarray['owner-name'] = $parent_item['owner-name'];
+       $datarray['owner-link'] = $parent_item['owner-link'];
+       $datarray['owner-avatar'] = $parent_item['owner-avatar'];
 
        $datarray['author-name'] = $person['name'];
        $datarray['author-link'] = $person['url'];
index c3f7f33ea1566e21d1b292ff62de8c3a0de06df1..18a0fe584c471aa2a012c79a0c098141f5a4a1a0 100644 (file)
@@ -183,6 +183,7 @@ function notifier_run($argv, $argc){
                // We will only send a "notify owner to relay" or followup message if the referenced post
                // originated on our system by virtue of having our hostname somewhere
                // in the URI, AND it was a comment (not top_level) AND the parent originated elsewhere.
+
                // if $parent['wall'] == 1 we will already have the parent message in our array
                // and we will relay the whole lot.
  
@@ -357,6 +358,7 @@ function notifier_run($argv, $argc){
                                        continue;
 
                                $contact = get_item_contact($item,$contacts);
+
                                if(! $contact)
                                        continue;
 
index 53179eaf1033d843a5281c3de20a7cae151b3cd6..01bb9119eddff58b87c9f5f4def07c17a123a7c6 100644 (file)
@@ -454,9 +454,9 @@ function dfrn_notify_post(&$a) {
                        // was the top-level post for this reply written by somebody on this site? 
                        // Specifically, the recipient? 
 
-                       $r = q("select `item`.`id` from `item` 
+                       $r = q("select `item`.`id`, `contact`.`name`, `contact`.`url`, `contact`.`thumb` from `item` 
                                LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` 
-                               WHERE `contact`.`self` = 1 AND `item`.`uri` = '%s' AND `item`.`uid` = %d LIMIT 1",
+                               WHERE `contact`.`self` = 1 AND `item`.`wall` = 1 AND `item`.`uri` = '%s' AND `item`.`uid` = %d LIMIT 1",
                                dbesc($parent_uri),
                                intval($importer['importer_uid'])
                        );
@@ -470,6 +470,9 @@ function dfrn_notify_post(&$a) {
                                $datarray['wall'] = 1;
                                $datarray['parent-uri'] = $parent_uri;
                                $datarray['uid'] = $importer['importer_uid'];
+                               $datarray['owner-name'] = $r[0]['name'];
+                               $datarray['owner-link'] = $r[0]['url'];
+                               $datarray['owner-avatar'] = $r[0]['thumb'];
                                $datarray['contact-id'] = $importer['id'];
                                if(($datarray['verb'] == ACTIVITY_LIKE) || ($datarray['verb'] == ACTIVITY_DISLIKE)) {
                                        $is_like = true;