diff options
author | friendica <info@friendica.com> | 2013-01-24 20:43:33 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-01-24 20:43:33 -0800 |
commit | 50433d857ae5b04ae5f3f381889d8450fe9699f5 (patch) | |
tree | 7a7c8f770fc7861de72956a55aa1b367ba728f66 /include/ItemObject.php | |
parent | 99c40ce388fe7666e38372fd1d0006cff7f7fcc8 (diff) | |
download | volse-hubzilla-50433d857ae5b04ae5f3f381889d8450fe9699f5.tar.gz volse-hubzilla-50433d857ae5b04ae5f3f381889d8450fe9699f5.tar.bz2 volse-hubzilla-50433d857ae5b04ae5f3f381889d8450fe9699f5.zip |
quick-n-dirty wall-to-wall detection, wasn't working at all - this may be overboard or it may still not work at all.
Diffstat (limited to 'include/ItemObject.php')
-rw-r--r-- | include/ItemObject.php | 58 |
1 files changed, 8 insertions, 50 deletions
diff --git a/include/ItemObject.php b/include/ItemObject.php index 37b9b4a83..426517b06 100644 --- a/include/ItemObject.php +++ b/include/ItemObject.php @@ -571,59 +571,17 @@ class Item extends BaseObject { * Check if we are a wall to wall item and set the relevant properties */ protected function check_wall_to_wall() { - $a = $this->get_app(); $conv = $this->get_conversation(); $this->wall_to_wall = false; + $this->owner_url = ''; + $this->owner_photo = ''; + $this->owner_name = ''; - if($this->is_toplevel()) { - if( (! $this->get_data_value('self')) && ($conv->get_mode() !== 'channel')) { - if($this->get_data_value('wall')) { - - // 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 as the wall owner of the wall-to-wall notice. - - $this->owner_url = zid($a->page_contact['url']); - $this->owner_photo = $a->page_contact['thumb']; - $this->owner_name = $a->page_contact['name']; - $this->wall_to_wall = true; - } - else if($this->get_data_value('owner-link')) { - - $owner_linkmatch = (($this->get_data_value('owner-link')) && link_compare($this->get_data_value('owner-link'),$this->get_data_value('author-link'))); - $alias_linkmatch = (($this->get_data_value('alias')) && link_compare($this->get_data_value('alias'),$this->get_data_value('author-link'))); - $owner_namematch = (($this->get_data_value('owner-name')) && $this->get_data_value('owner-name') == $this->get_data_value('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. - - - $this->owner_photo = $this->get_data_value('owner-avatar'); - $this->owner_name = $this->get_data_value('owner-name'); - $this->wall_to_wall = true; - // If it is our contact, use a friendly redirect link - if((link_compare($this->get_data_value('owner-link'),$this->get_data_value('url'))) - && ($this->get_data_value('network') === NETWORK_DFRN)) { - $this->owner_url = $this->get_redirect_url(); - } - else - $this->owner_url = zid($this->get_data_value('owner-link')); - } - } - } - } - - if(!$this->wall_to_wall) { - $this->owner_url = ''; - $this->owner_photo = ''; - $this->owner_name = ''; + if($this->is_toplevel() && ($this->get_data_value('author_xchan') != $this->get_data_value('owner_xchan'))) { + $this->owner_url = $this->data['owner']['xchan_url']; + $this->owner_photo = $this->data['owner']['xchan_photo_m']; + $this->owner_name = $this->data['owner']['xchan_name']; + $this->wall_to_wall = true; } } |