Issue #3038 added initialized flag to session feed view
differentiates between roster population and new joins Former-commit-id: 9b6c20ac39765120efc523c03a3d11d4b21c1748
This commit is contained in:
parent
a6b5997663
commit
ef61a7c281
1 changed files with 18 additions and 1 deletions
|
@ -74,6 +74,7 @@ import com.raytheon.uf.viz.core.icon.IconUtil;
|
||||||
* Mar 24, 2014 2936 mpduff Remove join alerts from feed view.
|
* Mar 24, 2014 2936 mpduff Remove join alerts from feed view.
|
||||||
* Mar 25, 2014 2938 mpduff Show status message for site and role changes.
|
* Mar 25, 2014 2938 mpduff Show status message for site and role changes.
|
||||||
* Apr 01, 2014 2938 mpduff Update logic for site and role changes.
|
* Apr 01, 2014 2938 mpduff Update logic for site and role changes.
|
||||||
|
* Apr 22, 2014 3038 bclement added initialized flag to differentiate between roster population and new joins
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -104,6 +105,8 @@ public class SessionFeedView extends SessionView {
|
||||||
*/
|
*/
|
||||||
private final ConcurrentHashMap<String, Presence> enabledUsers = new ConcurrentHashMap<String, Presence>();
|
private final ConcurrentHashMap<String, Presence> enabledUsers = new ConcurrentHashMap<String, Presence>();
|
||||||
|
|
||||||
|
private volatile boolean initialized = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -409,6 +412,18 @@ public class SessionFeedView extends SessionView {
|
||||||
@Override
|
@Override
|
||||||
protected void participantPresenceUpdated(VenueParticipant participant,
|
protected void participantPresenceUpdated(VenueParticipant participant,
|
||||||
Presence presence) {
|
Presence presence) {
|
||||||
|
/*
|
||||||
|
* when we join, the room will send presence for everyone in the room,
|
||||||
|
* then send us our own presence to signify that the list is done and we
|
||||||
|
* have been initialized.
|
||||||
|
*/
|
||||||
|
if (!initialized && session.getUserID().isSameUser(participant)) {
|
||||||
|
initialized = true;
|
||||||
|
/*
|
||||||
|
* continue and print the message for ourselves joining which will
|
||||||
|
* serve as a delimiter between historical messages and new messages
|
||||||
|
*/
|
||||||
|
}
|
||||||
// Verify we have properties
|
// Verify we have properties
|
||||||
if (!presence.getPropertyNames().contains(
|
if (!presence.getPropertyNames().contains(
|
||||||
SiteConfigInformation.SITE_NAME)) {
|
SiteConfigInformation.SITE_NAME)) {
|
||||||
|
@ -425,7 +440,9 @@ public class SessionFeedView extends SessionView {
|
||||||
|
|
||||||
String roleName = getRoleName(presence);
|
String roleName = getRoleName(presence);
|
||||||
if (presence.isAvailable()) {
|
if (presence.isAvailable()) {
|
||||||
if (prev == null || hasPresenceChanged(prev, presence)) {
|
/* only print announcements after we are initialized */
|
||||||
|
if (initialized
|
||||||
|
&& (prev == null || hasPresenceChanged(prev, presence))) {
|
||||||
StringBuilder message = getMessage(roleName, siteName, user);
|
StringBuilder message = getMessage(roleName, siteName, user);
|
||||||
sendSystemMessage(message);
|
sendSystemMessage(message);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue