method getMessages documentation in bbn\Appui\Chat

Deprecated??

Returns messages from the given chat sent after $last.

function($id_chat, $last = NULL, $day = NULL) { $res = ['success' => false, 'last' => null, 'messages' => []]; if ($this->check()) { $dir = bbn\Mvc::getUserDataPath($this->user->getId(), 'appui-chat').$id_chat.'/'.($day ?: date('Y-m-d')); if ($this->isParticipant($id_chat) && is_dir($dir)) { $res['success'] = true; $files = bbn\File\Dir::getFiles($dir); foreach ($files as $file){ $time = (float)X::basename($file, '.msg'); if ((!$last || X::compareFloats($time, $last, '>')) && ($st = file_get_contents($file))) { $res['messages'][] = json_decode(bbn\Util\Enc::decrypt($st), true); } } if (isset($time)) { $res['last'] = $time; } } } return $res; }

Deprecated?? 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.