mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-29 09:19:01 +03:00
Merge remote-tracking branch 'origin/develop' into feature/eric/space-settings
This commit is contained in:
commit
2a1483f6a5
4 changed files with 12 additions and 5 deletions
changelog.d
vector/src
androidTest/java/im/vector/app/features/reactions/data
main/java/im/vector/app/features/createdirect
1
changelog.d/5525.wip
Normal file
1
changelog.d/5525.wip
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Create DM room only on first message - Trigger the flow when the "Direct Message" action is selected from the room member details screen
|
|
@ -76,7 +76,7 @@ class EmojiDataSourceTest : InstrumentedTest {
|
||||||
fun searchTestOneResult() {
|
fun searchTestOneResult() {
|
||||||
val emojiDataSource = createEmojiDataSource()
|
val emojiDataSource = createEmojiDataSource()
|
||||||
val result = runBlocking {
|
val result = runBlocking {
|
||||||
emojiDataSource.filterWith("france")
|
emojiDataSource.filterWith("flag-france")
|
||||||
}
|
}
|
||||||
assertEquals("Should have 1 result", 1, result.size)
|
assertEquals("Should have 1 result", 1, result.size)
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,10 +132,10 @@ class CreateDirectRoomViewModel @AssistedInject constructor(
|
||||||
if (vectorFeatures.shouldStartDmOnFirstMessage()) {
|
if (vectorFeatures.shouldStartDmOnFirstMessage()) {
|
||||||
session.roomService().createLocalRoom(roomParams)
|
session.roomService().createLocalRoom(roomParams)
|
||||||
} else {
|
} else {
|
||||||
|
analyticsTracker.capture(CreatedRoom(isDM = roomParams.isDirect.orFalse()))
|
||||||
session.roomService().createRoom(roomParams)
|
session.roomService().createRoom(roomParams)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
analyticsTracker.capture(CreatedRoom(isDM = roomParams.isDirect.orFalse()))
|
|
||||||
|
|
||||||
setState {
|
setState {
|
||||||
copy(
|
copy(
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
package im.vector.app.features.createdirect
|
package im.vector.app.features.createdirect
|
||||||
|
|
||||||
|
import im.vector.app.features.VectorFeatures
|
||||||
import im.vector.app.features.analytics.AnalyticsTracker
|
import im.vector.app.features.analytics.AnalyticsTracker
|
||||||
import im.vector.app.features.analytics.plan.CreatedRoom
|
import im.vector.app.features.analytics.plan.CreatedRoom
|
||||||
import im.vector.app.features.raw.wellknown.getElementWellknown
|
import im.vector.app.features.raw.wellknown.getElementWellknown
|
||||||
|
@ -30,7 +31,8 @@ import javax.inject.Inject
|
||||||
class DirectRoomHelper @Inject constructor(
|
class DirectRoomHelper @Inject constructor(
|
||||||
private val rawService: RawService,
|
private val rawService: RawService,
|
||||||
private val session: Session,
|
private val session: Session,
|
||||||
private val analyticsTracker: AnalyticsTracker
|
private val analyticsTracker: AnalyticsTracker,
|
||||||
|
private val vectorFeatures: VectorFeatures,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
suspend fun ensureDMExists(userId: String): String {
|
suspend fun ensureDMExists(userId: String): String {
|
||||||
|
@ -48,8 +50,12 @@ class DirectRoomHelper @Inject constructor(
|
||||||
setDirectMessage()
|
setDirectMessage()
|
||||||
enableEncryptionIfInvitedUsersSupportIt = adminE2EByDefault
|
enableEncryptionIfInvitedUsersSupportIt = adminE2EByDefault
|
||||||
}
|
}
|
||||||
roomId = session.roomService().createRoom(roomParams)
|
roomId = if (vectorFeatures.shouldStartDmOnFirstMessage()) {
|
||||||
analyticsTracker.capture(CreatedRoom(isDM = roomParams.isDirect.orFalse()))
|
session.roomService().createLocalRoom(roomParams)
|
||||||
|
} else {
|
||||||
|
analyticsTracker.capture(CreatedRoom(isDM = roomParams.isDirect.orFalse()))
|
||||||
|
session.roomService().createRoom(roomParams)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return roomId
|
return roomId
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue