Merge branch 'master' into caps

This commit is contained in:
James Booth
2013-01-22 01:39:18 +00:00
4 changed files with 53 additions and 1 deletions

View File

@@ -120,6 +120,7 @@ static gboolean _cmd_set_autoping(gchar **args, struct cmd_help_t help);
static gboolean _cmd_set_titlebar(gchar **args, struct cmd_help_t help);
static gboolean _cmd_set_autoaway(gchar **args, struct cmd_help_t help);
static gboolean _cmd_set_mouse(gchar **args, struct cmd_help_t help);
static gboolean _cmd_set_statuses(gchar **args, struct cmd_help_t help);
static gboolean _cmd_vercheck(gchar **args, struct cmd_help_t help);
static gboolean _cmd_away(gchar **args, struct cmd_help_t help);
static gboolean _cmd_online(gchar **args, struct cmd_help_t help);
@@ -561,6 +562,15 @@ static struct cmd_t setting_commands[] =
"---------------",
"Set priority for the current session.",
"value : Number between -128 and 127. Default value is 0.",
NULL } } },
{ "/statuses",
_cmd_set_statuses, parse_args, 1, 1,
{ "/statuses on|off", "Set notifications for status messages.",
{ "/statuses on|off",
"---------------",
"Set notifications for status messages, such as online/offline or join/part channels.",
"When notifications are off status messages, such as online/offline or join/part, are not displayed.",
NULL } } }
};
@@ -666,6 +676,7 @@ cmd_init(void)
p_autocomplete_add(notify_ac, strdup("message"));
p_autocomplete_add(notify_ac, strdup("typing"));
p_autocomplete_add(notify_ac, strdup("remind"));
p_autocomplete_add(notify_ac, strdup("status"));
sub_ac = p_autocomplete_new();
p_autocomplete_add(sub_ac, strdup("request"));
@@ -939,6 +950,8 @@ _cmd_complete_parameters(char *input, int *size)
prefs_autocomplete_boolean_choice);
_parameter_autocomplete(input, size, "/vercheck",
prefs_autocomplete_boolean_choice);
_parameter_autocomplete(input, size, "/statuses",
prefs_autocomplete_boolean_choice);
if (win_current_is_groupchat()) {
PAutocomplete nick_ac = muc_get_roster_ac(win_current_get_recipient());
@@ -2009,7 +2022,8 @@ _cmd_set_notify(gchar **args, struct cmd_help_t help)
cons_show("Usage: /notify typing on|off");
}
} else { // remind
// set remind setting
} else if (strcmp(kind, "remind") == 0) {
gint period = atoi(value);
prefs_set_notify_remind(period);
if (period == 0) {
@@ -2019,6 +2033,9 @@ _cmd_set_notify(gchar **args, struct cmd_help_t help)
} else {
cons_show("Message reminder period set to %d seconds.", period);
}
} else {
cons_show("Unknown command: %s.", kind);
}
return TRUE;
@@ -2159,6 +2176,13 @@ _cmd_set_priority(gchar **args, struct cmd_help_t help)
return TRUE;
}
static gboolean
_cmd_set_statuses(gchar **args, struct cmd_help_t help)
{
return _cmd_set_boolean_preference(args[0], help,
"Status notifications", prefs_set_statuses);
}
static gboolean
_cmd_vercheck(gchar **args, struct cmd_help_t help)
{