]> git.mxchange.org Git - friendica.git/commitdiff
fewer "bob smith to bob smith via wall-to-wall".
authorfriendica <info@friendica.com>
Sat, 2 Jun 2012 07:40:38 +0000 (00:40 -0700)
committerfriendica <info@friendica.com>
Sat, 2 Jun 2012 07:40:38 +0000 (00:40 -0700)
include/conversation.php
mod/community.php
mod/network.php
mod/notes.php
mod/profile.php
mod/search.php

index dc574ddff8e899a0caa0f494d1e46dff0324565c..5c9b604e73b6ea80320f7dae06439640f13582b8 100644 (file)
@@ -496,7 +496,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
 
                                                // On the network page, I am the owner. On the display page it will be the profile owner.
                                                // This will have been stored in $a->page_contact by our calling page.
-                                               // Put this person on the left of the wall-to-wall notice.
+                                               // Put this person as the wall owner of the wall-to-wall notice.
 
                                                $owner_url = zrl($a->page_contact['url']);
                                                $owner_photo = $a->page_contact['thumb'];
@@ -504,23 +504,38 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
                                                $template = $wallwall;
                                                $commentww = 'ww';      
                                        }
-                                       if((! $item['wall']) && (strlen($item['owner-link'])) && (! link_compare($item['owner-link'],$item['author-link']))) {
 
-                                               // Could be anybody. 
-
-                                               $owner_url = $item['owner-link'];
-                                               $owner_photo = $item['owner-avatar'];
-                                               $owner_name = $item['owner-name'];
-                                               $template = $wallwall;
-                                               $commentww = 'ww';
-                                               // If it is our contact, use a friendly redirect link
-                                               if((link_compare($item['owner-link'],$item['url'])) 
-                                                       && ($item['network'] === NETWORK_DFRN)) {
-                                                       $owner_url = $redirect_url;
-                                                       $osparkle = ' sparkle';
+                                       if((! $item['wall']) && $item['owner-link']) {
+
+                                               $owner_linkmatch = (($item['owner-link']) && link_compare($item['owner-link'],$item['author-link']));
+                                               $alias_linkmatch = (($item['alias']) && link_compare($item['alias'],$item['author-link']));
+                                               $owner_namematch = (($item['owner-name']) && $item['owner-name'] == $item['author-name']);
+                                               if((! $owner_linkmatch) && (! $alias_linkmatch) && (! $owner_namematch)) {
+
+                                                       // The author url doesn't match the owner (typically the contact)
+                                                       // and also doesn't match the contact alias. 
+                                                       // The name match is a hack to catch several weird cases where URLs are 
+                                                       // all over the park. It can be tricked, but this prevents you from
+                                                       // seeing "Bob Smith to Bob Smith via Wall-to-wall" and you know darn
+                                                       // well that it's the same Bob Smith. 
+
+                                                       // But it could be somebody else with the same name. It just isn't highly likely. 
+                                                       
+
+                                                       $owner_url = $item['owner-link'];
+                                                       $owner_photo = $item['owner-avatar'];
+                                                       $owner_name = $item['owner-name'];
+                                                       $template = $wallwall;
+                                                       $commentww = 'ww';
+                                                       // If it is our contact, use a friendly redirect link
+                                                       if((link_compare($item['owner-link'],$item['url'])) 
+                                                               && ($item['network'] === NETWORK_DFRN)) {
+                                                               $owner_url = $redirect_url;
+                                                               $osparkle = ' sparkle';
+                                                       }
+                                                       else
+                                                               $owner_url = zrl($owner_url);
                                                }
-                                               else
-                                                       $owner_url = zrl($owner_url);
                                        }
                                }
 
index bfe5a30893f6d1fda936ea9dd045d19155f5fc63..fb28f78059cc1e7d2af2eef8502e0722efa6fdfe 100644 (file)
@@ -63,7 +63,7 @@ function community_content(&$a, $update = 0) {
        }
 
        $r = q("SELECT distinct(`item`.`uri`), `item`.*, `item`.`id` AS `item_id`, 
-               `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
+               `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`rel`,
                `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, 
                `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`,
                `user`.`nickname`, `user`.`hidewall`
index 7c4c1ac04e77f97c5e9a2c30e22bb66be1e7ed39..b998a310735df134ddb047610e84a942d16fadad 100644 (file)
@@ -534,7 +534,7 @@ function network_content(&$a, $update = 0) {
                        $parents_str = implode(', ', $parents_arr);
 
                        $items = q("SELECT `item`.*, `item`.`id` AS `item_id`,
-                               `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`writable`,
+                               `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`rel`, `contact`.`writable`,
                                `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
                                `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
                                FROM `item`, `contact`
index 703c898e6e36dce0f3b82276f755a7177ab4050a..625bbd2eefa97354d84af10f2561bb13e36c4d4e 100644 (file)
@@ -117,7 +117,7 @@ function notes_content(&$a,$update = false) {
                $parents_str = implode(', ', $parents_arr);
  
                $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, 
-                       `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`network`, `contact`.`rel`, 
+                       `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`network`, `contact`.`rel`, 
                        `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, 
                        `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
                        FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
index 69f044e89f4561f02bf4cfe357cd129cf22eec70..7658a9647d78b84fcfebd2e9a8b54339308a9ec3 100644 (file)
@@ -242,7 +242,7 @@ function profile_content(&$a, $update = 0) {
                $parents_str = implode(', ', $parents_arr);
  
                $items = q("SELECT `item`.*, `item`.`id` AS `item_id`, 
-                       `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`network`, `contact`.`rel`, 
+                       `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`network`, `contact`.`rel`, 
                        `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, 
                        `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
                        FROM `item`, `contact`
index 466ffc4c34cad18c6fdf62c3deaa495a81836321..320ffddcef2fbc0df671e6c58e5c26937372711a 100644 (file)
@@ -146,7 +146,7 @@ function search_content(&$a) {
        }
 
        $r = q("SELECT distinct(`item`.`uri`), `item`.*, `item`.`id` AS `item_id`, 
-               `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
+               `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`rel`,
                `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, 
                `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`,
                `user`.`nickname`