made a pubsubhub constant
This commit is contained in:
parent
4160baa25e
commit
99f7e938fd
3 changed files with 7 additions and 5 deletions
|
|
@ -1,11 +1,14 @@
|
||||||
development:
|
development:
|
||||||
debug: false
|
debug: false
|
||||||
socket_port: 8080
|
socket_port: 8080
|
||||||
|
pubsub_server: 'https://pubsubhubbub.appspot.com/'
|
||||||
|
|
||||||
test:
|
test:
|
||||||
debug: false
|
debug: false
|
||||||
socket_port: 8081
|
socket_port: 8081
|
||||||
|
pubsub_server: 'https://pubsubhubbub.appspot.com/'
|
||||||
|
|
||||||
production:
|
production:
|
||||||
debug: false
|
debug: false
|
||||||
socket_port: 8080
|
socket_port: 8080
|
||||||
|
pubsub_server: 'https://pubsubhubbub.appspot.com/'
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ module Diaspora
|
||||||
|
|
||||||
def push_to(recipients)
|
def push_to(recipients)
|
||||||
|
|
||||||
@@queue.add_hub_notification('http://pubsubhubbub.appspot.com/', User.owner.url + self.class.to_s.pluralize.underscore + '.atom')
|
@@queue.add_hub_notification(APP_CONFIG[:pubsub_server], User.owner.url + self.class.to_s.pluralize.underscore + '.atom')
|
||||||
|
|
||||||
unless recipients.empty?
|
unless recipients.empty?
|
||||||
recipients.map!{|x| x = x.url + "receive/"}
|
recipients.map!{|x| x = x.url + "receive/"}
|
||||||
|
|
@ -132,7 +132,7 @@ module Diaspora
|
||||||
|
|
||||||
def self.endpoints
|
def self.endpoints
|
||||||
<<-XML
|
<<-XML
|
||||||
<link href="http://pubsubhubbub.appspot.com/" rel="hub"/>
|
<link href="#{APP_CONFIG[:pubsub_server]}" rel="hub"/>
|
||||||
XML
|
XML
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ class MessageHandler
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_hub_notification(destination, feed_location)
|
def add_hub_notification(destination, feed_location)
|
||||||
puts "going to: #{destination}, telling it to fetch #{feed_location}"
|
|
||||||
@queue.push(Message.new(:pubhub, destination, feed_location))
|
@queue.push(Message.new(:pubhub, destination, feed_location))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -33,7 +32,7 @@ class MessageHandler
|
||||||
http.callback {send_to_seed(query, http.response); process}
|
http.callback {send_to_seed(query, http.response); process}
|
||||||
when :pubhub
|
when :pubhub
|
||||||
http = EventMachine::PubSubHubbub.new(query.destination).publish query.body, :timeout => TIMEOUT
|
http = EventMachine::PubSubHubbub.new(query.destination).publish query.body, :timeout => TIMEOUT
|
||||||
http.callback { puts "boner city"; process}
|
http.callback { process}
|
||||||
else
|
else
|
||||||
raise "message is not a type I know!"
|
raise "message is not a type I know!"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue