public void AddCurrentParticipantsToNewConv(SktConversation conv) { participants = conv.GetParticipants(SktConversation.PARTICIPANTFILTER.ALL); foreach (Participant person in participants) AddParticipantToConversation(person); }
// Now, this is the tricky bit! What happens when you first start out with an 1-on-1 call, // and then someone adds more people, making it into a conference call? Well, what happens is this: // 1. a new conversation is created, both people from old 1-on-1 call and the new ones get added in; // 2. the new conversation goes live; // 3. the old 1-on-1 conversation goes OFF live; // 4. in the old 1-on-1, a message gets posted with type SktMessage.TYPE.SPAWNED_CONFERENCE // and this event will fire with new conversation in the e.spawned field. // At that point, what we need to do is to switcheverything over to that one. void OnConversationSpawnConference(SktConversation sender, SktEvents.OnConversationSpawnConferenceArgs e) { if (sender == liveSession) { // As participants are conversation-specific, our participants list is now invalid as well. // At this point we will need to do a *complete* re-load of both participants and the UI! participants.Clear(); while (participantPanel.Controls.Count > 0) participantPanel.Controls.RemoveAt(0); liveSession = e.spawned; participants = liveSession.GetParticipants(SktConversation.PARTICIPANTFILTER.ALL); int participantsInNewConv = participants.Count; for (int i = 0; i < participantsInNewConv; i++) AddParticipantToLiveSession((Participant)participants[i]); } }