From badfda68523cd35778895e1d1311fa90dec623bf Mon Sep 17 00:00:00 2001 From: gzydong <837215079@qq.com> Date: Fri, 23 Jul 2021 22:52:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Service/TalkService.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/app/Service/TalkService.php b/app/Service/TalkService.php index 921e80f..ea7bd45 100644 --- a/app/Service/TalkService.php +++ b/app/Service/TalkService.php @@ -82,19 +82,19 @@ class TalkService extends BaseService $rows = $rowsSqlObj->orderBy('talk_records.id', 'desc')->limit($limit)->get()->toArray(); - if ($record_id === 0 && $talk_type == TalkModeConstant::PRIVATE_CHAT) { - if (!di()->get(UserFriendService::class)->isFriend($user_id, $receiver_id, true)) { - array_unshift($rows, [ - 'id' => ($rows[0]['id'] ?? 0) + 1, - 'talk_type' => TalkModeConstant::PRIVATE_CHAT, - 'msg_type' => TalkMessageType::SYSTEM_TEXT_MESSAGE, - 'user_id' => 0, - 'receiver_id' => $user_id, - 'content' => '你与对方已解除好友关系,系统已禁止发送消息!', - 'created_at' => date('Y-m-d H:i:s'), - ]); - } - } + //if ($record_id === 0 && $talk_type == TalkModeConstant::PRIVATE_CHAT) { + // if (!di()->get(UserFriendService::class)->isFriend($user_id, $receiver_id, true)) { + // array_unshift($rows, [ + // 'id' => ($rows[0]['id'] ?? 0) + 1, + // 'talk_type' => TalkModeConstant::PRIVATE_CHAT, + // 'msg_type' => TalkMessageType::SYSTEM_TEXT_MESSAGE, + // 'user_id' => 0, + // 'receiver_id' => $user_id, + // 'content' => '你与对方已解除好友关系,系统已禁止发送消息!', + // 'created_at' => date('Y-m-d H:i:s'), + // ]); + // } + //} return di()->get(FormatMessageService::class)->handleChatRecords($rows); }