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
e4144a17
Commit
e4144a17
authored
2 years ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
fix(server): アンテナタイムライン(ストリーミング)が、フォローしていないユーザーの鍵投稿も拾ってしまう問題を修正
Fix #9025
parent
3cfd0175
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
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
packages/backend/src/core/AntennaService.ts
+6
-14
6 additions, 14 deletions
packages/backend/src/core/AntennaService.ts
with
7 additions
and
14 deletions
CHANGELOG.md
+
1
−
0
View file @
e4144a17
...
...
@@ -102,6 +102,7 @@ You should also include the user name that made the change.
-
Server: Escape SQL LIKE @mei23
-
Server: 特定のPNG画像のアップロードに失敗する問題を修正 @usbharu
-
Server: 非公開のクリップのURLでOGPレンダリングされる問題を修正 @syuilo
-
Server: アンテナタイムライン(ストリーミング)が、フォローしていないユーザーの鍵投稿も拾ってしまう @syuilo
-
Client: case insensitive emoji search @saschanaz
-
Client: InAppウィンドウが操作できなくなることがあるのを修正 @tamaina
-
Client: use proxied image for instance icon @syuilo
...
...
This diff is collapsed.
Click to expand it.
packages/backend/src/core/AntennaService.ts
+
6
−
14
View file @
e4144a17
...
...
@@ -15,8 +15,8 @@ import type { Packed } from '@/misc/schema.js';
import
{
DI
}
from
'
@/di-symbols.js
'
;
import
type
{
MutingsRepository
,
BlockingsRepository
,
NotesRepository
,
AntennaNotesRepository
,
AntennasRepository
,
UserGroupJoiningsRepository
,
UserListJoiningsRepository
}
from
'
@/models/index.js
'
;
import
{
UtilityService
}
from
'
@/core/UtilityService.js
'
;
import
type
{
OnApplicationShutdown
}
from
'
@nestjs/common
'
;
import
{
bindThis
}
from
'
@/decorators.js
'
;
import
type
{
OnApplicationShutdown
}
from
'
@nestjs/common
'
;
@
Injectable
()
export
class
AntennaService
implements
OnApplicationShutdown
{
...
...
@@ -135,7 +135,7 @@ export class AntennaService implements OnApplicationShutdown {
this
.
globalEventServie
.
publishMainStream
(
antenna
.
userId
,
'
unreadAntenna
'
,
antenna
);
this
.
pushNotificationService
.
pushNotification
(
antenna
.
userId
,
'
unreadAntennaNote
'
,
{
antenna
:
{
id
:
antenna
.
id
,
name
:
antenna
.
name
},
note
:
await
this
.
noteEntityService
.
pack
(
note
)
note
:
await
this
.
noteEntityService
.
pack
(
note
)
,
});
}
},
2000
);
...
...
@@ -144,27 +144,19 @@ export class AntennaService implements OnApplicationShutdown {
// NOTE: フォローしているユーザーのノート、リストのユーザーのノート、グループのユーザーのノート指定はパフォーマンス上の理由で無効になっている
/**
* noteUserFollowers / antennaUserFollowing はどちらか一方が指定されていればよい
*/
@
bindThis
public
async
checkHitAntenna
(
antenna
:
Antenna
,
note
:
(
Note
|
Packed
<
'
Note
'
>
),
noteUser
:
{
id
:
User
[
'
id
'
];
username
:
string
;
host
:
string
|
null
;
}
,
noteUserFollowers
?:
User
[
'
id
'
][],
antennaUserFollowing
?:
User
[
'
id
'
][]
):
Promise
<
boolean
>
{
public
async
checkHitAntenna
(
antenna
:
Antenna
,
note
:
(
Note
|
Packed
<
'
Note
'
>
),
noteUser
:
{
id
:
User
[
'
id
'
];
username
:
string
;
host
:
string
|
null
;
}):
Promise
<
boolean
>
{
if
(
note
.
visibility
===
'
specified
'
)
return
false
;
if
(
note
.
visibility
===
'
followers
'
)
return
false
;
// アンテナ作成者がノート作成者にブロックされていたらスキップ
const
blockings
=
await
this
.
blockingCache
.
fetch
(
noteUser
.
id
,
()
=>
this
.
blockingsRepository
.
findBy
({
blockerId
:
noteUser
.
id
}).
then
(
res
=>
res
.
map
(
x
=>
x
.
blockeeId
)));
if
(
blockings
.
some
(
blocking
=>
blocking
===
antenna
.
userId
))
return
false
;
if
(
note
.
visibility
===
'
followers
'
)
{
if
(
noteUserFollowers
&&
!
noteUserFollowers
.
includes
(
antenna
.
userId
))
return
false
;
if
(
antennaUserFollowing
&&
!
antennaUserFollowing
.
includes
(
note
.
userId
))
return
false
;
}
if
(
!
antenna
.
withReplies
&&
note
.
replyId
!=
null
)
return
false
;
if
(
antenna
.
src
===
'
home
'
)
{
if
(
noteUserFollowers
&&
!
noteUserFollowers
.
includes
(
antenna
.
userId
))
return
false
;
if
(
antennaUserFollowing
&&
!
antennaUserFollowing
.
includes
(
note
.
userId
))
return
false
;
// TODO
}
else
if
(
antenna
.
src
===
'
list
'
)
{
const
listUsers
=
(
await
this
.
userListJoiningsRepository
.
findBy
({
userListId
:
antenna
.
userListId
!
,
...
...
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