Skip to content

Commit

Permalink
squash: Fixes some warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
damencho committed Dec 1, 2023
1 parent 470217a commit 3cefb36
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ void notifyChatRoomMemberUpdated(ChatRoomMember chatMember, Presence presence)
}
catch (InterruptedException e)
{
e.printStackTrace();
logger.error(e);
}

if (!transcriber.isAnyParticipantRequestingTranscription())
Expand Down Expand Up @@ -564,7 +564,7 @@ private String getConferenceMemberResourceID(ConferenceMember member)
}
catch (XmppStringprepException e)
{
e.printStackTrace();
logger.error(e);
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,9 @@ public class WhisperConnectionPool
/**
* Gets a connection if it exists, creates one if it doesn't.
* @param roomId The room jid.
* @param participantId The participant id.
* @return The websocket.
* @throws Exception When fail to initialize the socket.
*/
public WhisperWebsocket getConnection(String roomId, String participantId)
throws Exception
public WhisperWebsocket getConnection(String roomId)
{
if (!pool.containsKey(roomId))
{
Expand All @@ -86,9 +83,7 @@ public WhisperWebsocket getConnection(String roomId, String participantId)
public void end(String roomId, String participantId)
{
// execute this in new thread to not block Smack
threadPool.execute(() -> {
this.endInternal(roomId, participantId);
});
threadPool.execute(() -> this.endInternal(roomId, participantId));
}

private void endInternal(String roomId, String participantId)
Expand All @@ -99,12 +94,11 @@ private void endInternal(String roomId, String participantId)
return;
}

boolean isEverybodyDisconnected = false;
try
{
isEverybodyDisconnected = wsConn.disconnectParticipant(participantId);
if (isEverybodyDisconnected)
if (wsConn.disconnectParticipant(participantId))
{
// remove from the pull if everyone is disconnected
pool.remove(roomId);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,13 @@ public static class WhisperWebsocketStreamingSession


WhisperWebsocketStreamingSession(Participant participant)
throws Exception
{
this.participant = participant;
String[] debugName = this.participant.getDebugName().split("/");
participantId = debugName[1];
roomId = participant.getTranscriber().getRoomName();
connectionPool = WhisperConnectionPool.getInstance();
wsClient = connectionPool.getConnection(roomId, participantId);
wsClient = connectionPool.getConnection(roomId);
wsClient.setTranscriptionTag(transcriptionTag);
}

Expand Down

0 comments on commit 3cefb36

Please sign in to comment.