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

Class Method Details

.private(sender_id, obj_str, targets) ⇒ Hash

Send a private message to receive-urls


24
25
26
27
28
# File 'lib/diaspora_federation/federation/sender.rb', line 24

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.map {|url| [url, targets[url]] }.to_h
end

.public(sender_id, obj_str, urls, xml) ⇒ Array<String>

Send a public message to all urls


12
13
14
15
16
# File 'lib/diaspora_federation/federation/sender.rb', line 12

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