forked from Silverfish/proton-bridge
feat: switch to proxy when need be
This commit is contained in:
@ -179,7 +179,7 @@ func writeAttachment(w *multipart.Writer, att *Attachment, r io.Reader, sig io.R
|
||||
//
|
||||
// The returned created attachment contains the new attachment ID and its size.
|
||||
func (c *Client) CreateAttachment(att *Attachment, r io.Reader, sig io.Reader) (created *Attachment, err error) {
|
||||
req, w, err := NewMultipartRequest("POST", "/attachments")
|
||||
req, w, err := c.NewMultipartRequest("POST", "/attachments")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@ -213,7 +213,7 @@ type UpdateAttachmentSignatureReq struct {
|
||||
|
||||
func (c *Client) UpdateAttachmentSignature(attachmentID, signature string) (err error) {
|
||||
updateReq := &UpdateAttachmentSignatureReq{signature}
|
||||
req, err := NewJSONRequest("PUT", "/attachments/"+attachmentID+"/signature", updateReq)
|
||||
req, err := c.NewJSONRequest("PUT", "/attachments/"+attachmentID+"/signature", updateReq)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@ -228,7 +228,7 @@ func (c *Client) UpdateAttachmentSignature(attachmentID, signature string) (err
|
||||
|
||||
// DeleteAttachment removes an attachment. message is the message ID, att is the attachment ID.
|
||||
func (c *Client) DeleteAttachment(attID string) (err error) {
|
||||
req, err := NewRequest("DELETE", "/attachments/"+attID, nil)
|
||||
req, err := c.NewRequest("DELETE", "/attachments/"+attID, nil)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@ -249,7 +249,7 @@ func (c *Client) GetAttachment(id string) (att io.ReadCloser, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
req, err := NewRequest("GET", "/attachments/"+id, nil)
|
||||
req, err := c.NewRequest("GET", "/attachments/"+id, nil)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user