-
Notifications
You must be signed in to change notification settings - Fork 317
Wire enhanced-mention fields through Message #6479
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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
|
||
| 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
|
||
| 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
|
||
| 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
|
||
| ) | ||
|
|
||
| @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
|
||
| 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
|
||
| 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
|
||
| 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
|
||
| ) | ||
| 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>? { | ||
|
andremion marked this conversation as resolved.
|
||
| if (data.isNullOrEmpty() || data == "null") return emptyList() | ||
| return listAdapter.fromJson(data) | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.