Reputation: 26
I'm in the process of integrating the Skype for Business Web SDK in my webapplication.
My question is about status changes (presence). According to the samples on https://ucwa.skype.com/websdk I am listening to (my) status changes in the following way:
client.personsAndGroupsManager.mePerson.status.changed(function (status) {
console.log("My new status: " + status);
// etc...
});
This works and I can update the UI according to the status change.
There is one exception --> status 'Be right back'. When the status is changed to 'Be right back' (BeRightBack) externally in a Skype client or in the UI of my application, I'm getting back status 'Away'.
When checking in the Dev Tools of Edge, I see the following:
POST
{"availability":"BeRightBack"}
and
GET
{"availability":"BeRightBack","_links":{"self": {"href":"/ucwa/oauth/v1/applications.... etc }},"rel":"presence"}
Also when I sign in while being logged into Skype with the 'Be right back' status, the SDK returns status 'Away'.
When running the samples on https://ucwa.skype.com/websdk I get the same result. I change the status to 'Be right back' and the alert shows I'm 'Away'.
Am I missing something here? Is this expected behaviour?
Upvotes: 1
Views: 1079
Reputation: 81
By the way, guys, I realized this; mePerson object has two attribute. One of them is status
and the other attribute is activity
.
Let me explain difference between two of them. BeRightBack
is not a status, it is an activity. The status of BeRightBack
is Away
and activity
is be-right-back
. Same as OffWork
. If you set the status to OffWork
you will see status = Away
and activity = off-work
. I did not find how I can set activity
. If you find anything please let me know.
here is code;
var stasus = 'BeRightBack' ;
window.skypeWebApp.personsAndGroupsManager.mePerson.activity.changed(function (status) {
// alert('Activity Changed to: ' + status);
console.log('Activity Changed to: ' + window.skypeWebApp.personsAndGroupsManager.mePerson.activity);
});
Upvotes: 0
Reputation: 5312
Running into the same issue: if I log into skype for business (the desktop client) and set the user to be right back
the value I get from the web sdk is away
.
Investigating a little bit I noticed that method is present at sdk.js:44553 (with version 1.2.36)
/**
* Transform status values from UCWA to values known to jCafe.
* @param {string} s - status value from UCWA
*/
function fixStatus(s) {
return Person.Status[s] || {
BeRightBack: Person.Status.Away,
Idle: Person.Status.Away,
IdleOnline: Person.Status.Away,
IdleBusy: Person.Status.Away,
Unknown: Person.Status.Offline
}[s] || Person.Status.Offline;
}
Right above, you can see the declaration of the Status enum is missing the BRB value, I don't understand why though, especially since the SDK support the BRB value according to documentation
var Status;
(function (Status) {
Status.Away = 'Away';
Status.Busy = 'Busy';
Status.DoNotDisturb = 'DoNotDisturb';
Status.Offline = 'Offline';
Status.Online = 'Online';
})(Status = Person.Status || (Person.Status = {}));
To me it looks like it's a status they added after creating the SDK and for retro-compatibility reasons they are doing strange things, hard to confirm without having access to the repository though.
Upvotes: 1