[Feature] Add Rule to Limit Task Update Messages (#4459)

* [Feature] Add Rule to Limit Task Update Messages

* Update task_client_state.cpp

* Update task_client_state.cpp

* Change rule
This commit is contained in:
Alex King
2024-08-27 21:49:07 -04:00
committed by GitHub
parent ff16a76481
commit 39876ab858
2 changed files with 7 additions and 1 deletions
+6 -1
View File
@@ -869,7 +869,12 @@ int ClientTaskState::IncrementDoneCount(
if (task_data->type != TaskType::Shared) {
// live messages for each increment of non-shared tasks
auto activity_type = task_data->activity_information[activity_id].activity_type;
int msg_count = activity_type == TaskActivityType::GiveCash ? 1 : count;
int msg_count = 1;
if (activity_type != TaskActivityType::GiveCash) {
msg_count = std::min(count, RuleI(TaskSystem, MaxUpdateMessages));
}
for (int i = 0; i < msg_count; ++i) {
client->MessageString(Chat::DefaultText, TASK_UPDATED, task_data->title.c_str());
}