Vaadin Collaboration Engine 3.2.0.alpha3
Pre-release
Pre-release
Refactored PresenceManager
API
The PresenceManager
, introduced in 3.2.0.alpha2
, has been improved based on feedback.
setAutoPresence
has been renamed tomarkAsPresent
PresenceManager presence = new PresenceManager(users, ownUserInfo, topicId);
presence.markAsPresent(true);
getUsers
method has been removed from the public API. The method always returned0
before the connection was established, which lead to confusion. Developers should now register aNewUserHandler
if they want keep track of the users as they are added or removed from a topic.
Example: Keeping a list of users in a topic.
// Create your own list to keep track of the users in the topic
List<UserInfo> userList = ...;
// ...
presenceManager.setNewUserHandler(userInfo -> {
// Add the new user to the local list when she joins the topic
userList.add(userInfo);
return () -> {
// Remove the user from the local list when she leaves the topic
userList.remove(userInfo);
};
});