fix title
This commit is contained in:
@@ -57,6 +57,10 @@ TXT;
|
||||
*/
|
||||
public function scheduleBroadcastIfEligible(): void
|
||||
{
|
||||
if (! $this->hasPriceChannelAccess()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (! $this->config->getBool('price_channel_enabled', false)) {
|
||||
return;
|
||||
}
|
||||
@@ -81,6 +85,10 @@ TXT;
|
||||
public function broadcastIfEligible(): void
|
||||
{
|
||||
try {
|
||||
if (! $this->hasPriceChannelAccess()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (! $this->config->getBool('price_channel_enabled', false)) {
|
||||
return;
|
||||
}
|
||||
@@ -202,6 +210,10 @@ TXT;
|
||||
public function broadcastAfterTemplateChange(): void
|
||||
{
|
||||
try {
|
||||
if (! $this->hasPriceChannelAccess()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (! $this->config->getBool('price_channel_enabled', false)) {
|
||||
return;
|
||||
}
|
||||
@@ -323,7 +335,7 @@ TXT;
|
||||
'selected' => $isSelected,
|
||||
'has_token' => $token !== '',
|
||||
'destinations' => $chatIds,
|
||||
'will_send' => $isSelected && $token !== '' && $chatIds !== [],
|
||||
'will_send' => $this->hasPriceChannelAccess() && $isSelected && $token !== '' && $chatIds !== [],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -333,6 +345,7 @@ TXT;
|
||||
$display = $trade !== null ? $this->computeDisplayPrices() : null;
|
||||
|
||||
return [
|
||||
'access' => $this->hasPriceChannelAccess(),
|
||||
'enabled' => $this->config->getBool('price_channel_enabled', false),
|
||||
'selected_messengers' => $selected,
|
||||
'min_seconds' => $this->config->getInt('price_channel_min_seconds', 120),
|
||||
@@ -850,6 +863,11 @@ TXT;
|
||||
}
|
||||
|
||||
/** @return array<int, string> */
|
||||
private function hasPriceChannelAccess(): bool
|
||||
{
|
||||
return $this->config->getBool('price_channel_access', false);
|
||||
}
|
||||
|
||||
private function parseList(string $raw): array
|
||||
{
|
||||
$parts = preg_split('/[,\n]+/', trim($raw)) ?: [];
|
||||
|
||||
Reference in New Issue
Block a user