Skip to content

Commit

Permalink
Suppress FADED calls when no one is on frequency
Browse files Browse the repository at this point in the history
  • Loading branch information
dharmab committed Aug 29, 2024
1 parent 8ca9540 commit a7df56a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,12 @@ func (c *controller) Run(ctx context.Context, out chan<- any) {
}
if coalition == c.coalition.Opposite() {
group.SetDeclaration(brevity.Hostile)
log.Info().Stringer("group", group).Msg("broadcasting FADED call")
c.out <- brevity.FadedCall{Group: group}
if c.srsClient.ClientsOnFrequency() > 0 {
log.Info().Stringer("group", group).Msg("broadcasting FADED call")
c.out <- brevity.FadedCall{Group: group}
} else {
log.Debug().Msg("skipping FADED call because no clients are on frequency")
}
}
})

Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/threat.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (c *controller) broadcastThreats() {
}

if len(call.Callsigns) == 0 {
logger.Debug().Msg("skipping threat call because there is no one on frequency to notify")
logger.Debug().Msg("skipping threat call because no relevant clients are on frequency")
continue
}

Expand Down

0 comments on commit a7df56a

Please sign in to comment.