send private message
This commit is contained in:
parent
5f25135848
commit
b89c1d0cd7
1 changed files with 16 additions and 1 deletions
|
|
@ -3,7 +3,22 @@ module Diaspora
|
|||
class Dispatcher
|
||||
class Private < Dispatcher
|
||||
def deliver_to_remote(people)
|
||||
# TODO
|
||||
entity = Entities.build(object)
|
||||
Workers::SendPrivate.perform_async(sender.id, entity.to_s, targets(people, salmon_slap(entity)))
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def targets(people, salmon_slap)
|
||||
people.map {|person| [person.receive_url, salmon_slap.generate_xml(person.public_key)] }.to_h
|
||||
end
|
||||
|
||||
def salmon_slap(entity)
|
||||
DiasporaFederation::Salmon::EncryptedSlap.prepare(
|
||||
sender.diaspora_handle,
|
||||
sender.encryption_key,
|
||||
entity
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue