10.07.2015 Views

Lotus Instant Messaging/ Web Conferencing ... - IBM Redbooks

Lotus Instant Messaging/ Web Conferencing ... - IBM Redbooks

Lotus Instant Messaging/ Web Conferencing ... - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

if (currGroupId == sampleGroupId){pvtGroup->addUser(newUser);groupFound = TRUE;break;}}}if (!groupFound){//there is no sample group, we need to add a new private groupBSTR bstrId(sampleGroupId.AllocSysString());list users;users.push_back(newUser);PrivateGroup* pvtGroup = new PrivateGroup(bstrId,bstrId,L"",true,users);m_pMyBuddyList->addGroup(pvtGroup);::SysFreeString(bstrId);}m_pBuddyListService->setBuddyList(*m_pMyBuddyList);}}If the user trying to add people while the BuddyList service is not available, theservice will display a message indicating that this change will not be saved.If the BuddyList service is available, we will search for the ExLiveNamesGroup. Ifwe find it, we will add the new user to this group. Otherwise, we will create thegroup and add the user to the new group. The final step is to call thesetBuddyList API method for storing the update list on the server.If you log in from another application (for example, the Sametime Connect client),you will see a new private group called ExLiveNamesGroup with the user thatyou added.7.6.2 Removing a person from the listWhen removing a person from the list, we would like to immediately update thestored buddylist on the server. To accomplish this, we will update theAwarenessList::RemoveSelectedUser method.First, we need to save the removed user ID before deleting the user object:CString removedUserId(pWatchedUser->GetId().getId().c_str());delete pWatchedUser;We will use the user ID for searching for this user in our BL structure.180 <strong>Lotus</strong> <strong>Instant</strong> <strong>Messaging</strong>/<strong>Web</strong> <strong>Conferencing</strong> (Sametime): Building Sametime-Enabled Applications

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!