Skype for Business Web SDK - participants object empty - skype-for-business

When creating a meeting via the Skype for Business Web SDK, the conversation object contains a participants list which contains objects representing the participant details of that meeting. This is working and we can see all the participants that we would expect.
However when joining a meeting that someone else has created via the Skype for Business Web SDK, the participants list is always empty, despite knowing for a fact that there are other users connected to that meeting.
Is this a bug in the SDK? Any help would be appreciated!
Edit: updating with more info after suggestions
we retrieve the conversation object using the following code (note we are retrieving it via a URI):
app.conversationsManager.getConversationByUri(uri);
Here are the outputs from experimenting with the conversation object:
conversation.participants() returns []
conversation.participants returns function [Collection: 0 items]
conversation.participants.get().then(function(participants) {
console.log(participants)
})
logs Promise {task_ccf0d98018eaf: Task}

getConversationByUri doesn't actually join the meeting. It just retrieves a conversation model. You need to actually start one of the services (conversation.chatService.start(), conversation.audioService.start(), etc) in order to join the meeting. Once you join the meeting the participants collection will get updated with people in the meeting.

There are a few things that could prevent seeing the participants in a conversation/meeting:
Events have not posted indicating who is active
The collection containing participants has not updated (it is lazy loaded)
If you wanted to get the exact count you would be best served by making a request on the collection similar to:
conv.participants.get().then(function (participants) {
// participants is an array of currently active persons in the conversation/meeting
});
You could also keep track locally by listening to the added/removed events on the participants collection.
conv.participants.added(function (person) {
// add to local list...
});
conv.participants.removed(function (person) {
// remove from local list...
});
If this is not the case it would be interesting to know what code you are using to observe the empty list of participants.

Related

Combine Flux (vuex) store with global event bus?

I'm using Vuex & Vuejs (flux architect) for a CRM single page application.
In contact page i'm showing a list of tasks related to current contact and at sidebar i have a list of task for current logged in user.
These collection of tasks are kept in separate stores. I don't know which is best solution:
After update post request search in both list and update task object if it's present and mutate state.
After update post request use an global event bus and each store should listen and update task object if needed.
It really depends of your requirements, but one thing I can tell is that using two separated stores + bus is defeating the whole purpose of Redux.
If the tasks in your application share the same scope and can be assigned to you or other users that you may be visiting/managing, you can have all the tasks from your scope (your team, for example) and display it on different places using different getters with Array.filter functions.
If the number of tasks is too big to have it all loaded, I'd approach it doing one single tasks list in the store, being populated from a single url.
ie:
- Give me all the tasks I have + the tasks of current user I'm managing
- Give me all the tasks I have + the tasks that matches this search
Although this can get messy if the requirements are more complicated and can get confusing. But try to structure your application with one single store if possible and avoid bus, as it is only recommended for small size applications.

Microsoft Graph API List Locations

Hi I am having trouble finding any way to list locations so I can create an event and add a location to it.
There is a list of known locations that should be available shouldn't there be?
https://graph.microsoft.io/en-us/docs/api-reference/v1.0/resources/location
I'm not sure that listing known locations is available, so we'll need to be creative on this one.
You could get a list of existing calendar events and only select the locations property (what you linked to). If you then filter these client side to remove duplicates, you can get a decent list of known locations. The down side is that if a room is now available but has never been used, it won't appear in this list. Also, this is only for one user so another idea is querying a different (or multiple) calendars. For me, the following snippet returns around 247 unique locations.
https://graph.microsoft.com/v1.0/me/events?$select=location&$top=500
With the Graph JavaScript SDK this looks like:
client
.api('/me/events')
.select('location')
.top(500)
.get((err, res) => {
var locations = res.value
.map((x) => x.location.displayName) //only get the displayName
.filter((v, i, a) => a.indexOf(v) === i) // remove duplicates
});
There's also some existing threads about listing conference rooms.
So We decided not to use the graph API at all. It is not ready I actually cannot believe this is an oversight on Microsoft's part. Any organization's core problem when it gets to SME size is booking a room. We opted to use the Office 365 SDK,ADAL and Outlook and use a convoluted way to solve the problem that involves either checking the calendar or checking your inbox for the room being booked or not. Then we opted to figure out whether the room was busy or not using the preview availability Api.

Is there a way to store metadata on meetup?

I want to use the Meetup.com API to have a group everyone belongs to, but then enable members to receive notifications of certain types of events on their smartphones. For example the group would have 3000 members and have activist meetings, social meetings, and training meetings. Users would be able to specify interests so they would only get notified of the categories they are interested in.
Is there a clean way to do this through the meetup API? If there is metadata like a category that would be perfect.
Looking at their event get api I don't think there is a clean way to do it. Seems storing it as a hidden HTML value is a hacky way to do it. I'll probably end up with another datastore referencing the eventID and store my info there.

UILocalNotification adding and removing

After my user logs in the app pulls down a list of their meetings and adds them as UILocalNotification.
Each time the user launches the app and logs in this happens.
Which of the following is better "practice" when it comes to doing this over and over:
Pull all the location notifications with scheduledLocalNotifications then as I cycle through the downloaded meetings check to see if a local notification already exist for that meeting. If so, don't add it.
Use cancelAllLocalNotifications to clear all the local notifications and add them over.
It seems that #1 would be the right way but I'm concerned that if I have a meeting at the same time as another (it happens), it will view it as already added and won't add the new one.
Personally I would pull down the locations and check through them. It just feels tidier to me rather than destroying everything and creating it all again. Then again, #2 might be (negligibly) faster as you don't need to loop and check.
If you're concerned about #1 not matching where two meetings have the same time, you could add your own unique identifier to the UILocalNotification object via the userInfo property, and query this to see if the meeting is the same event, rather than basing it on the time of the notification.
If you have an unique token, say a UUID, for each meeting, the double-booking situation can be avoided. Put this token in the userInfo dictionary for the notification and then you can see precisely which meeting the notification is for. Comparison to determine the if this meeting has a notification queued already would best be done by this unique token, making sure the time of the meeting did not change.

Data Mapper API - unsure about organisation

Let's say we have "User" and a "Hotel" model classes. I'd use a User_Mapper and Hotel_Mapper to load/save/delete etc. I want to then have the user be able to mark their "favourite" hotels. In the database I have my user_favourite_hotels table which is a simple link table along with say a field for subscribing to hotel updates.
When listing out the user's favourite hotels, how would you expect this to work from an API point of view? A part of me thinks that this should be a "findFavouritesByUserId" method on the Hotel_Mapper, but other than saying it "feels" right - however a colleague suggests that the "favourites" is owned by the user and should therefore be on the User_Mapper.
Perhaps I should have a User_Hotel_Favourites_Mapper? I was thinking of incorporating the "favourites" data in to the User object so it's saved and loaded whenever the User object is. I'm not sure whether it'd be better to split it out in to it's own object and mapper however.
I'd appreciate any advice on how best to setup the API for the above and any pros/cons/experiences.
Thanks very much,
James.
This (admittedly retired) patterns&practices guide to designing data tier components suggests that you put the method in the mapper of the type of object that you're getting back from the call.
If you have methods that return a particular type of business entity, place these methods in the Data Access Logic Component for that type. For example, if you are retrieving all orders for a customer, implement that function in the Order Data Access Logic Component because your return value is of the type Order. Conversely, if you are retrieving all customers that have ordered a specific product, implement that function in the Customer Data Access Logic Component.
So, in your example, it would go in the Hotel Mapper as it is returning Hotels.
If you want to store favorite hotels for the user, you are using the UserMapper, which notices that domain object for User has changes favorites, and updates both tables for users and for user_favorite_hotels ( you just need the hotel IDs ).
When you are retrieving favorite hotels of some user, you use HotelMapper and set filter to be based on User, because you will be working with instances of Hotel.
Considering that this was asked more than 2 years ago, I'm not sure if an answer matters to you now. But here's what I think anyway.
If User could have multiple types of favourites (including Hotels), it may make sense to have a UserFavourites abstraction to cover all possible types of favourites. UserFavourites could expose a getItems() method to get the underlying Favourites.
This could be managed with the help of a manager class to return the appropriate Favourites object(FavouriteHotels for example) on which the getItems() method can be called.