Убрал send в чат из user::class. Убрал лишние вызовы.
This commit is contained in:
+4
-20
@@ -317,21 +317,14 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
|
||||
|
||||
} else {
|
||||
//Записываем данные
|
||||
$msg['time'] = time();
|
||||
$msg['spam'] = 0;
|
||||
$msg['type'] = 1;
|
||||
$msg['toChat'] = 0;
|
||||
$msg['color'] = 'Black';
|
||||
$msg['typeTime'] = 0;
|
||||
$msg['sound'] = 0;
|
||||
$msg['global'] = 0;
|
||||
$msg['molch'] = 0;
|
||||
$msg['login'] = $u->info['login'];
|
||||
|
||||
$msg['cancel'] = 0;
|
||||
$msg['delete'] = 0;
|
||||
$msg['to'] = '';
|
||||
$msg['da'] = 0;
|
||||
$msg['color'] = $u->info['chatColor'];
|
||||
|
||||
//Нормируем типы сообщений
|
||||
if (preg_match("/private\[(.*?)\]/", $_POST['msg'], $msg['to'])) {
|
||||
@@ -354,11 +347,8 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
|
||||
$_POST['msg'] = str_replace('to [' . $msg['to'] . ']', ' ', $_POST['msg']);
|
||||
}
|
||||
if ($u->info['admin'] == 0) { //ТУТ SPAM
|
||||
if ($msg['to'] != '' && !isset($admq['id'])) {
|
||||
if ($msg['to'] != '' && !isset($admq['id']) && $msg['type'] == 3) {
|
||||
$admq = Db::getRow('select id, admin from users where login = ? and admin > 0', [$msg['to']]);
|
||||
if ($msg['type'] != 3) {
|
||||
unset($admq);
|
||||
}
|
||||
}
|
||||
if (!isset($admq['id'])) {
|
||||
$msg['fspam'] = $filter->spamFiltr(str_replace('точка', '.', str_replace('ру', 'ru', $_POST['msg'])));
|
||||
@@ -507,25 +497,19 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
|
||||
$i++;
|
||||
}
|
||||
|
||||
//todo: внимательно перебрать логику, возможно есть ненужные\дефолтные поля.
|
||||
$cmsg = new ChatMessage();
|
||||
$cmsg->setInvis($u->info['invis']);
|
||||
$cmsg->setDa($msg['da']);
|
||||
$cmsg->setDelete($msg['delete']);
|
||||
$cmsg->setMolch($msg['molch']);
|
||||
$cmsg->setLogin($msg['login']);
|
||||
$cmsg->setLogin($u->info['login']);
|
||||
$cmsg->setTo($msg['to']);
|
||||
$cmsg->setCity($u->info['city']);
|
||||
$cmsg->setRoom($u->info['room']);
|
||||
$cmsg->setTime($msg['time']);
|
||||
$cmsg->setType($msg['type']);
|
||||
$cmsg->setSpam($msg['spam']);
|
||||
$cmsg->setText($_POST['msg']);
|
||||
$cmsg->setToChat($msg['toChat']);
|
||||
$cmsg->setColor($msg['color']);
|
||||
$cmsg->setTypeTime($msg['typeTime']);
|
||||
$cmsg->setSound($msg['sound']);
|
||||
$cmsg->setGlobal($msg['global']);
|
||||
$cmsg->setColor($u->info['chatColor']);
|
||||
$chat->sendMsg($cmsg);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user