text
stringlengths
0
357
{
// no value yet, use default value
if (strcmp(key, "e2ee_enabled")==0) {
value = dc_mprintf("%i", DC_E2EE_DEFAULT_ENABLED);
}
else if (strcmp(key, "mdns_enabled")==0) {
value = dc_mprintf("%i", DC_MDNS_DEFAULT_ENABLED);
}
else if (strcmp(key, "imap_folder")==0) {
value = dc_strdup("INBOX");
}
else if (strcmp(key, "inbox_watch")==0) {
value = dc_mprintf("%i", DC_INBOX_WATCH_DEFAULT);
}
else if (strcmp(key, "sentbox_watch")==0) {
value = dc_mprintf("%i", DC_SENTBOX_WATCH_DEFAULT);
}
else if (strcmp(key, "mvbox_watch")==0) {
value = dc_mprintf("%i", DC_MVBOX_WATCH_DEFAULT);
}
else if (strcmp(key, "mvbox_move")==0) {
value = dc_mprintf("%i", DC_MVBOX_MOVE_DEFAULT);
}
else if (strcmp(key, "show_emails")==0) {
value = dc_mprintf("%i", DC_SHOW_EMAILS_DEFAULT);
}
else if (strcmp(key, "selfstatus")==0) {
value = dc_stock_str(context, DC_STR_STATUSLINE);
}
else {
value = dc_mprintf("");
}
}
return value;
}
/**
* Tool to check if a folder is equal to the configured INBOX.
* @private @memberof dc_context_t
*/
int dc_is_inbox(dc_context_t* context, const char* folder_name)
{
int is_inbox = 0;
if (folder_name) {
is_inbox = strcasecmp("INBOX", folder_name)==0? 1 : 0;
}
return is_inbox;
}
/**
* Tool to check if a folder is equal to the configured sent-folder.
* @private @memberof dc_context_t
*/
int dc_is_sentbox(dc_context_t* context, const char* folder_name)
{
char* sentbox_name = dc_sqlite3_get_config(context->sql, "configured_sentbox_folder", NULL);
int is_sentbox = 0;
if (sentbox_name && folder_name) {
is_sentbox = strcasecmp(sentbox_name, folder_name)==0? 1 : 0;
}
free(sentbox_name);
return is_sentbox;
}
/**
* Tool to check if a folder is equal to the configured sent-folder.
* @private @memberof dc_context_t
*/
int dc_is_mvbox(dc_context_t* context, const char* folder_name)
{
char* mvbox_name = dc_sqlite3_get_config(context->sql, "configured_mvbox_folder", NULL);
int is_mvbox = 0;
if (mvbox_name && folder_name) {
is_mvbox = strcasecmp(mvbox_name, folder_name)==0? 1 : 0;
}
free(mvbox_name);
return is_mvbox;
}
/**
* Find out the version of the Delta Chat core library.
* Deprecated, use dc_get_config() instread
*
* @private @memberof dc_context_t
* @return String with version number as `major.minor.revision`. The return value must be free()'d.
*/
char* dc_get_version_str(void)
{
return dc_strdup(DC_VERSION_STR);
}
/**
* Get information about the context.
* The information is returned by a multi-line string
* and contains information about the current configuration.