MCPcopy Index your code
hub / github.com/git/git / imap_store_msg

Function imap_store_msg

imap-send.c:1404–1425  ·  view source on GitHub ↗

* Store msg to IMAP. Also detach and free the data from msg->data, * leaving msg->data empty. */

Source from the content-addressed store, hash-verified

1402 * leaving msg->data empty.
1403 */
1404static int imap_store_msg(struct imap_store *ctx, struct strbuf *msg)
1405{
1406 struct imap *imap = ctx->imap;
1407 struct imap_cmd_cb cb;
1408 const char *prefix, *box;
1409 int ret;
1410
1411 lf_to_crlf(msg);
1412 memset(&cb, 0, sizeof(cb));
1413
1414 cb.dlen = msg->len;
1415 cb.data = strbuf_detach(msg, NULL);
1416
1417 box = ctx->name;
1418 prefix = !strcmp(box, "INBOX") ? "" : ctx->prefix;
1419 ret = imap_exec_m(ctx, &cb, "APPEND \"%s%s\" ", prefix, box);
1420 imap->caps = imap->rcaps;
1421 if (ret != DRV_OK)
1422 return ret;
1423
1424 return DRV_OK;
1425}
1426
1427static void wrap_in_html(struct strbuf *msg)
1428{

Callers 1

append_msgs_to_imapFunction · 0.85

Calls 3

lf_to_crlfFunction · 0.85
strbuf_detachFunction · 0.85
imap_exec_mFunction · 0.85

Tested by

no test coverage detected