summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_rc.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-07-20 10:51:35 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-07-20 10:51:35 +0000
commit2fe00cdd66d4559cc43a5f27c19ddc79a43676eb (patch)
tree546def30affbabeaad425c9a25e2545e1e4096f5 /protocols/JabberG/src/jabber_rc.cpp
parentf946ebcb1ac09b7220f8547074496aa2d1b83768 (diff)
- all manual list locks removed;
- ListExists removed and replaced with ListGetItemPtr; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@5426 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_rc.cpp')
-rw-r--r--protocols/JabberG/src/jabber_rc.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp
index dbe490c9c1..eb01bc219a 100644
--- a/protocols/JabberG/src/jabber_rc.cpp
+++ b/protocols/JabberG/src/jabber_rc.cpp
@@ -723,19 +723,19 @@ int CJabberProto::AdhocLeaveGroupchatsHandler(HXML, CJabberIqInfo* pInfo, CJabbe
int i = 0;
if (pSession->GetStage() == 0) {
// first form
- TCHAR szMsg[ 1024 ];
-
- ListLock();
int nChatsCount = 0;
- LISTFOREACH_NODEF(i, this, LIST_CHATROOM)
{
- JABBER_LIST_ITEM *item = ListGetItemPtrFromIndex(i);
- if (item != NULL)
- nChatsCount++;
+ mir_cslock lck(m_csLists);
+ LISTFOREACH_NODEF(i, this, LIST_CHATROOM)
+ {
+ JABBER_LIST_ITEM *item = ListGetItemPtrFromIndex(i);
+ if (item != NULL)
+ nChatsCount++;
+ }
}
- ListUnlock();
if ( !nChatsCount) {
+ TCHAR szMsg[ 1024 ];
mir_sntprintf(szMsg, SIZEOF(szMsg), TranslateT("There is no groupchats to leave"));
m_ThreadInfo->send(
@@ -764,15 +764,15 @@ int CJabberProto::AdhocLeaveGroupchatsHandler(HXML, CJabberIqInfo* pInfo, CJabbe
// Groupchats
HXML fieldNode = xNode << XCHILD(_T("field")) << XATTR(_T("label"), NULL) << XATTR(_T("type"), _T("list-multi")) << XATTR(_T("var"), _T("groupchats"));
fieldNode << XCHILD(_T("required"));
-
- ListLock();
- LISTFOREACH_NODEF(i, this, LIST_CHATROOM)
{
- JABBER_LIST_ITEM *item = ListGetItemPtrFromIndex(i);
- if (item != NULL)
- fieldNode << XCHILD(_T("option")) << XATTR(_T("label"), item->jid) << XCHILD(_T("value"), item->jid);
+ mir_cslock lck(m_csLists);
+ LISTFOREACH_NODEF(i, this, LIST_CHATROOM)
+ {
+ JABBER_LIST_ITEM *item = ListGetItemPtrFromIndex(i);
+ if (item != NULL)
+ fieldNode << XCHILD(_T("option")) << XATTR(_T("label"), item->jid) << XCHILD(_T("value"), item->jid);
+ }
}
- ListUnlock();
m_ThreadInfo->send(iq);
return JABBER_ADHOC_HANDLER_STATUS_EXECUTING;