Skip to content

Vaadin Collaboration Engine 3.2.0.alpha3

Pre-release
Pre-release
Compare
Choose a tag to compare
@tulioag tulioag released this 28 Jun 08:32
· 526 commits to main since this release
cd9acf0

Refactored PresenceManager API

The PresenceManager, introduced in 3.2.0.alpha2, has been improved based on feedback.

  • setAutoPresence has been renamed to markAsPresent
PresenceManager presence = new PresenceManager(users, ownUserInfo, topicId);
presence.markAsPresent(true);
  • getUsers method has been removed from the public API. The method always returned 0 before the connection was established, which lead to confusion. Developers should now register a NewUserHandler 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);
    };
});