commit 8b7d3792e40fb4cc289f68eb94b3297cb5c99255
parent 39247197f931c8abc5e726c4c780f6a8ff1d8449
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date: Fri, 24 Mar 2017 17:00:00 +0100
factor out transform_refcounted_msg_response()
the missing cross of transform_refcounted_box_response() and
transform_msg_response().
Diffstat:
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/src/drv_imap.c b/src/drv_imap.c
@@ -605,6 +605,20 @@ transform_refcounted_box_response( imap_cmd_refcounted_state_t *sts, int respons
}
}
+static void
+transform_refcounted_msg_response( imap_cmd_refcounted_state_t *sts, int response )
+{
+ switch (response) {
+ case RESP_CANCEL:
+ sts->ret_val = DRV_CANCELED;
+ break;
+ case RESP_NO:
+ if (sts->ret_val == DRV_OK) /* Don't override cancelation. */
+ sts->ret_val = DRV_MSG_BAD;
+ break;
+ }
+}
+
static const char *
imap_strchr( const char *s, char tc )
{
@@ -2665,15 +2679,8 @@ static void
imap_set_flags_p2( imap_store_t *ctx ATTR_UNUSED, imap_cmd_t *cmd, int response )
{
imap_set_msg_flags_state_t *sts = (imap_set_msg_flags_state_t *)((imap_cmd_refcounted_t *)cmd)->state;
- switch (response) {
- case RESP_CANCEL:
- sts->gen.ret_val = DRV_CANCELED;
- break;
- case RESP_NO:
- if (sts->gen.ret_val == DRV_OK) /* Don't override cancelation. */
- sts->gen.ret_val = DRV_MSG_BAD;
- break;
- }
+
+ transform_refcounted_msg_response( &sts->gen, response);
imap_set_flags_p3( sts );
}