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.

This commit is contained in:
friendica 2015-03-07 23:35:56 -08:00
parent 1351f9c81a
commit 480dac1af2
3 changed files with 9 additions and 6 deletions

2
.gitignore vendored
View File

@ -8,7 +8,7 @@
*.lock *.lock
*.kate-swp *.kate-swp
#Ignore emacs tempfiles #Ignore emacs tempfiles
.#* \#*
# patch attempts # patch attempts
*.orig *.orig
*.rej *.rej

View File

@ -724,12 +724,13 @@ function profile_load(&$a, $nickname, $profile = '') {
$p[0]['extra_fields'] = $extra_fields; $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']) dbesc($p[0]['channel_hash'])
); );
if($z) if($z) {
$p[0]['picdate'] = $z[0]['xchan_photo_date']; $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 // 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; $location = false;
$address = false; $address = false;
$pdesc = true; $pdesc = true;
$reddress = true;
if((! is_array($profile)) && (! count($profile))) if((! is_array($profile)) && (! count($profile)))
return $o; return $o;
@ -906,7 +908,7 @@ logger('online: ' . $profile['online']);
} }
if(($profile['hidewall'] && (! local_channel()) && (! remote_channel())) || $block ) { 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'],' ')) $firstname = ((strpos($profile['channel_name'],' '))
@ -957,6 +959,7 @@ logger('online: ' . $profile['online']);
'$homepage' => $homepage, '$homepage' => $homepage,
'$chanmenu' => $channel_menu, '$chanmenu' => $channel_menu,
'$diaspora' => $diaspora, '$diaspora' => $diaspora,
'$reddress' => $reddress,
'$rating' => $z, '$rating' => $z,
'$contact_block' => $contact_block, '$contact_block' => $contact_block,
)); ));

View File

@ -16,7 +16,7 @@
{{/if}} {{/if}}
<div class="fn">{{$profile.name}}{{if $profile.online}} <i class="icon-asterisk online-now" title="{{$profile.online}}"></i>{{/if}}</div> <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}} {{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> <div id="profile-photo-wrapper"><img class="photo" width="175" height="175" src="{{$profile.photo}}?rev={{$profile.picdate}}" alt="{{$profile.name}}"></div>