Skip to content

Commit

Permalink
alertbox: Show the alert label in simulation mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosuav committed Nov 25, 2024
1 parent 696f7d9 commit fd75af9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/http/chan_alertbox.pike
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,13 @@ __async__ mapping message_params(object channel, mapping person, [string alert,
if (!alert || alert == "") error("Need an alert type\n");
mapping cfg = await(G->G->DB->load_config(channel->userid, "alertbox"));
if (!valid_alert_type(alert, cfg)) error("Unknown alert type\n");
if (msgcfg->simulate) {msgcfg->simulate("Send alert " + alert); return ([]);}
if (msgcfg->simulate) {
string label = alert;
foreach (ALERTTYPES + (cfg->personals || ({ })), mapping a)
if (a->id == alert) label = a->label;
msgcfg->simulate("Send alert " + label);
return ([]);
}
mapping emotes = ([]);
//TODO: If text isn't exactly %s but is contained in it, give an offset.
//TODO: If %s is contained in text, parse that somehow too.
Expand Down

0 comments on commit fd75af9

Please sign in to comment.