diff --git a/samples/js-skype-status/README.md b/samples/js-skype-status/README.md index c21897e76..948ec8470 100644 --- a/samples/js-skype-status/README.md +++ b/samples/js-skype-status/README.md @@ -28,6 +28,7 @@ js-skype-status|[Vincent Biret](https://github.com/baywet) Version|Date|Comments -------|----|-------- +1.2|July 4th, 2018|Fixed a bug when subscribing to the current user's status 1.1|June 22nd, 2018|Upgraded to SPFX 1.5 1.0|December 1, 2017|Initial release @@ -51,7 +52,7 @@ Take note of the `application ID`, we'll need it later. Click on `required permi ![skype permission](./images/5.PNG) Click on `add` then `select an API` and select `Skype for Business`. ![skype scopes](./images/6.PNG) -Select under `delegated permissions` both `Read/Write Skype user contacts and groups` and `Read/Write Skype user information (preview)`, then click `select`. Finish by clicking `Done`. +Select under `delegated permissions` both `Read/Write Skype user contacts and groups`, `Read/Write Skype user information (preview)`, `Receive conversation invites (preview)` (the receive conversation permission is required to get access to the mePerson object and have access to the current user's presence information) then click `select`. Finish by clicking `Done`. ![grant permission](./images/7.PNG) Don't forget to click on `Grant permissions` and `yes`. diff --git a/samples/js-skype-status/images/6.PNG b/samples/js-skype-status/images/6.PNG index 93393e3c8..d2edd01b3 100644 Binary files a/samples/js-skype-status/images/6.PNG and b/samples/js-skype-status/images/6.PNG differ diff --git a/samples/js-skype-status/src/webparts/skypePresence/services/SkypeForBusinessCommunicationService.ts b/samples/js-skype-status/src/webparts/skypePresence/services/SkypeForBusinessCommunicationService.ts index c67657e3b..b5bb88155 100644 --- a/samples/js-skype-status/src/webparts/skypePresence/services/SkypeForBusinessCommunicationService.ts +++ b/samples/js-skype-status/src/webparts/skypePresence/services/SkypeForBusinessCommunicationService.ts @@ -22,8 +22,11 @@ export class SkypeForBusinessCommunicationService implements ICommunicationServi const personsAndGroupsManager: any = skypeApp.personsAndGroupsManager; const mePerson: any = personsAndGroupsManager.mePerson; if (SkypeForBusinessCommunicationService.webPartContext().pageContext.user.email === userEmail) { - Log.info(Constants.ErrorCategory, `Bypassed skype subscription for current user ${userEmail}`); - handler("Online", undefined, mePerson.displayName()); + mePerson.status.changed((newStatus: string, reason: string, oldStatus: string) => { + Log.info(Constants.ErrorCategory, `${mePerson.displayName()} status changed from ${oldStatus} to ${newStatus} because ${reason}`); + handler(newStatus, oldStatus, mePerson.displayName()); + }); + mePerson.status.subscribe(); } else { const query: any = personsAndGroupsManager.createPersonSearchQuery(); query.text(userEmail);