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
5b4205bd
Unverified
Commit
5b4205bd
authored
6 years ago
by
syuilo
Browse files
Options
Downloads
Plain Diff
Merge branch 'develop' of
https://github.com/syuilo/misskey
into develop
parents
20cf2b3f
3c0d2db3
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/prelude/array.ts
+6
-2
6 additions, 2 deletions
src/prelude/array.ts
src/remote/activitypub/models/note.ts
+2
-2
2 additions, 2 deletions
src/remote/activitypub/models/note.ts
with
8 additions
and
4 deletions
src/prelude/array.ts
+
6
−
2
View file @
5b4205bd
...
...
@@ -18,8 +18,12 @@ export function erase<T>(x: T, xs: T[]): T[] {
return
xs
.
filter
(
y
=>
x
!==
y
);
}
export
function
setDifference
<
T
>
(
xs
:
T
[],
ys
:
T
[]):
T
[]
{
return
xs
.
filter
(
x
=>
!
ys
.
includes
(
x
));
/**
* Finds the array of all elements in the first array not contained in the second array.
* The order of result values are determined by the first array.
*/
export
function
difference
<
T
>
(
includes
:
T
[],
excludes
:
T
[]):
T
[]
{
return
includes
.
filter
(
x
=>
!
excludes
.
includes
(
x
));
}
export
function
unique
<
T
>
(
xs
:
T
[]):
T
[]
{
...
...
This diff is collapsed.
Click to expand it.
src/remote/activitypub/models/note.ts
+
2
−
2
View file @
5b4205bd
...
...
@@ -13,7 +13,7 @@ import htmlToMFM from '../../../mfm/html-to-mfm';
import
Emoji
from
'
../../../models/emoji
'
;
import
{
ITag
}
from
'
./tag
'
;
import
{
toUnicode
}
from
'
punycode
'
;
import
{
unique
,
concat
,
setD
ifference
}
from
'
../../../prelude/array
'
;
import
{
unique
,
concat
,
d
ifference
}
from
'
../../../prelude/array
'
;
const
log
=
debug
(
'
misskey:activitypub
'
);
...
...
@@ -181,7 +181,7 @@ async function extractEmojis(tags: ITag[], host_: string) {
async
function
extractMentionedUsers
(
actor
:
IRemoteUser
,
to
:
string
[],
cc
:
string
[],
resolver
:
Resolver
)
{
const
ignoreUris
=
[
'
https://www.w3.org/ns/activitystreams#Public
'
,
`
${
actor
.
uri
}
/followers`
];
const
uris
=
setD
ifference
(
unique
(
concat
([
to
||
[],
cc
||
[]])),
ignoreUris
);
const
uris
=
d
ifference
(
unique
(
concat
([
to
||
[],
cc
||
[]])),
ignoreUris
);
const
users
=
await
Promise
.
all
(
uris
.
map
(
async
uri
=>
await
resolvePerson
(
uri
,
null
,
resolver
).
catch
(()
=>
null
))
...
...
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