DG IZ friend request, has a puts in the receive hook for debugging
This commit is contained in:
parent
b496ee567a
commit
ebfc55ff28
2 changed files with 19 additions and 6 deletions
|
|
@ -1,7 +1,10 @@
|
|||
class PersonRequest
|
||||
require 'lib/common'
|
||||
include ApplicationHelper
|
||||
include MongoMapper::Document
|
||||
include Diaspora::Webhooks
|
||||
include ROXML
|
||||
include Diaspora::Webhooks
|
||||
|
||||
|
||||
xml_name :person_request
|
||||
|
||||
|
|
@ -16,11 +19,9 @@ class PersonRequest
|
|||
before_save :check_for_person_requests
|
||||
|
||||
def self.for(url)
|
||||
request = PersonRequest.new(:url => url)
|
||||
request.person = User.first
|
||||
request = PersonRequest.new(:url => url, :person => User.first)
|
||||
request.save
|
||||
|
||||
request.push_to([request])
|
||||
request.push_to_url(url)
|
||||
end
|
||||
|
||||
def check_for_person_requests
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ module Diaspora
|
|||
def store_objects_from_xml(xml)
|
||||
objects = parse_objects_from_xml(xml)
|
||||
|
||||
puts xml
|
||||
|
||||
objects.each do |p|
|
||||
if p.is_a? Retraction
|
||||
p.perform
|
||||
|
|
@ -72,6 +74,16 @@ module Diaspora
|
|||
end
|
||||
end
|
||||
|
||||
def push_to_url(url)
|
||||
if url
|
||||
puts "AHHHHHH, sending"
|
||||
xml = self.class.build_xml_for([self])
|
||||
puts xml
|
||||
@@queue.add_post_request( [url], xml )
|
||||
@@queue.process
|
||||
end
|
||||
end
|
||||
|
||||
def prep_webhook
|
||||
"<post>#{self.to_xml.to_s}</post>"
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue