From 977721881f62c40543810a2c6b941e447120d7d3 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 17 Jul 2019 18:35:41 +0200 Subject: [PATCH] Cancel invitation notification when handling the invitation in the application --- .../riotx/features/home/room/detail/RoomDetailFragment.kt | 2 ++ .../vector/riotx/features/home/room/list/RoomListFragment.kt | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt index c8e2d944..55ee4dfa 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt @@ -858,10 +858,12 @@ class RoomDetailFragment : // VectorInviteView.Callback override fun onAcceptInvite() { + notificationDrawerManager.clearMemberShipNotificationForRoom(roomDetailArgs.roomId) roomDetailViewModel.process(RoomDetailActions.AcceptInvite) } override fun onRejectInvite() { + notificationDrawerManager.clearMemberShipNotificationForRoom(roomDetailArgs.roomId) roomDetailViewModel.process(RoomDetailActions.RejectInvite) } } diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomListFragment.kt b/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomListFragment.kt index 74873e51..b61e69ac 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomListFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomListFragment.kt @@ -38,6 +38,7 @@ import im.vector.riotx.core.platform.OnBackPressed import im.vector.riotx.core.platform.StateView import im.vector.riotx.core.platform.VectorBaseFragment import im.vector.riotx.features.home.room.list.widget.FabMenuView +import im.vector.riotx.features.notifications.NotificationDrawerManager import kotlinx.android.parcel.Parcelize import kotlinx.android.synthetic.main.fragment_room_list.* import javax.inject.Inject @@ -69,6 +70,7 @@ class RoomListFragment : VectorBaseFragment(), RoomSummaryController.Listener, O @Inject lateinit var roomController: RoomSummaryController @Inject lateinit var roomListViewModelFactory: RoomListViewModel.Factory @Inject lateinit var errorFormatter: ErrorFormatter + @Inject lateinit var notificationDrawerManager: NotificationDrawerManager private val roomListViewModel: RoomListViewModel by fragmentViewModel() override fun getLayoutResId() = R.layout.fragment_room_list @@ -258,10 +260,12 @@ class RoomListFragment : VectorBaseFragment(), RoomSummaryController.Listener, O } override fun onAcceptRoomInvitation(room: RoomSummary) { + notificationDrawerManager.clearMemberShipNotificationForRoom(room.roomId) roomListViewModel.accept(RoomListActions.AcceptInvitation(room)) } override fun onRejectRoomInvitation(room: RoomSummary) { + notificationDrawerManager.clearMemberShipNotificationForRoom(room.roomId) roomListViewModel.accept(RoomListActions.RejectInvitation(room)) }