Omaha #3061 only shared display capable clients get payload in invite
Former-commit-id:46b526473d
[formerlydec5159216
] [formerly1502354f87
] [formerlyc61e30a422
[formerly1502354f87
[formerly 6595f5be37941f35c33b46231deef7d41e967380]]] Former-commit-id:c61e30a422
Former-commit-id: 0a74f9c3259a55c56b2763cb02f26aae56e52755 [formerly58f45fa7d0
] Former-commit-id:9d25e9dcb8
This commit is contained in:
parent
58fda9c22a
commit
89fbf5f2bc
2 changed files with 56 additions and 15 deletions
|
@ -59,6 +59,7 @@ import com.raytheon.uf.common.xmpp.ext.ChangeAffiliationExtension;
|
|||
import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.ISession;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.invite.VenueInvite;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.user.SharedDisplayRole;
|
||||
import com.raytheon.uf.viz.collaboration.comm.packet.SessionPayload;
|
||||
import com.raytheon.uf.viz.collaboration.comm.packet.SessionPayload.PayloadType;
|
||||
|
@ -101,6 +102,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
|
|||
* Apr 21, 2014 2822 bclement removed use of resources in topicSubscribers, added skipCache
|
||||
* Apr 22, 2014 2903 bclement added connection test to closePubSub() method
|
||||
* Apr 23, 2014 2822 bclement added formatInviteAddress()
|
||||
* Apr 29, 2014 3061 bclement added createInviteMessage()
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -804,6 +806,39 @@ public class SharedDisplaySession extends VenueSession implements
|
|||
return rval;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see ContactsManager#getSharedDisplayEnabledResource(UserId)
|
||||
* @param user
|
||||
* @return null if none found
|
||||
*/
|
||||
private String getSharedDisplayResource(UserId user) {
|
||||
CollaborationConnection manager = getConnection();
|
||||
ContactsManager cm = manager.getContactsManager();
|
||||
return cm.getSharedDisplayEnabledResource(user);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.collaboration.comm.provider.session.VenueSession#
|
||||
* createInviteMessage
|
||||
* (com.raytheon.uf.viz.collaboration.comm.provider.user.UserId,
|
||||
* com.raytheon.uf.viz.collaboration.comm.identity.invite.VenueInvite)
|
||||
*/
|
||||
@Override
|
||||
protected Message createInviteMessage(UserId id, VenueInvite invite) {
|
||||
Message rval = super.createInviteMessage(id, invite);
|
||||
/* only send shared display invite if we know the user supports it */
|
||||
if (getSharedDisplayResource(id) != null) {
|
||||
SessionPayload payload = new SessionPayload(PayloadType.Invitation,
|
||||
invite);
|
||||
rval.addExtension(payload);
|
||||
}
|
||||
return rval;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
@ -814,9 +849,7 @@ public class SharedDisplaySession extends VenueSession implements
|
|||
*/
|
||||
@Override
|
||||
protected String formatInviteAddress(UserId id) {
|
||||
CollaborationConnection manager = getConnection();
|
||||
ContactsManager cm = manager.getContactsManager();
|
||||
String resource = cm.getSharedDisplayEnabledResource(id);
|
||||
String resource = getSharedDisplayResource(id);
|
||||
/*
|
||||
* resource will be null if we can't find a resource that supports
|
||||
* shared displays for this user
|
||||
|
|
|
@ -52,8 +52,6 @@ import com.raytheon.uf.viz.collaboration.comm.identity.event.ParticipantEventTyp
|
|||
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenue;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.invite.VenueInvite;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.user.IUser;
|
||||
import com.raytheon.uf.viz.collaboration.comm.packet.SessionPayload;
|
||||
import com.raytheon.uf.viz.collaboration.comm.packet.SessionPayload.PayloadType;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.TextMessage;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.Tools;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
|
||||
|
@ -111,6 +109,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
|
|||
* Apr 21, 2014 2822 bclement added hasMultipleHandles()
|
||||
* Apr 22, 2014 2903 bclement added connection test to close method
|
||||
* Apr 23, 2014 2822 bclement added formatInviteAddress()
|
||||
* Apr 29, 2014 3061 bclement moved invite payload to shared display session
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
|
@ -223,22 +222,31 @@ public class VenueSession extends BaseSession implements IVenueSession {
|
|||
@Override
|
||||
public void sendInvitation(UserId id, VenueInvite invite)
|
||||
throws CollaborationException {
|
||||
SessionPayload payload = new SessionPayload(PayloadType.Invitation,
|
||||
invite);
|
||||
Message msg = new Message();
|
||||
UserId user = getAccount();
|
||||
msg.setFrom(user.getNormalizedId());
|
||||
msg.setType(Type.normal);
|
||||
msg.addExtension(payload);
|
||||
Message msg = createInviteMessage(id, invite);
|
||||
String reason = "";
|
||||
if (!StringUtils.isBlank(invite.getMessage())) {
|
||||
reason = invite.getMessage();
|
||||
} else if (!StringUtils.isBlank(invite.getSubject())) {
|
||||
if (!StringUtils.isBlank(invite.getSubject())) {
|
||||
reason = invite.getSubject();
|
||||
} else if (!StringUtils.isBlank(invite.getMessage())) {
|
||||
reason = invite.getMessage();
|
||||
}
|
||||
muc.invite(msg, formatInviteAddress(id), reason);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create message object for session invitation
|
||||
*
|
||||
* @param id
|
||||
* recipient of invite
|
||||
* @param invite
|
||||
* @return
|
||||
*/
|
||||
protected Message createInviteMessage(UserId id, VenueInvite invite) {
|
||||
Message msg = new Message();
|
||||
msg.setType(Type.normal);
|
||||
msg.setBody(invite.getMessage());
|
||||
return msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* format invite address for user
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue