update reception code to split sms every 1000 chars

This commit is contained in:
osaajani 2021-04-27 00:23:40 +02:00
parent 4430d95d40
commit b833d76380
1 changed files with 27 additions and 22 deletions

View File

@ -306,6 +306,10 @@ namespace controllers\internals;
}
}
//Cut received messages by 1000 chars max
$text_parts = mb_str_split($text, 1000);
foreach ($text_parts as $text)
{
$received_id = $this->create($id_user, $id_phone, $at, $text, $origin, $status, $is_command, $mms, $media_ids);
if (!$received_id)
{
@ -331,6 +335,7 @@ namespace controllers\internals;
$internal_user = new User($this->bdd);
$internal_user->transfer_received($id_user, $received);
}
return $return;
}