text stringlengths 0 357 |
|---|
static int is_gettable_config_key(const char* key) |
{ |
for (int i = 0; i < str_array_len(sys_config_keys); i++) { |
if (strcmp(key, sys_config_keys[i]) == 0) { |
return 1; |
} |
} |
return is_settable_config_key(key); |
} |
static char* get_config_keys_str() |
{ |
dc_strbuilder_t ret; |
dc_strbuilder_init(&ret, 0); |
for (int i = 0; i < str_array_len(config_keys); i++) { |
if (strlen(ret.buf) > 0) { |
dc_strbuilder_cat(&ret, " "); |
} |
dc_strbuilder_cat(&ret, config_keys[i]); |
} |
for (int i = 0; i < str_array_len(sys_config_keys); i++) { |
if (strlen(ret.buf) > 0) { |
dc_strbuilder_cat(&ret, " "); |
} |
dc_strbuilder_cat(&ret, sys_config_keys[i]); |
} |
return ret.buf; |
} |
static char* get_sys_config_str(const char* key) |
{ |
if (strcmp(key, "sys.version")==0) |
{ |
return dc_strdup(DC_VERSION_STR); |
} |
else if (strcmp(key, "sys.msgsize_max_recommended")==0) |
{ |
return dc_mprintf("%i", DC_MSGSIZE_MAX_RECOMMENDED); |
} |
else if (strcmp(key, "sys.config_keys")==0) |
{ |
return get_config_keys_str(); |
} |
else { |
return dc_strdup(NULL); |
} |
} |
/** |
* Configure the context. The configuration is handled by key=value pairs as: |
* |
* - `addr` = address to display (always needed) |
* - `mail_server` = IMAP-server, guessed if left out |
* - `mail_user` = IMAP-username, guessed if left out |
* - `mail_pw` = IMAP-password (always needed) |
* - `mail_port` = IMAP-port, guessed if left out |
* - `send_server` = SMTP-server, guessed if left out |
* - `send_user` = SMTP-user, guessed if left out |
* - `send_pw` = SMTP-password, guessed if left out |
* - `send_port` = SMTP-port, guessed if left out |
* - `server_flags` = IMAP-/SMTP-flags as a combination of @ref DC_LP flags, guessed if left out |
* - `displayname` = Own name to use when sending messages. MUAs are allowed to spread this way eg. using CC, defaults to empty |
* - `selfstatus` = Own status to display eg. in email footers, defaults to a standard text |
* - `selfavatar` = File containing avatar. Will be copied to blob directory. |
* NULL to remove the avatar. |
* It is planned for future versions |
* to send this image together with the next messages. |
* - `e2ee_enabled` = 0=no end-to-end-encryption, 1=prefer end-to-end-encryption (default) |
* - `mdns_enabled` = 0=do not send or request read receipts, |
* 1=send and request read receipts (default) |
* - `inbox_watch` = 1=watch `INBOX`-folder for changes (default), |
* 0=do not watch the `INBOX`-folder |
* - `sentbox_watch`= 1=watch `Sent`-folder for changes (default), |
* 0=do not watch the `Sent`-folder |
* - `mvbox_watch` = 1=watch `DeltaChat`-folder for changes (default), |
* 0=do not watch the `DeltaChat`-folder |
* - `mvbox_move` = 1=heuristically detect chat-messages |
* and move them to the `DeltaChat`-folder, |
* 0=do not move chat-messages |
* - `show_emails` = DC_SHOW_EMAILS_OFF (0)= |
* show direct replies to chats only (default), |
* DC_SHOW_EMAILS_ACCEPTED_CONTACTS (1)= |
* also show all mails of confirmed contacts, |
* DC_SHOW_EMAILS_ALL (2)= |
* also show mails of unconfirmed contacts in the deaddrop. |
* - `save_mime_headers` = 1=save mime headers |
* and make dc_get_mime_headers() work for subsequent calls, |
* 0=do not save mime headers (default) |
* |
* If you want to retrieve a value, use dc_get_config(). |
* |
* @memberof dc_context_t |
* @param context The context object |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.