Skip to content

Commit

Permalink
feat(transcription): Handles dial iq coming from visitors.
Browse files Browse the repository at this point in the history
  • Loading branch information
damencho committed Sep 13, 2024
1 parent 5cba140 commit 8256b8b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
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, its maybe 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

0 comments on commit 8256b8b

Please sign in to comment.