mirror of
https://github.com/mastodon/mastodon.git
synced 2025-07-12 15:33:14 +00:00
Compare commits
4 Commits
845fe1c693
...
8c0ff6498e
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8c0ff6498e | ||
![]() |
a40831b363 | ||
![]() |
07d222665b | ||
![]() |
2c7eed1fa1 |
|
@ -3,7 +3,5 @@ import type { ApiRelationshipJSON } from 'mastodon/api_types/relationships';
|
|||
|
||||
export const apiSubmitAccountNote = (id: string, value: string) =>
|
||||
apiRequestPost<ApiRelationshipJSON>(`v1/accounts/${id}/note`, {
|
||||
data: {
|
||||
comment: value,
|
||||
},
|
||||
comment: value,
|
||||
});
|
||||
|
|
|
@ -3,9 +3,7 @@ import type { Status, StatusVisibility } from 'mastodon/models/status';
|
|||
|
||||
export const apiReblog = (statusId: string, visibility: StatusVisibility) =>
|
||||
apiRequestPost<{ reblog: Status }>(`v1/statuses/${statusId}/reblog`, {
|
||||
data: {
|
||||
visibility,
|
||||
},
|
||||
visibility,
|
||||
});
|
||||
|
||||
export const apiUnreblog = (statusId: string) =>
|
||||
|
|
|
@ -6,7 +6,4 @@ export const apiGetNotificationPolicy = () =>
|
|||
|
||||
export const apiUpdateNotificationsPolicy = (
|
||||
policy: Partial<NotificationPolicyJSON>,
|
||||
) =>
|
||||
apiRequestPut<NotificationPolicyJSON>('/v1/notifications/policy', {
|
||||
data: policy,
|
||||
});
|
||||
) => apiRequestPut<NotificationPolicyJSON>('/v1/notifications/policy', policy);
|
||||
|
|
|
@ -56,11 +56,11 @@ $account-background-color: $white !default;
|
|||
|
||||
$emojis-requiring-inversion: 'chains';
|
||||
|
||||
.theme-mastodon-light {
|
||||
body {
|
||||
--dropdown-border-color: #d9e1e8;
|
||||
--dropdown-background-color: #fff;
|
||||
--background-border-color: #d9e1e8;
|
||||
--background-color: #fff;
|
||||
--background-color-tint: rgba(255, 255, 255, 90%);
|
||||
--background-color-tint: rgba(255, 255, 255, 80%);
|
||||
--background-filter: blur(10px);
|
||||
}
|
||||
|
|
|
@ -28,9 +28,7 @@ class AccountSearchService < BaseService
|
|||
},
|
||||
|
||||
functions: [
|
||||
reputation_score_function,
|
||||
followers_score_function,
|
||||
time_distance_function,
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -81,36 +79,12 @@ class AccountSearchService < BaseService
|
|||
}
|
||||
end
|
||||
|
||||
# This function deranks accounts that follow more people than follow them
|
||||
def reputation_score_function
|
||||
{
|
||||
script_score: {
|
||||
script: {
|
||||
source: "(Math.max(doc['followers_count'].value, 0) + 0.0) / (Math.max(doc['followers_count'].value, 0) + Math.max(doc['following_count'].value, 0) + 1)",
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
# This function promotes accounts that have more followers
|
||||
def followers_score_function
|
||||
{
|
||||
script_score: {
|
||||
script: {
|
||||
source: "(Math.max(doc['followers_count'].value, 0) / (Math.max(doc['followers_count'].value, 0) + 1))",
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
# This function deranks accounts that haven't posted in a long time
|
||||
def time_distance_function
|
||||
{
|
||||
gauss: {
|
||||
last_status_at: {
|
||||
scale: '30d',
|
||||
offset: '30d',
|
||||
decay: 0.3,
|
||||
source: "Math.log10((Math.max(doc['followers_count'].value, 0) + 1))",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -126,10 +100,24 @@ class AccountSearchService < BaseService
|
|||
|
||||
def core_query
|
||||
{
|
||||
multi_match: {
|
||||
query: @query,
|
||||
type: 'bool_prefix',
|
||||
fields: %w(username^2 username.*^2 display_name display_name.*),
|
||||
dis_max: {
|
||||
queries: [
|
||||
{
|
||||
multi_match: {
|
||||
query: @query,
|
||||
type: 'most_fields',
|
||||
fields: %w(username username.*),
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
multi_match: {
|
||||
query: @query,
|
||||
type: 'most_fields',
|
||||
fields: %w(display_name display_name.*),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
end
|
||||
|
@ -142,7 +130,7 @@ class AccountSearchService < BaseService
|
|||
{
|
||||
multi_match: {
|
||||
query: @query,
|
||||
type: 'most_fields',
|
||||
type: 'best_fields',
|
||||
fields: %w(username^2 display_name^2 text text.*),
|
||||
operator: 'and',
|
||||
},
|
||||
|
|
12
yarn.lock
12
yarn.lock
|
@ -17151,22 +17151,22 @@ __metadata:
|
|||
linkType: hard
|
||||
|
||||
"typescript@npm:5, typescript@npm:^5.0.4":
|
||||
version: 5.4.5
|
||||
resolution: "typescript@npm:5.4.5"
|
||||
version: 5.5.2
|
||||
resolution: "typescript@npm:5.5.2"
|
||||
bin:
|
||||
tsc: bin/tsc
|
||||
tsserver: bin/tsserver
|
||||
checksum: 10c0/2954022ada340fd3d6a9e2b8e534f65d57c92d5f3989a263754a78aba549f7e6529acc1921913560a4b816c46dce7df4a4d29f9f11a3dc0d4213bb76d043251e
|
||||
checksum: 10c0/8ca39b27b5f9bd7f32db795045933ab5247897660627251e8254180b792a395bf061ea7231947d5d7ffa5cb4cc771970fd4ef543275f9b559f08c9325cccfce3
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"typescript@patch:typescript@npm%3A5#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.0.4#optional!builtin<compat/typescript>":
|
||||
version: 5.4.5
|
||||
resolution: "typescript@patch:typescript@npm%3A5.4.5#optional!builtin<compat/typescript>::version=5.4.5&hash=5adc0c"
|
||||
version: 5.5.2
|
||||
resolution: "typescript@patch:typescript@npm%3A5.5.2#optional!builtin<compat/typescript>::version=5.5.2&hash=379a07"
|
||||
bin:
|
||||
tsc: bin/tsc
|
||||
tsserver: bin/tsserver
|
||||
checksum: 10c0/db2ad2a16ca829f50427eeb1da155e7a45e598eec7b086d8b4e8ba44e5a235f758e606d681c66992230d3fc3b8995865e5fd0b22a2c95486d0b3200f83072ec9
|
||||
checksum: 10c0/a7b7ede75dc7fc32a76d0d0af6b91f5fbd8620890d84c906f663d8783bf3de6d7bd50f0430b8bb55eac88a38934af847ff709e7156e5138b95ae94cbd5f73e5b
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user