From 1c4aaad7f9831887653c105cd27d3350392bd8b6 Mon Sep 17 00:00:00 2001 From: Dusan Stevanovic Date: Mon, 20 Sep 2021 12:38:28 +0200 Subject: [PATCH] zcall: increase # of retries on OTR sending to allow users being quickly added on the fly --- src/engine/otr.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/engine/otr.c b/src/engine/otr.c index 9bd574529..f3357035d 100644 --- a/src/engine/otr.c +++ b/src/engine/otr.c @@ -23,6 +23,7 @@ #define MAX_CLIENTS 8 #define MAX_ID_LEN 64 +#define OTR_RETRIES 6 struct context { struct engine *engine; @@ -264,8 +265,11 @@ static int send_otr_if_ready(struct context *ctx, bool ignore_missing) struct ctx_user *cu; size_t i; - //info("send_otr_if_ready w:%s mp:%u rt:%d\n", ctx->waiting_for_otr ? "true" : "false", - // ctx->missing_prekeys, ctx->retries); +#if 0 + info("send_otr_if_ready w:%s mp:%u rt:%d\n", + ctx->waiting_for_otr ? "true" : "false", + ctx->missing_prekeys, ctx->retries); +#endif if (!ctx->waiting_for_otr && ctx->missing_prekeys == 0) { if (--ctx->retries < 0) { @@ -379,7 +383,7 @@ int engine_send_otr_message(struct engine *engine, ctx->resph = resph; ctx->arg = arg; ctx->missing_prekeys = 0; - ctx->retries = 3; + ctx->retries = OTR_RETRIES; if (targets && num_targets > 0) { size_t tsz = num_targets * sizeof(struct otr_target);