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 the service is available, we will call the getBuddyList method for loading thebuddylist.Assuming that the load is successful, we will receive the BuddyList service eventblRetrieveSucceeded with all the information that we need. We will then overwrite this method in the AwarenessList class, as in Example 7-6.Example 7-6 Retrieving the buddylist contentvoid AwarenessList::blRetrieveSucceeded(BLEvent event){if (m_pMyBuddyList) delete m_pMyBuddyList;m_pMyBuddyList = new BL(event.getBL());list myBuddyListGroups = m_pMyBuddyList->getblGroups();list::iterator itr;//Going over all the groupsfor (itr = myBuddyListGroups.begin(); itr != myBuddyListGroups.end();itr++){BLGroup* currGroup = *itr;//Adding people from privat groupsif (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);STUsercurrUser(STId(blUser->getBLId(),L""),blUser->getName(),blUser->getNickName());//Calling the AddUser with False value means that we just want to//add it to the UI but not re add t to our BL structure.AddUser(&currUser,FALSE);}}}}As you can see in the code from Example 7-6, we are using dynamic casting fordetermine which group the BLGroup object represents. In this example, we arehandling only private groups. We will display all the people from our privategroups in one flat list.176 <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!