Civilised mute for user groups


  • FoxDev

    Continuing the discussion from /t/1000:

    @ChaosTheEternal said:

    Another bot to add to the mute list

    Which got me thinking:


  • Discourse touched me in a no-no place

    Not very likely judging by how the information is stored:

    discourse=# \d+ muted_users;
                                                              Table "public.muted_users"
        Column     |            Type             |                        Modifiers                         | Storage | Stats target | Description 
    ---------------+-----------------------------+----------------------------------------------------------+---------+--------------+-------------
     id            | integer                     | not null default nextval('muted_users_id_seq'::regclass) | plain   |              | 
     user_id       | integer                     | not null                                                 | plain   |              | 
     muted_user_id | integer                     | not null                                                 | plain   |              | 
     created_at    | timestamp without time zone |                                                          | plain   |              | 
     updated_at    | timestamp without time zone |                                                          | plain   |              | 
    Indexes:
        "muted_users_pkey" PRIMARY KEY, btree (id)
        "index_muted_users_on_muted_user_id_and_user_id" UNIQUE, btree (muted_user_id, user_id)
        "index_muted_users_on_user_id_and_muted_user_id" UNIQUE, btree (user_id, muted_user_id)
    Has OIDs: no
    

    Now they could probably add all the users in the group at the time of adding, but users added afterwards wouldn't automatically get added.



  • I wonder how that table was added in the first place...
    Perhaps it existed since the beginning of Discourse?


  • Discourse touched me in a no-no place

    No point in muting groups considering it just wipes the Muted list anyway ๐Ÿ˜†


  • Discourse touched me in a no-no place

    @CreatedToDislikeThis said:

    I wonder how that table was added in the first place...
    Perhaps it existed since the beginning of Discourse?

    [pjh@sofa discourse]$ git blame db/migrate/20150323234856_add_muted_users.rb | head -n4
    92e371f0 (Sam 2015-03-24 11:55:22 +1100  1) class AddMutedUsers < ActiveRecord::Migration
    92e371f0 (Sam 2015-03-24 11:55:22 +1100  2)   def change
    92e371f0 (Sam 2015-03-24 11:55:22 +1100  3)     create_table :muted_users do |t|
    92e371f0 (Sam 2015-03-24 11:55:22 +1100  4)       t.integer :user_id, null: false
    [pjh@sofa discourse]$ 
    

  • kills Dumbledore

    forums allowing bots is a HUGE edge case.

    If an edge case is large, doesn't that make it not an edge case, by definition?



  • It's an edge, but it's a blunt edge so you're not going to get a clean cut when it chops half of your software off.


  • Banned

    You could create a plugin with a mute_bots user option based off:

    Then run a job hourly that runs a job to add all the bots to the muted list.

    This would take @riking 15 to 30 minutes.


  • Discourse touched me in a no-no place

    @sam said:

    Then run a job hourly that runs a job to add all the bots to the muted list.

    I think hourly is overkill - at least for here - I don't update group memberships that often. (Any of the groups, which was the original use-case.)

    I suggest 24hrs as a default.


Log in to reply