Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ import io.getstream.chat.android.client.api2.model.dto.DownstreamThreadInfoDto
import io.getstream.chat.android.client.api2.model.dto.DownstreamThreadParticipantDto
import io.getstream.chat.android.client.api2.model.dto.DownstreamUserBlockDto
import io.getstream.chat.android.client.api2.model.dto.DownstreamUserDto
import io.getstream.chat.android.client.api2.model.dto.DownstreamUserGroupDto
import io.getstream.chat.android.client.api2.model.dto.DownstreamUserGroupMemberDto
import io.getstream.chat.android.client.api2.model.dto.DownstreamVoteDto
import io.getstream.chat.android.client.api2.model.dto.PrivacySettingsDto
import io.getstream.chat.android.client.api2.model.dto.ReadReceiptsDto
Expand Down Expand Up @@ -121,6 +123,8 @@ import io.getstream.chat.android.models.UnreadCounts
import io.getstream.chat.android.models.UnreadThread
import io.getstream.chat.android.models.User
import io.getstream.chat.android.models.UserBlock
import io.getstream.chat.android.models.UserGroup
import io.getstream.chat.android.models.UserGroupMember
import io.getstream.chat.android.models.UserId
import io.getstream.chat.android.models.UserTransformer
import io.getstream.chat.android.models.Vote
Expand All @@ -130,7 +134,7 @@ import io.getstream.chat.android.models.querysort.QuerySorter
import io.getstream.chat.android.models.querysort.SortDirection
import java.util.Date

@Suppress("TooManyFunctions")
@Suppress("TooManyFunctions", "LargeClass")
internal class DomainMapping(
val currentUserIdProvider: () -> UserId?,
private val channelTransformer: ChannelTransformer,
Expand Down Expand Up @@ -225,6 +229,10 @@ internal class DomainMapping(
messageId = id,
),
mentionedUsers = mentioned_users.map { it.toDomain() },
mentionedHere = mentioned_here ?: false,
mentionedChannel = mentioned_channel ?: false,
mentionedGroups = mentioned_groups.map { it.toDomain() },
mentionedRoles = mentioned_roles,
ownReactions = own_reactions.toDomain(
messageId = id,
),
Expand Down Expand Up @@ -672,6 +680,7 @@ internal class DomainMapping(
messageRemindersEnabled = user_message_reminders ?: false,
sharedLocationsEnabled = shared_locations ?: false,
markMessagesPending = mark_messages_pending,
pushLevel = push_level,
)

/**
Expand Down Expand Up @@ -930,6 +939,24 @@ internal class DomainMapping(
return QuerySortByField<Channel>().desc(field)
}

internal fun DownstreamUserGroupDto.toDomain(): UserGroup = UserGroup(
id = id,
name = name,
description = description,
team = team_id.orEmpty(),
members = members.map { it.toDomain() },
createdBy = created_by,
createdAt = created_at,
updatedAt = updated_at,
)

internal fun DownstreamUserGroupMemberDto.toDomain(): UserGroupMember = UserGroupMember(
groupId = group_id,
userId = user_id,
isAdmin = is_admin,
createdAt = created_at,
)

private companion object {
private const val FIELD_LAST_MESSAGE_AT = "last_message_at"
private const val FIELD_LAST_UPDATED = "last_updated"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import io.getstream.chat.android.models.MessageType
import io.getstream.chat.android.models.Mute
import io.getstream.chat.android.models.Reaction
import io.getstream.chat.android.models.User
import io.getstream.chat.android.models.UserGroup
import io.getstream.chat.android.models.UserTransformer

internal class DtoMapping(
Expand Down Expand Up @@ -134,6 +135,10 @@ internal class DtoMapping(
id = id,
type = upstreamType,
mentioned_users = mentionedUsersIds,
mentioned_here = mentionedHere,
mentioned_channel = mentionedChannel,
mentioned_group_ids = mentionedGroups.map(UserGroup::id),
mentioned_roles = mentionedRoles,
parent_id = parentId,
pin_expires = pinExpires,
pinned = pinned,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@
val user_message_reminders: Boolean?,
val shared_locations: Boolean?,
val mark_messages_pending: Boolean,
val push_level: String? = null,

Check warning on line 50 in stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/dto/ConfigDto.kt

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter to match the regular expression ^`?[_a-z][a-zA-Z0-9]*`?$

See more on https://sonarcloud.io/project/issues?id=GetStream_stream-chat-android&issues=AZ5zqe1HCw50Qcw1rhgk&open=AZ5zqe1HCw50Qcw1rhgk&pullRequest=6479
)
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
val id: String,
val type: String,
val mentioned_users: List<String>,
val mentioned_here: Boolean = false,

Check warning on line 41 in stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/dto/MessageDtos.kt

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter to match the regular expression ^`?[_a-z][a-zA-Z0-9]*`?$

See more on https://sonarcloud.io/project/issues?id=GetStream_stream-chat-android&issues=AZ5zqe9PCw50Qcw1rhgt&open=AZ5zqe9PCw50Qcw1rhgt&pullRequest=6479
val mentioned_channel: Boolean = false,

Check warning on line 42 in stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/dto/MessageDtos.kt

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter to match the regular expression ^`?[_a-z][a-zA-Z0-9]*`?$

See more on https://sonarcloud.io/project/issues?id=GetStream_stream-chat-android&issues=AZ5zqe9PCw50Qcw1rhgu&open=AZ5zqe9PCw50Qcw1rhgu&pullRequest=6479
val mentioned_group_ids: List<String> = emptyList(),

Check warning on line 43 in stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/dto/MessageDtos.kt

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter to match the regular expression ^`?[_a-z][a-zA-Z0-9]*`?$

See more on https://sonarcloud.io/project/issues?id=GetStream_stream-chat-android&issues=AZ5zqe9PCw50Qcw1rhgv&open=AZ5zqe9PCw50Qcw1rhgv&pullRequest=6479
val mentioned_roles: List<String> = emptyList(),

Check warning on line 44 in stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/dto/MessageDtos.kt

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter to match the regular expression ^`?[_a-z][a-zA-Z0-9]*`?$

See more on https://sonarcloud.io/project/issues?id=GetStream_stream-chat-android&issues=AZ5zqe9PCw50Qcw1rhgw&open=AZ5zqe9PCw50Qcw1rhgw&pullRequest=6479
val parent_id: String?,
val pin_expires: Date?,
val pinned: Boolean?,
Expand Down Expand Up @@ -75,6 +79,10 @@
val id: String,
val latest_reactions: List<DownstreamReactionDto>,
val mentioned_users: List<DownstreamUserDto>,
val mentioned_here: Boolean? = null,

Check warning on line 82 in stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/dto/MessageDtos.kt

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter to match the regular expression ^`?[_a-z][a-zA-Z0-9]*`?$

See more on https://sonarcloud.io/project/issues?id=GetStream_stream-chat-android&issues=AZ5zqe9PCw50Qcw1rhgx&open=AZ5zqe9PCw50Qcw1rhgx&pullRequest=6479
val mentioned_channel: Boolean? = null,

Check warning on line 83 in stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/dto/MessageDtos.kt

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter to match the regular expression ^`?[_a-z][a-zA-Z0-9]*`?$

See more on https://sonarcloud.io/project/issues?id=GetStream_stream-chat-android&issues=AZ5zqe9PCw50Qcw1rhgy&open=AZ5zqe9PCw50Qcw1rhgy&pullRequest=6479
val mentioned_groups: List<DownstreamUserGroupDto> = emptyList(),

Check warning on line 84 in stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/dto/MessageDtos.kt

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter to match the regular expression ^`?[_a-z][a-zA-Z0-9]*`?$

See more on https://sonarcloud.io/project/issues?id=GetStream_stream-chat-android&issues=AZ5zqe9PCw50Qcw1rhgz&open=AZ5zqe9PCw50Qcw1rhgz&pullRequest=6479
val mentioned_roles: List<String> = emptyList(),

Check warning on line 85 in stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/dto/MessageDtos.kt

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter to match the regular expression ^`?[_a-z][a-zA-Z0-9]*`?$

See more on https://sonarcloud.io/project/issues?id=GetStream_stream-chat-android&issues=AZ5zqe9PCw50Qcw1rhg0&open=AZ5zqe9PCw50Qcw1rhg0&pullRequest=6479
val own_reactions: List<DownstreamReactionDto>,
val parent_id: String?,
val pin_expires: Date?,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright (c) 2014-2026 Stream.io Inc. All rights reserved.
*
* Licensed under the Stream License;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://github.com/GetStream/stream-chat-android/blob/main/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.getstream.chat.android.client.api2.model.dto

import com.squareup.moshi.JsonClass
import java.util.Date

@JsonClass(generateAdapter = true)
internal data class DownstreamUserGroupDto(
val id: String,
val name: String,
val description: String? = null,
val team_id: String? = null,

Check warning on line 27 in stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/dto/UserGroupDtos.kt

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter to match the regular expression ^`?[_a-z][a-zA-Z0-9]*`?$

See more on https://sonarcloud.io/project/issues?id=GetStream_stream-chat-android&issues=AZ5zqe4PCw50Qcw1rhgl&open=AZ5zqe4PCw50Qcw1rhgl&pullRequest=6479
val members: List<DownstreamUserGroupMemberDto> = emptyList(),
val created_by: String? = null,

Check warning on line 29 in stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/dto/UserGroupDtos.kt

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter to match the regular expression ^`?[_a-z][a-zA-Z0-9]*`?$

See more on https://sonarcloud.io/project/issues?id=GetStream_stream-chat-android&issues=AZ5zqe4PCw50Qcw1rhgm&open=AZ5zqe4PCw50Qcw1rhgm&pullRequest=6479
val created_at: Date? = null,

Check warning on line 30 in stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/dto/UserGroupDtos.kt

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter to match the regular expression ^`?[_a-z][a-zA-Z0-9]*`?$

See more on https://sonarcloud.io/project/issues?id=GetStream_stream-chat-android&issues=AZ5zqe4PCw50Qcw1rhgn&open=AZ5zqe4PCw50Qcw1rhgn&pullRequest=6479
val updated_at: Date? = null,

Check warning on line 31 in stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/dto/UserGroupDtos.kt

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter to match the regular expression ^`?[_a-z][a-zA-Z0-9]*`?$

See more on https://sonarcloud.io/project/issues?id=GetStream_stream-chat-android&issues=AZ5zqe4PCw50Qcw1rhgo&open=AZ5zqe4PCw50Qcw1rhgo&pullRequest=6479
)

@JsonClass(generateAdapter = true)
internal data class DownstreamUserGroupMemberDto(
val group_id: String,

Check warning on line 36 in stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/dto/UserGroupDtos.kt

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter to match the regular expression ^`?[_a-z][a-zA-Z0-9]*`?$

See more on https://sonarcloud.io/project/issues?id=GetStream_stream-chat-android&issues=AZ5zqe4PCw50Qcw1rhgp&open=AZ5zqe4PCw50Qcw1rhgp&pullRequest=6479
val user_id: String,

Check warning on line 37 in stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/dto/UserGroupDtos.kt

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter to match the regular expression ^`?[_a-z][a-zA-Z0-9]*`?$

See more on https://sonarcloud.io/project/issues?id=GetStream_stream-chat-android&issues=AZ5zqe4PCw50Qcw1rhgq&open=AZ5zqe4PCw50Qcw1rhgq&pullRequest=6479
val is_admin: Boolean = false,

Check warning on line 38 in stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/dto/UserGroupDtos.kt

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter to match the regular expression ^`?[_a-z][a-zA-Z0-9]*`?$

See more on https://sonarcloud.io/project/issues?id=GetStream_stream-chat-android&issues=AZ5zqe4PCw50Qcw1rhgr&open=AZ5zqe4PCw50Qcw1rhgr&pullRequest=6479
val created_at: Date? = null,

Check warning on line 39 in stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/dto/UserGroupDtos.kt

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter to match the regular expression ^`?[_a-z][a-zA-Z0-9]*`?$

See more on https://sonarcloud.io/project/issues?id=GetStream_stream-chat-android&issues=AZ5zqe4PCw50Qcw1rhgs&open=AZ5zqe4PCw50Qcw1rhgs&pullRequest=6479
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (c) 2014-2026 Stream.io Inc. All rights reserved.
*
* Licensed under the Stream License;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://github.com/GetStream/stream-chat-android/blob/main/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.getstream.chat.android.client.internal.offline.repository.database.converter.internal

import androidx.room.TypeConverter
import com.squareup.moshi.adapter
import io.getstream.chat.android.models.UserGroup

internal class UserGroupConverter {

@OptIn(ExperimentalStdlibApi::class)
private val listAdapter = moshi.adapter<List<UserGroup>>()

@TypeConverter
fun userGroupListToString(groups: List<UserGroup>?): String? = groups?.let(listAdapter::toJson)

@TypeConverter
fun stringToUserGroupList(data: String?): List<UserGroup>? {
if (data.isNullOrEmpty() || data == "null") return emptyList()
return listAdapter.fromJson(data)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import io.getstream.chat.android.client.internal.offline.repository.database.con
import io.getstream.chat.android.client.internal.offline.repository.database.converter.internal.ReminderInfoConverter
import io.getstream.chat.android.client.internal.offline.repository.database.converter.internal.SetConverter
import io.getstream.chat.android.client.internal.offline.repository.database.converter.internal.SyncStatusConverter
import io.getstream.chat.android.client.internal.offline.repository.database.converter.internal.UserGroupConverter
import io.getstream.chat.android.client.internal.offline.repository.database.converter.internal.UserMuteConverter
import io.getstream.chat.android.client.internal.offline.repository.database.converter.internal.VoteConverter
import io.getstream.chat.android.client.internal.offline.repository.domain.channel.internal.ChannelDao
Expand Down Expand Up @@ -88,7 +89,7 @@ import io.getstream.chat.android.client.internal.offline.repository.domain.user.
ThreadOrderEntity::class,
DraftMessageEntity::class,
],
version = 200,
version = 201,
exportSchema = false,
)
@TypeConverters(
Expand All @@ -112,6 +113,7 @@ import io.getstream.chat.android.client.internal.offline.repository.domain.user.
LocationConverter::class,
PushPreferenceConverter::class,
UserMuteConverter::class,
UserGroupConverter::class,
)
internal abstract class ChatDatabase : RoomDatabase() {
abstract fun queryChannelsDao(): QueryChannelsDao
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ internal data class ChannelConfigInnerEntity(
val blocklistBehavior: String,
val messageRemindersEnabled: Boolean,
val markMessagesPending: Boolean,
val pushLevel: String? = null,
)

@Entity(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ internal fun ChannelConfig.toEntity(): ChannelConfigEntity = ChannelConfigEntity
blocklistBehavior = blocklistBehavior,
messageRemindersEnabled = messageRemindersEnabled,
markMessagesPending = markMessagesPending,
pushLevel = pushLevel,
)
},
commands = config.commands.map { it.toEntity(type) },
Expand Down Expand Up @@ -78,6 +79,7 @@ internal fun ChannelConfigEntity.toModel(): ChannelConfig = ChannelConfig(
commands = commands.map(CommandInnerEntity::toModel),
messageRemindersEnabled = messageRemindersEnabled,
markMessagesPending = markMessagesPending,
pushLevel = pushLevel,
)
},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import io.getstream.chat.android.client.internal.offline.repository.domain.messa
import io.getstream.chat.android.client.internal.offline.repository.domain.message.channelinfo.internal.ChannelInfoEntity
import io.getstream.chat.android.client.internal.offline.repository.domain.reaction.internal.ReactionEntity
import io.getstream.chat.android.models.SyncStatus
import io.getstream.chat.android.models.UserGroup
import java.util.Date

internal data class MessageEntity(
Expand Down Expand Up @@ -77,6 +78,14 @@ internal data class MessageInnerEntity(
val remoteMentionedUserIds: List<String> = emptyList(),
/** the users to be mentioned in this message */
val mentionedUsersId: List<String> = emptyList(),
/** whether this message includes an `@here` mention */
val mentionedHere: Boolean = false,
/** whether this message includes an `@channel` mention */
val mentionedChannel: Boolean = false,
/** the user groups mentioned in this message */
val mentionedGroups: List<UserGroup> = emptyList(),
/** the roles mentioned in this message */
val mentionedRoles: List<String> = emptyList(),
/** a mapping between reaction type and the count, ie like:10, heart:4 */
val reactionCounts: Map<String, Int> = emptyMap(),
/** a mapping between reaction type and the reaction score, ie like:10, heart:4 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ internal suspend fun MessageEntity.toModel(
ownReactions = (ownReactions.map { it.toModel(getUser) }),
mentionedUsers = remoteMentionedUserIds.map { getUser(it) },
mentionedUsersIds = mentionedUsersId,
mentionedHere = mentionedHere,
mentionedChannel = mentionedChannel,
mentionedGroups = mentionedGroups,
mentionedRoles = mentionedRoles,
replyTo = replyToId?.let { getReply(it) },
replyMessageId = replyToId,
threadParticipants = threadParticipantsIds.map { getUser(it) },
Expand Down Expand Up @@ -114,6 +118,10 @@ internal fun Message.toEntity(): MessageEntity = MessageEntity(
i18n = i18n,
remoteMentionedUserIds = mentionedUsers.map(User::id),
mentionedUsersId = mentionedUsersIds,
mentionedHere = mentionedHere,
mentionedChannel = mentionedChannel,
mentionedGroups = mentionedGroups,
mentionedRoles = mentionedRoles,
replyToId = replyTo?.id ?: replyMessageId,
threadParticipantsIds = threadParticipants.map(User::id),
showInChannel = showInChannel,
Expand Down Expand Up @@ -170,6 +178,10 @@ internal suspend fun ReplyMessageEntity.toModel(
ownReactions = mutableListOf(),
mentionedUsers = remoteMentionedUserIds.map { getUser(it) },
mentionedUsersIds = mentionedUsersId,
mentionedHere = mentionedHere,
mentionedChannel = mentionedChannel,
mentionedGroups = mentionedGroups,
mentionedRoles = mentionedRoles,
replyTo = null,
replyMessageId = null,
threadParticipants = threadParticipantsIds.map { getUser(it) },
Expand Down Expand Up @@ -213,6 +225,10 @@ internal fun Message.toReplyEntity(): ReplyMessageEntity =
i18n = i18n,
remoteMentionedUserIds = mentionedUsers.map(User::id),
mentionedUsersId = mentionedUsersIds,
mentionedHere = mentionedHere,
mentionedChannel = mentionedChannel,
mentionedGroups = mentionedGroups,
mentionedRoles = mentionedRoles,
threadParticipantsIds = threadParticipants.map(User::id),
showInChannel = showInChannel,
silent = silent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import androidx.room.Relation
import io.getstream.chat.android.client.internal.offline.repository.domain.message.attachment.internal.ReplyAttachmentEntity
import io.getstream.chat.android.client.internal.offline.repository.domain.message.channelinfo.internal.ChannelInfoEntity
import io.getstream.chat.android.models.SyncStatus
import io.getstream.chat.android.models.UserGroup
import java.util.Date

internal data class ReplyMessageEntity(
Expand Down Expand Up @@ -70,6 +71,14 @@ internal data class ReplyMessageInnerEntity(
val remoteMentionedUserIds: List<String> = emptyList(),
/** the users to be mentioned in this message */
val mentionedUsersId: List<String> = emptyList(),
/** whether this message includes an `@here` mention */
val mentionedHere: Boolean = false,
/** whether this message includes an `@channel` mention */
val mentionedChannel: Boolean = false,
/** the user groups mentioned in this message */
val mentionedGroups: List<UserGroup> = emptyList(),
/** the roles mentioned in this message */
val mentionedRoles: List<String> = emptyList(),
/** parent id, used for threads */
val parentId: String? = null,
/** slash command like /giphy etc */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ import io.getstream.chat.android.client.api2.model.dto.DownstreamThreadInfoDto
import io.getstream.chat.android.client.api2.model.dto.DownstreamThreadParticipantDto
import io.getstream.chat.android.client.api2.model.dto.DownstreamUserBlockDto
import io.getstream.chat.android.client.api2.model.dto.DownstreamUserDto
import io.getstream.chat.android.client.api2.model.dto.DownstreamUserGroupDto
import io.getstream.chat.android.client.api2.model.dto.DownstreamUserGroupMemberDto
import io.getstream.chat.android.client.api2.model.dto.DownstreamVoteDto
import io.getstream.chat.android.client.api2.model.dto.ErrorDetailDto
import io.getstream.chat.android.client.api2.model.dto.ErrorDto
Expand Down Expand Up @@ -290,6 +292,10 @@ internal object Mother {
id: String = randomString(),
latest_reactions: List<DownstreamReactionDto> = emptyList(),
mentioned_users: List<DownstreamUserDto> = emptyList(),
mentioned_here: Boolean? = null,
mentioned_channel: Boolean? = null,
mentioned_groups: List<DownstreamUserGroupDto> = emptyList(),
mentioned_roles: List<String> = emptyList(),
own_reactions: List<DownstreamReactionDto> = emptyList(),
parent_id: String? = randomString(),
pin_expires: Date? = randomDateOrNull(),
Expand Down Expand Up @@ -331,6 +337,10 @@ internal object Mother {
id = id,
latest_reactions = latest_reactions,
mentioned_users = mentioned_users,
mentioned_here = mentioned_here,
mentioned_channel = mentioned_channel,
mentioned_groups = mentioned_groups,
mentioned_roles = mentioned_roles,
own_reactions = own_reactions,
parent_id = parent_id,
pin_expires = pin_expires,
Expand Down Expand Up @@ -1374,6 +1384,26 @@ internal object Mother {
chat_level = chatLevel,
disabled_until = disabledUntil,
)

fun randomDownstreamUserGroupDto(
id: String = randomString(),
name: String = randomString(),
description: String? = randomString(),
teamId: String? = randomString(),
members: List<DownstreamUserGroupMemberDto> = emptyList(),
createdBy: String? = randomString(),
createdAt: Date? = randomDate(),
updatedAt: Date? = randomDate(),
): DownstreamUserGroupDto = DownstreamUserGroupDto(
id = id,
name = name,
description = description,
team_id = teamId,
members = members,
created_by = createdBy,
created_at = createdAt,
updated_at = updatedAt,
)
}

internal fun randomPushMessage(
Expand Down
Loading
Loading