Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
Merge 79ee6b8 into 647cde0
Browse files Browse the repository at this point in the history
  • Loading branch information
Jikstra committed Jul 16, 2019
2 parents 647cde0 + 79ee6b8 commit 9775ea6
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,12 @@ static uintptr_t dc_event_handler(dc_context_t* dc_context, int event, uintptr_t
dcn_event->data1_str = (DC_EVENT_DATA1_IS_STRING(event) && data1) ? strdup((char*)data1) : NULL;
dcn_event->data2_str = (DC_EVENT_DATA2_IS_STRING(event) && data2) ? strdup((char*)data2) : NULL;

napi_call_threadsafe_function(dcn_context->threadsafe_event_handler, dcn_event, napi_tsfn_blocking);
napi_status status = napi_call_threadsafe_function(dcn_context->threadsafe_event_handler, dcn_event, napi_tsfn_nonblocking);

if (status == napi_queue_full) {
TRACE("Queue is full, can't call callback");
}

return 0;
}

Expand Down Expand Up @@ -1523,7 +1527,7 @@ NAPI_METHOD(dcn_set_event_handler) {
callback,
0,
async_resource_name,
100,
0,
1,
NULL,
NULL,
Expand Down Expand Up @@ -2581,12 +2585,23 @@ NAPI_METHOD(dcn_array_get_chat_id) {
return napi_chat_id;
}

NAPI_METHOD(dcn_perform_imap_jobs) {
NAPI_ARGV(1);
NAPI_DCN_CONTEXT();

dc_perform_imap_jobs(dcn_context->dc_context);

//TRACE("calling..");
NAPI_RETURN_UNDEFINED();
}

NAPI_INIT() {
/**
* Main context
*/

NAPI_EXPORT_FUNCTION(dcn_context_new);
NAPI_EXPORT_FUNCTION(dcn_perform_imap_jobs);

/**
* Static functions
Expand Down

0 comments on commit 9775ea6

Please sign in to comment.