Skip to content
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

feat(transcription): Handles dial iq coming from visitors. #1165

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ public interface JitsiMeetConference extends XmppProvider.Listener
*/
EntityBareJid getMainRoomJid();

/**
* @return the JIDs of the connected visitor rooms.
*/
List<EntityBareJid> getVisitorRoomsJids();

/** Return the number of visitors in the conference */
long getVisitorCount();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,13 @@ public EntityBareJid getMainRoomJid()
return mainRoomJid;
}

@Override
public List<EntityBareJid> getVisitorRoomsJids()
{
return this.visitorChatRooms.values().stream().map(ChatRoom::getRoomJid)
.collect(Collectors.toList());
}

/**
* @return the colibri session manager, late init.
*/
Expand Down
17 changes: 12 additions & 5 deletions jicofo/src/main/kotlin/org/jitsi/jicofo/xmpp/JigasiIqHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,18 @@ class JigasiIqHandler(
Stats.rejectedRequests.inc()
}

val conference = conferenceStore.getConference(conferenceJid)
?: return RejectedWithError(request, StanzaError.Condition.item_not_found).also {
logger.warn("Rejected request for non-existent conference: $conferenceJid")
Stats.rejectedRequests.inc()
}
var conference = conferenceStore.getConference(conferenceJid)

if (conference == null) {
// let's search for visitor room with that jid, maybe it's an invite from a visitor
conference = conferenceStore.getAllConferences()
.find { c -> c.visitorRoomsJids.contains(conferenceJid) }
}

conference ?: return RejectedWithError(request, StanzaError.Condition.item_not_found).also {
logger.warn("Rejected request for non-existent conference: $conferenceJid")
Stats.rejectedRequests.inc()
}

if (!conference.acceptJigasiRequest(request.iq.from)) {
return RejectedWithError(request, StanzaError.Condition.forbidden).also {
Expand Down
4 changes: 3 additions & 1 deletion jicofo/src/main/kotlin/org/jitsi/jicofo/xmpp/XmppServices.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ class XmppServices(

private val jigasiIqHandler = if (jigasiDetector != null) {
JigasiIqHandler(
setOf(clientConnection.xmppConnection, serviceConnection.xmppConnection),
setOf(clientConnection.xmppConnection, serviceConnection.xmppConnection) + visitorConnections.map {
it.xmppConnection
}.toSet(),
conferenceStore,
jigasiDetector
)
Expand Down
Loading