-
Notifications
You must be signed in to change notification settings - Fork 363
fix: Skips extra presences on join. #536
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
Open
damencho
wants to merge
2
commits into
master
Choose a base branch
from
skip-extra-presences
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,14 +34,13 @@ | |
| import java.util.stream.*; | ||
|
|
||
| /** | ||
| * The class listens for "focus joined room" and "conference created" events | ||
| * and adds the info about all conference components versions to Jicofo's MUC | ||
| * Providers info about all conference components versions to Jicofo's MUC | ||
| * presence. | ||
| * | ||
| * @author Pawel Domas | ||
| * @author Damian Minkov | ||
| */ | ||
| public class VersionBroadcaster | ||
|
||
| extends EventHandlerActivator | ||
| { | ||
| /** | ||
| * The logger | ||
|
|
@@ -50,105 +49,16 @@ public class VersionBroadcaster | |
| = Logger.getLogger(VersionBroadcaster.class); | ||
|
|
||
| /** | ||
| * <tt>FocusManager</tt> instance used to access | ||
| * <tt>JitsiMeetConference</tt>. | ||
| */ | ||
| private FocusManager focusManager; | ||
|
|
||
| /** | ||
| * <tt>VersionService</tt> which provides Jicofo version. | ||
| */ | ||
| private VersionService versionService; | ||
|
|
||
| /** | ||
| * Jitsi Meet tools used to add packet extension to Jicofo presence. | ||
| */ | ||
| private OperationSetJitsiMeetTools meetTools; | ||
|
|
||
| /** | ||
| * Creates new instance of <tt>VersionBroadcaster</tt>. | ||
| */ | ||
| public VersionBroadcaster() | ||
| { | ||
| super(new String[] { | ||
| EventFactory.FOCUS_JOINED_ROOM_TOPIC, | ||
| EventFactory.CONFERENCE_ROOM_TOPIC | ||
| }); | ||
| } | ||
|
|
||
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| @Override | ||
| public void start(BundleContext bundleContext) | ||
| throws Exception | ||
| { | ||
| focusManager | ||
| = ServiceUtils2.getService(bundleContext, FocusManager.class); | ||
|
|
||
| Objects.requireNonNull(focusManager, "focusManager"); | ||
|
|
||
| versionService | ||
| = ServiceUtils2.getService(bundleContext, VersionService.class); | ||
|
|
||
| Objects.requireNonNull(versionService, "versionService"); | ||
|
|
||
| meetTools | ||
| = focusManager.getOperationSet(OperationSetJitsiMeetTools.class); | ||
|
|
||
| Objects.requireNonNull(meetTools, "meetTools"); | ||
|
|
||
| super.start(bundleContext); | ||
| } | ||
|
|
||
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| @Override | ||
| public void stop(BundleContext bundleContext) | ||
| throws Exception | ||
| { | ||
| super.stop(bundleContext); | ||
|
|
||
| focusManager = null; | ||
| versionService = null; | ||
| meetTools = null; | ||
| } | ||
|
|
||
| /** | ||
| * Handles {@link EventFactory#FOCUS_JOINED_ROOM_TOPIC} and | ||
| * {@link EventFactory#CONFERENCE_ROOM_TOPIC}. | ||
| * | ||
| * Constructs versions extension to be sent with presence. | ||
| * {@inheritDoc} | ||
| */ | ||
| @Override | ||
| public void handleEvent(Event event) | ||
| static ComponentVersionsExtension getVersionsExtension( | ||
| JitsiMeetConference conference) | ||
| { | ||
| String topic = event.getTopic(); | ||
| if (!topic.equals(EventFactory.FOCUS_JOINED_ROOM_TOPIC) | ||
| && !topic.equals(EventFactory.CONFERENCE_ROOM_TOPIC)) | ||
| { | ||
| logger.error("Unexpected event topic: " + topic); | ||
| return; | ||
| } | ||
|
|
||
| EntityBareJid roomJid | ||
| = (EntityBareJid)event.getProperty(EventFactory.ROOM_JID_KEY); | ||
|
|
||
| JitsiMeetConference conference | ||
| = focusManager.getConference(roomJid); | ||
| if (conference == null) | ||
| { | ||
| logger.error("Conference is null"); | ||
| return; | ||
| } | ||
|
|
||
| ChatRoom chatRoom = conference.getChatRoom(); | ||
| if (chatRoom == null) | ||
| { | ||
| logger.error("Chat room is null"); | ||
| return; | ||
| } | ||
| FocusManager focusManager = ServiceUtils2.getService( | ||
| FocusBundleActivator.bundleContext, FocusManager.class); | ||
| VersionService versionService = ServiceUtils2.getService( | ||
| FocusBundleActivator.bundleContext, VersionService.class); | ||
|
|
||
| JitsiMeetServices meetServices = focusManager.getJitsiMeetServices(); | ||
| ComponentVersionsExtension versionsExtension | ||
|
|
@@ -186,9 +96,9 @@ public void handleEvent(Event event) | |
| String.join(",", jvbVersions)); | ||
| } | ||
|
|
||
| meetTools.sendPresenceExtension(chatRoom, versionsExtension); | ||
|
|
||
| if (logger.isDebugEnabled()) | ||
| logger.debug("Sending versions: " + versionsExtension.toXML()); | ||
| logger.debug("Providing versions: " + versionsExtension.toXML()); | ||
|
|
||
| return versionsExtension; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
typo in "Providers"