Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
J
jasette-facil
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneur
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
facil
jasette-facil
Validations
e3ed212b
Valider
e3ed212b
rédigé
8 years ago
par
Eugen Rochko
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Filter statuses that mention blocked users
parent
543d0697
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
app/lib/feed_manager.rb
+15
-11
15 ajouts, 11 suppressions
app/lib/feed_manager.rb
app/models/account.rb
+2
-2
2 ajouts, 2 suppressions
app/models/account.rb
avec
17 ajouts
et
13 suppressions
app/lib/feed_manager.rb
+
15
−
11
Voir le fichier @
e3ed212b
...
@@ -68,30 +68,34 @@ class FeedManager
...
@@ -68,30 +68,34 @@ class FeedManager
def
filter_from_home?
(
status
,
receiver
)
def
filter_from_home?
(
status
,
receiver
)
should_filter
=
false
should_filter
=
false
if
status
.
reply?
&&
!
status
.
thread
.
account
.
nil?
# Filter out if it's a reply
if
status
.
reply?
&&
!
status
.
thread
.
account
.
nil?
# Filter out if it's a reply
should_filter
=
!
receiver
.
following?
(
status
.
thread
.
account
)
# and I'm not following the person it's a reply to
should_filter
=
!
receiver
.
following?
(
status
.
thread
.
account
)
# and I'm not following the person it's a reply to
should_filter
&&=
!
(
receiver
.
id
==
status
.
thread
.
account_id
)
# and it's not a reply to me
should_filter
&&=
!
(
receiver
.
id
==
status
.
thread
.
account_id
)
# and it's not a reply to me
should_filter
&&=
!
(
status
.
account_id
==
status
.
thread
.
account_id
)
# and it's not a self-reply
should_filter
&&=
!
(
status
.
account_id
==
status
.
thread
.
account_id
)
# and it's not a self-reply
elsif
status
.
reblog?
# Filter out a reblog
elsif
status
.
reblog?
# Filter out a reblog
should_filter
=
receiver
.
blocking?
(
status
.
reblog
.
account
)
# if I'm blocking the reblogged person
should_filter
=
receiver
.
blocking?
(
status
.
reblog
.
account
)
# if I'm blocking the reblogged person
end
end
should_filter
||=
receiver
.
blocking?
(
status
.
mentions
.
map
(
&
:account_id
))
# or if it mentions someone I blocked
should_filter
should_filter
end
end
def
filter_from_mentions?
(
status
,
receiver
)
def
filter_from_mentions?
(
status
,
receiver
)
should_filter
=
receiver
.
id
==
status
.
account_id
# Filter if I'm mentioning myself
should_filter
=
receiver
.
id
==
status
.
account_id
# Filter if I'm mentioning myself
should_filter
||=
receiver
.
blocking?
(
status
.
account
)
# or it's from someone I blocked
should_filter
||=
receiver
.
blocking?
(
status
.
account
)
# or it's from someone I blocked
should_filter
||=
receiver
.
blocking?
(
status
.
mentions
.
map
(
&
:account_id
))
# or if it mentions someone I blocked
if
status
.
reply?
&&
!
status
.
thread
.
account
.
nil?
# or it's a reply
if
status
.
reply?
&&
!
status
.
thread
.
account
.
nil?
# or it's a reply
should_filter
||=
receiver
.
blocking?
(
status
.
thread
.
account
)
# to a user I blocked
should_filter
||=
receiver
.
blocking?
(
status
.
thread
.
account
)
# to a user I blocked
end
end
should_filter
should_filter
end
end
def
filter_from_public?
(
status
,
receiver
)
def
filter_from_public?
(
status
,
receiver
)
should_filter
=
receiver
.
blocking?
(
status
.
account
)
should_filter
=
receiver
.
blocking?
(
status
.
account
)
should_filter
||=
receiver
.
blocking?
(
status
.
mentions
.
map
(
&
:account_id
))
if
status
.
reply?
&&
!
status
.
thread
.
account
.
nil?
if
status
.
reply?
&&
!
status
.
thread
.
account
.
nil?
should_filter
||=
receiver
.
blocking?
(
status
.
thread
.
account
)
should_filter
||=
receiver
.
blocking?
(
status
.
thread
.
account
)
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
app/models/account.rb
+
2
−
2
Voir le fichier @
e3ed212b
...
@@ -66,12 +66,12 @@ class Account < ApplicationRecord
...
@@ -66,12 +66,12 @@ class Account < ApplicationRecord
def
unfollow!
(
other_account
)
def
unfollow!
(
other_account
)
follow
=
active_relationships
.
find_by
(
target_account:
other_account
)
follow
=
active_relationships
.
find_by
(
target_account:
other_account
)
follow
.
destroy
unless
follow
.
nil?
follow
&
.
destroy
end
end
def
unblock!
(
other_account
)
def
unblock!
(
other_account
)
block
=
block_relationships
.
find_by
(
target_account:
other_account
)
block
=
block_relationships
.
find_by
(
target_account:
other_account
)
block
.
destroy
unless
block
.
nil?
block
&
.
destroy
end
end
def
following?
(
other_account
)
def
following?
(
other_account
)
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter