File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
app/src/main/java/com/nextcloud/talk/conversationinfo/viewmodel Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ import com.nextcloud.talk.models.json.participants.TalkBan
30
30
import com.nextcloud.talk.repositories.conversations.ConversationsRepository
31
31
import com.nextcloud.talk.utils.ApiUtils
32
32
import com.nextcloud.talk.utils.ApiUtils.getUrlForRooms
33
+ import com.nextcloud.talk.utils.DisplayUtils
33
34
import io.reactivex.Observer
34
35
import io.reactivex.android.schedulers.AndroidSchedulers
35
36
import io.reactivex.disposables.Disposable
@@ -172,20 +173,12 @@ class ConversationInfoViewModel @Inject constructor(
172
173
}
173
174
174
175
private fun createConversationNameByParticipants (autocompleteUsers : List <AutocompleteUser >): String {
175
- fun cutOffString (input : String , maxLength : Int ): String {
176
- return if (input.length > maxLength) {
177
- input.take(maxLength)
178
- } else {
179
- input
180
- }
181
- }
182
-
183
176
val conversationName = autocompleteUsers
184
177
.sortedBy { it.label?.lowercase() }
185
178
.mapNotNull { it.label }
186
179
.joinToString(NEW_CONVERSATION_PARTICIPANTS_SEPARATOR )
187
180
188
- return cutOffString (conversationName, MAX_ROOM_NAME_LENGTH )
181
+ return DisplayUtils .ellipsize (conversationName, MAX_ROOM_NAME_LENGTH )
189
182
}
190
183
191
184
private fun convertAutocompleteUserToParticipant (autocompleteUsers : List <AutocompleteUser >): Participants {
You can’t perform that action at this time.
0 commit comments