- /*
- * Initially, we don't consider ourselves as having finished.
- */
-
- completed_now = FALSE;
-
- /*
- * Since irssi can't handle overlapping keyboard prompt requests, block
- * future requests until we are finished. N.B. This should really be
- * handled inside of irssi, but this requires a breaking change to how
- * keyboard callbacks are processed from an API perspective. A problem
- * exists where another user could call a keyboard redirect request
- * external to silc while we have one pending, and cause ours to get
- * lost, in which case we will get stuck denying future prompt requests.
- *
- * Fortunately, nobody else seems to use keyboard prompt requests, at least
- * not that I can tell.
- */
-
- silc_keyboard_prompt_pending = TRUE;
-
- /*
- * Set up the call to the irssi keyboard entry redirection facility.
- */
-
- ctx->user_prompt_proc = prompt_func;
- ctx->user_context = data;
- ctx->aborted = FALSE;
- ctx->immediate_completion = &completed_now;
-
- keyboard_entry_redirect((SIGNAL_FUNC)silc_keyboard_entry_redirect_completion,
- entry, 0, ctx);
-
- ctx->immediate_completion = NULL;
-
- /*
- * If we completed immediately, then there is nothing to return as the async
- * context has already been released. In this case we have completed with a
- * success status, but there is no SilcAsyncOperation context to return.
- */
-
- if (completed_now)
- {
- *async = NULL;
- return TRUE;
- }