diff --git a/app/helpers/status_messages_helper.rb b/app/helpers/status_messages_helper.rb index 2dfbd31cc..f076e3fab 100644 --- a/app/helpers/status_messages_helper.rb +++ b/app/helpers/status_messages_helper.rb @@ -5,7 +5,7 @@ module StatusMessagesHelper def my_latest_message unless @latest_status_message.nil? - return @latest_status_message.message + return @latest_status_message.text else return I18n.t('status_messages.helper.no_message_to_display') end diff --git a/app/models/service.rb b/app/models/service.rb index fc6364588..1225e547b 100644 --- a/app/models/service.rb +++ b/app/models/service.rb @@ -10,7 +10,7 @@ class Service < ActiveRecord::Base def public_message(post, length, url = "") url = "" if post.respond_to?(:photos) && post.photos.count == 0 space_for_url = url.blank? ? 0 : (url.length + 1) - truncated = truncate(post.message(:plain_text => true), :length => (length - space_for_url)) + truncated = truncate(post.text(:plain_text => true), :length => (length - space_for_url)) truncated = "#{truncated} #{url}" unless url.blank? return truncated end diff --git a/app/models/status_message.rb b/app/models/status_message.rb index cbefe0849..f44a345f4 100644 --- a/app/models/status_message.rb +++ b/app/models/status_message.rb @@ -10,7 +10,7 @@ class StatusMessage < Post acts_as_taggable_on :tags - validates_length_of :message, :maximum => 1000, :text => "please make your status messages less than 1000 characters" + validates_length_of :text, :maximum => 1000, :text => "please make your status messages less than 1000 characters" xml_name :status_message xml_attr :raw_message @@ -26,7 +26,7 @@ class StatusMessage < Post before_create :build_tags - def message(opts = {}) + def text(opts = {}) self.formatted_message(opts) end diff --git a/app/views/photos/show.html.haml b/app/views/photos/show.html.haml index 439d9f258..f3fa29859 100644 --- a/app/views/photos/show.html.haml +++ b/app/views/photos/show.html.haml @@ -40,7 +40,7 @@ .span-8.last %p - = markdownify(@photo.status_message.message) + = markdownify(@photo.status_message.text) %span{:style=>'font-size:smaller'} =link_to t('.collection_permalink'), @photo.status_message %br diff --git a/app/views/posts/photo.html.haml b/app/views/posts/photo.html.haml index 06b0ff44f..edcbdf2e6 100644 --- a/app/views/posts/photo.html.haml +++ b/app/views/posts/photo.html.haml @@ -27,7 +27,7 @@ = link_to t('photos.show.view'), post_path(@post.status_message) %p - = @post.status_message.message + = @post.status_message.text %p - for photo in @post.status_message.photos diff --git a/app/views/posts/status_message.haml b/app/views/posts/status_message.haml index c57087f43..d2cb3899f 100644 --- a/app/views/posts/status_message.haml +++ b/app/views/posts/status_message.haml @@ -11,7 +11,7 @@ .span-14.append-1.last #show_text %p - = markdownify(@post.message, :youtube_maps => @post[:youtube_titles]) + = markdownify(@post.text, :youtube_maps => @post[:youtube_titles]) - for photo in @post.photos = link_to (image_tag photo.url(:thumb_small)), post_path(photo) diff --git a/app/views/shared/_reshare.haml b/app/views/shared/_reshare.haml index 9f6f0ad45..83bdd30f4 100644 --- a/app/views/shared/_reshare.haml +++ b/app/views/shared/_reshare.haml @@ -7,5 +7,5 @@ = link_to t('.reshare'), "#" %ul.reshare_box - = aspect_links(aspects, :prefill => post.message) + = aspect_links(aspects, :prefill => post.text) diff --git a/app/views/status_messages/_status_message.haml b/app/views/status_messages/_status_message.haml index cd1aa377c..632a8ecef 100644 --- a/app/views/status_messages/_status_message.haml +++ b/app/views/status_messages/_status_message.haml @@ -13,7 +13,7 @@ - else - for photo in photos[1..photos.size] = link_to (image_tag photo.url(:thumb_small)), photo_path(photo) - = markdownify(post.message, :youtube_maps => post[:youtube_titles]) + = markdownify(post.text, :youtube_maps => post[:youtube_titles]) - else - = markdownify(post.message, :youtube_maps => post[:youtube_titles]) + = markdownify(post.text, :youtube_maps => post[:youtube_titles]) diff --git a/app/views/status_messages/show.html.haml b/app/views/status_messages/show.html.haml index e79b89471..f07962c68 100644 --- a/app/views/status_messages/show.html.haml +++ b/app/views/status_messages/show.html.haml @@ -9,7 +9,7 @@ #show_text %p - = markdownify(@status_message.message, :youtube_maps => @status_message[:youtube_titles]) + = markdownify(@status_message.text, :youtube_maps => @status_message[:youtube_titles]) - for photo in @status_message.photos = link_to (image_tag photo.url(:thumb_small)), photo_path(photo) diff --git a/app/views/status_messages/show.mobile.haml b/app/views/status_messages/show.mobile.haml index 6961ae3d4..8b208e86d 100644 --- a/app/views/status_messages/show.mobile.haml +++ b/app/views/status_messages/show.mobile.haml @@ -6,7 +6,7 @@ = render 'shared/author_info', :person => @status_message.author, :post => @status_message %p - = markdownify(@status_message.message, :youtube_maps => @status_message[:youtube_titles]) + = markdownify(@status_message.text, :youtube_maps => @status_message[:youtube_titles]) - for photo in @status_message.photos = link_to (image_tag photo.url(:thumb_small)), photo.url(:thumb_medium) diff --git a/lib/postzord/dispatch.rb b/lib/postzord/dispatch.rb index 4b3833032..823287236 100644 --- a/lib/postzord/dispatch.rb +++ b/lib/postzord/dispatch.rb @@ -59,7 +59,7 @@ class Postzord::Dispatch if @object.respond_to?(:public) && @object.public deliver_to_hub end - if @object.respond_to?(:message) + if @object.instance_of?(StatusMessage) services.each do |service| Resque.enqueue(Job::PostToService, service.id, @object.id, url) end diff --git a/spec/controllers/aspects_controller_spec.rb b/spec/controllers/aspects_controller_spec.rb index 2a4e89aea..aa708001d 100644 --- a/spec/controllers/aspects_controller_spec.rb +++ b/spec/controllers/aspects_controller_spec.rb @@ -122,7 +122,7 @@ describe AspectsController do connect_users(@alice, @alices_aspect_1, user, aspect) post = @alice.post(:status_message, :text => "hello#{n}", :to => @alices_aspect_2.id) 8.times do |n| - user.comment "yo#{post.message}", :on => post + user.comment "yo#{post.text}", :on => post end end end diff --git a/spec/controllers/people_controller_spec.rb b/spec/controllers/people_controller_spec.rb index f015cb30a..a0c5f775c 100644 --- a/spec/controllers/people_controller_spec.rb +++ b/spec/controllers/people_controller_spec.rb @@ -67,7 +67,7 @@ describe PeopleController do end @posts.each do |post| @users.each do |user| - user.comment "yo#{post.message}", :on => post + user.comment "yo#{post.text}", :on => post end end end diff --git a/spec/controllers/sockets_controller_spec.rb b/spec/controllers/sockets_controller_spec.rb index da6e6524f..b6878504e 100644 --- a/spec/controllers/sockets_controller_spec.rb +++ b/spec/controllers/sockets_controller_spec.rb @@ -26,7 +26,7 @@ describe SocketsController do it 'actionhashes posts' do json = @controller.action_hash(@user, @message) - json.include?(@message.message).should be_true + json.include?(@message.text).should be_true json.include?('status_message').should be_true end diff --git a/spec/controllers/status_messages_controller_spec.rb b/spec/controllers/status_messages_controller_spec.rb index 28910582e..46dd5037c 100644 --- a/spec/controllers/status_messages_controller_spec.rb +++ b/spec/controllers/status_messages_controller_spec.rb @@ -98,7 +98,7 @@ describe StatusMessagesController do old_status_message = @user1.post(:status_message, :text => "hello", :to => @aspect1.id) status_message_hash[:status_message][:id] = old_status_message.id post :create, status_message_hash - old_status_message.reload.message.should == 'hello' + old_status_message.reload.text.should == 'hello' end it 'calls dispatch post once subscribers is set' do diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index e32ff0c07..2986823b3 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -25,7 +25,7 @@ describe UsersController do it 'renders xml' do sm = Factory(:status_message, :public => true, :author => @user.person) get :public, :username => @user.username - response.body.should include(sm.message) + response.body.should include(sm.text) end end diff --git a/spec/integration/receiving_spec.rb b/spec/integration/receiving_spec.rb index 24953ee51..0593b256d 100644 --- a/spec/integration/receiving_spec.rb +++ b/spec/integration/receiving_spec.rb @@ -120,7 +120,7 @@ describe 'a user receives a post' do receive_with_zord(@user2, @user1.person, xml) - status.reload.message.should == 'store this!' + status.reload.text.should == 'store this!' end it 'updates posts marked as mutable' do diff --git a/spec/lib/diaspora/exporter_spec.rb b/spec/lib/diaspora/exporter_spec.rb index aa99783e0..8223bf688 100644 --- a/spec/lib/diaspora/exporter_spec.rb +++ b/spec/lib/diaspora/exporter_spec.rb @@ -89,9 +89,9 @@ describe Diaspora::Exporter do context '' do let(:posts_xml) {exported.xpath('//posts').to_s} it 'should include many posts xml' do - posts_xml.should include @status_message1.message - posts_xml.should include @status_message2.message - posts_xml.should_not include @status_message3.message + posts_xml.should include @status_message1.text + posts_xml.should include @status_message2.text + posts_xml.should_not include @status_message3.text end it 'should include post created at time' do diff --git a/spec/lib/diaspora/ostatus_builder_spec.rb b/spec/lib/diaspora/ostatus_builder_spec.rb index f9a3c826d..1250565cc 100644 --- a/spec/lib/diaspora/ostatus_builder_spec.rb +++ b/spec/lib/diaspora/ostatus_builder_spec.rb @@ -25,11 +25,11 @@ describe Diaspora::OstatusBuilder do let!(:atom) { director = Diaspora::Director.new; director.build(Diaspora::OstatusBuilder.new(user, public_status_messages)) } it 'should include a users posts' do - public_status_messages.each{ |status| atom.should include status.message } + public_status_messages.each{ |status| atom.should include status.text} end it 'should iterate through all objects, and not stop if it runs into a post without a to_activity' do - messages = public_status_messages.collect{|x| x.message} + messages = public_status_messages.collect{|x| x.text} public_status_messages.insert(1, []) director = Diaspora::Director.new; atom2 = director.build(Diaspora::OstatusBuilder.new(user, public_status_messages)) diff --git a/spec/mailers/notifier_spec.rb b/spec/mailers/notifier_spec.rb index 5d3e7d447..997cdb697 100644 --- a/spec/mailers/notifier_spec.rb +++ b/spec/mailers/notifier_spec.rb @@ -102,7 +102,7 @@ describe Notifier do end it 'has the post text in the body' do - @mail.body.encoded.should include(@sm.message) + @mail.body.encoded.should include(@sm.text) end it 'should not include translation missing' do diff --git a/spec/models/services/facebook_spec.rb b/spec/models/services/facebook_spec.rb index 96bc84157..a48a722f0 100644 --- a/spec/models/services/facebook_spec.rb +++ b/spec/models/services/facebook_spec.rb @@ -11,7 +11,7 @@ describe Services::Facebook do describe '#post' do it 'posts a status message to facebook' do - RestClient.should_receive(:post).with("https://graph.facebook.com/me/feed", :message => @post.message, :access_token => @service.access_token) + RestClient.should_receive(:post).with("https://graph.facebook.com/me/feed", :message => @post.text, :access_token => @service.access_token) @service.post(@post) end it 'swallows exception raised by facebook always being down' do diff --git a/spec/models/services/twitter_spec.rb b/spec/models/services/twitter_spec.rb index f75fee86a..98766e2b6 100644 --- a/spec/models/services/twitter_spec.rb +++ b/spec/models/services/twitter_spec.rb @@ -11,7 +11,7 @@ describe Services::Twitter do describe '#post' do it 'posts a status message to twitter' do - Twitter.should_receive(:update).with(@post.message) + Twitter.should_receive(:update).with(@post.text) @service.post(@post) end diff --git a/spec/models/status_message_spec.rb b/spec/models/status_message_spec.rb index 5f517de51..e98a7c693 100644 --- a/spec/models/status_message_spec.rb +++ b/spec/models/status_message_spec.rb @@ -61,7 +61,7 @@ describe StatusMessage do message = "Users do things" status = @user.post(:status_message, :text => message, :to => @aspect.id) db_status = StatusMessage.find(status.id) - db_status.message.should == message + db_status.text.should == message end it 'should require status messages to be less than 1000 characters' do @@ -118,7 +118,7 @@ STR describe '#formatted_message' do it 'escapes the message' do xss = " " - @sm.message << xss + @sm.text << xss @sm.formatted_message.should_not include xss end @@ -235,7 +235,7 @@ STR end it 'serializes the unescaped, unprocessed message' do @message.text = "" - @message.to_xml.to_s.should include @message.message + @message.to_xml.to_s.should include @message.text end it 'serializes the message' do @xml.should include "I hate WALRUSES!" @@ -250,7 +250,7 @@ STR @marshalled = StatusMessage.from_xml(@xml) end it 'marshals the message' do - @marshalled.message.should == "I hate WALRUSES!" + @marshalled.text.should == "I hate WALRUSES!" end it 'marshals the guid' do @marshalled.guid.should == @message.guid diff --git a/spec/models/user/attack_vectors_spec.rb b/spec/models/user/attack_vectors_spec.rb index 1a16bd7a4..e540e7d3c 100644 --- a/spec/models/user/attack_vectors_spec.rb +++ b/spec/models/user/attack_vectors_spec.rb @@ -72,7 +72,7 @@ describe "attack vectors" do zord = Postzord::Receiver.new(user, :salmon_xml => salmon_xml) zord.perform - original_message.reload.message.should == "store this!" + original_message.reload.text.should == "store this!" end it 'does not save a message over an old message with the same author' do @@ -91,8 +91,8 @@ describe "attack vectors" do }.should_not change{user.reload.raw_visible_posts.count} - original_message.reload.message.should == "store this!" - user.raw_visible_posts.first.message.should == "store this!" + original_message.reload.text.should == "store this!" + user.raw_visible_posts.first.text.should == "store this!" end end it 'should not overwrite another persons profile profile' do diff --git a/spec/models/user/posting_spec.rb b/spec/models/user/posting_spec.rb index 2b46ded3d..43957618a 100644 --- a/spec/models/user/posting_spec.rb +++ b/spec/models/user/posting_spec.rb @@ -62,7 +62,7 @@ describe User do describe '#build_post' do it 'sets status_message#message' do post = user.build_post(:status_message, :text => "hey", :to => aspect.id) - post.message.should == "hey" + post.text.should == "hey" end it 'does not save a status_message' do post = user.build_post(:status_message, :text => "hey", :to => aspect.id)