Skip to content

Commit

Permalink
react-skype-status: fixed a bug where subscription to the current use…
Browse files Browse the repository at this point in the history
…rs status wouldn't work (#554)
  • Loading branch information
baywet authored and VesaJuvonen committed Jul 5, 2018
1 parent 711cae3 commit 293bbba
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion samples/react-skype-status/README.md
Expand Up @@ -27,6 +27,7 @@ react-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 25th, 2018|Upgrade to 1.5
1.0|December 1, 2017|Initial release

Expand All @@ -50,7 +51,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`.

Expand Down
Binary file modified samples/react-skype-status/images/6.PNG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -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);
Expand Down

0 comments on commit 293bbba

Please sign in to comment.