Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flagged accounts should not appear on TV #14858

Open
danispringer opened this issue Mar 14, 2024 · 3 comments
Open

flagged accounts should not appear on TV #14858

danispringer opened this issue Mar 14, 2024 · 3 comments
Labels
bug good first issue Narrow in scope (but not necessarily easy)

Comments

@danispringer
Copy link

Are we sure we want flagged accounts featured on TV?

Untitled

@SergioGlorias
Copy link
Contributor

ok, maybe it's difficult to disclose
but in any case it is against the computer and not against a person

@kraktus kraktus added the good first issue Narrow in scope (but not necessarily easy) label Mar 16, 2024
@kraktus kraktus changed the title flagged account on TV flagged accounts should not appear on TV Mar 16, 2024
@kraktus kraktus added the bug label Mar 16, 2024
@randompearl-stack
Copy link
Contributor

randompearl-stack commented Mar 17, 2024

ok, maybe it's difficult to disclose but in any case it is against the computer and not against a person

Even if it is against the computer, isn't featuring flagged accounts on TV condoning their behavior to some extent? Also, the example shown is a computer match, but the issue concerns all the TV sections. It is highly unlikely, but the TV could feature a top player who was just found to violate ToS.

@tors42
Copy link
Contributor

tors42 commented Apr 29, 2024

Jotting down a "simple" solution which works on my empty test system (tested with bots),
but maybe the penalty of performing the engine count on each notification of a started game isn't a feasable approach on non-test system... 😅

tv/src/main/Env.scala

...
     lightUserSync: lila.core.LightUser.GetterSync,
+    userApi: lila.core.user.UserApi,
...

tv/src/main/TvSyncActor.scala

...
     lightUserApi: lila.core.user.LightUserApi,
+    userApi: lila.core.user.UserApi,
...

     case lila.core.game.StartGame(g) =>
       if g.hasClock then
+        userApi
+          .countEngines(g.userIds)
+          .map(nb =>
+            if nb == 0 then
               val candidate = Tv.Candidate(g, g.userIds.exists(lightUserApi.isBotSync))
               channelActors
                 .collect {
                   case (chan, actor) if chan.filter(candidate) => actor
                 }
                 .foreach(_.addCandidate(g))
+          )
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue Narrow in scope (but not necessarily easy)
Projects
Status: No status
Development

No branches or pull requests

5 participants