diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b161c515f..ae952d178 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -96,7 +96,7 @@ module ApplicationHelper end def person_image_tag(person) - image_tag image_or_default(person), :class => "avatar", :alt => person.real_name, :title => person.real_name, "data-person_id" => person.id + image_tag image_or_default(person), :class => "avatar", :alt => person.name, :title => person.name, "data-person_id" => person.id end def image_or_default(person) diff --git a/app/mailers/notifier.rb b/app/mailers/notifier.rb index ed535373c..1081a24b3 100644 --- a/app/mailers/notifier.rb +++ b/app/mailers/notifier.rb @@ -12,8 +12,8 @@ class Notifier < ActionMailer::Base attachments.inline['diaspora_white_on_grey.png'] = ATTACHMENT - mail(:to => "#{@receiver.real_name} <#{@receiver.email}>", - :subject => I18n.t('notifier.new_request.subject', :from => @sender.real_name), :host => APP_CONFIG[:terse_pod_url]) + mail(:to => "#{@receiver.name} <#{@receiver.email}>", + :subject => I18n.t('notifier.new_request.subject', :from => @sender.name), :host => APP_CONFIG[:terse_pod_url]) end def request_accepted(recipient_id, sender_id, aspect_id) @@ -25,8 +25,8 @@ class Notifier < ActionMailer::Base attachments.inline['diaspora_white_on_grey.png'] = ATTACHMENT - mail(:to => "#{@receiver.real_name} <#{@receiver.email}>", - :subject => I18n.t('notifier.request_accepted.subject', :name => @sender.real_name), :host => APP_CONFIG[:terse_pod_url]) + mail(:to => "#{@receiver.name} <#{@receiver.email}>", + :subject => I18n.t('notifier.request_accepted.subject', :name => @sender.name), :host => APP_CONFIG[:terse_pod_url]) end private diff --git a/app/models/person.rb b/app/models/person.rb index 7e258561b..d6bd1800c 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -67,12 +67,12 @@ class Person return p end - def real_name - @real_name ||= if profile.first_name.nil? || profile.first_name.empty? - self.diaspora_handle - else - "#{profile.first_name.to_s} #{profile.last_name.to_s}" - end + def name + @name ||= if profile.first_name.nil? || profile.first_name.empty? + self.diaspora_handle + else + "#{profile.first_name.to_s} #{profile.last_name.to_s}" + end end def owns?(post) @@ -143,10 +143,10 @@ class Person { :person => { :id => self.id, - :name => self.real_name, - :diaspora_handle => self.diaspora_handle, + :name => self.name, :url => self.url, - :exported_key => exported_key + :exported_key => exported_key, + :diaspora_handle => self.diaspora_handle } } end diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index ed3940b90..36b0dcbee 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -4,7 +4,7 @@ .span-24.last %h2{:style => "position:relative;"} - = current_user.real_name + = current_user.name .right{:style=>"top:0"} %span.description = link_to current_user.diaspora_handle, person_path(current_user.person) diff --git a/app/views/comments/_comment.html.haml b/app/views/comments/_comment.html.haml index 719b8c22d..b59df96a4 100644 --- a/app/views/comments/_comment.html.haml +++ b/app/views/comments/_comment.html.haml @@ -5,10 +5,10 @@ - person = hash[:person] %li.comment{:data=>{:guid=>comment.id}} %a{:href => "/people/#{person.id}"} - %img{:src => image_or_default(person), :class => "avatar", :alt => person.real_name, :title => person.real_name, "data-person_id" => person.id} + %img{:src => image_or_default(person), :class => "avatar", :alt => person.name, :title => person.name, "data-person_id" => person.id} .content .from - %a{:href => "/people/#{person.id}"}=person.real_name + %a{:href => "/people/#{person.id}"}=person.name = markdownify(comment.text, :youtube_maps => comment[:youtube_titles]) %div.time = comment.created_at ? "#{time_ago_in_words(comment.created_at)} #{t('ago')}" : time_ago_in_words(Time.now) diff --git a/app/views/devise/mailer/_inviters.haml b/app/views/devise/mailer/_inviters.haml index b40b5807e..b348decf2 100644 --- a/app/views/devise/mailer/_inviters.haml +++ b/app/views/devise/mailer/_inviters.haml @@ -1,11 +1,11 @@ %p - if @invs.count == 1 - = t('.has_invited_you', :name => @invs.first.from.real_name + " (#{@invs.first.from.diaspora_handle})") + = t('.has_invited_you', :name => @invs.first.from.name + " (#{@invs.first.from.diaspora_handle})") - else - = t('.have_invited_you', :names => (@invs.map{|inv| inv.from.real_name + " (#{inv.from.diaspora_handle})"}.join(","))) + = t('.have_invited_you', :names => (@invs.map{|inv| inv.from.name + " (#{inv.from.diaspora_handle})"}.join(","))) = t('.accept_at', :url => root_url) - @invs.each do |inv| - if inv.message - = "#{inv.from.real_name}:" + = "#{inv.from.name}:" = "\"#{inv.message}\"" %p diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index 7a1d65100..214754ca8 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -26,7 +26,7 @@ ▼ .avatar = owner_image_tag - = link_to current_user.real_name, '#' + = link_to current_user.name, '#' %li= link_to t('.view_profile'), current_user.person %li= link_to t('.edit_profile'), edit_person_path(current_user.person) %li= link_to t('.account_settings'), edit_user_path(current_user) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 6f217e80e..166c24e99 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -9,7 +9,7 @@ %title - if current_user - = "#{current_user.real_name} | DIASPORA*" + = "#{current_user.name} | DIASPORA*" - else DIASPORA* @@ -69,7 +69,7 @@ - if current_user - %link{:rel => "alternate", :href => "#{current_user.public_url}", :type => "application/atom+xml", :title => "Public Diaspora Feed for #{current_user.real_name}"} + %link{:rel => "alternate", :href => "#{current_user.public_url}", :type => "application/atom+xml", :title => "Public Diaspora Feed for #{current_user.name}"} %body -unless @landing_page diff --git a/app/views/layouts/application.mobile.haml b/app/views/layouts/application.mobile.haml index b20c81643..4ead50b0f 100644 --- a/app/views/layouts/application.mobile.haml +++ b/app/views/layouts/application.mobile.haml @@ -6,7 +6,7 @@ %html{:lang => I18n.locale.to_s} %head %title - = "#{current_user.real_name} | diaspora" if current_user + = "#{current_user.name} | diaspora" if current_user %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/ @@ -25,7 +25,7 @@ %div{:data => {:role => 'header', :nobackbtn => 'true'}} %h1 = person_image_tag (current_user.person) - = current_user.real_name + = current_user.name = select_tag "aspect_picker", aspect_select_options(@aspects, @aspect) = yield diff --git a/app/views/notifier/new_request.html.haml b/app/views/notifier/new_request.html.haml index 288b2efe7..91d386c0b 100644 --- a/app/views/notifier/new_request.html.haml +++ b/app/views/notifier/new_request.html.haml @@ -1,7 +1,7 @@ %p = t('notifier.hello', :name => @receiver.email) %p - = "#{@sender.real_name} (#{@sender.diaspora_handle})" + = "#{@sender.name} (#{@sender.diaspora_handle})" = t('.just_sent_you') = t('.try_it_out') %br diff --git a/app/views/notifier/new_request.text.haml b/app/views/notifier/new_request.text.haml index 9d4f6e957..dfef1ff17 100644 --- a/app/views/notifier/new_request.text.haml +++ b/app/views/notifier/new_request.text.haml @@ -1,5 +1,5 @@ = t('notifier.hello', :name => @receiver.profile.first_name) -= "#{@sender.real_name} (#{@sender.diaspora_handle})" += "#{@sender.name} (#{@sender.diaspora_handle})" = t('notifier.new_request.just_sent_you') = t('notifier.new_request.try_it_out') diff --git a/app/views/notifier/request_accepted.html.haml b/app/views/notifier/request_accepted.html.haml index c6de766e9..c8b225911 100644 --- a/app/views/notifier/request_accepted.html.haml +++ b/app/views/notifier/request_accepted.html.haml @@ -1,7 +1,7 @@ %p = t('notifier.hello', :name => @receiver.profile.first_name) %p - = "#{@sender.real_name} (#{@sender.diaspora_handle})" + = "#{@sender.name} (#{@sender.diaspora_handle})" = t('.accepted') = link_to @aspect.name, aspect_url(@aspect) = t('.aspect') diff --git a/app/views/notifier/request_accepted.text.haml b/app/views/notifier/request_accepted.text.haml index b0e9fa7a7..eade8373d 100644 --- a/app/views/notifier/request_accepted.text.haml +++ b/app/views/notifier/request_accepted.text.haml @@ -1,5 +1,5 @@ = t('notifier.hello', :name => @receiver.profile.first_name) -= "#{@sender.real_name} (#{@sender.diaspora_handle})" += "#{@sender.name} (#{@sender.diaspora_handle})" = t('notifier.request_accepted.accepted') = "#{@aspect.name} #{t('notifier.request_accepted.aspect')}\n" = "#{aspect_url(@aspect)}" diff --git a/app/views/people/_person.html.haml b/app/views/people/_person.html.haml index 936eaf2d9..7c455a3bb 100644 --- a/app/views/people/_person.html.haml +++ b/app/views/people/_person.html.haml @@ -8,7 +8,7 @@ .content %span.from - = link_to person.real_name, person_path(person) + = link_to person.name, person_path(person) .right{:style=>"display:inline;"} - if person.id == current_user.person.id diff --git a/app/views/people/_profile_sidebar.html.haml b/app/views/people/_profile_sidebar.html.haml index a8b3d8023..03e782667 100644 --- a/app/views/people/_profile_sidebar.html.haml +++ b/app/views/people/_profile_sidebar.html.haml @@ -9,7 +9,7 @@ $(this).closest('li').fadeOut(200); }); $('.delete').bind('ajax:failure', function() { - alert("#{t('.cannot_remove', :name => person.real_name)}"); + alert("#{t('.cannot_remove', :name => person.name)}"); }); }); @@ -29,7 +29,7 @@ - for aspect in @aspects_with_person %li = link_to aspect.name, aspect - = link_to "x", {:controller => "aspects", :action => "remove_from_aspect", :person_id => person.id, :aspect_id => aspect.id}, :confirm => t('.remove_from', :name => person.real_name, :aspect => aspect), :remote => true, :class => "delete" + = link_to "x", {:controller => "aspects", :action => "remove_from_aspect", :person_id => person.id, :aspect_id => aspect.id}, :confirm => t('.remove_from', :name => person.name, :aspect => aspect), :remote => true, :class => "delete" -if is_contact || person == current_user.person diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index 174ccf9cd..7615a63ac 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -7,7 +7,7 @@ #author_info .from{:style=>"padding-left:0;display:block;"} %h2{:style=>"display:block;"} - = @person.real_name + = @person.name .right{:style => "top:0;"} %span.description = @person.diaspora_handle @@ -47,7 +47,7 @@ - else .floating %h3 - = t('.not_connected', :name => @person.real_name) + = t('.not_connected', :name => @person.name) - unless pending_request_for(@person) %h3 @@ -59,5 +59,5 @@ - else %h3 .description - = t('.already_requested', :name => @person.real_name) + = t('.already_requested', :name => @person.name) diff --git a/app/views/photos/_photo.haml b/app/views/photos/_photo.haml index 9ca39bffa..a601735ae 100644 --- a/app/views/photos/_photo.haml +++ b/app/views/photos/_photo.haml @@ -10,5 +10,5 @@ %p.photo_description = post.caption -= link_to t('.view_all', :name => post.person.real_name), person_photos_path(post.person), :class => "small_text" += link_to t('.view_all', :name => post.person.name), person_photos_path(post.person), :class => "small_text" diff --git a/app/views/publics/hcard.haml b/app/views/publics/hcard.haml index 869286964..be6bf2bcb 100644 --- a/app/views/publics/hcard.haml +++ b/app/views/publics/hcard.haml @@ -1,5 +1,5 @@ #content - %h1= @person.real_name + %h1= @person.name #content_inner #i.entity_profile.vcard.author %h2 User profile @@ -7,7 +7,7 @@ %dl.entity_nickname %dt Nickname %dd - %a.nickname.url.uid{:href=>@person.url, :rel=>'me'}= @person.real_name + %a.nickname.url.uid{:href=>@person.url, :rel=>'me'}= @person.name %dl.entity_given_name %dt First name @@ -22,7 +22,7 @@ %dl.entity_fn %dt Full name %dd - %span.fn= @person.real_name + %span.fn= @person.name %dl.entity_url %dt URL diff --git a/app/views/shared/_author_info.html.haml b/app/views/shared/_author_info.html.haml index da8d30184..e74e197fd 100644 --- a/app/views/shared/_author_info.html.haml +++ b/app/views/shared/_author_info.html.haml @@ -2,7 +2,7 @@ = person_image_link(person) .from %h2 - = person.real_name + = person.name - if current_user.owns?(post) .aspect ➔ diff --git a/app/views/shared/_contact_list.html.haml b/app/views/shared/_contact_list.html.haml index 856becacc..c86b007a5 100644 --- a/app/views/shared/_contact_list.html.haml +++ b/app/views/shared/_contact_list.html.haml @@ -9,7 +9,7 @@ - for contact in contacts %li %span.name - = link_to contact.person.real_name, contact.person + = link_to contact.person.name, contact.person .right = aspect_membership_button(aspect_id, contact) diff --git a/app/views/shared/_notification.haml b/app/views/shared/_notification.haml index 153f78c2d..7547bcf10 100644 --- a/app/views/shared/_notification.haml +++ b/app/views/shared/_notification.haml @@ -2,4 +2,4 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -= link_to t('.new', :type => object.class.to_s, :from => object.person.real_name), object_path(object.post) += link_to t('.new', :type => object.class.to_s, :from => object.person.name), object_path(object.post) diff --git a/app/views/shared/_stream_element.html.haml b/app/views/shared/_stream_element.html.haml index 2487c54ae..b7849c999 100644 --- a/app/views/shared/_stream_element.html.haml +++ b/app/views/shared/_stream_element.html.haml @@ -4,11 +4,11 @@ %li.message{:data=>{:guid=>post.id}} %a{:href => "/people/#{person.id}"} - %img{:src => image_or_default(person), :class => "avatar", :alt => person.real_name, :title => person.real_name, "data-person_id" => person.id} + %img{:src => image_or_default(person), :class => "avatar", :alt => person.name, :title => person.name, "data-person_id" => person.id} .content .from - %a{:href => "/people/#{person.id}"}=person.real_name + %a{:href => "/people/#{person.id}"}=person.name - if person.owner_id == current_user.id .aspect diff --git a/app/views/shared/_stream_element.mobile.haml b/app/views/shared/_stream_element.mobile.haml index 404abde95..08b6e6a40 100644 --- a/app/views/shared/_stream_element.mobile.haml +++ b/app/views/shared/_stream_element.mobile.haml @@ -7,7 +7,7 @@ .content .from - = link_to post.person.real_name, post.person + = link_to post.person.name, post.person .aspect ➔ - if post.public? diff --git a/lib/diaspora/ostatus_builder.rb b/lib/diaspora/ostatus_builder.rb index 60a106ac5..6ea1ede89 100644 --- a/lib/diaspora/ostatus_builder.rb +++ b/lib/diaspora/ostatus_builder.rb @@ -29,11 +29,11 @@ module Diaspora Diaspora #{@user.public_url}.atom -#{@user.real_name}'s Public Feed +#{@user.name}'s Public Feed Posts from Diaspora #{Time.now.xmlschema} - #{@user.real_name} + #{@user.name} #{@user.public_url} XML @@ -51,7 +51,7 @@ module Diaspora http://activitystrea.ms/schema/1.0/person #{@user.public_url} - #{@user.real_name} + #{@user.name} diff --git a/lib/diaspora/user/connecting.rb b/lib/diaspora/user/connecting.rb index 33783eea6..fe9e8f99c 100644 --- a/lib/diaspora/user/connecting.rb +++ b/lib/diaspora/user/connecting.rb @@ -67,11 +67,11 @@ module Diaspora if contact_request.save! self.pending_requests << contact_request self.save! - Rails.logger.info("#{self.real_name} has received a contact request") + Rails.logger.info("#{self.name} has received a contact request") Request.send_new_request(self, contact_request.from) end else - Rails.logger.info "#{self.real_name} is trying to receive a contact request from himself." + Rails.logger.info "#{self.name} is trying to receive a contact request from himself." return nil end contact_request @@ -80,7 +80,7 @@ module Diaspora def receive_request_acceptance(received_request, sent_request) destination_aspect = self.aspect_by_id(sent_request.into_id) activate_contact(received_request.from, destination_aspect) - Rails.logger.info("#{self.real_name}'s contact request has been accepted") + Rails.logger.info("#{self.name}'s contact request has been accepted") received_request.destroy pending_requests.delete(sent_request) diff --git a/lib/encryptable.rb b/lib/encryptable.rb index c293c8257..8af06f565 100644 --- a/lib/encryptable.rb +++ b/lib/encryptable.rb @@ -16,13 +16,13 @@ Rails.logger.info("Verifying sig on #{signable_string} but no person is here") return false elsif person.public_key.nil? - Rails.logger.info("Verifying sig on #{signable_string} but #{person.real_name} has no key") + Rails.logger.info("Verifying sig on #{signable_string} but #{person.name} has no key") return false elsif signature.nil? - Rails.logger.info("Verifying sig on #{signable_string} but #{person.real_name} did not sign") + Rails.logger.info("Verifying sig on #{signable_string} but #{person.name} did not sign") return false end - Rails.logger.debug("Verifying sig on #{signable_string} from person #{person.real_name}") + Rails.logger.debug("Verifying sig on #{signable_string} from person #{person.name}") validity = person.public_key.verify "SHA", Base64.decode64(signature), signable_string Rails.logger.debug("Validity: #{validity}") validity diff --git a/lib/salmon/salmon.rb b/lib/salmon/salmon.rb index 0b27da63a..331322024 100644 --- a/lib/salmon/salmon.rb +++ b/lib/salmon/salmon.rb @@ -102,7 +102,7 @@ ENTRY #{iv} #{aes_key} - #{@author.real_name} + #{@author.name} acct:#{@author.diaspora_handle} diff --git a/script/websocket_server.rb b/script/websocket_server.rb index b3df18e10..65b60dd69 100644 --- a/script/websocket_server.rb +++ b/script/websocket_server.rb @@ -72,14 +72,14 @@ begin user_id = cookie["warden.user.user.key"].last - debug_pp "In WSS, suscribing user: #{User.find(user_id).real_name} with id: #{user_id}" + debug_pp "In WSS, suscribing user: #{User.find(user_id).name} with id: #{user_id}" sid = Diaspora::WebSocket.subscribe(user_id, ws) ws.onmessage { |msg| SocketsController.new.incoming(msg) } ws.onclose { begin - debug_pp "In WSS, unsuscribing user: #{User.find(user_id).real_name} with id: #{user_id}" + debug_pp "In WSS, unsuscribing user: #{User.find(user_id).name} with id: #{user_id}" Diaspora::WebSocket.unsubscribe(user_id, sid) rescue debug_pp "Could not unsubscribe socket for #{user_id}" diff --git a/spec/mailers/notifier_spec.rb b/spec/mailers/notifier_spec.rb index 608a129bf..5fbb976c7 100644 --- a/spec/mailers/notifier_spec.rb +++ b/spec/mailers/notifier_spec.rb @@ -21,7 +21,7 @@ describe Notifier do it 'has the name of person sending the request' do - request_mail.body.encoded.include?(person.real_name).should be true + request_mail.body.encoded.include?(person.name).should be true end it 'has the css' do @@ -40,7 +40,7 @@ describe Notifier do it 'has the name of person sending the request' do - request_accepted_mail.body.encoded.include?(person.real_name).should be true + request_accepted_mail.body.encoded.include?(person.name).should be true end it 'has the name of the aspect in the body' do diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index 061c78ace..a04229b93 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -61,14 +61,14 @@ describe Person do end end - context '#real_name' do + context '#name' do let!(:user) { make_user } let!(:person) { user.person } let!(:profile) { person.profile } context 'with first name' do - it 'should return their name for real name' do - person.real_name.should match /#{profile.first_name}|#{profile.last_name}/ + it 'should return their name for name' do + person.name.should match /#{profile.first_name}|#{profile.last_name}/ end end @@ -77,7 +77,7 @@ describe Person do person.profile.first_name = nil person.profile.last_name = nil person.save! - person.real_name.should == person.diaspora_handle + person.name.should == person.diaspora_handle end end end