method hasOldMessages documentation in bbn\Appui\Chat
function(string $id_chat, $moment)
{
if ($this->check()) {
$cdir = bbn\Mvc::getUserDataPath($this->user->getId(), 'appui-chat').$id_chat.'/';
if ($this->isParticipant($id_chat) && is_dir($cdir)) {
$dir = $cdir . date('Y-m-d', $moment);
$files = \bbn\File\Dir::getFiles($dir);
foreach ($files as $file){
$time = round((float)X::basename($file, '.msg'), 4);
if (X::compareFloats($time, $moment, '<') && ($st = file_get_contents($file))) {
return true;
}
}
$dirs = \bbn\File\Dir::getDirs($cdir);
foreach ($dirs as $d){
if ((X::basename($d) < date('Y-m-d', $moment)) && !empty(\bbn\File\Dir::getFiles($d))) {
return true;
}
}
}
}
return false;
}
BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2023
BBN Solutions