# 📣 Introducing default chat channels (automatically add users)

**URL:** https://meta.discourse.org/t/introducing-default-chat-channels-automatically-add-users/233141
**Category:** Announcements
**Tags:** chat, new-feature
**Created:** [July 18, 2022, 8:57pm UTC](https://meta.discourse.org/t/introducing-default-chat-channels-automatically-add-users/233141 "2022-07-18T20:57:34Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![rishabh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rishabh/32/179446_2.png) [@rishabh](https://meta.discourse.org/u/rishabh)
#### Post date: [July 18, 2022, 8:57pm UTC](https://meta.discourse.org/t/introducing-default-chat-channels-automatically-add-users/233141/1 "2022-07-18T20:57:34Z")

</div>

## Automatically add users to channel

While creating a new channel, admins will now see a preference to add all new and existing users to it. Using this, admins can configure “default channels” for groups of users to be included in automatically.

 ![image](https://global.discourse-cdn.com/meta/original/4X/5/2/d/52d2466fc83ed90d5f06a681b3569495ec76a3b4.png)

For an existing channel, admins can toggle this behavior in Channel Settings. In all cases, a confirmation dialog will appear to indicate the number of users being added.

✅ Users auto-join a channel when:

- they are added to a group that has access to a channel with auto-join
- a channel is created or edited to have auto-join enabled

> Note that users are not removed from a channel automatically if auto-join was disabled after they were added. If any user was automatically added to a “default channel”, they may leave at any time.

[https://github.com/discourse/discourse-chat/pull/988](https://github.com/discourse/discourse-chat/pull/988)

## A new Info Panel

Clicking a channel title will now take users to a useful info panel with three tabs:

![image](https://global.discourse-cdn.com/meta/original/4X/0/c/c/0cc0017446e45803cbfb263a9b3c77aac6181500.png)

- The **About** tab will display title, description and linked category, so users have the context they need for each channel.

- The **Members** tab lets users see who else is in the room with them (member list and total count). It includes a filter so they can use search.

- The **Settings** tab will let you set notification preferences (mute, desktop / mobile push notifications). For admins, this tab also includes the auto-join mode toggle.

[https://github.com/discourse/discourse-chat/pull/947](https://github.com/discourse/discourse-chat/pull/947)

---

<div class="post-metadata">

### Author: ![sdpiowa](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sdpiowa/32/242915_2.png) [@sdpiowa](https://meta.discourse.org/u/sdpiowa)
#### Post date: [July 20, 2022, 2:19am UTC](https://meta.discourse.org/t/introducing-default-chat-channels-automatically-add-users/233141/3 "2022-07-20T02:19:57Z")

</div>

We turned on the “automatically add users” function for one of our “everyone” chat channels tonight. However, it has currently only added 284 users out of our 1200+ users on the forums instance. I haven’t noted a lot of consistency regarding who all was added and who wasn’t. Is this currently a plugin limitation or is there something else going on?

_ **For some background:** _  
We run a login-required site. The affected chat channel is currently tied to a category that “everyone” has permission to access. All users on the forums currently have access to the chat plugin in the admin settings.

Thoughts appreciated!

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [July 20, 2022, 2:23am UTC](https://meta.discourse.org/t/introducing-default-chat-channels-automatically-add-users/233141/4 "2022-07-20T02:23:02Z")

</div>

How many of those 1200 users had interacted with the site since it was turned on?

---

<div class="post-metadata">

### Author: ![sdpiowa](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sdpiowa/32/242915_2.png) [@sdpiowa](https://meta.discourse.org/u/sdpiowa)
#### Post date: [July 20, 2022, 2:30am UTC](https://meta.discourse.org/t/introducing-default-chat-channels-automatically-add-users/233141/5 "2022-07-20T02:30:57Z")

</div>

I initially thought that might be the cause, but some of the users in the list haven’t been active for a long time…possibly ever. I don’t have an exact number…but could do more digging on that, if needed.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [July 20, 2022, 8:32am UTC](https://meta.discourse.org/t/introducing-default-chat-channels-automatically-add-users/233141/6 "2022-07-20T08:32:01Z")

</div>

> [@Stephen](#):
>
> users had interacted with the site since it was turned on?

Do you mean/guessing that ”add everyone” is actually ”add those how have been interacted in some time range”?

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [July 20, 2022, 2:13pm UTC](https://meta.discourse.org/t/introducing-default-chat-channels-automatically-add-users/233141/7 "2022-07-20T14:13:45Z")

</div>

We do currently filter out users who are “inactive” (as well as “staged” users and anonymous users). Here are [the specs](https://github.com/discourse/discourse-chat/blob/95423f04b14c4e2130291392abe1a3d3d0bd2717/spec/jobs/regular/auto_join_channel_batch_spec.rb#L90-L115) for that logic.

@Roman, are there tests that cover the scenario for these users if they later become active? Or is that implied by the existing spec because this job is run periodically?

---

<div class="post-metadata">

### Author: ![Roman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roman/32/157504_2.png) [@Roman](https://meta.discourse.org/u/Roman)
#### Post date: [July 20, 2022, 2:19pm UTC](https://meta.discourse.org/t/introducing-default-chat-channels-automatically-add-users/233141/8 "2022-07-20T14:19:54Z")

</div>

> [@mcwumbly](#):
>
> are there tests that cover the scenario for these users if they later become active? Or is that implied by the existing spec because this job is run periodically?

Good question. We only covered the user’s activation, so that’s a scenario I missed. The job doesn’t run periodically, but it probably should, as we keep finding more cases where the user’s state changes, and we need to auto-join them.

---

<div class="post-metadata">

### Author: ![sdpiowa](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sdpiowa/32/242915_2.png) [@sdpiowa](https://meta.discourse.org/u/sdpiowa)
#### Post date: [July 20, 2022, 2:30pm UTC](https://meta.discourse.org/t/introducing-default-chat-channels-automatically-add-users/233141/9 "2022-07-20T14:30:42Z")

</div>

> [@mcwumbly](#):
>
> We do currently filter out users who are “inactive” (as well as “staged” users and anonymous users). Here are [the specs](https://github.com/discourse/discourse-chat/blob/95423f04b14c4e2130291392abe1a3d3d0bd2717/spec/jobs/regular/auto_join_channel_batch_spec.rb#L90-L115) for that logic.

That definitely makes sense. Is the “inactive” status used here the same as the “Activated/Deactivated” flag in the admin dashboard or is it connected to something tracking actual ongoing usage of the platform? If it’s the former, we still have an issue because we only have two deactivated users, no staged users, and 13 anonymized users.

---

<div class="post-metadata">

### Author: ![Roman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roman/32/157504_2.png) [@Roman](https://meta.discourse.org/u/Roman)
#### Post date: [July 20, 2022, 2:38pm UTC](https://meta.discourse.org/t/introducing-default-chat-channels-automatically-add-users/233141/10 "2022-07-20T14:38:30Z")

</div>

Active has two meanings here. It has to be active, as their email is confirmed, but it also means they visited the site at least once in the last three months (we check their `last_seen_at` attribute for this).

---

<div class="post-metadata">

### Author: ![sdpiowa](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sdpiowa/32/242915_2.png) [@sdpiowa](https://meta.discourse.org/u/sdpiowa)
#### Post date: [July 20, 2022, 2:46pm UTC](https://meta.discourse.org/t/introducing-default-chat-channels-automatically-add-users/233141/11 "2022-07-20T14:46:38Z")

</div>

Just as a heads-up…I did a quick check and found about 24 tl0 accounts just in the "A"s of our auto-added chat participants who have never logged in to the platform since their accounts were approved. Most of them created accounts in the 2018-2019 timeframe. They should have all been considered inactive, by that definition.

---

<div class="post-metadata">

### Author: ![Roman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roman/32/157504_2.png) [@Roman](https://meta.discourse.org/u/Roman)
#### Post date: [July 20, 2022, 2:51pm UTC](https://meta.discourse.org/t/introducing-default-chat-channels-automatically-add-users/233141/12 "2022-07-20T14:51:04Z")

</div>

Yes, this was intentionally for handling the case where the user is created, but it doesn’t really make sense. Moving to a scheduled job will fix this too.

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [September 8, 2022, 5:37pm UTC](https://meta.discourse.org/t/introducing-default-chat-channels-automatically-add-users/233141/13 "2022-09-08T17:37:14Z")

</div>

6 posts were merged into an existing topic: [Automatically add user to channel based on group subscription](https://meta.discourse.org/t/automatically-add-user-to-channel-based-on-group-subscription/235177/4)

---

<div class="post-metadata">

### Author: ![th21](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/th21/32/211915_2.png) [@th21](https://meta.discourse.org/u/th21)
#### Post date: [August 4, 2022, 7:20pm UTC](https://meta.discourse.org/t/introducing-default-chat-channels-automatically-add-users/233141/19 "2022-08-04T19:20:50Z")

</div>

> [@rishabh](#):
>
> For an existing channel, admins can toggle this behavior in Channel Settings. In all cases, a confirmation dialog will appear to indicate the number of users being added.

So if I have `chat allowed groups` set to tl1 user and allow a channel to auto add users which linked to a tl0 accessible category, what will happen? Does this later option overwrite the former one?

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [August 5, 2022, 2:04am UTC](https://meta.discourse.org/t/introducing-default-chat-channels-automatically-add-users/233141/20 "2022-08-05T02:04:57Z")

</div>

It should respect both settings and only tl1 users will be added in this case.

---

<div class="post-metadata">

### Author: ![th21](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/th21/32/211915_2.png) [@th21](https://meta.discourse.org/u/th21)
#### Post date: [August 7, 2022, 12:04am UTC](https://meta.discourse.org/t/introducing-default-chat-channels-automatically-add-users/233141/21 "2022-08-07T00:04:05Z")

</div>

Thx for the reply, I see the linked channel (which is linked to a tl0 accessible category) shows it has around 1700 members, but my tl0 users are around 4000 as shown on the group page, I have removed the tl1 restriction, but the number doesn’t increase. Is there a data delay or any settings will also affect this number?

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [August 8, 2022, 2:11pm UTC](https://meta.discourse.org/t/introducing-default-chat-channels-automatically-add-users/233141/24 "2022-08-08T14:11:33Z")

</div>

Currently the users get added to the channel based on the category permissions, but those outside of the `chat allowed groups` simply can’t see any chat features at all and so don’t have access. There are a couple of other criteria that go into whether they’re ‘active’ or not and get scooped up into being added, which may account for the difference in numbers:

> [@mega Introducing default chat channels (automatically add users)](https://meta.discourse.org/t/introducing-default-chat-channels-automatically-add-users/233141/10):
>
> Active has two meanings here. It has to be active, as their email is confirmed, but it also means they visited the site at least once in the last three months (we check their last\_seen\_at attribute for this).

---

<div class="post-metadata">

### Author: ![alehandrof](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alehandrof/32/119526_2.png) [@alehandrof](https://meta.discourse.org/u/alehandrof)
#### Post date: [August 12, 2022, 2:18pm UTC](https://meta.discourse.org/t/introducing-default-chat-channels-automatically-add-users/233141/25 "2022-08-12T14:18:01Z")

</div>

I’m experiencing the same issue that @sdpiowa identified earlier in this thread:

> [@sdpiowa](#):
>
> We turned on the “automatically add users” function for one of our “everyone” chat channels tonight. However, it has currently only added 284 users out of our 1200+ users on the forums instance.

I understand from this thread that only “active” users join the channel. That’s fine – though the label on the option should be updated to more accurately describe the feature.

What remains unclear to me is whether this check is run periodically. In other words, if a previously inactive user interacts with the site tomorrow will they automatically join the chat channel or not?

---

<div class="post-metadata">

### Author: ![alehandrof](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alehandrof/32/119526_2.png) [@alehandrof](https://meta.discourse.org/u/alehandrof)
#### Post date: [September 1, 2022, 2:25pm UTC](https://meta.discourse.org/t/introducing-default-chat-channels-automatically-add-users/233141/26 "2022-09-01T14:25:45Z")

</div>

Any confirmation on my question above?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 1, 2022, 2:51pm UTC](https://meta.discourse.org/t/introducing-default-chat-channels-automatically-add-users/233141/27 "2022-09-01T14:51:31Z")

</div>

I guess by now you should have empirical evidence?

I can’t quite tell what `subject.execute(chat_channel_id: channel.id, starts_at: user.id, ends_at: user.id)` does in the spec, but I **think** that those users are added continually.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [September 1, 2022, 4:07pm UTC](https://meta.discourse.org/t/introducing-default-chat-channels-automatically-add-users/233141/29 "2022-09-01T16:07:09Z")

</div>

On my forum returning users will be added continually. Sure, there can be somekind delay, but it can’t be long.

(That shows one metric I could guess quite many community admins dislike 😉 It tells directly how many pseudo users that community has…)

[Next page](https://meta.discourse.org/t/introducing-default-chat-channels-automatically-add-users/233141.md?page=2)
