Closed pekam closed 2 years ago
This is now provided by the PresenceManager
:
presenceManager.setPresenceHandler(context -> {
UserInfo user = context.getUser();
log(user.getName() + " joined");
return () -> log(user.getName() + " left");
});
Is your feature request related to a use case? Please describe.
In issue #6, @chrosim described a use case. He would like to display a label above the avatar group conditionally when there are more than zero avatars in the group.
Describe the solution you'd like A generic API for reacting to changes in the list of users would solve this use case and potentially other cases as well.
The proposal is an event listener API, with an event class like this:
The type for users would be
Collection
instead ofList
, because we haven't made any promises of how the avatars are ordered.The listener interface would be:
The method to add to
CollaborationAvatarGroup
would be:The usage for the described use case would look like this:
To accompany this event listener API, it would make sense to also have a getter method in
CollaborationAvatarGroup
. I propose we add that in the scope of this ticket: