-
Notifications
You must be signed in to change notification settings - Fork 614
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
Add Stream Name field in room info command #3439
Conversation
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.
There are some parts needs to be changed. I'll make some quick commits for that. Please take a look at the new commits and if you think it does not make sense, we can discuss.
JSONObject jsonResponse = new JSONObject(); | ||
JSONArray jsonStreamIdArray = null; |
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.
There is code duplication
jsonResponse.put(WebSocketConstants.COMMAND, WebSocketConstants.NOTIFICATION_COMMAND); | ||
jsonResponse.put(WebSocketConstants.DEFINITION, WebSocketConstants.JOINED_THE_ROOM); | ||
jsonResponse.put(WebSocketConstants.STREAM_ID, newStreamId); | ||
jsonResponse.put(WebSocketConstants.STREAMS_IN_ROOM, jsonStreamArray); | ||
jsonResponse.put(WebSocketConstants.STREAMS_IN_ROOM, jsonStreamIdArray); | ||
jsonResponse.put(WebSocketConstants.STREAM_NAMES_IN_ROOM, jsonStreamNameArray); |
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 don't think it's good idea to have two separate arrays having related information. It creates an overload in parsing.
Kudos, SonarCloud Quality Gate passed! |
#3344