Skip to content

Commit

Permalink
Fix dynamic GIF redeem updating - had the silly thing in reverse
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosuav committed Nov 5, 2023
1 parent 536da37 commit 9b13149
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions modules/http/chan_alertbox.pike
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,6 @@ void websocket_cmd_auditlog(mapping(string:mixed) conn, mapping(string:mixed) ms


//Update the magic variable $nonhiddengifredeems$
//TODO: Support hidden redeems which won't be in this list
void update_gif_variants(object channel) {
mapping cfg = persist_status->path("alertbox", (string)channel->userid);
array kwd = ({ });
Expand Down Expand Up @@ -1210,7 +1209,7 @@ void copy_stock(mapping alertconfigs, string basetype) {
if (sock_reply) conn->sock->send_text(Standards.JSON.encode(sock_reply, 4));
if (!hosts_were_active) {
//Host alerts may have just been activated. Make sure we have a backend.
werror("ALERTBOX: Hosts weren't active for %O/%O\n", channel->name[1..], channel->userid);
//werror("ALERTBOX: Hosts weren't active for %O/%O\n", channel->name[1..], channel->userid);
ensure_host_connection(channel->name[1..]);
}
}
Expand Down
4 changes: 2 additions & 2 deletions modules/pointsmgr.pike
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ multiset pending_update_alls = (<>);
continue Concurrent.Future update_all_rewards(object channel) {
pending_update_alls[channel->userid] = 0;
foreach (channel->config->dynamic_rewards || ([]); string rewardid; mapping rwd)
yield((object)update_dynamic_reward(channel, rewardid));
yield(update_dynamic_reward(channel, rewardid));
}

@hook_variable_changed: void notify_rewards(object channel, string varname, string newval) {
//TODO: Figure out which rewards might have changed (ie which are affected by
//the variable that changed) and update only those.
if (channel->config->dynamic_rewards) return;
if (!channel->config->dynamic_rewards) return;
if (pending_update_alls[channel->userid]) return; //If multiple variables are updated all at once, do just one batch of updates at the end
pending_update_alls[channel->userid] = 1;
call_out(spawn_task, 0, update_all_rewards(channel));
Expand Down

0 comments on commit 9b13149

Please sign in to comment.