From 9f63dd9b69229a5c08b1b10e7a489c21d22ebbef Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 20 Sep 2010 15:55:11 -0700 Subject: [PATCH 1/8] MS added another message in the readme about not using mod_rails, as mod_rails does not work with EventMachine --- README.md | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 0bc06f27f..9bff999fb 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,10 @@ The privacy aware, personally controlled, do-it-all, open source social network. Also, we really want to continue to focus on features and improving the code base. When we think it is ready for general use, we will post more detailed instructions. +## Notice +We currently run Diaspora with the [thin](http://code.macournoyer.com/thin/) as our webserver, behind [nginx](http://wiki.nginx.org/Main). Diaspora uses the asynchronous feature of [EventMachine](http://rubyeventmachine.com/) +Because our websocket server and message queue both work using the power of the [Reactor](http://en.wikipedia.org/wiki/Reactor_pattern) pattern. If you use mod_rails, mongrel, or another non-eventmachine based application server, federation and/or websockets may not work. +We will try and fully support more webservers later, but that is what works for now. These instructions are for machines running [Ubuntu](http://www.ubuntu.com/), [Fedora](http://www.fedoraproject.org) or Mac OS X. We are developing Diaspora for the latest and greatest browsers, so please update your Firefox, Chrome or Safari to the latest and greatest. @@ -235,14 +239,3 @@ Ongoing discussion: More general info and updates about the project can be found on our [blog](http://joindiaspora.com), [and on Twitter](http://twitter.com/joindiaspora). Also, be sure to join the official [mailing list](http://http://eepurl.com/Vebk). If you wish to contact us privately about any exploits in Diaspora you may find, you can email [exploits@joindiaspora.com](mailto:exploits@joindiaspora.com). - - -## License -Copyright 2010 Diaspora Inc. - -Diaspora is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - -Diaspora is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License along with Diaspora. If not, see . - From 788ed3aac25aff4af417a0122ac9361a6f2a92f7 Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 20 Sep 2010 15:58:09 -0700 Subject: [PATCH 2/8] small typo in readme --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9bff999fb..2c75561c1 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,10 @@ Also, we really want to continue to focus on features and improving the code bas ready for general use, we will post more detailed instructions. ## Notice -We currently run Diaspora with the [thin](http://code.macournoyer.com/thin/) as our webserver, behind [nginx](http://wiki.nginx.org/Main). Diaspora uses the asynchronous feature of [EventMachine](http://rubyeventmachine.com/) -Because our websocket server and message queue both work using the power of the [Reactor](http://en.wikipedia.org/wiki/Reactor_pattern) pattern. If you use mod_rails, mongrel, or another non-eventmachine based application server, federation and/or websockets may not work. +We currently run Diaspora with the [thin](http://code.macournoyer.com/thin/) as our webserver, behind [nginx](http://wiki.nginx.org/Main). Diaspora uses the asynchronous feature of [EventMachine](http://rubyeventmachine.com/) to send messages between seeds. +using the power of the [Reactor](http://en.wikipedia.org/wiki/Reactor_pattern) pattern. If you use mod_rails, mongrel, or another non-eventmachine based application server, federation and/or websockets may not work. + +If you don't like thin, you can always try [Rainbows!](http://rainbows.rubyforge.org/) We will try and fully support more webservers later, but that is what works for now. From 2b31c09ab387911f7297852e694cb2f837aa99c6 Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 20 Sep 2010 15:58:09 -0700 Subject: [PATCH 3/8] small typo in readme --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9bff999fb..d7960a634 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,10 @@ Also, we really want to continue to focus on features and improving the code bas ready for general use, we will post more detailed instructions. ## Notice -We currently run Diaspora with the [thin](http://code.macournoyer.com/thin/) as our webserver, behind [nginx](http://wiki.nginx.org/Main). Diaspora uses the asynchronous feature of [EventMachine](http://rubyeventmachine.com/) -Because our websocket server and message queue both work using the power of the [Reactor](http://en.wikipedia.org/wiki/Reactor_pattern) pattern. If you use mod_rails, mongrel, or another non-eventmachine based application server, federation and/or websockets may not work. +We currently run Diaspora with the [thin](http://code.macournoyer.com/thin/) as our webserver, behind [nginx](http://wiki.nginx.org/Main). Diaspora uses the asynchronous feature of [EventMachine](http://rubyeventmachine.com/) to send messages between seeds, +using the power of the [Reactor](http://en.wikipedia.org/wiki/Reactor_pattern) pattern. If you use mod_rails, mongrel, or another non-eventmachine based application server, federation and/or websockets may not work. + +If you don't like thin, you can always try [Rainbows!](http://rainbows.rubyforge.org/) We will try and fully support more webservers later, but that is what works for now. From 0bbbded89537c4478c45581e9960f4582cd1d162 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 20 Sep 2010 16:02:10 -0700 Subject: [PATCH 4/8] or any later version of the AGPL --- COPYRIGHT | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/COPYRIGHT b/COPYRIGHT index af330bbc2..8a380cc7e 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,4 +1,4 @@ -Diaspora is copyright Diaspora Inc., 2010, and files herein are licensed under the Affero General Public License version 3, the text of which can be found in GNU-AGPL-3.0, unless otherwise noted. Components of Diaspora, including Rails, JQuery, and Devise, are licensed under the MIT/X11 license. Blueprint-CSS is licensed under a modified version of the MIT/X11 license. All unmodified files from these and other sources retain their original copyright and license notices: see the relevant individual files. Attribution information for Diaspora is contained in the AUTHORS file. +Diaspora is copyright Diaspora Inc., 2010, and files herein are licensed under the Affero General Public License version 3, the text of which can be found in GNU-AGPL-3.0, or any later version of the AGPL, unless otherwise noted. Components of Diaspora, including Rails, JQuery, and Devise, are licensed under the MIT/X11 license. Blueprint-CSS is licensed under a modified version of the MIT/X11 license. All unmodified files from these and other sources retain their original copyright and license notices: see the relevant individual files. Attribution information for Diaspora is contained in the AUTHORS file. * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the @@ -11,4 +11,4 @@ Diaspora is copyright Diaspora Inc., 2010, and files herein are licensed under t * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source -* files in the program, then also delete it here. \ No newline at end of file +* files in the program, then also delete it here. From 8dd11c0c95eaf2a0da1f183db78658f24070f500 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 20 Sep 2010 16:41:03 -0700 Subject: [PATCH 5/8] Add a couple specs to friending --- lib/diaspora/user/friending.rb | 3 ++- spec/models/user/user_friending_spec.rb | 31 +++++++++++++++++++------ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/lib/diaspora/user/friending.rb b/lib/diaspora/user/friending.rb index e79608381..a4dcdd38d 100644 --- a/lib/diaspora/user/friending.rb +++ b/lib/diaspora/user/friending.rb @@ -86,7 +86,8 @@ module Diaspora def remove_friend(bad_friend) raise "Friend not deleted" unless self.friend_ids.delete( bad_friend.id ) - aspects.each{|g| g.person_ids.delete( bad_friend.id )} + aspects.each{|aspect| + aspect.person_ids.delete( bad_friend.id )} self.save self.raw_visible_posts.find_all_by_person_id( bad_friend.id ).each{|post| diff --git a/spec/models/user/user_friending_spec.rb b/spec/models/user/user_friending_spec.rb index bef8fa416..67ed9f799 100644 --- a/spec/models/user/user_friending_spec.rb +++ b/spec/models/user/user_friending_spec.rb @@ -189,16 +189,14 @@ describe User do @user2 = Factory.create :user @aspect2 = @user2.aspect(:name => "Gross people") - request = @user.send_friend_request_to( @user2, @aspect) - request.reverse_for @user2 - @user2.activate_friend(@user.person, @aspect2) - @user.receive request.to_diaspora_xml + friend_users(@user, @aspect, @user2, @aspect2) + @user.reload + @user2.reload + @aspect.reload + @aspect2.reload end it 'should unfriend the other user on the same seed' do - @user.reload - @user2.reload - @user.friends.count.should == 1 @user2.friends.count.should == 1 @@ -212,6 +210,25 @@ describe User do @aspect.people.count.should == 0 @aspect2.people.count.should == 0 end + context 'with a post' do + before do + @message = @user.post(:status_message, :message => "hi", :to => @aspect.id) + @user2.receive @message.to_diaspora_xml.to_s + @user2.unfriend @user.person + @user.unfriended_by @user2.person + @aspect.reload + @aspect2.reload + @user.reload + @user2.reload + end + it "deletes the unfriended user's posts from visible_posts" do + @user.raw_visible_posts.include?(@message.id).should be_false + end + it "deletes the unfriended user's posts from the aspect's posts" do + pending "We need to implement this" + @aspect2.posts.include?(@message).should be_false + end + end end From e2fc48c9ff8ec83eebbf9a6258d1082eec83c516 Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 20 Sep 2010 16:44:35 -0700 Subject: [PATCH 6/8] MS being slightly more proper with application helper, and fixing the person search page --- app/helpers/application_helper.rb | 4 ++-- app/views/people/_person.html.haml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 75a13dc6b..65f1c8679 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -43,11 +43,11 @@ module ApplicationHelper end def owner_image_tag - person_image_tag(current_user) + person_image_tag(current_user.person) end def owner_image_link - person_image_link(current_user) + person_image_link(current_user.person) end def person_image_tag(person) diff --git a/app/views/people/_person.html.haml b/app/views/people/_person.html.haml index 646d0b333..e0c77d990 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 + = link_to person.real_name, person_path(person) .info = person.diaspora_handle From 2be0cca2cd3f99c53c0220ef6082b6cc00ad5632 Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 20 Sep 2010 16:51:02 -0700 Subject: [PATCH 7/8] MS adding downcase to webfinger lookup --- app/models/person.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/person.rb b/app/models/person.rb index 74079ff93..970a90a0b 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -78,7 +78,7 @@ class Person def self.by_webfinger( identifier, opts = {}) #need to check if this is a valid email structure, maybe should do in JS - local_person = Person.first(:diaspora_handle => identifier.gsub('acct:', '')) + local_person = Person.first(:diaspora_handle => identifier.gsub('acct:', '').to_s.downcase) if local_person Rails.logger.info("Do not need to webfinger, found a local person #{local_person.real_name}") From 24ca139241e70444e696ed2cdb2f135083896499 Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 20 Sep 2010 17:11:07 -0700 Subject: [PATCH 8/8] MS remove some stray puts --- app/controllers/publics_controller.rb | 2 -- app/views/people/show.html.haml | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index b6c03ff62..d7f4825de 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -10,7 +10,6 @@ class PublicsController < ApplicationController def hcard @person = Person.find_by_id params[:id] - puts @person unless @person.nil? || @person.owner.nil? render 'hcard' end @@ -34,7 +33,6 @@ class PublicsController < ApplicationController return unless params[:xml] begin person = Person.first(:id => params[:id]) - puts person.real_name @user = person.owner rescue NoMethodError => e Rails.logger.error("Received post for nonexistent person #{params[:id]}") diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index 4f76f18cf..0939bd376 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -4,7 +4,7 @@ - content_for :page_title do - = @person.real_name + profile - content_for :left_pane do #profile