Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dima Krasner
Sharkey
Commits
7ff8fb02
Commit
7ff8fb02
authored
5 years ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
Fix #4731
parent
d672bb46
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/server/api/common/generate-mute-query.ts
+5
-1
5 additions, 1 deletion
src/server/api/common/generate-mute-query.ts
src/server/api/endpoints/users/notes.ts
+1
-1
1 addition, 1 deletion
src/server/api/endpoints/users/notes.ts
with
6 additions
and
2 deletions
src/server/api/common/generate-mute-query.ts
+
5
−
1
View file @
7ff8fb02
...
...
@@ -2,11 +2,15 @@ import { User } from '../../../models/entities/user';
import
{
Mutings
}
from
'
../../../models
'
;
import
{
SelectQueryBuilder
,
Brackets
}
from
'
typeorm
'
;
export
function
generateMuteQuery
(
q
:
SelectQueryBuilder
<
any
>
,
me
:
User
)
{
export
function
generateMuteQuery
(
q
:
SelectQueryBuilder
<
any
>
,
me
:
User
,
exclude
?:
User
)
{
const
mutingQuery
=
Mutings
.
createQueryBuilder
(
'
muting
'
)
.
select
(
'
muting.muteeId
'
)
.
where
(
'
muting.muterId = :muterId
'
,
{
muterId
:
me
.
id
});
if
(
exclude
)
{
mutingQuery
.
andWhere
(
'
muting.muteeId != :excludeId
'
,
{
excludeId
:
exclude
.
id
});
}
// 投稿の作者をミュートしていない かつ
// 投稿の返信先の作者をミュートしていない かつ
// 投稿の引用元の作者をミュートしていない
...
...
This diff is collapsed.
Click to expand it.
src/server/api/endpoints/users/notes.ts
+
1
−
1
View file @
7ff8fb02
...
...
@@ -134,7 +134,7 @@ export default define(meta, async (ps, me) => {
.
leftJoinAndSelect
(
'
note.user
'
,
'
user
'
);
if
(
me
)
generateVisibilityQuery
(
query
,
me
);
if
(
me
)
generateMuteQuery
(
query
,
me
);
if
(
me
)
generateMuteQuery
(
query
,
me
,
user
);
if
(
ps
.
withFiles
)
{
query
.
andWhere
(
'
note.fileIds !=
\'
{}
\'
'
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment