module DiasporaFederation::Federation::Sender

Federation logic to send messages to other pods

Public Class Methods

private(sender_id, obj_str, targets) click to toggle source

Send a private message to receive-urls

@param [String] sender_id sender diaspora-ID @param [String] obj_str object string representation for logging (e.g. type@guid) @param [Hash] targets Hash with receive-urls (key) of peoples with encrypted salmon-xml for them (value) @return [Hash] targets to retry

# 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) click to toggle source

Send a public message to all urls

@param [String] sender_id sender diaspora-ID @param [String] obj_str object string representation for logging (e.g. type@guid) @param [Array<String>] urls receive-urls from pods @param [String] xml salmon-xml @return [Array<String>] url to retry

# 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