clean activity streams, fix test
This commit is contained in:
parent
183ea42d54
commit
6364f2a332
3 changed files with 13 additions and 16 deletions
|
|
@ -102,7 +102,7 @@ class StatusMessage < Post
|
|||
<title>#{x(self.formatted_message(:plain_text => true))}</title>
|
||||
<content>#{x(self.formatted_message(:plain_text => true))}</content>
|
||||
<link rel="alternate" type="text/html" href="#{self.author.url}p/#{self.id}"/>
|
||||
<id>#{self.author.url}posts/#{self.id}</id>
|
||||
<id>#{self.author.url}p/#{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>
|
||||
|
|
|
|||
|
|
@ -36,10 +36,19 @@ module Diaspora
|
|||
<subtitle>Updates from #{x(@user.name)} on Diaspora</subtitle>
|
||||
<logo>#{@user.person.profile.image_url(:thumb_small)}</logo>
|
||||
<updated>#{Time.now.xmlschema}</updated>
|
||||
<link href="#{AppConfig[:pod_url]}/people/#{@user.person.id}" rel="alternative" type="text/html"/>
|
||||
XML
|
||||
end
|
||||
|
||||
def create_subject
|
||||
<<-XML
|
||||
<author>
|
||||
<activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
|
||||
<name>#{x(@user.name)}</name>
|
||||
<uri>#{@user.public_url}</uri>
|
||||
<uri>"#{AppConfig[:pod_url]}/people/#{@user.person.id}"</uri>
|
||||
<link href="#{@user.public_url}" rel="alternative" type="text/html"/>
|
||||
<poco:preferredUsername>#{x(@user.username)}</poco:preferredUsername>
|
||||
<poco:displayName>#{x(@user.person.name)}</poco:displayName>
|
||||
<link rel="avatar" type="image/jpeg" media:width="100" media:height="100" href="#{@user.profile.image_url}"/>
|
||||
</author>
|
||||
XML
|
||||
end
|
||||
|
|
@ -51,18 +60,6 @@ module Diaspora
|
|||
XML
|
||||
end
|
||||
|
||||
def create_subject
|
||||
<<-XML
|
||||
<activity:subject>
|
||||
<activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
|
||||
<id>#{@user.public_url}</id>
|
||||
<title>#{x(@user.name)}</title>
|
||||
<link rel="alternative" type="text/html" href="#{@user.public_url}"/>
|
||||
<link rel="avatar" type="image/jpeg" media:width="100" media:height="100" href="#{@user.profile.image_url}"/>
|
||||
</activity:subject>
|
||||
XML
|
||||
end
|
||||
|
||||
def create_body
|
||||
@posts.inject("") do |xml,curr|
|
||||
if curr.respond_to?(:to_activity)
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ describe Job::ReceiveLocalBatch do
|
|||
SocketsController.stub(:new).and_return(@controller)
|
||||
end
|
||||
it 'sockets to each user' do
|
||||
@controller.should_receive(:outgoing).with(bob.id, @post, {})
|
||||
@controller.should_receive(:outgoing).with(bob.id, @post, instance_of(Hash))
|
||||
Job::ReceiveLocalBatch.socket_to_users(@post, [bob.id])
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue