Module: DiasporaFederation::Federation::Sender
- Defined in:
- lib/diaspora_federation/federation/sender.rb,
lib/diaspora_federation/federation/sender/hydra_wrapper.rb
Overview
Federation logic to send messages to other pods
Defined Under Namespace
Classes: HydraWrapper
Class Method Summary collapse
-
.private(sender_id, obj_str, targets) ⇒ Hash
Send a private message to receive-urls.
-
.public(sender_id, obj_str, urls, xml) ⇒ Array<String>
Send a public message to all urls.
Class Method Details
.private(sender_id, obj_str, targets) ⇒ Hash
Send a private message to receive-urls
26 27 28 29 30 |
# File 'lib/diaspora_federation/federation/sender.rb', line 26 def self.private(sender_id, obj_str, targets) hydra = HydraWrapper.new(sender_id, obj_str) targets.each {|url, json| hydra.insert_enc_magic_env_request(url, json) } hydra.send.to_h {|url| [url, targets[url]] } end |
.public(sender_id, obj_str, urls, xml) ⇒ Array<String>
Send a public message to all urls
14 15 16 17 18 |
# File 'lib/diaspora_federation/federation/sender.rb', line 14 def self.public(sender_id, obj_str, urls, xml) hydra = HydraWrapper.new(sender_id, obj_str) urls.each {|url| hydra.insert_magic_env_request(url, xml) } hydra.send end |