|
| 1 | +/* |
| 2 | + * Copyright (c) 2021 The Matrix.org Foundation C.I.C. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +package im.vector.app.core.utils |
| 18 | + |
| 19 | +import org.matrix.android.sdk.api.provider.RoomDisplayNameFallbackProvider |
| 20 | + |
| 21 | +class TestRoomDisplayNameFallbackProvider : RoomDisplayNameFallbackProvider { |
| 22 | + |
| 23 | + override fun excludedUserIds(roomId: String) = emptyList<String>() |
| 24 | + |
| 25 | + override fun getNameForRoomInvite() = |
| 26 | + "Room invite" |
| 27 | + |
| 28 | + override fun getNameForEmptyRoom(isDirect: Boolean, leftMemberNames: List<String>) = |
| 29 | + "Empty room" |
| 30 | + |
| 31 | + override fun getNameFor1member(name: String) = |
| 32 | + name |
| 33 | + |
| 34 | + override fun getNameFor2members(name1: String, name2: String) = |
| 35 | + "$name1 and $name2" |
| 36 | + |
| 37 | + override fun getNameFor3members(name1: String, name2: String, name3: String) = |
| 38 | + "$name1, $name2 and $name3" |
| 39 | + |
| 40 | + override fun getNameFor4members(name1: String, name2: String, name3: String, name4: String) = |
| 41 | + "$name1, $name2, $name3 and $name4" |
| 42 | + |
| 43 | + override fun getNameFor4membersAndMore(name1: String, name2: String, name3: String, remainingCount: Int) = |
| 44 | + "$name1, $name2, $name3 and $remainingCount others" |
| 45 | +} |
0 commit comments