Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaifan committed Dec 25, 2023
1 parent 865dc61 commit 8a7e80f
Show file tree
Hide file tree
Showing 81 changed files with 993 additions and 968 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

All notable changes to this project will be documented in this file.

## [0.33.58]

### Bug Fixes

- 修复已知问题

### Performance

- 优化会话列表

## [0.33.54]

### Bug Fixes
Expand All @@ -27,6 +37,7 @@ All notable changes to this project will be documented in this file.

- 更新导致的小问题
- 更新导致的小问题
- 版本验证有问题,先干掉

### Performance

Expand All @@ -36,7 +47,6 @@ All notable changes to this project will be documented in this file.

### Bug Fixes

- 版本验证有问题,先干掉
- Android 无法回删输入框内的@(mention)内容
- Android 长按重复事件
- 合并修复
Expand Down
2 changes: 2 additions & 0 deletions app/Http/Controllers/Api/DialogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ public function one()
->where('u.userid', $user->userid)
->first();
if (empty($item)) {
WebSocketDialogMsgRead::forceRead($dialog_id, $user->userid);
return Base::retError('会话不存在或已被删除', ['dialog_id' => $dialog_id], -4003);
}
return Base::retSuccess('success', $item->formatData($user->userid));
Expand Down Expand Up @@ -1738,6 +1739,7 @@ public function group__edit()
$user->checkAdmin();
$dialog = WebSocketDialog::find($dialog_id);
if (empty($dialog)) {
WebSocketDialogMsgRead::forceRead($dialog_id, $user->userid);
return Base::retError('对话不存在或已被删除', ['dialog_id' => $dialog_id], -4003);
}
} else {
Expand Down
1 change: 1 addition & 0 deletions app/Models/WebSocketDialog.php
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ public static function checkDialog($dialog_id, $checkOwner = false)
return $dialog;
}
if (!WebSocketDialogUser::whereDialogId($dialog->id)->whereUserid($userid)->exists()) {
WebSocketDialogMsgRead::forceRead($dialog_id, $userid);
throw new ApiException('不在成员列表内', ['dialog_id' => $dialog_id], -4003);
}
return $dialog;
Expand Down
14 changes: 14 additions & 0 deletions app/Models/WebSocketDialogMsgRead.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@ public function webSocketDialogMsg(): \Illuminate\Database\Eloquent\Relations\Ha
return $this->hasOne(WebSocketDialogMsg::class, 'id', 'msg_id');
}

/**
* 强制标记成阅读
* @param $dialogId
* @param $userId
* @return void
*/
public static function forceRead($dialogId, $userId)
{
self::whereDialogId($dialogId)
->whereUserid($userId)
->whereNull('read_at')
->update(['read_at' => Carbon::now()]);
}

/**
* 仅标记成阅读
* @param $list
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "DooTask",
"version": "0.33.54",
"version": "0.33.58",
"description": "DooTask is task management system.",
"scripts": {
"start": "./cmd dev",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Loading

0 comments on commit 8a7e80f

Please sign in to comment.