Skip to content
Extraits de code Groupes Projets
Valider ec4c63ad rédigé par maxwell's avatar maxwell
Parcourir les fichiers

Merge branch 'master' of github.com:diaspora/diaspora

parents d638bdb0 79f19b68
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Affichage de
avec 91 ajouts et 48 suppressions
......@@ -19,3 +19,4 @@ bin/*
nbproject
config/initializers/secret_token.rb
public/source.tar
config/fb_config.yml
......@@ -18,13 +18,11 @@ instructions.
You are welcome to contribute, add to and extend Diaspora however you see fit. We
will do our best to incorporate everything that meets our guidelines.
We need you to fill out a
[contributor agreement form](https://spreadsheets.google.com/a/joindiaspora.com/viewform?formkey=dGI2cHA3ZnNHLTJvbm10LUhXRTJjR0E6MQ&theme=0AX42CRMsmRFbUy1iOGYwN2U2Mi1hNWU0LTRlNjEtYWMyOC1lZmU4ODg1ODc1ODI&ifq)
before we can accept your patches. The agreement gives Diaspora joint
ownership of the patch so the copyright isn't scattered. You can find it
[here](https://spreadsheets.google.com/a/joindiaspora.com/viewform?formkey=dGI2cHA3ZnNHLTJvbm10LUhXRTJjR0E6MQ&theme=0AX42CRMsmRFbUy1iOGYwN2U2Mi1hNWU0LTRlNjEtYWMyOC1lZmU4ODg1ODc1ODI&ifq).
Please do not rebase our tree into yours.
See [here](http://www.mail-archive.com/dri-devel@lists.sourceforge.net/msg39091.html)
for when to rebase.
All commits must be tested, and after each commit, all tests should be green
All commits must be tested, and all your tests should be green
before a pull request is sent. Please write your tests in Rspec.
GEMS: We would like to keep external dependencies unduplicated. We're using
......@@ -32,6 +30,12 @@ Nokogiri, Mongomapper, and EM::HttpRequest as much as possible. We have a few
gems in the project we'd rather not use, but if you can, use dependencies we
already have.
We need you to fill out a
[contributor agreement form](https://spreadsheets.google.com/a/joindiaspora.com/viewform?formkey=dGI2cHA3ZnNHLTJvbm10LUhXRTJjR0E6MQ&theme=0AX42CRMsmRFbUy1iOGYwN2U2Mi1hNWU0LTRlNjEtYWMyOC1lZmU4ODg1ODc1ODI&ifq)
before we can accept your patches. The agreement gives Diaspora joint
ownership of the patch so the copyright isn't scattered. You can find it
[here](https://spreadsheets.google.com/a/joindiaspora.com/viewform?formkey=dGI2cHA3ZnNHLTJvbm10LUhXRTJjR0E6MQ&theme=0AX42CRMsmRFbUy1iOGYwN2U2Mi1hNWU0LTRlNjEtYWMyOC1lZmU4ODg1ODc1ODI&ifq).
## Resources
We are maintaining a
......
......@@ -52,7 +52,7 @@ class AspectsController < ApplicationController
@fb_access_url = MiniFB.oauth_url(FB_APP_ID, APP_CONFIG[:pod_url] + "services/create",
:scope=>MiniFB.scopes.join(","))
@posts = current_user.visible_posts(:public => true).paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC'
@posts = current_user.visible_posts(:person_id => current_user.person.id, :public => true).paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC'
respond_with @aspect
end
......
......@@ -9,7 +9,8 @@ class PhotosController < ApplicationController
respond_to :json, :only => :show
def create
album = Album.find_by_id params[:album_id]
album = current_user.find_visible_post_by_id( params[:album_id] )
begin
######################## dealing with local files #############
......
......@@ -28,6 +28,12 @@ class PublicsController < ApplicationController
end
end
def hub
if params['hub.mode'] == 'subscribe' || params['hub.mode'] == 'unsubscribe'
render :text => params['hub.challenge'], :status => 202, :layout => false
end
end
def receive
render :nothing => true
return unless params[:xml]
......
......@@ -13,7 +13,7 @@ class UsersController < ApplicationController
@user = current_user
@person = @user.person
@profile = @user.person.profile
@photos = Photo.find_all_by_person_id(@person.id).paginate :page => params[:page], :order => 'created_at DESC'
@photos = current_user.visible_posts(:person_id => current_user.person.id, :_type => 'Photo').paginate :page => params[:page], :order => 'created_at DESC'
@fb_access_url = MiniFB.oauth_url(FB_APP_ID, APP_CONFIG[:pod_url] + "services/create",
:scope=>MiniFB.scopes.join(","))
......@@ -49,7 +49,7 @@ class UsersController < ApplicationController
director = Diaspora::Director.new
ostatus_builder = Diaspora::OstatusBuilder.new(user)
render :xml => director.build(ostatus_builder)
render :xml => director.build(ostatus_builder), :content_type => 'application/atom+xml'
else
flash[:error] = "User #{params[:username]} does not exist!"
redirect_to root_url
......
......@@ -110,7 +110,7 @@ class Person
hcard = HCard.find profile.hcard.first[:href]
new_person.url = hcard[:url]
new_person.profile = Profile.new(:first_name => hcard[:given_name], :last_name => hcard[:family_name])
new_person.profile = Profile.new(:first_name => hcard[:given_name], :last_name => hcard[:family_name], :image_url => hcard[:photo])
if new_person.save
new_person
else
......
......@@ -13,12 +13,13 @@ class StatusMessage < Post
def to_activity
<<-XML
<entry>
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
<title>#{self.message}</title>
<link rel="alternate" type="text/html" href="#{person.url}status_messages/#{self.id}"/>
<id>#{person.url}status_messages/#{self.id}</id>
<published>#{self.created_at.xmlschema}</published>
<updated>#{self.updated_at.xmlschema}</updated>
<title>#{self.message}</title>
<link rel="alternate" type="text/html" href="#{person.url}status_messages/#{self.id}"/>
<id>#{person.url}status_messages/#{self.id}</id>
<published>#{self.created_at.xmlschema}</published>
<updated>#{self.updated_at.xmlschema}</updated>
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
<activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
</entry>
XML
end
......
......@@ -167,6 +167,8 @@ class User
target_people = target_people | aspect.people
}
push_to_hub(post) if post.respond_to?(:public) && post.public
push_to_people(post, target_people)
end
......@@ -179,10 +181,14 @@ class User
end
def push_to_person( person, xml )
Rails.logger.debug("Adding xml for #{self} to message queue to #{url}")
QUEUE.add_post_request( person.receive_url, xml )
QUEUE.process
Rails.logger.debug("Adding xml for #{self} to message queue to #{self.url}")
QUEUE.add_post_request( person.receive_url, xml )
QUEUE.process
end
def push_to_hub(post)
Rails.logger.debug("Pushing update to pubsub server #{APP_CONFIG[:pubsub_server]} with url #{self.public_url}")
QUEUE.add_hub_notification(APP_CONFIG[:pubsub_server], self.public_url)
end
def salmon( post )
......
......@@ -33,6 +33,12 @@
<a href="<%= @person.url%>" rel="me" id="pod_location" class="url"><%= @person.url%></a>
</dd>
</dl>
<dl class="entity_photo">
<dt>Photo</dt>
<dd>
<span class="photo"><%= @person.profile.image_url%></span>
</dd>
</dl>
<dl class="entity_note">
<dt>Note</dt>
<dd class="note">Diaspora is awesome! vi is better than emacs!</dd>
......
......@@ -5,5 +5,8 @@
<Link rel="http://microformats.org/profile/hcard" type="text/html" href="<%=@person.url%>hcard/users/<%=@person.id%>"/>
<Link rel="http://joindiaspora.com/seed_location" type = 'text/html' href="<%=@person.url%>"/>
<Link rel="http://joindiaspora.com/guid" type = 'text/html' href="<%=@person.id%>"/>
<Link rel="http://schemas.google.com/g/2010#updates-from" type="application/atom+xml" href="<%=@person.public_url%>"/>
<Link rel="diaspora-public-key" type = 'RSA' href="<%=Base64.encode64(@person.exported_key)%>"/>
</XRD>
......@@ -6,11 +6,11 @@
= owner_image_link
- for friend in @friends
= person_image_link(friend)
- if @logged_in && (@aspect == :public)
%h3 Facebook Friends
- @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends")
- @fb_friends[:data].each do |friend|
= image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" )
- if @logged_in && (@aspect == :public)
%h3 Facebook Friends
- @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends")
- @fb_friends[:data].each do |friend|
= image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" )
-unless (@aspect == :all) || (@aspect == :public)
= link_to (image_tag('add_friend_button.png', :height => "50px", :width => "50px")), "#add_request_pane", :id => 'add_request_button'
......
......@@ -57,7 +57,7 @@
#submit_block
= link_to t('.cancel'), root_path
or
= t('.or')
= f.submit t('.update_profile')
#content_bottom
......
......@@ -5,19 +5,20 @@
%h2 Services
%h3 Facebook
%p
- if @logged_in
= connected_fb_as(@access_token)
%p
- @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends")
- @fb_friends[:data].each do |friend|
= image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" )
- if FACEBOOK
%h3 Facebook
%p
- if @logged_in
= connected_fb_as(@access_token)
%p
- @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends")
- @fb_friends[:data].each do |friend|
= image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" )
= link_to "Disconnect from Facebook", services_destroy_path
- else
= link_to "Connect to Facebook (DO NOT USE WITH A REAL ACCOUNT)", @fb_access_url
= link_to "Disconnect from Facebook", services_destroy_path
- else
= link_to "Connect to Facebook (DO NOT USE WITH A REAL ACCOUNT)", @fb_access_url
#content_bottom
.back
......
......@@ -56,6 +56,11 @@ namespace :deploy do
run "ln -s -f #{shared_path}/app_config.yml #{current_path}/config/app_config.yml"
end
task :symlink_fb_config do
run "touch #{shared_path}/fb_config.yml"
run "ln -s -f #{shared_path}/fb_config.yml #{current_path}/config/fb_config.yml"
end
task :start do
start_mongo
start_thin
......@@ -152,4 +157,4 @@ namespace :db do
end
after "deploy:symlink", "deploy:symlink_images", "deploy:symlink_bundle", 'deploy:symlink_config'
after "deploy:symlink", "deploy:symlink_images", "deploy:symlink_bundle", 'deploy:symlink_config', 'deploy:symlink_fb_config'
......@@ -6,7 +6,7 @@ cross_server:
deploy_to: '/usr/local/app/diaspora'
user: 'root'
repo: 'git://github.com/diaspora/diaspora.git'
branch: 'salmon_refactor'
branch: 'master'
default_env: 'development'
servers:
tom:
......
......@@ -7,13 +7,17 @@ require File.expand_path('../application', __FILE__)
Haml::Template.options[:format] = :html5
Haml::Template.options[:escape_html] = true
# Load facebook connection application credentials
fb_config = YAML::load(File.open(File.expand_path("./config/fb_config.yml")))
FB_API_KEY = fb_config['fb_api_key']
FB_SECRET = fb_config['fb_secret']
FB_APP_ID = fb_config['fb_app_id']
HOST = fb_config['host']
if File.exists?(File.expand_path("./config/fb_config.yml"))
# Load facebook connection application credentials
fb_config = YAML::load(File.open(File.expand_path("./config/fb_config.yml")))
FB_API_KEY = fb_config['fb_api_key']
FB_SECRET = fb_config['fb_secret']
FB_APP_ID = fb_config['fb_app_id']
HOST = fb_config['host']
FACEBOOK = true
else
FACEBOOK = false
end
# Initialize the rails application
Diaspora::Application.initialize!
fb_api_key: {key}
fb_secret: {secret}
fb_app_id: {app_id}
host: http://localhost:3000/
......@@ -18,7 +18,7 @@ he:
invalid: "הססמה או הדוא״ל שגויים."
invalid_token: "אסימון האימות שגוי."
timeout: "ההפעלה שלך פגה, נא להיכנס שוב כדי להמשיך."
inactive: "חשבונך לא הופעל עדין."
inactive: "חשבונך לא הופעל עדיין."
sessions:
signed_in: "נכנסת בהצלחה."
signed_out: "יצאת בהצלחה."
......
......@@ -113,6 +113,7 @@ en:
albums: "Albums"
you_dont_have_any_photos: "You don't have any photos! Go to the"
page_to_upload_some: "page to upload some."
or: "or"
comments:
comment:
ago: "ago"
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter