diff options
author | friendica <info@friendica.com> | 2015-03-07 23:35:56 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2015-03-07 23:35:56 -0800 |
commit | 480dac1af2dd5ed5ba3105577559568237fe5d80 (patch) | |
tree | 1b95ce77ef4d643b1967d27b596a438be549deba | |
parent | 1351f9c81afd0636b8d84bb317f1b8e84f9767f4 (diff) | |
download | volse-hubzilla-480dac1af2dd5ed5ba3105577559568237fe5d80.tar.gz volse-hubzilla-480dac1af2dd5ed5ba3105577559568237fe5d80.tar.bz2 volse-hubzilla-480dac1af2dd5ed5ba3105577559568237fe5d80.zip |
add reddress to profile - but all is not as it seems. Copy to clipboard is blocked because it isn't really a reddress and won't work if you copy it and try and use it somewhere. We should really convert the symbol back to '@' on copy and allow it to be copied, but this isn't as easy as it sounds and is left as an exercise for the community. If we just allow it to be copied we'll get a lot of bugs that making friends doesn't work. It does, but that isn't a legitimate reddress and even if we made allowances for it, Diaspora and Friendica and other webfinger based services wouldn't and would just say it can't be found or it's an illegal address. So if we block copy we'll just get bugs that it can't be copied. Eventually somebody will see this checkin and take it on themselves to figure out how to fix the address when copied to clipboard and then allow it to be copied. And there will be joy.
-rwxr-xr-x | .gitignore | 2 | ||||
-rw-r--r-- | include/identity.php | 11 | ||||
-rwxr-xr-x | view/tpl/profile_vcard.tpl | 2 |
3 files changed, 9 insertions, 6 deletions
diff --git a/.gitignore b/.gitignore index 8ded8b44a..b01074eaa 100755 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ *.lock *.kate-swp #Ignore emacs tempfiles -.#* +\#* # patch attempts *.orig *.rej diff --git a/include/identity.php b/include/identity.php index f63b576b2..079c1a245 100644 --- a/include/identity.php +++ b/include/identity.php @@ -724,12 +724,13 @@ function profile_load(&$a, $nickname, $profile = '') { $p[0]['extra_fields'] = $extra_fields; - $z = q("select xchan_photo_date from xchan where xchan_hash = '%s' limit 1", + $z = q("select xchan_photo_date, xchan_addr from xchan where xchan_hash = '%s' limit 1", dbesc($p[0]['channel_hash']) ); - if($z) + if($z) { $p[0]['picdate'] = $z[0]['xchan_photo_date']; - + $p[0]['reddress'] = str_replace('@','@',$z[0]['xchan_addr']); + } // fetch user tags if this isn't the default profile @@ -817,6 +818,7 @@ function profile_sidebar($profile, $block = 0, $show_connect = true) { $location = false; $address = false; $pdesc = true; + $reddress = true; if((! is_array($profile)) && (! count($profile))) return $o; @@ -906,7 +908,7 @@ logger('online: ' . $profile['online']); } if(($profile['hidewall'] && (! local_channel()) && (! remote_channel())) || $block ) { - $location = $pdesc = $gender = $marital = $homepage = $online = False; + $location = $reddress = $pdesc = $gender = $marital = $homepage = $online = False; } $firstname = ((strpos($profile['channel_name'],' ')) @@ -957,6 +959,7 @@ logger('online: ' . $profile['online']); '$homepage' => $homepage, '$chanmenu' => $channel_menu, '$diaspora' => $diaspora, + '$reddress' => $reddress, '$rating' => $z, '$contact_block' => $contact_block, )); diff --git a/view/tpl/profile_vcard.tpl b/view/tpl/profile_vcard.tpl index cae920c5d..2964d9c4b 100755 --- a/view/tpl/profile_vcard.tpl +++ b/view/tpl/profile_vcard.tpl @@ -16,7 +16,7 @@ {{/if}} <div class="fn">{{$profile.name}}{{if $profile.online}} <i class="icon-asterisk online-now" title="{{$profile.online}}"></i>{{/if}}</div> - + {{if $reddress}}<div class="reddress" oncopy="return false;">{{$profile.reddress}}</div>{{/if}} {{if $pdesc}}<div class="title">{{$profile.pdesc}}</div>{{/if}} <div id="profile-photo-wrapper"><img class="photo" width="175" height="175" src="{{$profile.photo}}?rev={{$profile.picdate}}" alt="{{$profile.name}}"></div> |