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

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphtheninja committed Oct 30, 2018
1 parent 2c259b8 commit 53801be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -104,7 +104,7 @@ class DeltaChat extends EventEmitter {

this.once('_configured', ready)

if (!opts.e2ee_enabled) opts.e2ee_enabled = 1
if (typeof opts.e2ee_enabled === 'undefined') opts.e2ee_enabled = 1

this.setConfig('addr', opts.addr)

Expand Down Expand Up @@ -518,7 +518,7 @@ class DeltaChat extends EventEmitter {
}

setConfig (key, value) {
return binding.dcn_set_config(this.dcn_context, key, value || null)
return binding.dcn_set_config(this.dcn_context, key, value || '')
}

setOffline (offline) {
Expand Down
3 changes: 2 additions & 1 deletion src/module.c
Expand Up @@ -1232,7 +1232,8 @@ NAPI_METHOD(dcn_set_config) {
NAPI_ARGV_UTF8_MALLOC(key, 1);
NAPI_ARGV_UTF8_MALLOC(value, 2);

int status = dc_set_config(dcn_context->dc_context, key, value);
char* value_null = strlen(value) > 0 ? value : NULL;
int status = dc_set_config(dcn_context->dc_context, key, value_null);

free(key);
free(value);
Expand Down

0 comments on commit 53801be

Please sign in to comment.