syntax = "proto3";

package low_trust_user_treatment;

option go_package = "low_trust_user_treatment";

import "eventbus/owner.proto";

// LowTrustUserTreatmentUpdate is triggered when a moderator or channel owner manually
// alters the LowTrustUserTreatment for a user in a channel.
// Currently all field values are returned with each event.
message LowTrustUserTreatmentUpdate {
  option (eventbus.owner.ldap_group) = "team-safety";
  // The channel of which the low trust user treatment for a user is applied within.
  string broadcaster_user_id = 1;
  // The user who updated the settings
  string requester_user_id = 2;
  // The user whose treatment has been updated
  string target_user_id = 3;
  // The updated treatment for the target user
  LowTrustUserTreatmentChange treatment = 4;
}

// LowTrustUserTreatmentChange represents a state change for a given
// low trust user treatment which follows the eventbus.change.proto scheme.
message LowTrustUserTreatmentChange {
  // Denotes whether the low trust user treatment was changed.
  bool updated = 1;
  // Denotes the current value of the low trust user treatment.
  LowTrustUserTreatmentType value = 2;
  // Denotes whether the previous low trust user treatment is included in the event.
  bool has_old_value = 3;
  // Denotes the previous low trust user treatment value.
  LowTrustUserTreatmentType old_value = 4;
}

// LowTrustUserTreatmentType is comprised of all the possible types
// for a low trust user treatment.
enum LowTrustUserTreatmentType {
  LOW_TRUST_USER_TREATMENT_TYPE_INVALID = 0;
  // The user's chat messages will be actively monitored
  LOW_TRUST_USER_TREATMENT_TYPE_ACTIVE_MONITORING = 1;
  // The user's chat messages will be withheld from chat.
  LOW_TRUST_USER_TREATMENT_TYPE_RESTRICTED = 2;
  // The user will not receive any treatment.
  LOW_TRUST_USER_TREATMENT_TYPE_NO_TREATMENT = 3;
}
