From 41f46c47b137f7fbc2392e3d1b45da6925471b12 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 16 Sep 2010 11:27:05 -0700 Subject: [PATCH 01/26] removed the deploy key, not needed now that the repo is public, thx for the heads up Juha @ Enemy & Sons Ltd --- config/sprinkle/deploy_key/id_rsa | 27 -------------------------- config/sprinkle/deploy_key/id_rsa.pub | 1 - config/sprinkle/deploy_key/known_hosts | 2 -- 3 files changed, 30 deletions(-) delete mode 100644 config/sprinkle/deploy_key/id_rsa delete mode 100644 config/sprinkle/deploy_key/id_rsa.pub delete mode 100644 config/sprinkle/deploy_key/known_hosts diff --git a/config/sprinkle/deploy_key/id_rsa b/config/sprinkle/deploy_key/id_rsa deleted file mode 100644 index 133715158..000000000 --- a/config/sprinkle/deploy_key/id_rsa +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAvCyAkyAMbn+flqwLIEnPL08iY8dWpkel1wtXXjUtaINjuvZ7 -2XwK7ntnVHVRm49t+QFMWh8SpxDHnJDgb3X6uYem2DzB6L8HtuFVFN5lOUi+TeiI -LJsBmiGHc1tQwGB0jqmCG0J2QBDpDiw//ktOJNlZJfnPGY+4viSXwWpYhhh1v3ij -Inmp0+lw7z0+TyklNGVEsr6emwkgo5t20ClAQDmwy1BeYBcmtAehF55V3aSPQt1d -+hCmwl11PR6BLuGYgRirr4Xyc/GmyZVKkz8dLv40X+/Bk2D7owO+N5hf74EB1e3r -7Vu7LAfUOdtOFQJV5SWr3HTPo5vvU1oqR4VViQIBIwKCAQEApqsSy3QoRJzsb4Jw -QStuXRo0ZwEDmpc7HY2zyHg+KV5uRoKK89REMlALEEqnXeVwCG7dOeEB5G3yoJ2T -lewnNpy4WR/e8rfTofrHs2XkoHOhPbCzIDGFE3zIbXzD3ZdCqj5dS1gfl9R2picx -XZMn9MCCKPMzxi7W1ExL5dM4dsOuPRvie+nYGWvvv/LXvFTLFXDVwGXOhfDkLocv -r6STaUMj7RzLJneawOg1YS1Ivsj+Db4Q+abB4mRRhOe6igYu9Zd0ve8XAjJAHbx2 -Kzl5XKj8fhOSwXyLBh+enqHv0yLR7GaZn0odjNdUeWdD0kF9DnsL3VMa12wmNXtu -48bX3wKBgQDzPRDyYmBIKp/eStzAEmkVz98JmQQoX3tF0VrVdLK0j0nLB19jbHl8 -poHaPG8qIgGfFMwdhLOJmJ6CXa4eHffLJ0c32Ow+jQ+Is70Ssn6WSq0962WuuoWA -ARUwhyO9BaWvzTnMCYDI+dSydM26cvDmTTuvCJDbifmAkArgWGqM4wKBgQDGC9za -VTqnfBHGBXebLk/PRA8YOD9CvRrIrjylUxeSrbScK9i6v+1WK3dZCl8j7H3yYJ3B -8CT38FXxrHtGIn+5XU++fAeiLrnmNlYFCsn1nLt2SUqvODYYefxm/Vq1LQaWknHV -itnZF1CIltLLMI2w2iVCA0xRqots6gX+SMarowKBgQC7pCMEIAEhuntTthgB4lEQ -047M48Fg+TM13AQ+RBTUboliG6FbU64s9XodYdIZMC0i8slYmZHQi616gsgl3JqV -Z3F0OaBNgsLXK5HbOT0U2oWky4j0gUJqD3a/CSoyuzasMJpM8WNZNcFWd1zgSgpL -QuTmHI0BIUtxzjRGqptWvQKBgGAxpckiFSzHO9U12wI7ENJi4sKe+ie678CPJMVU -PqZUXwoGqxjg4P332uIa+wLR9AgDCsvpq45eyqiVmvYuA4XrfoEXq++wS6pU5/PS -ClK512VWzID+C6V9FDIGB3ySNmZkYy000DY+hjO2+KvVwSoDjnCFQlONWanuAuk5 -So3hAoGBALfkYFRtSilhvtjOnnil0hdyUbCcRmKeUYl2Yb/cb3JmUfi9xRur7K46 -Okwba+mnOJQT0kefFEUwsP9UPVLgppVh+llyAal1aJ5OnXn1o996TGTfNmy1aThr -aaGeAU2u8GFBiBrz9tRwzZo8ixUEZZrGFFN/n53bDHpBsbhRvHGX ------END RSA PRIVATE KEY----- diff --git a/config/sprinkle/deploy_key/id_rsa.pub b/config/sprinkle/deploy_key/id_rsa.pub deleted file mode 100644 index e0b8e3715..000000000 --- a/config/sprinkle/deploy_key/id_rsa.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAvCyAkyAMbn+flqwLIEnPL08iY8dWpkel1wtXXjUtaINjuvZ72XwK7ntnVHVRm49t+QFMWh8SpxDHnJDgb3X6uYem2DzB6L8HtuFVFN5lOUi+TeiILJsBmiGHc1tQwGB0jqmCG0J2QBDpDiw//ktOJNlZJfnPGY+4viSXwWpYhhh1v3ijInmp0+lw7z0+TyklNGVEsr6emwkgo5t20ClAQDmwy1BeYBcmtAehF55V3aSPQt1d+hCmwl11PR6BLuGYgRirr4Xyc/GmyZVKkz8dLv40X+/Bk2D7owO+N5hf74EB1e3r7Vu7LAfUOdtOFQJV5SWr3HTPo5vvU1oqR4VViQ== Diaspora deploy key diff --git a/config/sprinkle/deploy_key/known_hosts b/config/sprinkle/deploy_key/known_hosts deleted file mode 100644 index 6b07b19ca..000000000 --- a/config/sprinkle/deploy_key/known_hosts +++ /dev/null @@ -1,2 +0,0 @@ -|1|1DLdTjtEIabpLiLzhVOp7colQSQ=|/Nw4MuJAYIztcexQDWF3NQoEljs= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== -|1|j1rKwLcrA2MgHhcpdVf04ig02Hs=|Y4Jl+8HpsTyFlhSwoVxSVeRsf3k= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== From 4fe4326ed1b7b8e58f340eadf316204d30122ec0 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 20 Sep 2010 15:00:02 -0700 Subject: [PATCH 02/26] DG IZ photo uploading now works --- app/controllers/photos_controller.rb | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 8fa7a3bdf..42b00007c 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -12,6 +12,7 @@ class PhotosController < ApplicationController def create album = Album.find_by_id params[:album_id] + puts params begin @@ -102,13 +103,18 @@ class PhotosController < ApplicationController private def clean_hash(params) - return { - :photo => { - :caption => params[:photo][:caption], - }, - :album_id => params[:album_id], - :user_file => params[:user_file] - } + if params[:photo] + return { + :photo => { + :caption => params[:photo][:caption], + } + } + else + return{ + :album_id => params[:album_id], + :user_file => params[:user_file] + } + end end end From 5e2fdedf8bb9ef0749dc79cda3ba558e55af5658 Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 20 Sep 2010 15:07:30 -0700 Subject: [PATCH 03/26] MS removed another logging of encrypted data.... --- app/controllers/publics_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index 6f2b09c43..72f8a0dfc 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -35,7 +35,7 @@ class PublicsController < ApplicationController begin @user = Person.first(:id => params[:id]).owner rescue NoMethodError => e - Rails.logger.error("Received post #{params[:xml]} for nonexistent person #{params[:id]}") + Rails.logger.error("Received post for nonexistent person #{params[:id]}") return end @user.receive_salmon params[:xml] From 5bb4ee5d3660977ac35e79ffa9aee4f45737c82c Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 20 Sep 2010 15:15:37 -0700 Subject: [PATCH 04/26] DG IZ; posting now ensures aspect ownership. --- app/models/user.rb | 3 +++ spec/models/user/posting_spec.rb | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/app/models/user.rb b/app/models/user.rb index f0481341a..e02c58534 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -105,7 +105,10 @@ class User end aspect_ids = [aspect_ids.to_s] if aspect_ids.is_a? BSON::ObjectId + raise ArgumentError.new("You must post to someone.") if aspect_ids.nil? || aspect_ids.empty? + aspect_ids.each{ |aspect_id| + raise ArgumentError.new("Cannot post to an aspect you do not own.") unless self.aspects.find(aspect_id) } post = build_post(class_name, options) diff --git a/spec/models/user/posting_spec.rb b/spec/models/user/posting_spec.rb index b1f6f71a8..d00747a2d 100644 --- a/spec/models/user/posting_spec.rb +++ b/spec/models/user/posting_spec.rb @@ -30,6 +30,10 @@ describe User do proc {@user.post(:status_message, :message => "heyheyhey")}.should raise_error /You must post to someone/ end + it 'should not be able to post to someone elses aspect' do + proc {@user.post(:status_message, :message => "heyheyhey", :to => @aspect2.id)}.should raise_error /Cannot post to an aspect you do not own./ + end + it 'should put the post in the aspect post array' do post = @user.post(:status_message, :message => "hey", :to => @aspect.id) @aspect.reload From fb2f027b24d64ffe38700d4f80ab19dd11fbfa15 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 20 Sep 2010 15:25:19 -0700 Subject: [PATCH 05/26] DG IZ; escape regex characters in Person.search --- 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 72f4c46b9..74079ff93 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -35,7 +35,7 @@ class Person /^(https?):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*(\.[a-z]{2,5})?(:[0-9]{1,5})?(\/.*)?$/ix def self.search(query) - query = query.to_s.strip + query = Regexp.escape( query.to_s.strip ) Person.all('profile.first_name' => /^#{query}/i) | Person.all('profile.last_name' => /^#{query}/i) end From cb0f0b72eb0e3fc0e65d234c6b0d20a2a76f06b7 Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 20 Sep 2010 15:32:18 -0700 Subject: [PATCH 06/26] MS removed a log and trying to be slightly more pedantic --- app/controllers/publics_controller.rb | 4 +++- app/helpers/requests_helper.rb | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index 72f8a0dfc..b6c03ff62 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -33,7 +33,9 @@ class PublicsController < ApplicationController render :nothing => true return unless params[:xml] begin - @user = Person.first(:id => params[:id]).owner + 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]}") return diff --git a/app/helpers/requests_helper.rb b/app/helpers/requests_helper.rb index 32ce79fd9..52955fc94 100644 --- a/app/helpers/requests_helper.rb +++ b/app/helpers/requests_helper.rb @@ -33,6 +33,7 @@ module RequestsHelper def relationship_flow(identifier) action = :none person = nil + puts identifier person = Person.by_webfinger identifier if person action = (person == current_user.person ? :none : :friend) From fc9cddc7b834228ddeac1f4106bb220e9d1c3582 Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 20 Sep 2010 15:40:43 -0700 Subject: [PATCH 07/26] make the remote tom work --- db/seeds/tom.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/seeds/tom.rb b/db/seeds/tom.rb index 2e06913f2..61b2ad44f 100644 --- a/db/seeds/tom.rb +++ b/db/seeds/tom.rb @@ -7,7 +7,7 @@ require 'config/environment' remote_url = "http://tom.joindiaspora.com/" -remote_url = "http://localhost:3000/" +#remote_url = "http://localhost:3000/" # Create seed user user = User.instantiate!( :email => "tom@tom.joindiaspora.com", :username => "tom", From 40c96fc6194b265647d927a1e58e071ae79237f8 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 20 Sep 2010 15:53:56 -0700 Subject: [PATCH 08/26] DG IZ; click to edit rollover text on aspect manage page --- app/views/aspects/manage.html.haml | 6 ++++-- app/views/shared/_sub_header.haml | 2 +- public/stylesheets/application.css | 10 ++++++++++ public/stylesheets/sass/application.sass | 13 +++++++++++++ 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/app/views/aspects/manage.html.haml b/app/views/aspects/manage.html.haml index c579671e1..656f0cb96 100644 --- a/app/views/aspects/manage.html.haml +++ b/app/views/aspects/manage.html.haml @@ -38,7 +38,9 @@ %li.aspect .aspect_name - %h1{:contenteditable => true}= aspect.name + %span.edit_name_field + %h1{:contenteditable => true}= aspect.name + %span.tip click to edit %ul.tools %li= link_to "add a new friend", "#add_request_pane_#{aspect.id}", :class => 'add_request_button' @@ -56,7 +58,7 @@ %li.person{:id => person.id, :from_aspect_id => aspect.id} = person_image_tag(person) .name - = person.real_name + = link_to person.real_name, person .yo{:style => 'display:none'} %div{:id => "add_request_pane_#{aspect.id}"} = render "requests/new_request", :aspect => aspect diff --git a/app/views/shared/_sub_header.haml b/app/views/shared/_sub_header.haml index badf8783d..4e0e2aca4 100644 --- a/app/views/shared/_sub_header.haml +++ b/app/views/shared/_sub_header.haml @@ -9,7 +9,7 @@ - if @aspect == :all = link_to "All Aspects", root_path - elsif @aspect == :manage - = link_to "Manage Aspects", root_path + = "Manage Aspects" - else = link_to @aspect.name, @aspect diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 98893cabb..60b50a9f4 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -520,6 +520,16 @@ h1.big_text { .requests h1, .remove h1 { display: inline-block; } + .aspect .tip, + .requests .tip, + .remove .tip { + display: none; + color: #999999; + margin-left: 0.5em; } + .aspect .edit_name_field:hover .tip, + .requests .edit_name_field:hover .tip, + .remove .edit_name_field:hover .tip { + display: inline; } .aspect .aspect_name, .requests .aspect_name, .remove .aspect_name { diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 5edc89135..80debac15 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -694,6 +694,19 @@ h1.big_text h1 :display inline-block + .tip + :display none + :color #999 + :margin + :left 0.5em + + .edit_name_field:hover + .tip + :display inline + + + + .aspect_name :position relative From 9f63dd9b69229a5c08b1b10e7a489c21d22ebbef Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 20 Sep 2010 15:55:11 -0700 Subject: [PATCH 09/26] 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 10/26] 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 11/26] 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 12/26] 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 13/26] 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 14/26] 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 15/26] 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 16/26] 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 From e588d7ab6af5755cd91f9702a1b0513e5b9b7fca Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 20 Sep 2010 17:26:20 -0700 Subject: [PATCH 17/26] DG IZ moving friends is now ajaxy --- app/controllers/aspects_controller.rb | 6 ++-- app/views/aspects/manage.html.haml | 4 --- app/views/shared/_aspect_nav.haml | 2 +- config/routes.rb | 5 +-- lib/diaspora/user/querying.rb | 3 +- public/javascripts/aspect-edit.js | 51 ++++++++------------------- 6 files changed, 22 insertions(+), 49 deletions(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 520485d33..779ce0f6f 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -79,10 +79,10 @@ class AspectsController < ApplicationController end if aspect = current_user.aspect_by_id(params[:to][:to]) flash[:notice] = "You are now showing your friend a different aspect of yourself." - respond_with aspect + render :nothing => true else - flash[:notice] = "You are now showing your friend a different aspect of yourself." - respond_with current_user.visible_person_by_id(params[:friend_id]) + flash[:error] = "Invalid aspect id!" + render aspects_manage_path end end diff --git a/app/views/aspects/manage.html.haml b/app/views/aspects/manage.html.haml index 656f0cb96..3903039ea 100644 --- a/app/views/aspects/manage.html.haml +++ b/app/views/aspects/manage.html.haml @@ -63,8 +63,4 @@ %div{:id => "add_request_pane_#{aspect.id}"} = render "requests/new_request", :aspect => aspect -%p - %br - = link_to 'Update Aspects', '#', :class => 'button', :id => "move_friends_link" - #content_bottom diff --git a/app/views/shared/_aspect_nav.haml b/app/views/shared/_aspect_nav.haml index ed3fe6f8f..dbca3bbef 100644 --- a/app/views/shared/_aspect_nav.haml +++ b/app/views/shared/_aspect_nav.haml @@ -6,7 +6,7 @@ #aspect_nav %ul - for aspect in @aspects - %li{:id => aspect.id, :class => ("selected" if current_aspect?(aspect))} + %li{:class => ("selected" if current_aspect?(aspect))} = link_for_aspect aspect %ul{ :style => "position:absolute;right:0;bottom:0.01em;"} diff --git a/config/routes.rb b/config/routes.rb index 188c4b137..ae757499c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -13,10 +13,11 @@ Diaspora::Application.routes.draw do resources :photos, :except => [:index] resources :albums - match 'aspects/manage', :to => 'aspects#manage' - resources :aspects, :except => [:edit] match 'aspects/move_friends', :to => 'aspects#move_friends', :as => 'move_friends' match 'aspects/move_friend', :to => 'aspects#move_friend', :as => 'move_friend' + match 'aspects/manage', :to => 'aspects#manage' + resources :aspects, :except => [:edit] + match 'warzombie', :to => "dev_utilities#warzombie" match 'zombiefriends', :to => "dev_utilities#zombiefriends" diff --git a/lib/diaspora/user/querying.rb b/lib/diaspora/user/querying.rb index 00ae27735..1079949b0 100644 --- a/lib/diaspora/user/querying.rb +++ b/lib/diaspora/user/querying.rb @@ -31,8 +31,7 @@ module Diaspora end def aspect_by_id( id ) - id = id.to_id - aspects.detect{|x| x.id == id } + self.aspects.find( id ) end def album_by_id( id ) diff --git a/public/javascripts/aspect-edit.js b/public/javascripts/aspect-edit.js index e07877cb7..39eee791a 100644 --- a/public/javascripts/aspect-edit.js +++ b/public/javascripts/aspect-edit.js @@ -20,28 +20,6 @@ function decrementRequestsCounter() { } $(function() { - - - $('#move_friends_link').live( 'click', function(){ - $.post( - '/aspects/move_friends', - { 'moves' : $('#aspect_list').data() }, - function() { - $('#aspect_title').html("Groups edited successfully!"); - } - ); - - // should the following logic be moved into the $.post() callback? - $("#aspect_list").removeData(); - - $(".person") - .css('background-color','none') - .attr('from_aspect_id', function() { - return $(this).parent().attr('id') - }); - - }); - // Multiple classes here won't work $("ul .person").draggable({ revert: true @@ -65,24 +43,23 @@ $(function() { } }); - } else { - var $aspect_list = $('#aspect_list'), - move = {}; - - // This is poor implementation - move[ 'friend_id' ] = ui.draggable[0].id; // ui.draggable.attr('id') - move[ 'to' ] = $(this)[0].id;// $(this).attr('id'); - move[ 'from' ] = ui.draggable[0].getAttribute('from_aspect_id'); // ui.draggable.attr('from_aspect_id') - - // if created custom attr's - should be using `data-foo` - - - if (move['to'] == move['from']){ - $aspect_list.data( ui.draggable[0].id, []); + }; + var dropzone = $(this)[0]; + + if ($(this)[0].id == ui.draggable[0].getAttribute('from_aspect_id')){ ui.draggable.css('background-color','#eee'); } else { - $aspect_list.data( ui.draggable[0].id, move); ui.draggable.css('background-color','orange'); + $.ajax({ + url: "/aspects/move_friend/", + data: {"friend_id" : ui.draggable[0].id, + "from" : ui.draggable[0].getAttribute('from_aspect_id'), + "to" : { "to" : dropzone.id }}, + success: function(data){ + ui.draggable.attr('from_aspect_id', dropzone.id); + ui.draggable.css('background','none'); + }}); + } } $(this).closest("ul").append(ui.draggable); From 441f75203a49ea2e1b0bcecc9294617e855c6dc4 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 20 Sep 2010 17:33:05 -0700 Subject: [PATCH 18/26] Add autolink and sanitize to show page --- app/views/status_messages/show.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/status_messages/show.html.haml b/app/views/status_messages/show.html.haml index 358c2244b..26777408d 100644 --- a/app/views/status_messages/show.html.haml +++ b/app/views/status_messages/show.html.haml @@ -7,7 +7,7 @@ %p %strong Message: - = @status_message.message + = auto_link sanitize @status_message.message %p %strong Owner: From ca97d792af238b59b885c4e7f61345469ff8d945 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 20 Sep 2010 18:08:59 -0700 Subject: [PATCH 19/26] DG IZ; fixing querying bug in aspect_by_id --- lib/diaspora/user/querying.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/diaspora/user/querying.rb b/lib/diaspora/user/querying.rb index 1079949b0..00ae27735 100644 --- a/lib/diaspora/user/querying.rb +++ b/lib/diaspora/user/querying.rb @@ -31,7 +31,8 @@ module Diaspora end def aspect_by_id( id ) - self.aspects.find( id ) + id = id.to_id + aspects.detect{|x| x.id == id } end def album_by_id( id ) From f50b70da9e2ed919c0202b2e5c6737a079276a73 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 20 Sep 2010 18:14:12 -0700 Subject: [PATCH 20/26] DG IZ; removed stray mustache --- public/javascripts/aspect-edit.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/public/javascripts/aspect-edit.js b/public/javascripts/aspect-edit.js index 39eee791a..9f9e5803e 100644 --- a/public/javascripts/aspect-edit.js +++ b/public/javascripts/aspect-edit.js @@ -47,7 +47,7 @@ $(function() { var dropzone = $(this)[0]; if ($(this)[0].id == ui.draggable[0].getAttribute('from_aspect_id')){ - ui.draggable.css('background-color','#eee'); + ui.draggable.css('background','none'); } else { ui.draggable.css('background-color','orange'); $.ajax({ @@ -61,7 +61,6 @@ $(function() { }}); } - } $(this).closest("ul").append(ui.draggable); } }); From 4d200fea87719398f16c29d16684533e8aba954b Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 20 Sep 2010 20:17:18 -0700 Subject: [PATCH 21/26] removed view all link from status_message#show --- app/views/status_messages/show.html.haml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/app/views/status_messages/show.html.haml b/app/views/status_messages/show.html.haml index 26777408d..251c92a0e 100644 --- a/app/views/status_messages/show.html.haml +++ b/app/views/status_messages/show.html.haml @@ -3,20 +3,14 @@ -# the COPYRIGHT file. -- title "Status Message" - -%p - %strong Message: +%h1 + = link_to @status_message.person.real_name, @status_message.person = auto_link sanitize @status_message.message -%p - %strong Owner: - = @status_message.person.real_name %h4= "comments (#{@status_message.comments.count})" = render "comments/comments", :post => @status_message %p - = link_to "Destroy", @status_message, :confirm => 'Are you sure?', :method => :delete - | - = link_to "View All", status_messages_path + - if current_user.owns? @status_message + = link_to "Destroy", @status_message, :confirm => 'Are you sure?', :method => :delete From b019ade588948065fe958a9caa9dddf0c05c0c03 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 20 Sep 2010 21:50:06 -0700 Subject: [PATCH 22/26] minor changes from production --- public/stylesheets/application.css | 14 +++++++++++--- public/stylesheets/fileuploader.css | 8 ++++---- public/stylesheets/sass/application.sass | 16 ++++++++++++---- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 60b50a9f4..9e8561cc2 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -346,12 +346,18 @@ label { margin-top: 26px; } #publisher textarea { width: 600px; - height: 40px; + height: 42px; margin-top: 0; margin-bottom: 0; - -webkit-box-shadow: 0 1px 0 white; } + box-shadow: 0 1px white; + -moz-box-shadow: 0 1px white; + -webkit-box-shadow: 0 1px white; } #publisher .button { margin-left: 100px; } + #publisher img { + -webkit-box-shadow: 0 1px 0 white; + border: 1px solid #bbbbbb; + border-top: 1px solid #666666; } #image_picker .small_photo { height: 100px; @@ -463,6 +469,7 @@ h1.big_text { display: inline; margin-right: 2px; } #aspect_nav ul > li a { + text-shadow: 0 2px 0 #444444; -webkit-border-radius: 3px 3px 0 0; -moz-border-radius: 3px 3px 0 0; line-height: 22px; @@ -557,7 +564,8 @@ h1.big_text { .requests .grey, .remove .grey { color: #999999; - cursor: default; } + cursor: default; + text-shadow: 0 2px white; } .aspect ul.dropzone, .requests ul.dropzone, .remove ul.dropzone { diff --git a/public/stylesheets/fileuploader.css b/public/stylesheets/fileuploader.css index 0e3f111a9..823c1b346 100755 --- a/public/stylesheets/fileuploader.css +++ b/public/stylesheets/fileuploader.css @@ -3,14 +3,14 @@ .qq-upload-button { display:block; /* or inline-block */ width: 105px; padding: 7px 0; text-align:center; - background:#880000; border-bottom:1px solid #ddd;color:#fff; + background:#333; border-bottom:1px solid #999;color:#fff; } -.qq-upload-button-hover {background:#cc0000;} +.qq-upload-button-hover {background:#666;} .qq-upload-button-focus {outline:1px dotted black;} .qq-upload-drop-area { position:absolute; top:0; left:0; width:100%; height:100%; min-height: 70px; z-index:2; - background:#FF9797; text-align:center; + background:#ccc; text-align:center; } .qq-upload-drop-area span { display:block; position:absolute; top: 50%; width:100%; margin-top:-8px; font-size:16px; @@ -28,4 +28,4 @@ .qq-upload-size,.qq-upload-cancel {font-size:11px;} .qq-upload-failed-text {display:none;} -.qq-upload-fail .qq-upload-failed-text {display:inline;} \ No newline at end of file +.qq-upload-fail .qq-upload-failed-text {display:inline;} diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 80debac15..88145b6df 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -453,16 +453,24 @@ label textarea :width 600px - :height 40px + :height 42px :margin :top 0 :bottom 0 - :-webkit-box-shadow 0 1px 0 #fff + :box-shadow 0 1px #fff + :-moz-box-shadow 0 1px #fff + :-webkit-box-shadow 0 1px #fff .button :margin-left 100px + img + :-webkit-box-shadow 0 1px 0 #fff + :border 1px solid #bbb + :top 1px solid #666 + + #image_picker .small_photo @@ -613,6 +621,7 @@ h1.big_text :right 2px a + :text-shadow 0 2px 0 #444 :-webkit-border-radius 3px 3px 0 0 :-moz-border-radius 3px 3px 0 0 :line @@ -705,8 +714,6 @@ h1.big_text :display inline - - .aspect_name :position relative @@ -731,6 +738,7 @@ h1.big_text .grey :color #999 :cursor default + :text-shadow 0 2px #fff ul.dropzone :min-height 20px From 50414fef40392605e50da4598c52cd638201db86 Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 21 Sep 2010 11:03:21 -0700 Subject: [PATCH 23/26] Remove unused method from message handler --- lib/message_handler.rb | 6 +----- spec/lib/message_handler_spec.rb | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/message_handler.rb b/lib/message_handler.rb index 7149ee65e..0b55ee0f7 100644 --- a/lib/message_handler.rb +++ b/lib/message_handler.rb @@ -31,7 +31,7 @@ class MessageHandler http.callback { process; process} when :get http = EventMachine::HttpRequest.new(query.destination).get :timeout => TIMEOUT - http.callback {send_to_seed(query, http.response); process} + http.callback {process} else raise "message is not a type I know!" end @@ -47,10 +47,6 @@ class MessageHandler } unless @queue.size == 0 end - def send_to_seed(message, http_response) - #DO SOMETHING! - end - def size @queue.size end diff --git a/spec/lib/message_handler_spec.rb b/spec/lib/message_handler_spec.rb index 00db2a1b8..e6cd668e2 100644 --- a/spec/lib/message_handler_spec.rb +++ b/spec/lib/message_handler_spec.rb @@ -123,7 +123,6 @@ describe MessageHandler do request = FakeHttpRequest.new(:success) request.should_receive(:get).exactly(1).times.and_return(request) request.should_receive(:post).exactly(1).times.and_return(request) - @handler.should_receive(:send_to_seed).once EventMachine::HttpRequest.stub!(:new).and_return(request) From 003a8b454f446ae4cf6b16cb41bcf0ef8629fe93 Mon Sep 17 00:00:00 2001 From: Dorian Date: Mon, 20 Sep 2010 05:29:06 +0800 Subject: [PATCH 24/26] Some refactoring again (define code rules would be good) --- app/helpers/application_helper.rb | 2 -- app/helpers/dashboards_helper.rb | 3 +-- app/helpers/photos_helper.rb | 1 - app/helpers/publics_helper.rb | 1 - app/helpers/requests_helper.rb | 2 -- app/helpers/sockets_helper.rb | 3 --- 6 files changed, 1 insertion(+), 11 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 65f1c8679..2c110f422 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -4,7 +4,6 @@ module ApplicationHelper - def current_aspect?(aspect) !@aspect.is_a?(Symbol) && @aspect.id == aspect.id end @@ -68,5 +67,4 @@ module ApplicationHelper def post_yield_tag(post) (':' + post.id.to_s).to_sym end - end diff --git a/app/helpers/dashboards_helper.rb b/app/helpers/dashboards_helper.rb index 542d938ee..ee83d72eb 100644 --- a/app/helpers/dashboards_helper.rb +++ b/app/helpers/dashboards_helper.rb @@ -4,8 +4,7 @@ module DashboardsHelper - def title_for_page - 'home' + 'home' end end diff --git a/app/helpers/photos_helper.rb b/app/helpers/photos_helper.rb index 2d0ddad6e..2737d3a2d 100644 --- a/app/helpers/photos_helper.rb +++ b/app/helpers/photos_helper.rb @@ -4,7 +4,6 @@ module PhotosHelper - def linked_scaled_photo(photo, album) link_to (image_tag photo.url(:scaled_full)), photo_path(album.next_photo(photo)), :rel => "prefetch" end diff --git a/app/helpers/publics_helper.rb b/app/helpers/publics_helper.rb index 9e76f59f7..46e778e2b 100644 --- a/app/helpers/publics_helper.rb +++ b/app/helpers/publics_helper.rb @@ -9,7 +9,6 @@ module PublicsHelper subscriber ||= Subscriber.new(:url => opts[:callback], :topic => opts[:topic]) if subscriber.save - if opts[:verify] == 'sync' 204 elsif opts[:verify] == 'async' diff --git a/app/helpers/requests_helper.rb b/app/helpers/requests_helper.rb index 52955fc94..faefe1f6e 100644 --- a/app/helpers/requests_helper.rb +++ b/app/helpers/requests_helper.rb @@ -4,7 +4,6 @@ module RequestsHelper - def subscription_mode(profile) if diaspora?(profile) :friend @@ -40,5 +39,4 @@ module RequestsHelper end { action => person } end - end diff --git a/app/helpers/sockets_helper.rb b/app/helpers/sockets_helper.rb index cbe465e7b..69135092a 100644 --- a/app/helpers/sockets_helper.rb +++ b/app/helpers/sockets_helper.rb @@ -33,7 +33,4 @@ module SocketsHelper action_hash.to_json end - - - end From 1882509a0beea16031928c569890b73c2d98dafe Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 21 Sep 2010 11:59:04 -0700 Subject: [PATCH 25/26] removed the auto_link seems to fix HTML injection, no more autolinking --- app/views/comments/_comment.html.haml | 2 +- app/views/status_messages/_status_message.html.haml | 2 +- app/views/status_messages/show.html.haml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/comments/_comment.html.haml b/app/views/comments/_comment.html.haml index 4252d9762..4fd46eb56 100644 --- a/app/views/comments/_comment.html.haml +++ b/app/views/comments/_comment.html.haml @@ -7,6 +7,6 @@ = person_image_tag(post.person) %span.from = link_to post.person.real_name, post.person - = auto_link sanitize post.text + = post.text %div.time = "#{time_ago_in_words(post.updated_at)} #{t('.ago')}" diff --git a/app/views/status_messages/_status_message.html.haml b/app/views/status_messages/_status_message.html.haml index 396f143a7..dcee761d1 100644 --- a/app/views/status_messages/_status_message.html.haml +++ b/app/views/status_messages/_status_message.html.haml @@ -10,7 +10,7 @@ .content %span.from = link_to post.person.real_name, post.person - = auto_link sanitize post.message + = post.message .info %span.time= link_to(how_long_ago(post), object_path(post)) diff --git a/app/views/status_messages/show.html.haml b/app/views/status_messages/show.html.haml index 251c92a0e..4a701d6a6 100644 --- a/app/views/status_messages/show.html.haml +++ b/app/views/status_messages/show.html.haml @@ -5,7 +5,7 @@ %h1 = link_to @status_message.person.real_name, @status_message.person - = auto_link sanitize @status_message.message + = @status_message.message %h4= "comments (#{@status_message.comments.count})" From 4d00a0e99eef36f2aace91053f72fc006a007dfb Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 21 Sep 2010 12:35:48 -0700 Subject: [PATCH 26/26] IZ posting to all albums should now work, needed to check for all in user.post --- app/models/user.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index e02c58534..e86a98cfb 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -96,6 +96,7 @@ class User ######## Posting ######## def post(class_name, options = {}) + puts options.inspect if class_name == :photo raise ArgumentError.new("No album_id given") unless options[:album_id] aspect_ids = aspects_with_post( options[:album_id] ) @@ -108,7 +109,7 @@ class User raise ArgumentError.new("You must post to someone.") if aspect_ids.nil? || aspect_ids.empty? aspect_ids.each{ |aspect_id| - raise ArgumentError.new("Cannot post to an aspect you do not own.") unless self.aspects.find(aspect_id) } + raise ArgumentError.new("Cannot post to an aspect you do not own.") unless aspect_id == "all" || self.aspects.find(aspect_id) } post = build_post(class_name, options)