Support the "BCC self" option
This commit is contained in:
@@ -32,6 +32,8 @@ _transpose_config(dc_context_t *mailbox, PurpleAccount *acct)
|
|||||||
const char *smtp_pass = purple_account_get_string(acct, PLUGIN_ACCOUNT_OPT_SMTP_PASS, NULL);
|
const char *smtp_pass = purple_account_get_string(acct, PLUGIN_ACCOUNT_OPT_SMTP_PASS, NULL);
|
||||||
const char *smtp_port = purple_account_get_string(acct, PLUGIN_ACCOUNT_OPT_SMTP_SERVER_PORT, NULL);
|
const char *smtp_port = purple_account_get_string(acct, PLUGIN_ACCOUNT_OPT_SMTP_SERVER_PORT, NULL);
|
||||||
|
|
||||||
|
gboolean bcc_self = purple_account_get_bool(acct, PLUGIN_ACCOUNT_OPT_BCC_SELF, FALSE);
|
||||||
|
|
||||||
dc_set_config(mailbox, PLUGIN_ACCOUNT_OPT_ADDR, addr);
|
dc_set_config(mailbox, PLUGIN_ACCOUNT_OPT_ADDR, addr);
|
||||||
dc_set_config(mailbox, PLUGIN_ACCOUNT_OPT_DISPLAY_NAME, display);
|
dc_set_config(mailbox, PLUGIN_ACCOUNT_OPT_DISPLAY_NAME, display);
|
||||||
|
|
||||||
@@ -44,6 +46,12 @@ _transpose_config(dc_context_t *mailbox, PurpleAccount *acct)
|
|||||||
dc_set_config(mailbox, PLUGIN_ACCOUNT_OPT_SMTP_USER, smtp_user);
|
dc_set_config(mailbox, PLUGIN_ACCOUNT_OPT_SMTP_USER, smtp_user);
|
||||||
dc_set_config(mailbox, PLUGIN_ACCOUNT_OPT_SMTP_PASS, smtp_pass);
|
dc_set_config(mailbox, PLUGIN_ACCOUNT_OPT_SMTP_PASS, smtp_pass);
|
||||||
dc_set_config(mailbox, PLUGIN_ACCOUNT_OPT_SMTP_SERVER_PORT, smtp_port);
|
dc_set_config(mailbox, PLUGIN_ACCOUNT_OPT_SMTP_SERVER_PORT, smtp_port);
|
||||||
|
|
||||||
|
if (bcc_self) {
|
||||||
|
dc_set_config(mailbox, PLUGIN_ACCOUNT_OPT_BCC_SELF, "1");
|
||||||
|
} else {
|
||||||
|
dc_set_config(mailbox, PLUGIN_ACCOUNT_OPT_BCC_SELF, "0");
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@@ -72,6 +72,12 @@ pwd_opt(const char *text, const char *name, const char *def)
|
|||||||
return option;
|
return option;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PurpleAccountOption *
|
||||||
|
bool_opt(const char *text, const char *name, const gboolean def)
|
||||||
|
{
|
||||||
|
return purple_account_option_bool_new(text, name, def);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
delta_init_plugin(PurplePlugin *plugin)
|
delta_init_plugin(PurplePlugin *plugin)
|
||||||
{
|
{
|
||||||
@@ -98,6 +104,8 @@ delta_init_plugin(PurplePlugin *plugin)
|
|||||||
// Not exposed: server_flags, selfstatus, e2ee_enabled
|
// Not exposed: server_flags, selfstatus, e2ee_enabled
|
||||||
// https://deltachat.github.io/api/classmrmailbox__t.html
|
// https://deltachat.github.io/api/classmrmailbox__t.html
|
||||||
|
|
||||||
|
opts = g_list_prepend(opts, bool_opt("Send copy to self", PLUGIN_ACCOUNT_OPT_BCC_SELF, FALSE));
|
||||||
|
|
||||||
extra->protocol_options = g_list_reverse(opts);
|
extra->protocol_options = g_list_reverse(opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -27,6 +27,8 @@
|
|||||||
#define PLUGIN_ACCOUNT_OPT_SMTP_USER "send_user"
|
#define PLUGIN_ACCOUNT_OPT_SMTP_USER "send_user"
|
||||||
#define PLUGIN_ACCOUNT_OPT_SMTP_PASS "send_pw"
|
#define PLUGIN_ACCOUNT_OPT_SMTP_PASS "send_pw"
|
||||||
|
|
||||||
|
#define PLUGIN_ACCOUNT_OPT_BCC_SELF "bcc_self"
|
||||||
|
|
||||||
#define UNUSED(x) (void)(x)
|
#define UNUSED(x) (void)(x)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user