# Semi-Distinct Group Chat

**URL:** <https://community.sendbird.com/t/semi-distinct-group-chat/3138>\
**Category:** API\
**Tags:** group-channel, chatsdk\
**Created:** [September 29, 2021, 6:23pm UTC](https://community.sendbird.com/t/semi-distinct-group-chat/3138 "2021-09-29T18:23:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![seths](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/seths/32/849_2.png) [@seths](https://community.sendbird.com/u/seths)\
**Post date:** [September 29, 2021, 6:23pm UTC](https://community.sendbird.com/t/semi-distinct-group-chat/3138/1 "2021-09-29T18:23:20Z")

</div>

Our app consists of users and teams. Each user can be a part of multiple teams.

We’d like users on a team to be able to start distinct chats with each other. So, each time a user on a team contacts an existing chat with a user, the same chat loads.

However, we don’t want group chats to be distinct across teams. For example, User A and User B on Team 1 start chatting, we would like that to be distinct for that team. If the same two users start a chat on Team 2, we would want it to start a new chat (despite being the same two users).

Is this scenario possible? If so, how can we accomplish this? Would setting the “custom\_type” to be the Team ID be sufficient?

---

<div class="post-metadata">

**Author:** ![Doug\_Exner](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/doug_exner/32/52_2.png) [@Doug\_Exner](https://community.sendbird.com/u/Doug_Exner)\
**Post date:** [September 30, 2021, 4:59pm UTC](https://community.sendbird.com/t/semi-distinct-group-chat/3138/2 "2021-09-30T16:59:20Z")

</div>

Yes, if you set the custom\_type to the team id, it will include that as part of the distinct logic. So if you Specify User A, User B and the Team, it will only return a channel with the same team in custom\_type. If it doesn’t exist, it will create it.

You do need to know not to request a distinct channel if you don’t want one. (e.g. in the example for Team 2.) There is no way to change the default setting for distinct for a custom\_type - it is always false unless you specify otherwise on create.

---

<div class="post-metadata">

**Author:** ![seths](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/seths/32/849_2.png) [@seths](https://community.sendbird.com/u/seths)\
**Post date:** [September 30, 2021, 7:07pm UTC](https://community.sendbird.com/t/semi-distinct-group-chat/3138/3 "2021-09-30T19:07:54Z")

</div>

> [@Doug\_Exner](#):
>
> Yes, if you set the custom\_type to the team id, it will include that as part of the distinct logic. So if you Specify User A, User B and the Team, it will only return a channel with the same team in custom\_type. If it doesn’t exist, it will create it.

Perfect, thank you! That helps.

---

<div class="post-metadata">

**Author:** ![seths](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/seths/32/849_2.png) [@seths](https://community.sendbird.com/u/seths)\
**Post date:** [October 6, 2021, 9:47pm UTC](https://community.sendbird.com/t/semi-distinct-group-chat/3138/4 "2021-10-06T21:47:58Z")

</div>

@Doug_Exner after diving deeper, I can’t tell if this is fully working.

For example, I’m creating a channel with

```auto
distinct = true
custom_type = "APPNAME:CHANNEL:COURSEID:12345"

```

I am able to filter the channel list by `APPNAME:CHANNEL:COURSEID:12345` correctly.

However, if I select the same users from the previous chat, but use a different custom\_type, it returns the previous chat. My understanding is that “distinct” factors in, not just the userIds within a chat, but also the custom\_type. That doesn’t appear to be the case.

I’m not sure if it matters, but the channel being created right now only includes 1 user. Is there a limitation/bug regarding the distinct property when only having 1 user?

---

<div class="post-metadata">

**Author:** ![Doug\_Exner](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/doug_exner/32/52_2.png) [@Doug\_Exner](https://community.sendbird.com/u/Doug_Exner)\
**Post date:** [October 7, 2021, 2:59am UTC](https://community.sendbird.com/t/semi-distinct-group-chat/3138/5 "2021-10-07T02:59:59Z")

</div>

After further research, there is a backend setting that needs to be enabled in your application to allow custom\_type to be part of the grouping for is\_distinct.

If you DM me your application id, I’ll see if I can get it turned on for you.

---

<div class="post-metadata">

**Author:** ![Andrew\_Bennett](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/andrew_bennett/32/4651_2.png) [@Andrew\_Bennett](https://community.sendbird.com/u/Andrew_Bennett)\
**Post date:** [October 27, 2023, 10:41pm UTC](https://community.sendbird.com/t/semi-distinct-group-chat/3138/6 "2023-10-27T22:41:02Z")

</div>

Sorry for the necro, but I’ve got the exact same issue. Which backend setting can I change to allow custom\_type to be part of the grouping for is\_distinct?

---

<div class="post-metadata">

**Author:** ![eoapps](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/eoapps/32/5643_2.png) [@eoapps](https://community.sendbird.com/u/eoapps)\
**Post date:** [January 7, 2025, 2:55am UTC](https://community.sendbird.com/t/semi-distinct-group-chat/3138/7 "2025-01-07T02:55:04Z")

</div>

I am contacting you about the same issue as the image and link above

Request to activate specific application ID backend settings to customize the chat solution

Maintain existing conversation history and product information when the other party leaves the chat room

Application ID: F830ABF2-0417-419C-8297-2E66B1AD67FA

val chatter = currentChannel?.members?.filter { it.userId != SendbirdChat.currentUser?.userId }  
title = chatter?.first()?.nickname ?: “”

isUsedGood = currentChannel?.customType.equals(“usedGood”)  
if (isUsedGood){  
data = Gson().fromJson(currentChannel?.data ?: “”, UsedGoodDto::class.java)  
}
