diff options
Diffstat (limited to 'protocols/JabberG/src/jabber_presence_manager.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_presence_manager.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/protocols/JabberG/src/jabber_presence_manager.cpp b/protocols/JabberG/src/jabber_presence_manager.cpp index aadde39091..680f852532 100644 --- a/protocols/JabberG/src/jabber_presence_manager.cpp +++ b/protocols/JabberG/src/jabber_presence_manager.cpp @@ -34,20 +34,13 @@ BOOL CJabberPresenceManager::FillPermanentHandlers() BOOL CJabberPresenceManager::HandlePresencePermanent(HXML node, ThreadData *pThreadData)
{
- BOOL bStopHandling = FALSE;
- Lock();
- CJabberPresencePermanentInfo *pInfo = m_pPermanentHandlers;
- while (pInfo && !bStopHandling) {
+ mir_cslock lck(m_cs);
+ for (CJabberPresencePermanentInfo *pInfo = m_pPermanentHandlers; pInfo; pInfo = pInfo->m_pNext) {
CJabberPresenceInfo presenceInfo;
presenceInfo.m_pUserData = pInfo->m_pUserData;
-
- if ((ppro->*(pInfo->m_pHandler))(node, pThreadData, &presenceInfo)) {
- bStopHandling = TRUE;
- break;
- }
- pInfo = pInfo->m_pNext;
+ if ((ppro->*(pInfo->m_pHandler))(node, pThreadData, &presenceInfo))
+ return true;
}
- Unlock();
- return bStopHandling;
+ return false;
}
|