Browse Source

Fixed small bugs and code style offences

closed-social-glitch-2
Eugen Rochko 8 years ago
parent
commit
44c5958203
4 changed files with 9 additions and 9 deletions
  1. +4
    -4
      app/helpers/atom_helper.rb
  2. +1
    -1
      app/services/follow_remote_account_service.rb
  3. +3
    -3
      app/services/process_feed_service.rb
  4. +1
    -1
      app/services/process_interaction_service.rb

+ 4
- 4
app/helpers/atom_helper.rb View File

@ -7,7 +7,7 @@ module AtomHelper
if is_root if is_root
root_tag(xml, :entry, &block) root_tag(xml, :entry, &block)
else else
xml.entry &block
xml.entry class="p">(&block)
end end
end end
@ -44,11 +44,11 @@ module AtomHelper
end end
def author(xml, &block) def author(xml, &block)
xml.author &block
xml.author class="p">(&block)
end end
def target(xml, &block) def target(xml, &block)
xml['activity'].object &block
xml['activity'].object class="p">(&block)
end end
def object_type(xml, type) def object_type(xml, type)
@ -177,6 +177,6 @@ module AtomHelper
private private
def root_tag(xml, tag, &block) def root_tag(xml, tag, &block)
xml.send(tag, {xmlns: 'http://www.w3.org/2005/Atom', 'xmlns:thr': 'http://purl.org/syndication/thread/1.0', 'xmlns:activity': 'http://activitystrea.ms/spec/1.0/', 'xmlns:poco': 'http://portablecontacts.net/spec/1.0'}, &block)
xml.send(tag, { :xmlns => 'http://www.w3.org/2005/Atom', 'xmlns:thr' => 'http://purl.org/syndication/thread/1.0', 'xmlns:activity' => 'http://activitystrea.ms/spec/1.0/', 'xmlns:poco' => 'http://portablecontacts.net/spec/1.0' }, &block)
end end
end end

+ 1
- 1
app/services/follow_remote_account_service.rb View File

@ -45,7 +45,7 @@ class FollowRemoteAccountService < BaseService
end end
return account return account
rescue Goldfinger::Error, HTTP::Error => e
rescue Goldfinger::Error, HTTP::Error
nil nil
end end

+ 3
- 3
app/services/process_feed_service.rb View File

@ -28,7 +28,7 @@ class ProcessFeedService < BaseService
private private
def add_post!(entry, status)
def add_post!(_entry, status)
status.save! status.save!
end end
@ -47,7 +47,7 @@ class ProcessFeedService < BaseService
status.save! status.save!
end end
def find_original_status(xml, id)
def find_original_status(_xml, id)
return nil if id.nil? return nil if id.nil?
if local_id?(id) if local_id?(id)
@ -96,7 +96,7 @@ class ProcessFeedService < BaseService
end end
def activity_id(xml) def activity_id(xml)
entry.at_xpath('./xmlns:id').content
xml.at_xpath('./xmlns:id').content
end end
def target_content(xml) def target_content(xml)

+ 1
- 1
app/services/process_interaction_service.rb View File

@ -68,7 +68,7 @@ class ProcessInteractionService < BaseService
end end
def status(xml) def status(xml)
Status.find(unique_tag_to_local_id(activity_id, 'Status'))
Status.find(unique_tag_to_local_id(activity_id(xml), 'Status'))
end end
def activity_id(xml) def activity_id(xml)

Loading…
Cancel
Save