new SIMPLE status (online, away, busy, on the phone and offline) + still trying to reduce the abnormal test failures

cusax-fix
Benoit Pradelle 19 years ago
parent 28633e9767
commit d8c4b9f96a

@ -221,6 +221,8 @@ public class OperationSetPresenceSipImpl
private static final String NS_AWAY_ELT = "rpid:away";
private static final String BUSY_ELEMENT = "busy";
private static final String NS_BUSY_ELT = "rpid:busy";
private static final String OTP_ELEMENT = "on-the-phone";
private static final String NS_OTP_ELT = "rpid:on-the-phone";
/**
* Creates an instance of this operation set keeping a reference to the
@ -3513,11 +3515,14 @@ public byte[] getPidfPresenceStatus(ContactSipImpl contact)
if (contact.getPresenceStatus().equals(SipStatusEnum.AWAY)) {
Element away = doc.createElement(NS_AWAY_ELT);
activities.appendChild(away);
} else if (contact.getPresenceStatus()
.equals(SipStatusEnum.DO_NOT_DISTURB))
{
} else if (contact.getPresenceStatus().equals(SipStatusEnum.BUSY)) {
Element busy = doc.createElement(NS_BUSY_ELT);
activities.appendChild(busy);
} else if (contact.getPresenceStatus()
.equals(SipStatusEnum.ON_THE_PHONE))
{
Element otp = doc.createElement(NS_OTP_ELT);
activities.appendChild(otp);
}
// <tuple>
@ -3632,20 +3637,18 @@ public void setPidfPresenceStatus(String presenceDoc)
continue;
}
if (activityNode.getNodeName().equals(AWAY_ELEMENT)
|| activityNode.getNodeName().equals(BUSY_ELEMENT))
{
activity = (Element) activityNode;
break;
}
}
// convert the activity in a SC status
if (activity != null) {
activity = (Element) activityNode;
// convert the activity in a SC status
if (activity.getNodeName().equals(AWAY_ELEMENT)) {
personStatus = SipStatusEnum.AWAY;
break;
} else if (activity.getNodeName().equals(BUSY_ELEMENT)) {
personStatus = SipStatusEnum.DO_NOT_DISTURB;
personStatus = SipStatusEnum.BUSY;
break;
} else if (activity.getNodeName().equals(OTP_ELEMENT)) {
personStatus = SipStatusEnum.ON_THE_PHONE;
break;
}
}
}
@ -3764,22 +3767,17 @@ public void setPidfPresenceStatus(String presenceDoc)
Element note = (Element) noteNode;
String state = getTextContent(note);
// away ?
if (state.equalsIgnoreCase(SipStatusEnum.AWAY
.getStatusName()))
{
changed = true;
changePresenceStatusForContact(sipcontact,
SipStatusEnum.AWAY);
}
// do not disturb ?
else if (state.equalsIgnoreCase(
SipStatusEnum.DO_NOT_DISTURB.getStatusName()))
{
changed = true;
changePresenceStatusForContact(sipcontact,
SipStatusEnum.DO_NOT_DISTURB);
Iterator states = SipStatusEnum.supportedStatusSet();
while (states.hasNext()) {
SipStatusEnum current = (SipStatusEnum) states.next();
if (current.getStatusName().equalsIgnoreCase(state)) {
changed = true;
changePresenceStatusForContact(sipcontact,
current);
break;
}
}
}

@ -34,13 +34,22 @@ public class SipStatusEnum
, loadIcon("resources/images/sip/sip16x16-offline.png"));
/**
* The DND status. Indicates that the user has connectivity but prefers
* not to be contacted.
* The busy status. Indicates that the user has connectivity but is doing
* something else.
*/
public static final SipStatusEnum DO_NOT_DISTURB
public static final SipStatusEnum BUSY
= new SipStatusEnum(
30
, "Do Not Disturb",
30,
"Busy",
loadIcon("resources/images/sip/sip16x16-dnd.png"));
/**
* The On the phone status. Indicates that the user is talking to the phone.
*/
public static final SipStatusEnum ON_THE_PHONE
= new SipStatusEnum(
37,
"On the phone",
loadIcon("resources/images/sip/sip16x16-dnd.png"));
/**
@ -79,8 +88,9 @@ public class SipStatusEnum
static
{
supportedStatusSet.add(ONLINE);
supportedStatusSet.add(DO_NOT_DISTURB);
supportedStatusSet.add(AWAY);
supportedStatusSet.add(ON_THE_PHONE);
supportedStatusSet.add(BUSY);
supportedStatusSet.add(OFFLINE);
}

@ -275,7 +275,7 @@ private void pauseAfterStateChanges()
{
try
{
Thread.currentThread().sleep(1500);
Thread.currentThread().sleep(2000);
}
catch (InterruptedException ex)
{

Loading…
Cancel
Save