-
Notifications
You must be signed in to change notification settings - Fork 731
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
Voice Broadcast - Send state events #7273
Conversation
a619173
to
1f23162
Compare
...r/src/main/java/im/vector/app/features/voicebroadcast/usecase/ResumeVoiceBroadcastUseCase.kt
Outdated
Show resolved
Hide resolved
...or/src/main/java/im/vector/app/features/voicebroadcast/usecase/StartVoiceBroadcastUseCase.kt
Outdated
Show resolved
Hide resolved
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.
LGTM, only small remarks!
vector/src/main/java/im/vector/app/features/home/room/detail/TimelineViewModel.kt
Show resolved
Hide resolved
...src/main/java/im/vector/app/features/home/room/detail/timeline/factory/MessageItemFactory.kt
Outdated
Show resolved
Hide resolved
...main/java/im/vector/app/features/home/room/detail/timeline/item/MessageVoiceBroadcastItem.kt
Outdated
Show resolved
Hide resolved
@Json(name = "m.new_content") override val newContent: Content? = null, | ||
|
||
/** The [VoiceBroadcastState] value. **/ | ||
@Json(name = "state") val voiceBroadcastStateStr: String = "", |
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.
Thanks for using a String
here.
|
||
Timber.d("## ResumeVoiceBroadcastUseCase: Resume voice broadcast requested") | ||
|
||
val lastVoiceBroadcastEvent = room.stateService().getStateEvent(STATE_ROOM_VOICE_BROADCAST_INFO, QueryStringValue.Equals(session.myUserId)) |
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.
I am wondering if we could have a object which observe the state, to always have the latest state event of the voice broadcast per room. Maybe this will be needed later.
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.
I was also thinking about it, I will see if I do it in this PR or improve it in a future PR (I am still looking for the implementation)
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.
I suggest considering this later
...r/src/main/java/im/vector/app/features/voicebroadcast/usecase/ResumeVoiceBroadcastUseCase.kt
Outdated
Show resolved
Hide resolved
|
||
private suspend fun startVoiceBroadcast(room: Room) { | ||
Timber.d("## StartVoiceBroadcastUseCase: Send new voice broadcast info state event") | ||
room.stateService().sendStateEvent( |
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.
This method can throw (no network for instance). Maybe protect by a try/catch. (applicable to the other similar calls)
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.
I didn't find a better way than catching the whole execute function: b286a52
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.
@bmarty I let you review this commit to resolve or not this conversation here
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, this is fine.
vector/src/main/java/im/vector/app/features/voicebroadcast/usecase/StopVoiceBroadcastUseCase.kt
Outdated
Show resolved
Hide resolved
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.
SGTM
b06c2af
to
07f0069
Compare
Force pushed to rebase on develop and remove a commit from the state events aggregation which is the purpose of another PR |
987b506
to
688c908
Compare
688c908
to
b286a52
Compare
|
SonarCloud Quality Gate failed. |
Type of change
Content
io.element.voice_broadcast_info
state event related to Voice Broadcast (by message chunking) element-meta#632Motivation and context
Continue #7127
Screenshots / GIFs
Tests
Tested devices
Checklist