Skip to content

Commit

Permalink
Merge branch 'release/tchap_v2.9.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
yostyle committed Dec 22, 2023
2 parents 168bb88 + 78d8722 commit aab5fe0
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 18 deletions.
9 changes: 9 additions & 0 deletions TCHAP_CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
Changes in Tchap 2.9.8 (2023-12-22)
===================================

Improvements 🙌
--------------
- Improve on-screen keyboard interaction when logging in. ([#948](https://github.com/tchapgouv/tchap-android/issues/948))
- Les forums sont fédérés par défaut à la création. ([#999](https://github.com/tchapgouv/tchap-android/issues/999))


Changes in Tchap 2.9.7 (2023-12-18)
===================================

Expand Down
2 changes: 1 addition & 1 deletion towncrier.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.towncrier]
version = "2.9.7"
version = "2.9.8"
directory = "changelog.d"
filename = "TCHAP_CHANGES.md"
name = "Changes in Tchap"
Expand Down
2 changes: 1 addition & 1 deletion vector-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ext.versionMinor = 9
// Note: even values are reserved for regular release, odd values for hotfix release.
// When creating a hotfix, you should decrease the value, since the current value
// is the value for the next regular release.
ext.versionPatch = 7
ext.versionPatch = 8

static def getGitTimestamp() {
def cmd = 'git show -s --format=%ct'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ class FtueAuthLoginFragment :
views.loginFieldTil.isHelperTextEnabled = false
views.passwordFieldTil.isHelperTextEnabled = false
views.tchapPasswordConfirmationFieldTil.isVisible = false
views.passwordField.imeOptions = EditorInfo.IME_ACTION_DONE
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,20 +224,13 @@ class CreateRoomViewModel @AssistedInject constructor(
}

private fun setTchapRoomType(action: CreateRoomAction.SetTchapRoomType) = setState {
if (action.roomType == TchapRoomType.FORUM) {
val userHSDomain = TchapUtils.getHomeServerDisplayNameFromMXIdentifier(session.myUserId)
val isAgentServerDomain = userHSDomain.equals(AGENT_SERVER_DOMAIN, ignoreCase = true)
copy(
roomType = action.roomType,
disableFederation = !isAgentServerDomain,
isFederationSettingAvailable = !isAgentServerDomain
)
} else {
copy(
roomType = action.roomType,
disableFederation = false
)
}
val isFederationSettingAvailable = action.roomType == TchapRoomType.FORUM &&
!TchapUtils.getHomeServerDisplayNameFromMXIdentifier(session.myUserId).equals(AGENT_SERVER_DOMAIN, ignoreCase = true)
copy(
roomType = action.roomType,
disableFederation = false,
isFederationSettingAvailable = isFederationSettingAvailable
)
}

private fun setRoomAliasLocalPart(action: CreateRoomAction.SetRoomAliasLocalPart) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ data class CreateRoomViewState(
val defaultEncrypted: Map<RoomJoinRules, Boolean> = emptyMap(),
val showAdvanced: Boolean = false,
val disableFederation: Boolean = false,
val isFederationSettingAvailable: Boolean = true,
val isFederationSettingAvailable: Boolean = false,
val homeServerName: String = "",
val userDomain: String = "",
val hsAdminHasDisabledE2E: Boolean = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ import im.vector.app.R
import im.vector.app.core.extensions.replaceFragment
import im.vector.app.core.platform.VectorBaseActivity
import im.vector.app.databinding.ActivityVectorSettingsBinding
import im.vector.app.features.analytics.plan.ViewRoom
import im.vector.app.features.discovery.DiscoverySettingsFragment
import im.vector.app.features.matrixto.MatrixToBottomSheet
import im.vector.app.features.navigation.Navigator
import im.vector.app.features.navigation.SettingsActivityPayload
import im.vector.app.features.settings.devices.VectorSettingsDevicesFragment
import im.vector.app.features.settings.notifications.VectorSettingsNotificationFragment
Expand All @@ -48,9 +51,33 @@ private const val KEY_ACTIVITY_PAYLOAD = "settings-activity-payload"
@AndroidEntryPoint
class VectorSettingsActivity : VectorBaseActivity<ActivityVectorSettingsBinding>(),
PreferenceFragmentCompat.OnPreferenceStartFragmentCallback,
MatrixToBottomSheet.InteractionListener,
FragmentManager.OnBackStackChangedListener,
VectorSettingsFragmentInteractionListener {

// Tchap: Manage Christmas entry
private val fragmentLifecycleCallbacks = object : FragmentManager.FragmentLifecycleCallbacks() {
override fun onFragmentResumed(fm: FragmentManager, f: Fragment) {
if (f is MatrixToBottomSheet) {
f.interactionListener = this@VectorSettingsActivity
}
super.onFragmentResumed(fm, f)
}

override fun onFragmentPaused(fm: FragmentManager, f: Fragment) {
if (f is MatrixToBottomSheet) {
f.interactionListener = null
}
super.onFragmentPaused(fm, f)
}
}

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

supportFragmentManager.registerFragmentLifecycleCallbacks(fragmentLifecycleCallbacks, false)
}

override fun getBinding() = ActivityVectorSettingsBinding.inflate(layoutInflater)

override fun getCoordinatorLayout() = views.coordinatorLayout
Expand Down Expand Up @@ -106,6 +133,7 @@ class VectorSettingsActivity : VectorBaseActivity<ActivityVectorSettingsBinding>
}

override fun onDestroy() {
supportFragmentManager.unregisterFragmentLifecycleCallbacks(fragmentLifecycleCallbacks)
supportFragmentManager.removeOnBackStackChangedListener(this)
super.onDestroy()
}
Expand Down Expand Up @@ -161,6 +189,14 @@ class VectorSettingsActivity : VectorBaseActivity<ActivityVectorSettingsBinding>
}
}

// Tchap: Manage Christmas entry
override fun mxToBottomSheetNavigateToRoom(roomId: String, trigger: ViewRoom.Trigger?) {
navigator.openRoom(this, roomId, trigger = trigger)
}
override fun mxToBottomSheetSwitchToSpace(spaceId: String) {
navigator.switchToSpace(this, spaceId, Navigator.PostSwitchSpaceAction.None)
}

fun <T : Fragment> navigateTo(fragmentClass: Class<T>, arguments: Bundle? = null) {
supportFragmentManager.beginTransaction()
.setCustomAnimations(R.anim.right_in, R.anim.fade_out, R.anim.fade_in, R.anim.right_out)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ import im.vector.app.core.preference.VectorPreference
import im.vector.app.core.utils.FirstThrottler
import im.vector.app.core.utils.openUrlInChromeCustomTab
import im.vector.app.features.analytics.plan.MobileScreen
import im.vector.app.features.matrixto.OriginOfMatrixTo
import im.vector.app.features.navigation.Navigator
import org.matrix.android.sdk.api.session.getRoomSummary
import org.matrix.android.sdk.api.session.room.model.Membership
import java.util.Calendar

@AndroidEntryPoint
Expand Down Expand Up @@ -69,7 +72,18 @@ class VectorSettingsRootFragment :
it.isVisible = true
it.onPreferenceClickListener = Preference.OnPreferenceClickListener {
if (firstThrottler.canHandle() is FirstThrottler.CanHandlerResult.Yes) {
navigator.openRoom(requireContext(), "!cDKdQyXHeWBEaKDWWV:agent.dinum.tchap.gouv.fr", null)
val roomAlias = "#JoyeusesFtesdelapartdelquipeTchapGl2gFYK2OD:agent.dinum.tchap.gouv.fr"
val eventId = "\$xW9f1eJGxQ1xstdPCVReUKQO_sFU4242SfaMIfNh3NU"

session.getRoomSummary(roomAlias).let { roomSummary ->
if (roomSummary?.membership == Membership.JOIN) {
navigator.openRoom(requireContext(), roomSummary.roomId)
} else {
session.permalinkService().createPermalink(roomAlias, eventId).let { link ->
navigator.openMatrixToBottomSheet(requireActivity(), link, OriginOfMatrixTo.LINK)
}
}
}
}
false
}
Expand Down

0 comments on commit aab5fe0

Please sign in to comment.