mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-21 19:16:22 +00:00
Add ability to script commands after connect
This commit is contained in:
@@ -1488,12 +1488,14 @@ static struct cmd_t command_defs[] =
|
||||
"/account set <account> nick <nick>",
|
||||
"/account set <account> otr <policy>",
|
||||
"/account set <account> pgpkeyid <pgpkeyid>",
|
||||
"/account set <account> startscript <script>",
|
||||
"/account clear <account> password",
|
||||
"/account clear <account> eval_password",
|
||||
"/account clear <account> server",
|
||||
"/account clear <account> port",
|
||||
"/account clear <account> otr",
|
||||
"/account clear <account> pgpkeyid")
|
||||
"/account clear <account> pgpkeyid",
|
||||
"/account clear <account> startscript")
|
||||
CMD_DESC(
|
||||
"Commands for creating and managing accounts. "
|
||||
"Calling with no arguments will display information for the current account.")
|
||||
@@ -1520,12 +1522,14 @@ static struct cmd_t command_defs[] =
|
||||
{ "set <account> nick <nick>", "The default nickname to use when joining chat rooms." },
|
||||
{ "set <account> otr <policy>", "Override global OTR policy for this account, see /otr." },
|
||||
{ "set <account> pgpkeyid <pgpkeyid>", "Set the ID of the PGP key for this account, see /pgp." },
|
||||
{ "set <account> startscript <script>", "Set the script to execute after connecting." },
|
||||
{ "clear <account> server", "Remove the server setting for this account." },
|
||||
{ "clear <account> port", "Remove the port setting for this account." },
|
||||
{ "clear <account> password", "Remove the password setting for this account." },
|
||||
{ "clear <account> eval_password", "Remove the eval_password setting for this account." },
|
||||
{ "clear <account> otr", "Remove the OTR policy setting for this account." },
|
||||
{ "clear <account> pgpkeyid", "Remove pgpkeyid associated with this account." })
|
||||
{ "clear <account> pgpkeyid", "Remove pgpkeyid associated with this account." },
|
||||
{ "clear <account> startscript", "Remove startscript associated with this account." })
|
||||
CMD_EXAMPLES(
|
||||
"/account add me",
|
||||
"/account set me jid me@chatty",
|
||||
@@ -1915,6 +1919,7 @@ cmd_init(void)
|
||||
autocomplete_add(account_set_ac, "nick");
|
||||
autocomplete_add(account_set_ac, "otr");
|
||||
autocomplete_add(account_set_ac, "pgpkeyid");
|
||||
autocomplete_add(account_set_ac, "startscript");
|
||||
|
||||
account_clear_ac = autocomplete_new();
|
||||
autocomplete_add(account_clear_ac, "password");
|
||||
@@ -1923,6 +1928,7 @@ cmd_init(void)
|
||||
autocomplete_add(account_clear_ac, "port");
|
||||
autocomplete_add(account_clear_ac, "otr");
|
||||
autocomplete_add(account_clear_ac, "pgpkeyid");
|
||||
autocomplete_add(account_clear_ac, "startscript");
|
||||
|
||||
account_default_ac = autocomplete_new();
|
||||
autocomplete_add(account_default_ac, "set");
|
||||
|
||||
@@ -586,6 +586,9 @@ cmd_account(ProfWin *window, const char * const command, gchar **args)
|
||||
cons_show("PGP support is not included in this build.");
|
||||
#endif
|
||||
cons_show("");
|
||||
} else if (strcmp(property, "startscript") == 0) {
|
||||
accounts_set_script_start(account_name, value);
|
||||
cons_show("Updated start script for account %s: %s", account_name, value);
|
||||
} else if (valid_resource_presence_string(property)) {
|
||||
int intval;
|
||||
char *err_msg = NULL;
|
||||
@@ -668,6 +671,10 @@ cmd_account(ProfWin *window, const char * const command, gchar **args)
|
||||
accounts_clear_pgp_keyid(account_name);
|
||||
cons_show("Removed PGP key ID for account %s", account_name);
|
||||
cons_show("");
|
||||
} else if (strcmp(property, "startscript") == 0) {
|
||||
accounts_clear_script_start(account_name);
|
||||
cons_show("Removed start script for account %s", account_name);
|
||||
cons_show("");
|
||||
} else {
|
||||
cons_show("Invalid property: %s", property);
|
||||
cons_show("");
|
||||
|
||||
Reference in New Issue
Block a user