Skip to content

Commit

Permalink
squash: Fixes comments and updates the dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
damencho committed Oct 28, 2024
1 parent c6a1cda commit e0eeaad
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jitsi-xmpp-extensions</artifactId>
<version>1.0-78-g62d03d4</version>
<version>1.0-82-ge8aacab</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
38 changes: 20 additions & 18 deletions src/main/java/org/jitsi/jigasi/sounds/SoundNotificationManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -235,28 +235,35 @@ public void process(Presence presence)
{
if (gatewaySession.getFocusResourceAddr().equals(presence.getFrom().getResourceOrEmpty().toString()))
{
boolean isJibriRecordingOn = false;
RecordingStatus rs = presence.getExtension(RecordingStatus.class);

if (rs != null)
{
notifyRecordingStatusChanged(rs.getRecordingMode(), rs.getStatus());

return;
isJibriRecordingOn = true;
}

boolean isAudioRecordingOn = false;
ConferenceProperties props = presence.getExtension(ConferenceProperties.class);

if (props != null)
{
props.getProperties().stream()
.filter(p -> ConferenceProperties.KEY_AUDIO_RECORDING_ENABLED.equals(p.getKey()))
.findFirst().ifPresent(p ->
{
if (p.getValue().equals(Boolean.TRUE.toString()))
{
notifyRecordingStatusChanged(JibriIq.RecordingMode.FILE, JibriIq.Status.ON);
}
});
ConferenceProperties.ConferenceProperty prop
= props.getProperties().stream()
.filter(p -> ConferenceProperties.KEY_AUDIO_RECORDING_ENABLED.equals(p.getKey()))
.findFirst().orElse(null);

isAudioRecordingOn = prop != null && prop.getValue().equals(Boolean.TRUE.toString());
}

JibriIq.Status newStatus
= isJibriRecordingOn || isAudioRecordingOn ? JibriIq.Status.ON : JibriIq.Status.OFF;

if (currentJibriStatus.equals(newStatus))
{
return;
}

notifyRecordingStatusChanged(rs != null ? rs.getRecordingMode() : JibriIq.RecordingMode.FILE, newStatus);
}
}

Expand All @@ -269,11 +276,6 @@ public void process(Presence presence)
private void notifyRecordingStatusChanged(
JibriIq.RecordingMode mode, JibriIq.Status status)
{
// not a change, ignore
if (currentJibriStatus.equals(status))
{
return;
}
currentJibriStatus = status;

String offSound;
Expand Down

0 comments on commit e0eeaad

Please sign in to comment.