automatically add medias as link if phone does not support mms

This commit is contained in:
osaajani 2021-04-16 20:20:19 +02:00
parent 4cd52ae9ec
commit 878d820dc2
7 changed files with 20 additions and 39 deletions

View file

@ -229,6 +229,18 @@ namespace controllers\internals;
];
}
//If adapter does not support mms and the message is a mms, add medias as link
if (!$adapter::meta_support_mms_sending() && $mms)
{
$media_urls = [];
foreach ($media_uris as $media_uri)
{
$media_urls[] = STATIC_HTTP_URL . '/data/public/' . $media_uri['path'];
}
$text .= "\n" . join(' - ', $media_urls);
}
$response = $adapter->send($destination, $text, $flash, $mms, $media_uris);
if ($response['error'])