17 $batchComponents = [];
18 $modifier = trim($modifier,
";");
19 if (!is_array($appMessages) ||
count($appMessages) <= 0)
23 foreach ($appMessages as $appID => $tokenMessages)
30 if (
$host = static::getHost())
32 $appBatch[] =
"h={$host}";
34 $appMessagesBatches = [];
35 foreach ($tokenMessages as $token =>
$messages)
40 (!$this->allowEmptyMessage && trim($messageArray[
"MESSAGE"]) ==
'')
41 || !static::shouldBeSent($messageArray)
48 $message = static::getMessageInstance($token);
49 $id = random_int(1, 10000);
51 $message->setFromArray($messageArray);
52 $message->setCustomProperty(
'target', md5($messageArray[
"USER_ID"] . \CMain::GetServerUniqID()));
53 $messageBatch =
$message->getBatch();
54 if(!empty($messageBatch))
56 $appMessagesBatches[] = $messageBatch;
61 if ($appMessagesBatches)
63 array_push($appBatch, ... $appMessagesBatches);
64 array_push($batchComponents, ... $appBatch);
68 if (!empty($batchComponents))
70 $batch =
";".implode(
";", $batchComponents);