Skip to main content

send

Function send 

Source
pub async fn send(
    http: &Client,
    servers: &[Url],
    auth: &Event,
    media: Media,
    hash: &str,
    sent: &Sent,
) -> Result<Attachment, Vec<(Url, UploadError)>>
Expand description

Send media, whose hash is hash and which auth authorizes sending, to the first of servers that takes it, and have the others fetch it from there; with sent kept at how much of it has gone. Returns where it is, or why each server did not take it.

A server that refused is not asked to fetch what it refused; and a server that did not fetch it is no reason for the file not to be attached. If the server that took the file changed it, which it is not to, it is a different file that it has, and no other is asked for that one.