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.

Example 7-8 Adding a new uservoid AwarenessList::AddUser(STUser* user, BOOL newUser){if (!user || (FindItemByUserId(user->GetId()) != -1))return;STWatchedUser* pWatchedUser = newSTWatchedUser(*user,STGroup(),STUserStatus(ST_USER_STATUS_DISCONNECTED, L""));if (!pWatchedUser)return;int pos = GetUsers();LV_ITEM item;item.mask = LVIF_PARAM;item.iItem = pos;item.iSubItem = 0;item.lParam = (DWORD)pWatchedUser;int index = m_ctlAwarenessListView.InsertItem(&item);m_ctlAwarenessListView.RedrawItems(index, index);m_ctlAwarenessListView.UpdateWindow();if (m_pWatchList)m_pWatchList->addItem(pWatchedUser);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;BOOL groupFound = FALSE;STBLUser* newUser = new STBLUser(STId(user->GetId().getId(),L""),user->GetName(),user->GetDesc(),user->getNickName());for (itr = myBuddyListGroups.begin(); itr != myBuddyListGroups.end();itr++){BLGroup* currGroup = *itr;if (typeid(*currGroup)==typeid(PrivateGroup)){PrivateGroup* pvtGroup = (PrivateGroup*)currGroup;CString currGroupId = pvtGroup->getBLId().c_str();Chapter 7. BuddyList service 179

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

Saved successfully!

Ooh no, something went wrong!