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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

At the end of the AwarenessList::RemoveSelectedUser, we will add the linesshown in Example 7-9.Example 7-9 Handling remove actionvoid AwarenessList::RemoveSelectedUser(){...if (!m_BLServiceIsOn){AfxMessageBox("There is a temporary problem with the storage service,can't save your buddylist.");return;}if (m_pMyBuddyList){list myBuddyListGroups = m_pMyBuddyList->getblGroups();list::iterator itr;for (itr = myBuddyListGroups.begin(); itr != myBuddyListGroups.end();itr++){BLGroup* currGroup = *itr;if (typeid(*currGroup)==typeid(PrivateGroup)){PrivateGroup* pvtGroup = (PrivateGroup*)currGroup;list users = pvtGroup->getUsersInGroup();list::iterator userItr;for (userItr = users.begin(); userItr != users.end(); userItr++){BLUser* blUser = (*userItr);CString currId(blUser->getBLId().c_str());if (currId == removedUserId)pvtGroup->removeUser(blUser);}}}m_pBuddyListService->setBuddyList(*m_pMyBuddyList);}}First, we need to check that the BuddyList service is available. If it is notavailable, the service will display an error message to the user indicating that hischange cannot be saved at this time. If the BuddyList service is available, we willsearch for this user in all the private groups in the BL structure and remove itfrom the groups.Chapter 7. BuddyList service 181

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

Saved successfully!

Ooh no, something went wrong!