-
Notifications
You must be signed in to change notification settings - Fork 751
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
Deferred DMs - Add and enable the feature by default in the labs settings #7180
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 @@ | ||
Deferred DMs - Enable and move the feature to labs settings |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,11 +26,11 @@ import im.vector.app.core.di.MavericksAssistedViewModelFactory | |
import im.vector.app.core.di.hiltMavericksViewModelFactory | ||
import im.vector.app.core.mvrx.runCatchingToAsync | ||
import im.vector.app.core.platform.VectorViewModel | ||
import im.vector.app.features.VectorFeatures | ||
import im.vector.app.features.analytics.AnalyticsTracker | ||
import im.vector.app.features.analytics.plan.CreatedRoom | ||
import im.vector.app.features.raw.wellknown.getElementWellknown | ||
import im.vector.app.features.raw.wellknown.isE2EByDefault | ||
import im.vector.app.features.settings.VectorPreferences | ||
import im.vector.app.features.userdirectory.PendingSelection | ||
import kotlinx.coroutines.Dispatchers | ||
import kotlinx.coroutines.launch | ||
|
@@ -45,9 +45,9 @@ import org.matrix.android.sdk.api.session.room.model.create.CreateRoomParams | |
class CreateDirectRoomViewModel @AssistedInject constructor( | ||
@Assisted initialState: CreateDirectRoomViewState, | ||
private val rawService: RawService, | ||
private val vectorPreferences: VectorPreferences, | ||
val session: Session, | ||
val analyticsTracker: AnalyticsTracker, | ||
val vectorFeatures: VectorFeatures | ||
) : | ||
VectorViewModel<CreateDirectRoomViewState, CreateDirectRoomAction, CreateDirectRoomViewEvents>(initialState) { | ||
|
||
|
@@ -124,7 +124,7 @@ class CreateDirectRoomViewModel @AssistedInject constructor( | |
} | ||
|
||
val result = runCatchingToAsync { | ||
if (vectorFeatures.shouldStartDmOnFirstMessage()) { | ||
if (vectorPreferences.isDeferredDmEnabled()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a remark as I am seeing this now: can you check that analytics will be sent when the room will be created? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good remark, done fa8b56b |
||
session.roomService().createLocalRoom(roomParams) | ||
} else { | ||
analyticsTracker.capture(CreatedRoom(isDM = roomParams.isDirect.orFalse())) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the doc at the top of this file, you should add another key with
visible
suffix:and use it in the labs pref file.
Maybe for this very temporary setting you could take this remark as optional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done dd92bb7 but the "doc" at the beginning of the file does not tell that these fields are "mandatory", it's more a description of the naming convention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, thanks 👐