mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Update meeting details after successfull edit
This commit is contained in:
parent
5d58b2a0fd
commit
e83afdf436
5 changed files with 27 additions and 6 deletions
|
|
@ -165,12 +165,6 @@ class ConversationViewModel @UiThread constructor() : AbstractConversationViewMo
|
|||
addEvents(arrayOf(eventLog))
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
override fun onChatMessageSent(chatRoom: ChatRoom, eventLog: EventLog) {
|
||||
val message = eventLog.chatMessage
|
||||
Log.i("$TAG Message [$message] has been sent")
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
override fun onChatMessagesReceived(chatRoom: ChatRoom, eventLogs: Array<EventLog>) {
|
||||
Log.i("$TAG Received [${eventLogs.size}] new message(s)")
|
||||
|
|
|
|||
|
|
@ -181,6 +181,7 @@ class EditMeetingFragment : SlidingPaneChildFragment() {
|
|||
getString(R.string.meeting_info_updated_toast),
|
||||
R.drawable.check
|
||||
)
|
||||
sharedViewModel.meetingEditedEvent.value = Event(true)
|
||||
sharedViewModel.forceRefreshMeetingsListEvent.value = Event(true)
|
||||
goBack()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -151,6 +151,13 @@ class MeetingFragment : SlidingPaneChildFragment() {
|
|||
viewModel.showBackButton.value = slideable
|
||||
}
|
||||
|
||||
sharedViewModel.meetingEditedEvent.observe(viewLifecycleOwner) {
|
||||
it.consume {
|
||||
Log.i("$TAG Meeting with URI [$uri] has been edited, reloading info")
|
||||
viewModel.refreshInfo(uri)
|
||||
}
|
||||
}
|
||||
|
||||
viewModel.conferenceInfoFoundEvent.observe(viewLifecycleOwner) {
|
||||
it.consume { found ->
|
||||
if (found) {
|
||||
|
|
|
|||
|
|
@ -192,6 +192,21 @@ class MeetingViewModel @UiThread constructor() : GenericViewModel() {
|
|||
}
|
||||
}
|
||||
|
||||
@UiThread
|
||||
fun refreshInfo(uri: String) {
|
||||
coreContext.postOnCoreThread { core ->
|
||||
val address = Factory.instance().createAddress(uri)
|
||||
if (address != null) {
|
||||
val found = core.findConferenceInformationFromUri(address)
|
||||
if (found != null) {
|
||||
Log.i("$TAG Conference info with SIP URI [$uri] was found, updating info")
|
||||
conferenceInfo = found
|
||||
configureConferenceInfo()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
private fun configureConferenceInfo() {
|
||||
if (::conferenceInfo.isInitialized) {
|
||||
|
|
|
|||
|
|
@ -144,6 +144,10 @@ class SharedMainViewModel @UiThread constructor() : ViewModel() {
|
|||
|
||||
var displayedMeeting: ConferenceInfo? = null // Prevents the need to go look for the conference info
|
||||
|
||||
val meetingEditedEvent: MutableLiveData<Event<Boolean>> by lazy {
|
||||
MutableLiveData<Event<Boolean>>()
|
||||
}
|
||||
|
||||
val forceRefreshMeetingsListEvent: MutableLiveData<Event<Boolean>> by lazy {
|
||||
MutableLiveData<Event<Boolean>>()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue