diff --git a/Changelog.md b/Changelog.md index 973c80b461e..eaa713c63c6 100644 --- a/Changelog.md +++ b/Changelog.md @@ -33,6 +33,7 @@ * Don't cut off long tags in stream posts [#4864](https://github.com/diaspora/diaspora/issues/4864) * Do not replace earlier appearances of the name while mentioning somebody [#4868](https://github.com/diaspora/diaspora/issues/4868) * Catch exceptions when trying to decode an invalid URI [#4874](https://github.com/diaspora/diaspora/issues/4874) +* Redirect to the stream when switching the mobile publisher to desktop [#4806](https://github.com/diaspora/diaspora/issues/4806) ## Features * You can report a single post by clicking the correct icon in the controler section [#4517](https://github.com/diaspora/diaspora/pull/4517) diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index 4ed6dd53170..c20b2976f5e 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -29,11 +29,13 @@ def new @contacts_of_contact = @contact.contacts render :layout => nil end - else + elsif(request.format == :mobile) @aspect = :all @aspects = current_user.aspects @aspect_ids = @aspects.map{ |a| a.id } gon.aspect_ids = @aspect_ids + else + redirect_to stream_path end end @@ -125,4 +127,4 @@ def normalize_public_flag! def remove_getting_started current_user.disable_getting_started end -end \ No newline at end of file +end diff --git a/spec/controllers/status_messages_controller_spec.rb b/spec/controllers/status_messages_controller_spec.rb index ea0443b670e..f354e02b806 100644 --- a/spec/controllers/status_messages_controller_spec.rb +++ b/spec/controllers/status_messages_controller_spec.rb @@ -58,6 +58,11 @@ def pass_test_args(text='cute kitty') response.should be_success end + it 'should redirect on desktop version' do + get :new + response.should redirect_to(stream_path) + end + it 'generates a jasmine fixture', :fixture => true do contact = alice.contact_for(bob.person) aspect = alice.aspects.create(:name => 'people')