add: move new block feature to a setting
This commit is contained in:
parent
d6348f7d67
commit
d90b08720a
4 changed files with 32 additions and 6 deletions
|
@ -354,7 +354,11 @@ macro_rules! ignore_users_gen {
|
|||
[
|
||||
$data
|
||||
.0
|
||||
.get_userblocks_receivers(ua.id, &ua.associated)
|
||||
.get_userblocks_receivers(
|
||||
ua.id,
|
||||
&ua.associated,
|
||||
ua.settings.hide_associated_blocked_users,
|
||||
)
|
||||
.await,
|
||||
$data.0.get_userblocks_initiator_by_receivers(ua.id).await,
|
||||
$data.0.get_user_stack_blocked_users(ua.id).await,
|
||||
|
@ -369,7 +373,11 @@ macro_rules! ignore_users_gen {
|
|||
[
|
||||
$data
|
||||
.0
|
||||
.get_userblocks_receivers($user.id, &$user.associated)
|
||||
.get_userblocks_receivers(
|
||||
$user.id,
|
||||
&$user.associated,
|
||||
$user.settings.hide_associated_blocked_users,
|
||||
)
|
||||
.await,
|
||||
$data
|
||||
.0
|
||||
|
@ -383,7 +391,11 @@ macro_rules! ignore_users_gen {
|
|||
($user:ident!, #$data:ident) => {
|
||||
[
|
||||
$data
|
||||
.get_userblocks_receivers($user.id, &$user.associated)
|
||||
.get_userblocks_receivers(
|
||||
$user.id,
|
||||
&$user.associated,
|
||||
$user.settings.hide_associated_blocked_users,
|
||||
)
|
||||
.await,
|
||||
$data.get_userblocks_initiator_by_receivers($user.id).await,
|
||||
]
|
||||
|
|
|
@ -1519,6 +1519,14 @@
|
|||
\"{{ profile.settings.all_timeline_hide_answers }}\",
|
||||
\"checkbox\",
|
||||
],
|
||||
[
|
||||
[
|
||||
\"hide_associated_blocked_users\",
|
||||
\"Hide users that you've blocked on your other accounts from timelines.\",
|
||||
],
|
||||
\"{{ profile.settings.hide_associated_blocked_users }}\",
|
||||
\"checkbox\",
|
||||
],
|
||||
[[], \"Questions\", \"title\"],
|
||||
[
|
||||
[
|
||||
|
|
|
@ -89,12 +89,15 @@ impl DataManager {
|
|||
&self,
|
||||
initiator: usize,
|
||||
associated: &Vec<usize>,
|
||||
do_associated: bool,
|
||||
) -> Vec<usize> {
|
||||
let mut associated_str = String::new();
|
||||
|
||||
if do_associated {
|
||||
for id in associated {
|
||||
associated_str.push_str(&(" OR initiator = ".to_string() + &id.to_string()));
|
||||
}
|
||||
}
|
||||
|
||||
// ...
|
||||
let conn = match self.0.connect().await {
|
||||
|
|
|
@ -273,6 +273,9 @@ pub struct UserSettings {
|
|||
/// Disable achievements.
|
||||
#[serde(default)]
|
||||
pub disable_achievements: bool,
|
||||
/// Automatically hide users that you've blocked on your other accounts from your timelines.
|
||||
#[serde(default)]
|
||||
pub hide_associated_blocked_users: bool,
|
||||
}
|
||||
|
||||
fn mime_avif() -> String {
|
||||
|
@ -561,7 +564,7 @@ impl AchievementName {
|
|||
Self::Enable2fa => "Locked in",
|
||||
Self::EditNote => "I take it back!",
|
||||
Self::CreatePostWithTitle => "Must declutter",
|
||||
Self::CreateRepost => "More than a like or a comment...",
|
||||
Self::CreateRepost => "More than a like or comment...",
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue