From 12225716d38830a23477b97a6979b6414faeec7b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 16 Mar 2018 21:05:31 +0300 Subject: entities' names to be started with capital letters --- include/m_database.h | 4 ++-- include/m_protoint.h | 2 +- libs/win32/mir_app.lib | Bin 131034 -> 130990 bytes libs/win64/mir_app.lib | Bin 126544 -> 126498 bytes plugins/AVS/src/options.cpp | 2 +- plugins/BasicHistory/src/HistoryWindow.cpp | 14 +++++++------- plugins/BasicHistory/src/Options.cpp | 8 ++++---- plugins/Clist_modern/src/modern_viewmodebar.cpp | 8 ++++---- plugins/Clist_nicer/src/contact.cpp | 4 ++-- plugins/Clist_nicer/src/extBackg.cpp | 2 +- plugins/Clist_nicer/src/viewmodes.cpp | 8 ++++---- plugins/CloudFile/src/events.cpp | 2 +- plugins/CmdLine/src/mimcmd_handlers.cpp | 8 ++++---- plugins/CmdLine/src/utils.cpp | 2 +- plugins/DbEditorPP/src/copymodule.cpp | 4 ++-- plugins/DbEditorPP/src/deletemodule.cpp | 4 ++-- plugins/DbEditorPP/src/exportimport.cpp | 2 +- plugins/DbEditorPP/src/modsettingenum.cpp | 2 +- plugins/DbEditorPP/src/moduletree.cpp | 2 +- plugins/DbEditorPP/src/renamemodule.cpp | 2 +- plugins/FingerprintNG/src/options.cpp | 2 +- plugins/FloatingContacts/src/main.cpp | 2 +- plugins/GmailNotifier/src/utility.cpp | 2 +- plugins/Msg_Export/src/options.cpp | 2 +- plugins/Msg_Export/src/utils.cpp | 4 ++-- plugins/NewsAggregator/Src/Options.cpp | 10 +++++----- plugins/NewsAggregator/Src/Services.cpp | 6 +++--- plugins/NewsAggregator/Src/Update.cpp | 2 +- plugins/NewsAggregator/Src/Utils.cpp | 4 ++-- plugins/Popup/src/opt_contacts.cpp | 4 ++-- plugins/RecentContacts/src/RecentContacts.cpp | 2 +- plugins/SMS/src/SMS_svc.cpp | 2 +- plugins/SMS/src/functions.cpp | 2 +- plugins/SMS/src/senddlg.cpp | 2 +- plugins/Scriver/src/msgoptions.cpp | 4 ++-- plugins/Scriver/src/msgs.cpp | 2 +- plugins/SeenPlugin/src/missed.cpp | 4 ++-- plugins/SeenPlugin/src/utils.cpp | 2 +- plugins/Sessions/Src/Main.cpp | 12 ++++++------ plugins/Sessions/Src/Options.cpp | 6 +++--- plugins/SmileyAdd/src/smileys.cpp | 4 ++-- plugins/TabSRMM/src/container.cpp | 4 ++-- plugins/TabSRMM/src/globals.cpp | 4 ++-- plugins/TabSRMM/src/msgoptions.cpp | 4 ++-- plugins/TabSRMM/src/sendqueue.cpp | 4 ++-- plugins/TabSRMM/src/trayicon.cpp | 2 +- plugins/TipperYM/src/options.cpp | 4 ++-- plugins/TipperYM/src/popwin.cpp | 4 ++-- plugins/UserInfoEx/src/dlg_anniversarylist.cpp | 2 +- .../src/ex_import/classExImContactBase.cpp | 2 +- plugins/UserInfoEx/src/psp_options.cpp | 4 ++-- plugins/UserInfoEx/src/svc_avatar.cpp | 4 ++-- plugins/UserInfoEx/src/svc_refreshci.cpp | 2 +- plugins/UserInfoEx/src/svc_reminder.cpp | 6 +++--- plugins/Variables/src/contact.cpp | 2 +- plugins/Variables/src/parse_miranda.cpp | 8 ++++---- plugins/Weather/src/weather_addstn.cpp | 2 +- plugins/Weather/src/weather_contacts.cpp | 2 +- plugins/Weather/src/weather_data.cpp | 2 +- plugins/Weather/src/weather_mwin.cpp | 4 ++-- plugins/Weather/src/weather_update.cpp | 2 +- plugins/YAMN/src/proto/pop3/pop3comm.cpp | 2 +- plugins/YAPP/src/options.cpp | 2 +- protocols/Discord/src/proto.cpp | 2 +- protocols/EmLanProto/src/mlan.cpp | 4 ++-- protocols/FacebookRM/src/chat.cpp | 2 +- protocols/FacebookRM/src/contacts.cpp | 6 +++--- protocols/FacebookRM/src/process.cpp | 2 +- protocols/Gadu-Gadu/src/core.cpp | 8 ++++---- protocols/Gadu-Gadu/src/groupchat.cpp | 6 +++--- protocols/Gadu-Gadu/src/import.cpp | 2 +- protocols/ICQCorp/src/protocol.cpp | 2 +- protocols/IRCG/src/clist.cpp | 4 ++-- protocols/IRCG/src/commandmonitor.cpp | 2 +- protocols/IcqOscarJ/src/icq_infoupdate.cpp | 2 +- protocols/IcqOscarJ/src/icq_proto.cpp | 2 +- protocols/IcqOscarJ/src/icq_server.cpp | 2 +- protocols/IcqOscarJ/src/icq_servlist.cpp | 6 +++--- protocols/IcqOscarJ/src/icq_uploadui.cpp | 8 ++++---- protocols/IcqOscarJ/src/utilities.cpp | 12 ++++++------ protocols/JabberG/src/jabber_chat.cpp | 4 ++-- protocols/JabberG/src/jabber_icolib.cpp | 2 +- protocols/JabberG/src/jabber_list.cpp | 2 +- protocols/JabberG/src/jabber_opt.cpp | 2 +- protocols/JabberG/src/jabber_privacy.cpp | 8 ++++---- protocols/JabberG/src/jabber_proto.cpp | 2 +- protocols/JabberG/src/jabber_rc.cpp | 4 ++-- protocols/JabberG/src/jabber_thread.cpp | 2 +- protocols/MRA/src/MraProto.cpp | 4 ++-- protocols/MRA/src/Mra_functions.cpp | 2 +- protocols/MRA/src/Mra_menus.cpp | 6 +++--- protocols/MRA/src/Mra_proto.cpp | 4 ++-- protocols/MSN/src/msn_chat.cpp | 2 +- protocols/MSN/src/msn_contact.cpp | 2 +- protocols/MSN/src/msn_misc.cpp | 2 +- protocols/MSN/src/msn_proto.cpp | 2 +- protocols/SkypeWeb/src/skype_contacts.cpp | 2 +- protocols/SkypeWeb/src/skype_dialogs.cpp | 6 +++--- protocols/SkypeWeb/src/skype_login.cpp | 2 +- protocols/Tox/src/tox_avatars.cpp | 4 ++-- protocols/Tox/src/tox_contacts.cpp | 2 +- protocols/Twitter/src/chat.cpp | 2 +- protocols/Twitter/src/contacts.cpp | 2 +- protocols/VKontakte/src/misc.cpp | 6 +++--- protocols/VKontakte/src/vk_dialogs.cpp | 6 +++--- protocols/VKontakte/src/vk_history.cpp | 2 +- protocols/VKontakte/src/vk_thread.cpp | 6 +++--- src/core/stdfile/src/file.cpp | 2 +- src/core/stdmsg/src/msgoptions.cpp | 4 ++-- src/core/stdmsg/src/msgs.cpp | 2 +- src/mir_app/src/DefaultExtraIcons.cpp | 2 +- src/mir_app/src/ExtraIcon.cpp | 2 +- src/mir_app/src/chat_clist.cpp | 4 ++-- src/mir_app/src/clcitems.cpp | 4 ++-- src/mir_app/src/clistgroups.cpp | 4 ++-- src/mir_app/src/contact.cpp | 2 +- src/mir_app/src/ignore.cpp | 4 ++-- src/mir_app/src/meta_addto.cpp | 2 +- src/mir_app/src/meta_main.cpp | 2 +- src/mir_app/src/meta_utils.cpp | 8 ++++---- src/mir_app/src/mir_app.def | 2 +- src/mir_app/src/mir_app64.def | 2 +- src/mir_app/src/options_ei.cpp | 2 +- src/mir_app/src/proto_utils.cpp | 2 +- src/mir_app/src/visibility.cpp | 4 ++-- 125 files changed, 224 insertions(+), 224 deletions(-) diff --git a/include/m_database.h b/include/m_database.h index bfab8294c5..d3a4d06088 100644 --- a/include/m_database.h +++ b/include/m_database.h @@ -228,12 +228,12 @@ EXTERN_C MIR_CORE_DLL(MCONTACT) db_find_next(MCONTACT hContact, const char *szPr #endif #if defined(__cplusplus) -class contact_iter +class Contacts { const char *m_szModule; public: - contact_iter(const char *m = nullptr) : + Contacts(const char *m = nullptr) : m_szModule(m) {} diff --git a/include/m_protoint.h b/include/m_protoint.h index e9477ce530..401135fd30 100644 --- a/include/m_protoint.h +++ b/include/m_protoint.h @@ -169,7 +169,7 @@ public: __forceinline void setWString(const char *name, const wchar_t* value) { db_set_ws(NULL, m_szModuleName, name, value); } __forceinline void setWString(MCONTACT hContact, const char *name, const wchar_t* value) { db_set_ws(hContact, m_szModuleName, name, value); } - __forceinline contact_iter acc_contact_iter() const { return contact_iter(m_szModuleName); } + __forceinline Contacts AccContacts() const { return Contacts(m_szModuleName); } ////////////////////////////////////////////////////////////////////////////////////// // Service functions diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib index e931186ad7..6b984b4429 100644 Binary files a/libs/win32/mir_app.lib and b/libs/win32/mir_app.lib differ diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib index 817ec22458..85df6fe22f 100644 Binary files a/libs/win64/mir_app.lib and b/libs/win64/mir_app.lib differ diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index 7940a80475..c6de060ac0 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -406,7 +406,7 @@ static INT_PTR CALLBACK DlgProcOptionsProtos(HWND hwndDlg, UINT msg, WPARAM wPar BOOL newVal = ListView_GetCheckState(hwndList, i); if (oldVal && !newVal) - for (auto &hContact : contact_iter(szProto)) + for (auto &hContact : Contacts(szProto)) DeleteAvatarFromCache(hContact, TRUE); if (newVal) diff --git a/plugins/BasicHistory/src/HistoryWindow.cpp b/plugins/BasicHistory/src/HistoryWindow.cpp index 88f20deb9f..d9d1b86a59 100644 --- a/plugins/BasicHistory/src/HistoryWindow.cpp +++ b/plugins/BasicHistory/src/HistoryWindow.cpp @@ -1496,7 +1496,7 @@ void HistoryWindow::ReloadContacts() } } - for (auto &_hContact : contact_iter()) { + for (auto &_hContact : Contacts()) { if (HistoryEventList::GetContactMessageNumber(_hContact) && (metaContactProto == nullptr || !db_mc_isSub(_hContact))) { HANDLE hItem = (HANDLE)SendMessage(contactList, CLM_FINDCONTACT, (WPARAM)_hContact, 0); if (hItem == nullptr) @@ -1627,7 +1627,7 @@ void HistoryWindow::SavePos(bool all) { MCONTACT contactToSave = m_hContact; if (all) { - for (auto &_hContact : contact_iter()) { + for (auto &_hContact : Contacts()) { db_unset(_hContact, MODULE, "history_x"); db_unset(_hContact, MODULE, "history_y"); db_unset(_hContact, MODULE, "history_width"); @@ -1825,7 +1825,7 @@ void HistoryWindow::DoImport(IImport::ImportType type) std::wstring err; std::vector contacts; - for (auto &_hContact : contact_iter()) + for (auto &_hContact : Contacts()) contacts.push_back(_hContact); bool changeContact = false; @@ -2049,7 +2049,7 @@ MCONTACT HistoryWindow::GetNextContact(MCONTACT hContact, int adder) HWND contactList = GetDlgItem(m_hWnd, IDC_LIST_CONTACTS); if (adder > 0) { if (hContact != NULL) { - for (auto &cc : contact_iter()) + for (auto &cc : Contacts()) if (SendMessage(contactList, CLM_FINDCONTACT, cc, 0) != NULL) return cc; @@ -2057,7 +2057,7 @@ MCONTACT HistoryWindow::GetNextContact(MCONTACT hContact, int adder) return NULL; } - for (auto &cc : contact_iter()) { + for (auto &cc : Contacts()) { if (cc == hContact) break; @@ -2067,7 +2067,7 @@ MCONTACT HistoryWindow::GetNextContact(MCONTACT hContact, int adder) } else { MCONTACT lastContact = NULL; - for (auto &cc : contact_iter()) { + for (auto &cc : Contacts()) { if (cc == hContact) break; @@ -2077,7 +2077,7 @@ MCONTACT HistoryWindow::GetNextContact(MCONTACT hContact, int adder) if (hContact != NULL) { if (lastContact == NULL && !HistoryEventList::GetContactMessageNumber(NULL)) { - for (auto &cc : contact_iter()) + for (auto &cc : Contacts()) if (SendMessage(contactList, CLM_FINDCONTACT, cc, 0) != NULL) lastContact = cc; } diff --git a/plugins/BasicHistory/src/Options.cpp b/plugins/BasicHistory/src/Options.cpp index b86a6cc91f..22f3cb55ae 100644 --- a/plugins/BasicHistory/src/Options.cpp +++ b/plugins/BasicHistory/src/Options.cpp @@ -550,7 +550,7 @@ void Options::SaveTasks(std::list* tasks) db_set_s(0, MODULE, buf, it->zipPassword.c_str()); mir_snprintf(buf, "IsInTask_%d", i); - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) db_unset(hContact, MODULE, buf); for (size_t j = 0; j < it->contacts.size(); ++j) @@ -605,7 +605,7 @@ void Options::SaveTasks(std::list* tasks) db_unset(NULL, MODULE, buf); mir_snprintf(buf, "IsInTask_%d", i); - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) db_unset(hContact, MODULE, buf); } } @@ -691,7 +691,7 @@ void Options::LoadTasks() } mir_snprintf(buf, "IsInTask_%d", i); - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) if (db_get_b(hContact, MODULE, buf, 0) == 1) to.contacts.push_back(hContact); @@ -1562,7 +1562,7 @@ void SaveList(HWND hwnd, MCONTACT hSystem, TaskOptions* to) if (hSystem) to->isSystem = SendMessage(hwnd, CLM_GETCHECKMARK, (WPARAM)hSystem, 0) != 0; - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = (HANDLE)SendMessage(hwnd, CLM_FINDCONTACT, hContact, 0); if (hItem && SendMessage(hwnd, CLM_GETCHECKMARK, (WPARAM)hItem, 0)) to->contacts.push_back(hContact); diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index 3c9ea70dc1..565d2edaeb 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -174,7 +174,7 @@ static DWORD GetMaskForItem(HANDLE hItem) static void UpdateStickies() { - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { MCONTACT hItem = (MCONTACT)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_FINDCONTACT, hContact, 0); if (hItem) SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, (BYTE)db_get_dw(hContact, CLVM_MODULE, g_szModename, 0) ? 1 : 0); @@ -432,7 +432,7 @@ void SaveState() T2Utf szModeName(szTempModeName); DWORD dwGlobalMask = GetMaskForItem(hInfoItem); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = (HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_FINDCONTACT, hContact, 0); if (hItem == nullptr) continue; @@ -624,7 +624,7 @@ void DeleteViewMode(char * szName) SetWindowText(hwndSelector, TranslateT("All contacts")); } - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) if (db_get_dw(hContact, CLVM_MODULE, szName, -1) != -1) db_set_dw(hContact, CLVM_MODULE, szName, 0); } @@ -793,7 +793,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP } case IDC_CLEARALL: { - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, hContact, 0); if (hItem) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 0); diff --git a/plugins/Clist_nicer/src/contact.cpp b/plugins/Clist_nicer/src/contact.cpp index f62749c3eb..7b815b40d8 100644 --- a/plugins/Clist_nicer/src/contact.cpp +++ b/plugins/Clist_nicer/src/contact.cpp @@ -113,7 +113,7 @@ void MF_UpdateThread(LPVOID) ResetEvent(hEvent); while (mf_updatethread_running) { - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { MF_CalcFrequency(hContact, 50, 1); if (mf_updatethread_running) WaitForSingleObject(hEvent, 5000); @@ -130,7 +130,7 @@ void MF_InitCheck(void) { BYTE bMsgFrequency = db_get_b(NULL, "CList", "fhistdata", 0); if (!bMsgFrequency) { - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) MF_CalcFrequency(hContact, 100, 0); db_set_b(NULL, "CList", "fhistdata", 1); } diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index 815a4e3e95..57a70373d5 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -1281,7 +1281,7 @@ void LoadPerContactSkins(wchar_t *tszFileName) } if (items) { - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { char *szProto = GetContactProto(hContact); if (szProto == nullptr) continue; diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index 01c19789a5..c6851bf790 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -134,7 +134,7 @@ static DWORD GetMaskForItem(HANDLE hItem) static void UpdateStickies() { - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { MCONTACT hItem = (MCONTACT)SendDlgItemMessage(sttClvmHwnd, IDC_CLIST, CLM_FINDCONTACT, hContact, 0); if (hItem) SendDlgItemMessage(sttClvmHwnd, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, db_get_b(hContact, "CLVM", sttModeName, 0) ? 1 : 0); @@ -374,7 +374,7 @@ void SaveState() DWORD dwGlobalMask = GetMaskForItem(hInfoItem); unsigned int stickies = 0; - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = (HANDLE)SendDlgItemMessage(sttClvmHwnd, IDC_CLIST, CLM_FINDCONTACT, hContact, 0); if (hItem) { if (SendDlgItemMessage(sttClvmHwnd, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0)) { @@ -652,7 +652,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP Clist_Broadcast(CLM_AUTOREBUILD, 0, 0); SetWindowText(hwndSelector, TranslateT("No view mode")); } - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) if (db_get_dw(hContact, "CLVM", szBuf, -1) != -1) db_set_dw(hContact, "CLVM", szBuf, 0); @@ -695,7 +695,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP break; case IDC_CLEARALL: - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, hContact, 0); if (hItem) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 0); diff --git a/plugins/CloudFile/src/events.cpp b/plugins/CloudFile/src/events.cpp index 874ce16f72..aa79ee3288 100644 --- a/plugins/CloudFile/src/events.cpp +++ b/plugins/CloudFile/src/events.cpp @@ -7,7 +7,7 @@ static int OnProtoAck(WPARAM, LPARAM lParam) if (ack->type != ACKTYPE_STATUS) return 0; - for (auto &hContact : contact_iter(ack->szModule)) { + for (auto &hContact : Contacts(ack->szModule)) { MessageWindowData msgw; if (Srmm_GetWindowData(hContact, msgw) || !(msgw.uState & MSG_WINDOW_STATE_EXISTS)) continue; diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index 122f7bfedd..acad40a2ed 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -1227,7 +1227,7 @@ void HandleContactsCommand(PCommand command, TArgument *argv, int argc, PReply r int count = 0; reply->code = MIMRES_SUCCESS; - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { GetContactProto(hContact, protocol, _countof(protocol)); ptrW contact(GetContactName(hContact, protocol)); @@ -1257,7 +1257,7 @@ void HandleContactsCommand(PCommand command, TArgument *argv, int argc, PReply r reply->code = MIMRES_SUCCESS; *reply->message = 0; - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { GetContactProto(hContact, protocol, _countof(protocol)); ptrW contact(GetContactName(hContact, protocol)); @@ -1270,7 +1270,7 @@ void HandleContactsCommand(PCommand command, TArgument *argv, int argc, PReply r reply->code = MIMRES_SUCCESS; *reply->message = 0; - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { MEVENT hUnreadEvent = db_event_firstUnread(hContact); if (hUnreadEvent != NULL) mir_forkthread(OpenMessageWindowThread, (void*)hContact); @@ -1324,7 +1324,7 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re reply->code = MIMRES_SUCCESS; mir_snwprintf(reply->message, TranslateT("No unread messages found.")); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { MEVENT hEvent = db_event_firstUnread(hContact); if (hEvent != NULL) { count = 0; diff --git a/plugins/CmdLine/src/utils.cpp b/plugins/CmdLine/src/utils.cpp index a7298887c6..6304a1498a 100644 --- a/plugins/CmdLine/src/utils.cpp +++ b/plugins/CmdLine/src/utils.cpp @@ -171,7 +171,7 @@ MCONTACT GetContactFromID(wchar_t *szID, char *szProto) char cProtocol[256]; int found = 0; - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { GetContactProto(hContact, cProtocol, sizeof(cProtocol)); ptrW szHandle(GetContactID(hContact, cProtocol)); diff --git a/plugins/DbEditorPP/src/copymodule.cpp b/plugins/DbEditorPP/src/copymodule.cpp index 61962fa89c..5ca149ee4e 100644 --- a/plugins/DbEditorPP/src/copymodule.cpp +++ b/plugins/DbEditorPP/src/copymodule.cpp @@ -31,7 +31,7 @@ INT_PTR CALLBACK copyModDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPar mir_snwprintf(msg, TranslateT("Copy module \"%s\""), _A2T(mac->module)); SetWindowText(hwnd, msg); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { if (ApplyProtoFilter(hContact)) continue; @@ -61,7 +61,7 @@ INT_PTR CALLBACK copyModDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPar } else { SetCursor(LoadCursor(nullptr, IDC_WAIT)); - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) copyModule(mac->module, mac->hContact, hContact); SetCursor(LoadCursor(nullptr, IDC_ARROW)); diff --git a/plugins/DbEditorPP/src/deletemodule.cpp b/plugins/DbEditorPP/src/deletemodule.cpp index 5d3104d233..4b07c0519b 100644 --- a/plugins/DbEditorPP/src/deletemodule.cpp +++ b/plugins/DbEditorPP/src/deletemodule.cpp @@ -47,7 +47,7 @@ void __cdecl PopulateModuleDropListThreadFunc(void *param) continue; } - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { if (!IsModuleEmpty(hContact, module->name)) { SendDlgItemMessageA(hwnd, IDC_CONTACTS, CB_ADDSTRING, 0, (LPARAM)module->name); moduleEmpty = 0; @@ -94,7 +94,7 @@ INT_PTR CALLBACK DeleteModuleDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM) char module[FLD_SIZE]; GetDlgItemTextA(hwnd, IDC_CONTACTS, module, _countof(module)); SetCursor(LoadCursor(nullptr, IDC_WAIT)); - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) deleteModule(hContact, module, 0); // do the null diff --git a/plugins/DbEditorPP/src/exportimport.cpp b/plugins/DbEditorPP/src/exportimport.cpp index 82fc93f5eb..6ae2f27626 100644 --- a/plugins/DbEditorPP/src/exportimport.cpp +++ b/plugins/DbEditorPP/src/exportimport.cpp @@ -256,7 +256,7 @@ MCONTACT CheckNewContact(const char *myProto, const char *uid, const char *myNam { char szProto[FLD_SIZE], szName[NAME_SIZE]; - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) if (!db_get_static(hContact, "Protocol", "p", szProto, _countof(szProto))) if (!mir_strcmp(szProto, myProto)) if (GetValueA(hContact, szProto, uid, szName, _countof(szName)) && !mir_strcmp(szName, myName)) diff --git a/plugins/DbEditorPP/src/modsettingenum.cpp b/plugins/DbEditorPP/src/modsettingenum.cpp index eef1292d39..630096c738 100644 --- a/plugins/DbEditorPP/src/modsettingenum.cpp +++ b/plugins/DbEditorPP/src/modsettingenum.cpp @@ -160,7 +160,7 @@ int fixResidentSettings() fixing = 1; int cnt = 0; - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { for (ModSetLinkLinkItem *module = ModuleList.first; module; module = module->next) { if (IsModuleEmpty(hContact, module->name)) continue; diff --git a/plugins/DbEditorPP/src/moduletree.cpp b/plugins/DbEditorPP/src/moduletree.cpp index 662c66ea85..5502e5c62e 100644 --- a/plugins/DbEditorPP/src/moduletree.cpp +++ b/plugins/DbEditorPP/src/moduletree.cpp @@ -46,7 +46,7 @@ int doContacts(HTREEITEM contactsRoot, ModuleSettingLL *modlist, MCONTACT hSelec char szProto[FLD_SIZE]; wchar_t name[NAME_SIZE]; - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { if (ApplyProtoFilter(hContact)) continue; diff --git a/plugins/DbEditorPP/src/renamemodule.cpp b/plugins/DbEditorPP/src/renamemodule.cpp index c4b12f9b88..f242fe5f1f 100644 --- a/plugins/DbEditorPP/src/renamemodule.cpp +++ b/plugins/DbEditorPP/src/renamemodule.cpp @@ -44,7 +44,7 @@ static INT_PTR CALLBACK AddModDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARA if (IsDlgButtonChecked(hwnd, CHK_ADD2ALL)) { // null contact db_set_b(NULL, modulename, "(Default)", 0); - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) db_set_b(hContact, modulename, "(Default)", 0); } else db_set_b((MCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA), modulename, "(Default)", 0); diff --git a/plugins/FingerprintNG/src/options.cpp b/plugins/FingerprintNG/src/options.cpp index 76482ee8b3..388a9e7175 100644 --- a/plugins/FingerprintNG/src/options.cpp +++ b/plugins/FingerprintNG/src/options.cpp @@ -101,7 +101,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP ClearFI(); RegisterIcons(); - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) OnExtraImageApply(hContact, 0); } break; diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp index e4fbafb88c..46aafdfbad 100644 --- a/plugins/FloatingContacts/src/main.cpp +++ b/plugins/FloatingContacts/src/main.cpp @@ -669,7 +669,7 @@ void SaveContactsPos() static void LoadContacts() { - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) LoadContact(hContact); } diff --git a/plugins/GmailNotifier/src/utility.cpp b/plugins/GmailNotifier/src/utility.cpp index bae5a91a74..64bb3cfa11 100644 --- a/plugins/GmailNotifier/src/utility.cpp +++ b/plugins/GmailNotifier/src/utility.cpp @@ -4,7 +4,7 @@ void BuildList(void) { g_accs.destroy(); - for (auto &hContact : contact_iter(MODULE_NAME)) { + for (auto &hContact : Contacts(MODULE_NAME)) { ptrA szName(db_get_sa(hContact, MODULE_NAME, "name")); if (szName != nullptr) { Account *p = new Account; diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index a769468e64..7765d1cc95 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -626,7 +626,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar int nUser = 0; tstring sTmp; LVITEM sItem = { 0 }; - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { PROTOACCOUNT *pa = Proto_GetAccount(GetContactProto(hContact)); if (pa == nullptr) continue; diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index a6c772801c..7dc168b153 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -787,7 +787,7 @@ void UpdateFileToColWidth() { clFileTo1ColWidth.clear(); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { tstring sNick = pcli->pfnGetContactDisplayName(hContact, 0); string::size_type &rnValue = clFileTo1ColWidth[GetFilePathFromUser(hContact)]; if (rnValue < sNick.size()) @@ -1395,7 +1395,7 @@ int nContactDeleted(WPARAM wparam, LPARAM /*lparam*/) tstring sFilePath = GetFilePathFromUser(hContact); // Test if there is another user using this file - for (auto &hOtherContact : contact_iter()) + for (auto &hOtherContact : Contacts()) if (hContact != hOtherContact && sFilePath == GetFilePathFromUser(hOtherContact)) return 0; // we found another contact abort mission :-) diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp index 4d43ddcbc4..bf3b9f77fc 100644 --- a/plugins/NewsAggregator/Src/Options.cpp +++ b/plugins/NewsAggregator/Src/Options.cpp @@ -39,7 +39,7 @@ CExportFeed::CExportFeed() void CExportFeed::OnInitDialog() { Utils_RestoreWindowPositionNoSize(m_hwnd, NULL, MODULE, "ExportDlg"); - for (auto &hContact : contact_iter(MODULE)) { + for (auto &hContact : Contacts(MODULE)) { wchar_t *message = db_get_wsa(hContact, MODULE, "Nick"); if (message != nullptr) { m_feedslist.AddString(message); @@ -692,7 +692,7 @@ void CFeedEditor::OnInitDialog() m_list->GetItemText(m_iItem, 0, SelNick, _countof(SelNick)); m_list->GetItemText(m_iItem, 1, SelUrl, _countof(SelNick)); - for (auto &hContact : contact_iter(MODULE)) { + for (auto &hContact : Contacts(MODULE)) { ptrW dbNick(db_get_wsa(hContact, MODULE, "Nick")); if ((dbNick == NULL) || (mir_wstrcmp(dbNick, SelNick) != 0)) continue; @@ -874,7 +874,7 @@ void CFeedEditor::OnUseAuth(CCtrlBase*) void COptionsMain::UpdateList() { - for (auto &hContact : contact_iter(MODULE)) { + for (auto &hContact : Contacts(MODULE)) { UpdateListFlag = TRUE; wchar_t *ptszNick = db_get_wsa(hContact, MODULE, "Nick"); if (ptszNick) { @@ -928,7 +928,7 @@ void COptionsMain::OnInitDialog() void COptionsMain::OnApply() { - for (auto &hContact : contact_iter(MODULE)) { + for (auto &hContact : Contacts(MODULE)) { ptrW dbNick(db_get_wsa(hContact, MODULE, "Nick")); for (int i = 0; i < m_feeds.GetItemCount(); i++) { wchar_t nick[MAX_PATH]; @@ -998,7 +998,7 @@ void COptionsMain::OnDeleteButtonClick(CCtrlBase*) m_feeds.GetItemText(isel, 0, nick, _countof(nick)); m_feeds.GetItemText(isel, 1, url, _countof(url)); - for (auto &hContact : contact_iter(MODULE)) { + for (auto &hContact : Contacts(MODULE)) { ptrW dbNick(db_get_wsa(hContact, MODULE, "Nick")); if (dbNick == NULL) break; diff --git a/plugins/NewsAggregator/Src/Services.cpp b/plugins/NewsAggregator/Src/Services.cpp index 8be70f3541..36e25ba073 100644 --- a/plugins/NewsAggregator/Src/Services.cpp +++ b/plugins/NewsAggregator/Src/Services.cpp @@ -36,7 +36,7 @@ int NewsAggrInit(WPARAM, LPARAM) else mir_wstrncpy(tszRoot, VARSW(L"%miranda_userdata%\\Avatars\\" _A2W(DEFAULT_AVATARS_FOLDER)), _countof(tszRoot)); - for (auto &hContact : contact_iter(MODULE)) { + for (auto &hContact : Contacts(MODULE)) { if (!db_get_b(NULL, MODULE, "StartupRetrieve", 1)) db_set_dw(hContact, MODULE, "LastCheck", time(nullptr)); db_set_w(hContact, MODULE, "Status", ID_STATUS_ONLINE); @@ -98,7 +98,7 @@ INT_PTR NewsAggrSetStatus(WPARAM wp, LPARAM) if(nStatus != g_nStatus) { g_nStatus = nStatus; - for (auto &hContact : contact_iter(MODULE)) + for (auto &hContact : Contacts(MODULE)) db_set_w(hContact, MODULE, "Status", nStatus); ProtoBroadcastAck(MODULE, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)nOldStatus, g_nStatus); @@ -133,7 +133,7 @@ INT_PTR NewsAggrGetInfo(WPARAM, LPARAM lParam) INT_PTR CheckAllFeeds(WPARAM, LPARAM lParam) { - for (auto &hContact : contact_iter(MODULE)) { + for (auto &hContact : Contacts(MODULE)) { if (lParam && db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME)) UpdateListAdd(hContact); else if (!lParam) diff --git a/plugins/NewsAggregator/Src/Update.cpp b/plugins/NewsAggregator/Src/Update.cpp index feaaf9840d..893a00239b 100644 --- a/plugins/NewsAggregator/Src/Update.cpp +++ b/plugins/NewsAggregator/Src/Update.cpp @@ -30,7 +30,7 @@ void CALLBACK timerProc(HWND, UINT, UINT_PTR, DWORD) // only run if it is not current updating and the auto update option is enabled if (!ThreadRunning && !Miranda_IsTerminated()) { bool HaveUpdates = FALSE; - for (auto &hContact : contact_iter(MODULE)) { + for (auto &hContact : Contacts(MODULE)) { if (db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME)) { double diff = difftime(time(nullptr), (time_t)db_get_dw(hContact, MODULE, "LastCheck", 0)); if (db_get_b(NULL, MODULE, "AutoUpdate", 1) != 0 && diff >= db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME) * 60) { diff --git a/plugins/NewsAggregator/Src/Utils.cpp b/plugins/NewsAggregator/Src/Utils.cpp index d2e646c5e8..4eff01b870 100644 --- a/plugins/NewsAggregator/Src/Utils.cpp +++ b/plugins/NewsAggregator/Src/Utils.cpp @@ -431,7 +431,7 @@ MCONTACT GetContactByNick(const wchar_t *nick) { MCONTACT hContact = NULL; - for (auto &hContact : contact_iter(MODULE)) { + for (auto &hContact : Contacts(MODULE)) { ptrW contactNick(::db_get_wsa(hContact, MODULE, "Nick")); if (!mir_wstrcmpi(contactNick, nick)) break; @@ -443,7 +443,7 @@ MCONTACT GetContactByURL(const wchar_t *url) { MCONTACT hContact = NULL; - for (auto &hContact : contact_iter(MODULE)) { + for (auto &hContact : Contacts(MODULE)) { ptrW contactURL(::db_get_wsa(hContact, MODULE, "URL")); if (!mir_wstrcmpi(contactURL, url)) break; diff --git a/plugins/Popup/src/opt_contacts.cpp b/plugins/Popup/src/opt_contacts.cpp index d42762c740..d9315e2f16 100644 --- a/plugins/Popup/src/opt_contacts.cpp +++ b/plugins/Popup/src/opt_contacts.cpp @@ -30,7 +30,7 @@ static void sttResetListOptions(HWND hwndList) static void sttSetAllContactIcons(HWND hwndList) { - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, hContact, 0); DWORD dwMode = db_get_b(hContact, MODULNAME, "ShowMode", 0); for (int i = 0; i < 4 /*_countof(sttIcons)*/; ++i) @@ -99,7 +99,7 @@ INT_PTR CALLBACK DlgProcContactOpts(HWND hwnd, UINT msg, WPARAM, LPARAM lParam) switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: HWND hwndList = GetDlgItem(hwnd, IDC_LIST); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, hContact, 0); for (int i = 0; i < 4 /*_countof(sttIcons)*/; ++i) { if (SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, 0))) { diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index 565ccee576..89e281b136 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -392,7 +392,7 @@ INT_PTR OnMenuCommandShowList(WPARAM, LPARAM) BYTE buf[1]; dbe.pBlob = buf; - for (auto &curContact : contact_iter()) { + for (auto &curContact : Contacts()) { __time64_t curTime = GetLastUsedTimeStamp(curContact); MEVENT curEvent = db_event_last(curContact); diff --git a/plugins/SMS/src/SMS_svc.cpp b/plugins/SMS/src/SMS_svc.cpp index 99e3059127..77c4b1c1e9 100644 --- a/plugins/SMS/src/SMS_svc.cpp +++ b/plugins/SMS/src/SMS_svc.cpp @@ -77,7 +77,7 @@ int SendSMSMenuCommand(WPARAM wParam, LPARAM) EnableWindow(GetDlgItem(hwndSendSms, IDC_NAME), TRUE); EnableWindow(GetDlgItem(hwndSendSms, IDC_SAVENUMBER), FALSE); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { if (GetContactPhonesCount(hContact)) { SendDlgItemMessage(hwndSendSms, IDC_NAME, CB_ADDSTRING, 0, (LPARAM)pcli->pfnGetContactDisplayName(hContact, 0)); SendSMSWindowSMSContactAdd(hwndSendSms, hContact); diff --git a/plugins/SMS/src/functions.cpp b/plugins/SMS/src/functions.cpp index 0adc6aee21..81406f3ed8 100644 --- a/plugins/SMS/src/functions.cpp +++ b/plugins/SMS/src/functions.cpp @@ -183,7 +183,7 @@ MCONTACT HContactFromPhone(LPWSTR lpwszPhone, size_t dwPhoneSize) { if (lpwszPhone && dwPhoneSize) { //check not already on list - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) if (IsContactPhone(hContact, lpwszPhone, dwPhoneSize)) return hContact; } diff --git a/plugins/SMS/src/senddlg.cpp b/plugins/SMS/src/senddlg.cpp index ed13941203..99d0012e80 100644 --- a/plugins/SMS/src/senddlg.cpp +++ b/plugins/SMS/src/senddlg.cpp @@ -1051,7 +1051,7 @@ void SendSMSWindowFillTreeView(HWND hWnd) HWND hWndTreeView = GetDlgItem(hWnd, IDC_NUMBERSLIST); TreeView_DeleteAllItems(hWndTreeView); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HTREEITEM hParent = nullptr; LPSTR lpszProto = GetContactProto(hContact); if (lpszProto) { diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index 6dae9ab64a..ecaac38ec9 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -828,7 +828,7 @@ static void RebuildList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown) if (hItemUnknown && db_get_b(0, SRMM_MODULE, SRMSGSET_TYPINGUNKNOWN, SRMSGDEFSET_TYPINGUNKNOWN)) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItemUnknown, 1); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, hContact, 0); if (hItem && db_get_b(hContact, SRMM_MODULE, SRMSGSET_TYPING, defType)) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 1); @@ -843,7 +843,7 @@ static void SaveList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown) if (hItemUnknown) db_set_b(0, SRMM_MODULE, SRMSGSET_TYPINGUNKNOWN, (BYTE)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItemUnknown, 0) ? 1 : 0)); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, hContact, 0); if (hItem) db_set_b(hContact, SRMM_MODULE, SRMSGSET_TYPING, (BYTE)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0) ? 1 : 0)); diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index f22f60c430..3af9114bac 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -248,7 +248,7 @@ static void RestoreUnreadMessageAlerts(void) { OBJLIST arEvents(10, NumericKeySortT); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { for (MEVENT hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) { DBEVENTINFO dbei = {}; dbei.cbBlob = 0; diff --git a/plugins/SeenPlugin/src/missed.cpp b/plugins/SeenPlugin/src/missed.cpp index 5e608c213e..8f202e7f61 100644 --- a/plugins/SeenPlugin/src/missed.cpp +++ b/plugins/SeenPlugin/src/missed.cpp @@ -42,7 +42,7 @@ int RemoveUser(int pos) int ResetMissed(void) { - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) db_set_b(hContact, S_MOD, "Missed", 0); memset(&mcs, 0, sizeof(mcs)); @@ -51,7 +51,7 @@ int ResetMissed(void) int CheckIfOnline(void) { - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) if (pcli->pfnGetContactIcon(hContact) != ICON_OFFLINE) db_set_b(hContact, S_MOD, "Missed", 2); diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index 4a1538cd36..5537de86dc 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -654,7 +654,7 @@ static void cleanThread(void *param) // I hope in 10 secons all logged-in contacts will be listed if (WaitForSingleObject(g_hShutdownEvent, 10000) == WAIT_TIMEOUT) { - for (auto &hContact : contact_iter(szProto)) { + for (auto &hContact : Contacts(szProto)) { WORD oldStatus = db_get_w(hContact, S_MOD, "StatusTriger", ID_STATUS_OFFLINE) | 0x8000; if (oldStatus > ID_STATUS_OFFLINE) { if (db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE) { diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp index 6ee67026ad..d5b790ad32 100644 --- a/plugins/Sessions/Src/Main.cpp +++ b/plugins/Sessions/Src/Main.cpp @@ -204,7 +204,7 @@ INT_PTR CALLBACK SaveSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l GetDlgItemText(hdlg, IDC_LIST, szUserSessionName, _countof(szUserSessionName)); szUserSessionName[length + 1] = '\0'; if (IsDlgButtonChecked(hdlg, IDC_SELCONTACTS) && bSC) { - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { BYTE res = (BYTE)SendMessage(hClistControl, CLM_GETCHECKMARK, SendMessage(hClistControl, CLM_FINDCONTACT, hContact, 0), 0); if (res) { user_session_list[i] = hContact; @@ -408,7 +408,7 @@ int SaveSessionHandles(WPARAM, LPARAM lparam) return 1; int k = 0; - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { if ((k = CheckForDuplicate(session_list, hContact)) != -1 && !(g_bExclHidden && !CheckContactVisibility(hContact))) { AddSessionMark(hContact, lparam, '1'); AddInSessionOrder(hContact, lparam, k, 1); @@ -528,7 +528,7 @@ int LoadSession(WPARAM, LPARAM lparam) if (session_list_recovered[0] && lparam == 256 && mode == 0) memcpy(session_list_t, session_list_recovered, sizeof(session_list_t)); else - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) if (LoadContactsFromMask(hContact, mode, lparam)) { int i = GetInSessionOrder(hContact, mode, lparam); session_list_t[i] = hContact; @@ -577,7 +577,7 @@ int LoadSession(WPARAM, LPARAM lparam) int DelUserDefSession(int ses_count) { - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { RemoveSessionMark(hContact, 1, ses_count); SetInSessionOrder(hContact, 1, ses_count, 0); } @@ -613,7 +613,7 @@ int DelUserDefSession(int ses_count) int DeleteAutoSession(int ses_count) { - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { RemoveSessionMark(hContact, 0, ses_count); SetInSessionOrder(hContact, 0, ses_count, 0); } @@ -841,7 +841,7 @@ extern "C" __declspec(dllexport) int Load(void) int i = 0; memset(session_list_recovered, 0, sizeof(session_list_recovered)); - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) if (db_get_b(hContact, MODNAME, "wasInLastSession", 0)) session_list_recovered[i++] = hContact; } diff --git a/plugins/Sessions/Src/Options.cpp b/plugins/Sessions/Src/Options.cpp index f19d90c1e1..28d5fbb075 100644 --- a/plugins/Sessions/Src/Options.cpp +++ b/plugins/Sessions/Src/Options.cpp @@ -46,7 +46,7 @@ int OpLoadSessionContacts(WPARAM, LPARAM lparam) { memset(session_list_t, 0, sizeof(session_list_t)); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { if (LoadContactsFromMask(hContact, 1, lparam)) { int i = GetInSessionOrder(hContact, 1, lparam); session_list_t[i] = hContact; @@ -314,7 +314,7 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l if (!hOpClistControl) EnableWindow(GetDlgItem(hdlg, IDC_DEL), TRUE); else { - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) SendMessage(hOpClistControl, CLM_SETCHECKMARK, hContact, 0); for (int i = 0; session_list_t[i] > 0; i++) { @@ -361,7 +361,7 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l case IDC_SAVE: { int i = 0; - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { BYTE res = (BYTE)SendDlgItemMessage(hdlg, IDC_EMCLIST, CLM_GETCHECKMARK, SendDlgItemMessage(hdlg, IDC_EMCLIST, CLM_FINDCONTACT, hContact, 0), 0); if (res) { diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp index ceeff234c1..7559abaea1 100644 --- a/plugins/SmileyAdd/src/smileys.cpp +++ b/plugins/SmileyAdd/src/smileys.cpp @@ -748,7 +748,7 @@ void SmileyCategoryListType::DeleteAccountAsCategory(PROTOACCOUNT *acc) { CMStringW tname(_A2T(acc->szModuleName)); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { char *proto = GetContactProto(hContact); if (proto == nullptr) continue; @@ -841,7 +841,7 @@ void SmileyCategoryListType::AddAllProtocolsAsCategory(void) for (int i = 0; i < protoCount; i++) AddAccountAsCategory(accList[i], defaultFile); - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) AddContactTransportAsCategory(hContact, defaultFile); CMStringW cats; diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index 41cfdfb025..c9b3ebeb1b 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -2191,7 +2191,7 @@ void TSAPI DeleteContainer(int iIndex) db_set_ws(0, CONTAINER_KEY, szIndex, L"**free**"); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { ptrW tszValue(db_get_wsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY)); if (!mir_wstrcmp(tszValue, tszContainerName)) db_unset(hContact, SRMSGMOD_T, CONTAINER_SUBKEY); @@ -2225,7 +2225,7 @@ void TSAPI RenameContainer(int iIndex, const wchar_t *szNew) db_set_ws(0, CONTAINER_KEY, szIndex, szNew); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { ptrW tszValue(db_get_wsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY)); if (!mir_wstrcmp(tszValue, tszContainerName)) db_set_ws(hContact, SRMSGMOD_T, CONTAINER_SUBKEY, szNew); diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index adc81218a0..11fb6aa266 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -454,7 +454,7 @@ int CGlobals::PreshutdownSendRecv(WPARAM, LPARAM) ::TN_ModuleDeInit(); ::CloseAllContainers(); - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) db_set_dw(hContact, SRMSGMOD_T, "messagecount", 0); ::SI_DeinitStatusIcons(); @@ -501,7 +501,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void) { OBJLIST arEvents(10, NumericKeySortT); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { if (db_get_dw(hContact, "SendLater", "count", 0)) sendLater->addContact(hContact); diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index d0b5a2e5dd..e87aa97f88 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -881,7 +881,7 @@ class COptTypingDlg : public CDlgBase if (hItemUnknown && M.GetByte(SRMSGMOD, SRMSGSET_TYPINGUNKNOWN, SRMSGDEFSET_TYPINGUNKNOWN)) SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItemUnknown, 1); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = (HANDLE)SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_FINDCONTACT, hContact, 0); if (hItem && db_get_b(hContact, SRMSGMOD, SRMSGSET_TYPING, defType)) SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 1); @@ -896,7 +896,7 @@ class COptTypingDlg : public CDlgBase if (hItemUnknown) db_set_b(0, SRMSGMOD, SRMSGSET_TYPINGUNKNOWN, (BYTE)(SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItemUnknown, 0) ? 1 : 0)); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = (HANDLE)SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_FINDCONTACT, hContact, 0); if (hItem) db_set_b(hContact, SRMSGMOD, SRMSGSET_TYPING, (BYTE)(SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0) ? 1 : 0)); diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index 43d26950e9..baf21a59d5 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -205,7 +205,7 @@ int SendQueue::sendQueued(CTabBaseDlg *dat, const int iEntry) size_t iSendLength = getSendLength(iEntry); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, hContact, 0); if (hItem && SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0)) { CContactCache *c = CContactCache::getContactCache(hContact); @@ -221,7 +221,7 @@ int SendQueue::sendQueued(CTabBaseDlg *dat, const int iEntry) return 0; } - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, hContact, 0); if (hItem && SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0)) { doSendLater(iEntry, nullptr, hContact, false); diff --git a/plugins/TabSRMM/src/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp index 122266d5f2..2c12278a9a 100644 --- a/plugins/TabSRMM/src/trayicon.cpp +++ b/plugins/TabSRMM/src/trayicon.cpp @@ -287,7 +287,7 @@ void TSAPI LoadFavoritesAndRecent() if (recentEntries == nullptr) return; - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { if (M.GetByte(hContact, "isFavorite", 0)) AddContactToFavorites(hContact, nullptr, nullptr, nullptr, 0, nullptr, 1, PluginConfig.g_hMenuFavorites); if ((dwRecent = M.GetDword(hContact, "isRecent", 0)) != 0 && iIndex < nen_options.wMaxRecent) { diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index 289b748916..02786dbd07 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -1842,7 +1842,7 @@ INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam, SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETGREYOUTFLAGS, 0, 0); SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETLEFTMARGIN, 2, 0); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, hContact, 0); if (hItem && db_get_b(hContact, MODULE, "FavouriteContact", 0)) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 1); @@ -1859,7 +1859,7 @@ INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam, BYTE isChecked; int count = 0; - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, hContact, 0); if (hItem) { isChecked = (BYTE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0); diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index 533c1abee9..5425e098aa 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -1470,7 +1470,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (dwItems & TRAYTIP_NUMCONTACTS) { int iCount = 0, iCountOnline = 0; - for (auto &hContact : contact_iter(pa->szModuleName)) { + for (auto &hContact : Contacts(pa->szModuleName)) { if (db_get_w(hContact, pa->szModuleName, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) iCountOnline++; iCount++; @@ -1588,7 +1588,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa bool bTitlePainted = false; int iCount = 0, iCountOnline = 0; - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { if (db_get_b(hContact, MODULE, "FavouriteContact", 0)) { char *proto = GetContactProto(hContact); if (proto == nullptr) diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp index 9ef92feeab..73ab8c733b 100644 --- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp +++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp @@ -741,7 +741,7 @@ class CAnnivList mtNow.GetLocalTime(); // insert the items into the list - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { // ignore meta subcontacts here, as they are not interesting. if (!db_mc_isSub(hContact)) { // filter protocol diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp index 77fdb16776..23c19e0e3d 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp @@ -499,7 +499,7 @@ BYTE CExImContactBase::isHandle(MCONTACT hContact) **/ MCONTACT CExImContactBase::findHandle() { - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { if (isHandle(hContact)) { _hContact = hContact; _isNewContact = FALSE; diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp index cd8d14ec6e..78466a2838 100644 --- a/plugins/UserInfoEx/src/psp_options.cpp +++ b/plugins/UserInfoEx/src/psp_options.cpp @@ -466,7 +466,7 @@ static INT_PTR CALLBACK DlgProc_AdvancedOpts(HWND hDlg, UINT uMsg, WPARAM wParam DB::Module::Delete(NULL, USERINFO"ExW"); // delete old contactsettings - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { db_unset(hContact, USERINFO, "PListColWidth0"); db_unset(hContact, USERINFO, "PListColWidth1"); db_unset(hContact, USERINFO, "PListColWidth2"); @@ -669,7 +669,7 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam // walk through all the contacts stored in the DB MAnnivDate mdb; - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) mdb.DBMoveBirthDate(hContact, bOld, bNew); } diff --git a/plugins/UserInfoEx/src/svc_avatar.cpp b/plugins/UserInfoEx/src/svc_avatar.cpp index 0ed9bd5b12..6fe5421881 100644 --- a/plugins/UserInfoEx/src/svc_avatar.cpp +++ b/plugins/UserInfoEx/src/svc_avatar.cpp @@ -102,7 +102,7 @@ namespace NServices if (bEnable && !ghChangedHook) { // walk through all the contacts stored in the DB - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { // don't set if avatar is locked! if (!db_get_b(hContact, "ContactPhoto", "Locked", 0)) { BYTE bInvalidAvatar = TRUE; @@ -144,7 +144,7 @@ namespace NServices ghChangedHook = nullptr; // walk through all the contacts stored in the DB - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) DeleteAvatar(hContact); } } diff --git a/plugins/UserInfoEx/src/svc_refreshci.cpp b/plugins/UserInfoEx/src/svc_refreshci.cpp index ac280af39a..b409fb78b6 100644 --- a/plugins/UserInfoEx/src/svc_refreshci.cpp +++ b/plugins/UserInfoEx/src/svc_refreshci.cpp @@ -692,7 +692,7 @@ public: { int iWait = 100; - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) if (QueueAddRefreshContact(hContact, iWait)) iWait += 5000; diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index 4c85441be5..c1e60e7531 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -564,7 +564,7 @@ void SvcReminderCheckAll(const ENotify notify) // walk through all the contacts stored in the DB CEvent evt; WORD a1 = 0; - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) CheckContact(hContact, now, evt, notify != NOTIFY_CLIST, &a1); if (notify != NOTIFY_CLIST) { @@ -727,7 +727,7 @@ static INT_PTR BackupBirthdayService(WPARAM hContact, LPARAM lParam) WORD a1 = 0; //walk through all the contacts stored in the DB - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) if (!db_mc_isSub(hContact) && !mdb.DBGetBirthDate(hContact)) mdb.BackupBirthday(hContact, nullptr, TRUE, &a1); } @@ -858,7 +858,7 @@ void SvcReminderEnable(BYTE bEnable) UpdateTimer(TRUE); } else { // Reminder is off - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) NotifyWithExtraIcon(hContact, CEvent()); gRemindOpts.RemindState = REMIND_OFF; diff --git a/plugins/Variables/src/contact.cpp b/plugins/Variables/src/contact.cpp index 9c8e51ecaa..9e40bc71dd 100644 --- a/plugins/Variables/src/contact.cpp +++ b/plugins/Variables/src/contact.cpp @@ -197,7 +197,7 @@ MCONTACT getContactFromString(const wchar_t *tszContact, DWORD dwFlags, int nMat MCONTACT hContact; LIST arResults(1); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { // <_HANDLE_:hContact> tmp.Format(L"<%s:%d>", _A2W(PROTOID_HANDLE), hContact); bool bMatch = (tmp == tszContact); diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp index 8eb429ba81..0dad8e92a0 100644 --- a/plugins/Variables/src/parse_miranda.cpp +++ b/plugins/Variables/src/parse_miranda.cpp @@ -439,7 +439,7 @@ static MEVENT findDbEvent(MCONTACT hContact, MEVENT hDbEvent, int flags) DBEVENTINFO dbe = {}; if (flags & DBE_FIRST) { - for (auto &hSearchContact : contact_iter()) { + for (auto &hSearchContact : Contacts()) { hSearchEvent = findDbEvent(hSearchContact, NULL, flags); dbe.cbBlob = 0; if (!db_event_get(hSearchEvent, &dbe)) { @@ -452,7 +452,7 @@ static MEVENT findDbEvent(MCONTACT hContact, MEVENT hDbEvent, int flags) hDbEvent = hMatchEvent; } else if (flags & DBE_LAST) { - for (auto &hSearchContact : contact_iter()) { + for (auto &hSearchContact : Contacts()) { hSearchEvent = findDbEvent(hSearchContact, NULL, flags); dbe.cbBlob = 0; if (!db_event_get(hSearchEvent, &dbe)) { @@ -468,7 +468,7 @@ static MEVENT findDbEvent(MCONTACT hContact, MEVENT hDbEvent, int flags) dbe.cbBlob = 0; if (!db_event_get(hDbEvent, &dbe)) { priorTimestamp = dbe.timestamp; - for (auto &hSearchContact : contact_iter()) { + for (auto &hSearchContact : Contacts()) { hSearchEvent = findDbEvent(hSearchContact, hDbEvent, flags); dbe.cbBlob = 0; if (!db_event_get(hSearchEvent, &dbe)) { @@ -484,7 +484,7 @@ static MEVENT findDbEvent(MCONTACT hContact, MEVENT hDbEvent, int flags) else if (flags & DBE_PREV) { if (!db_event_get(hDbEvent, &dbe)) { priorTimestamp = dbe.timestamp; - for (auto &hSearchContact : contact_iter()) { + for (auto &hSearchContact : Contacts()) { hSearchEvent = findDbEvent(hSearchContact, hDbEvent, flags); dbe.cbBlob = 0; if (!db_event_get(hSearchEvent, &dbe)) { diff --git a/plugins/Weather/src/weather_addstn.cpp b/plugins/Weather/src/weather_addstn.cpp index 87825b72a5..59f5720d22 100644 --- a/plugins/Weather/src/weather_addstn.cpp +++ b/plugins/Weather/src/weather_addstn.cpp @@ -39,7 +39,7 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam) return 0; // search for existing contact - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { // check if it is a weather contact if (IsMyContact(hContact)) { DBVARIANT dbv; diff --git a/plugins/Weather/src/weather_contacts.cpp b/plugins/Weather/src/weather_contacts.cpp index 647e855e99..efde7bc6d2 100644 --- a/plugins/Weather/src/weather_contacts.cpp +++ b/plugins/Weather/src/weather_contacts.cpp @@ -444,7 +444,7 @@ int ContactDeleted(WPARAM wParam, LPARAM) // now the default station is deleted, try to get a new one // start looking for other weather stations - for (auto &hContact : contact_iter(WEATHERPROTONAME)) { + for (auto &hContact : Contacts(WEATHERPROTONAME)) { tszID = db_get_wsa(hContact, WEATHERPROTONAME, "ID"); if (tszID == NULL) continue; diff --git a/plugins/Weather/src/weather_data.cpp b/plugins/Weather/src/weather_data.cpp index 90a8a05c0a..cc3fcbbf27 100644 --- a/plugins/Weather/src/weather_data.cpp +++ b/plugins/Weather/src/weather_data.cpp @@ -112,7 +112,7 @@ void EraseAllInfo() MCONTACT LastContact = NULL; DBVARIANT dbv; // loop through all contacts - for (auto &hContact : contact_iter(WEATHERPROTONAME)) { + for (auto &hContact : Contacts(WEATHERPROTONAME)) { db_set_w(hContact, WEATHERPROTONAME, "Status", ID_STATUS_OFFLINE); db_set_w(hContact, WEATHERPROTONAME, "StatusIcon", ID_STATUS_OFFLINE); db_unset(hContact, "CList", "MyHandle"); diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp index c219c2a9ca..12d24e8dfb 100644 --- a/plugins/Weather/src/weather_mwin.cpp +++ b/plugins/Weather/src/weather_mwin.cpp @@ -348,7 +348,7 @@ void InitMwin(void) mir_strcpy(fontid.prefix, "fnt1"); Font_RegisterW(&fontid); - for (auto &hContact : contact_iter(WEATHERPROTONAME)) + for (auto &hContact : Contacts(WEATHERPROTONAME)) if (db_get_dw(hContact, WEATHERPROTONAME, "mwin", 0)) addWindow(hContact); @@ -357,7 +357,7 @@ void InitMwin(void) void DestroyMwin(void) { - for (auto &hContact : contact_iter(WEATHERPROTONAME)) { + for (auto &hContact : Contacts(WEATHERPROTONAME)) { DWORD frameId = db_get_dw(hContact, WEATHERPROTONAME, "mwin", 0); if (frameId) CallService(MS_CLIST_FRAMES_REMOVEFRAME, frameId, 0); diff --git a/plugins/Weather/src/weather_update.cpp b/plugins/Weather/src/weather_update.cpp index 66feef7258..91a1755ede 100644 --- a/plugins/Weather/src/weather_update.cpp +++ b/plugins/Weather/src/weather_update.cpp @@ -307,7 +307,7 @@ static void UpdateThreadProc(void *) void UpdateAll(BOOL AutoUpdate, BOOL RemoveData) { // add all weather contact to the update queue list - for (auto &hContact : contact_iter(WEATHERPROTONAME)) + for (auto &hContact : Contacts(WEATHERPROTONAME)) if (!db_get_b(hContact, WEATHERPROTONAME, "AutoUpdate", FALSE) || !AutoUpdate) { if (RemoveData) DBDataManage(hContact, WDBM_REMOVE, 0, 0); diff --git a/plugins/YAMN/src/proto/pop3/pop3comm.cpp b/plugins/YAMN/src/proto/pop3/pop3comm.cpp index 280244d8a1..30d1097e35 100644 --- a/plugins/YAMN/src/proto/pop3/pop3comm.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3comm.cpp @@ -283,7 +283,7 @@ int RegisterPOP3Plugin(WPARAM, LPARAM) for (Finder = POP3Plugin->FirstAccount; Finder != nullptr; Finder = Finder->Next) { Finder->hContact = NULL; - for (auto &hContact : contact_iter(YAMN_DBMODULE)) { + for (auto &hContact : Contacts(YAMN_DBMODULE)) { if (!db_get_s(hContact, YAMN_DBMODULE, "Id", &dbv)) { if (mir_strcmp(dbv.pszVal, Finder->Name) == 0) { Finder->hContact = hContact; diff --git a/plugins/YAPP/src/options.cpp b/plugins/YAPP/src/options.cpp index 5fd2230882..262f3abe7a 100644 --- a/plugins/YAPP/src/options.cpp +++ b/plugins/YAPP/src/options.cpp @@ -99,7 +99,7 @@ void ShowExamplePopups() pd.ptzText = TranslateT("Thequickbrownfoxjumpedoverthelazydog."); ShowPopup(pd); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { if (options.av_layout != PAV_NONE && ServiceExists(MS_AV_DRAWAVATAR)) { AVATARCACHEENTRY *ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, hContact, 0); if (ace && (ace->dwFlags & AVS_BITMAP_VALID)) { diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp index 7014e6e51d..5403f78955 100644 --- a/protocols/Discord/src/proto.cpp +++ b/protocols/Discord/src/proto.cpp @@ -69,7 +69,7 @@ CDiscordProto::CDiscordProto(const char *proto_name, const wchar_t *username) : Clist_GroupCreate(0, m_wszDefaultGroup); // Fill users list - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { CDiscordUser *pNew = new CDiscordUser(getId(hContact, DB_KEY_ID)); pNew->hContact = hContact; pNew->channelId = getId(hContact, DB_KEY_CHANNELID); diff --git a/protocols/EmLanProto/src/mlan.cpp b/protocols/EmLanProto/src/mlan.cpp index aedb605b13..966804297e 100644 --- a/protocols/EmLanProto/src/mlan.cpp +++ b/protocols/EmLanProto/src/mlan.cpp @@ -111,7 +111,7 @@ void CMLan::SetMirandaStatus(u_int status) void CMLan::SetAllOffline() { - for (auto &hContact : contact_iter(PROTONAME)) { + for (auto &hContact : Contacts(PROTONAME)) { db_set_w(hContact, PROTONAME, "Status", ID_STATUS_OFFLINE); db_unset(hContact, PROTONAME, "IP"); } @@ -205,7 +205,7 @@ void CMLan::SendPacketExt(TPacket& pak, u_long addr) MCONTACT CMLan::FindContact(in_addr addr, const char* nick, bool add_to_list, bool make_permanent, bool make_visible, u_int status) { - for (auto &res : contact_iter(PROTONAME)) { + for (auto &res : Contacts(PROTONAME)) { u_long caddr = db_get_dw(res, PROTONAME, "ipaddr", -1); if (caddr == addr.S_un.S_addr) { if (make_permanent) diff --git a/protocols/FacebookRM/src/chat.cpp b/protocols/FacebookRM/src/chat.cpp index 565f434872..85aba15848 100644 --- a/protocols/FacebookRM/src/chat.cpp +++ b/protocols/FacebookRM/src/chat.cpp @@ -500,7 +500,7 @@ void FacebookProto::LoadParticipantsNames(facebook_chatroom *fbc) void FacebookProto::JoinChatrooms() { - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (!isChatRoom(hContact)) continue; diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp index 889b042fa3..7ebd189b9d 100644 --- a/protocols/FacebookRM/src/contacts.cpp +++ b/protocols/FacebookRM/src/contacts.cpp @@ -90,7 +90,7 @@ MCONTACT FacebookProto::ChatIDToHContact(const std::string &chat_id) } // Go through all local contacts - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (!IsMyContact(hContact, true)) continue; @@ -122,7 +122,7 @@ MCONTACT FacebookProto::ContactIDToHContact(const std::string &user_id) } // Go through all local contacts - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (isChatRoom(hContact)) continue; @@ -150,7 +150,7 @@ std::string FacebookProto::ThreadIDToContactID(const std::string &thread_id) } // Go through all local contacts - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (!IsMyContact(hContact)) continue; diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp index a30cdbbf6c..0203045c42 100644 --- a/protocols/FacebookRM/src/process.cpp +++ b/protocols/FacebookRM/src/process.cpp @@ -50,7 +50,7 @@ void FacebookProto::ProcessFriendList(void*) ParseFriends(&resp.data, &friends, loadAllContacts); // Check and update old contacts - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (isChatRoom(hContact)) continue; diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index f34163ad81..fdf025c619 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -1373,7 +1373,7 @@ void GaduProto::setalloffline() debugLogA("setalloffline(): started. Setting buddies offline"); setWord(GG_KEY_STATUS, ID_STATUS_OFFLINE); - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { setWord(hContact, GG_KEY_STATUS, ID_STATUS_OFFLINE); // Clear IP and port settings delSetting(hContact, GG_KEY_CLIENTIP); @@ -1437,7 +1437,7 @@ void GaduProto::notifyall() debugLogA("notifyall(): Subscribing notification to all users"); // Readup count int count = 0; - for (auto &hContact : acc_contact_iter()) + for (auto &hContact : AccContacts()) count++; // Readup list @@ -1454,7 +1454,7 @@ void GaduProto::notifyall() char *types = (char*)calloc(sizeof(char), count); int cc = 0; - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (uins[cc] = getDword(hContact, GG_KEY_UIN, 0)) { if ((getWord(hContact, GG_KEY_APPARENT, (WORD)ID_STATUS_ONLINE) == ID_STATUS_OFFLINE) || db_get_b(hContact, "CList", "NotOnList", 0)) @@ -1490,7 +1490,7 @@ MCONTACT GaduProto::getcontact(uin_t uin, int create, int inlist, wchar_t *szNic debugLogA("getcontact(): uin=%d create=%d inlist=%d", uin, create, inlist); #endif // Look for contact in DB - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if ((uin_t)getDword(hContact, GG_KEY_UIN, 0) == uin && !isChatRoom(hContact)) { if (inlist) { db_unset(hContact, "CList", "NotOnList"); diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp index 7e6d7a823f..7cde32feef 100644 --- a/protocols/Gadu-Gadu/src/groupchat.cpp +++ b/protocols/Gadu-Gadu/src/groupchat.cpp @@ -407,7 +407,7 @@ static void gg_gc_resetclistopts(HWND hwndList) static int gg_gc_countcheckmarks(HWND hwndList) { int count = 0; - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, hContact, 0); if (hItem && SendMessage(hwndList, CLM_GETCHECKMARK, (WPARAM)hItem, 0)) ++count; @@ -459,7 +459,7 @@ static INT_PTR CALLBACK gg_gc_openconfdlg(HWND hwndDlg, UINT message, WPARAM wPa // Create new participiants table uin_t* participants = (uin_t*)calloc(count, sizeof(uin_t)); gg->debugLogA("gg_gc_openconfdlg(): WM_COMMAND IDOK Opening new conference for %d contacts.", count); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, hContact, 0); if (hItem && SendMessage(hwndList, CLM_GETCHECKMARK, (WPARAM)hItem, 0)) { MCONTACT hMetaContact = gg_getsubcontact(gg, hContact); // MetaContacts support @@ -508,7 +508,7 @@ static INT_PTR CALLBACK gg_gc_openconfdlg(HWND hwndDlg, UINT message, WPARAM wPa break; // Delete non-gg contacts - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { MCONTACT hItem = (MCONTACT)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, hContact, 0); if (hItem) { MCONTACT hMetaContact = gg_getsubcontact(gg, hContact); // MetaContacts support diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp index ae8c96764f..ed17ea1aed 100644 --- a/protocols/Gadu-Gadu/src/import.cpp +++ b/protocols/Gadu-Gadu/src/import.cpp @@ -25,7 +25,7 @@ char *gg_makecontacts(GaduProto *gg, int cr) string_t s = string_init(nullptr); // Readup contacts - for (auto &hContact : gg->acc_contact_iter()) { + for (auto &hContact : gg->AccContacts()) { if (gg->isChatRoom(hContact)) continue; diff --git a/protocols/ICQCorp/src/protocol.cpp b/protocols/ICQCorp/src/protocol.cpp index 41cdc81cd3..067baf4ddf 100644 --- a/protocols/ICQCorp/src/protocol.cpp +++ b/protocols/ICQCorp/src/protocol.cpp @@ -1111,7 +1111,7 @@ void ICQ::updateContactList() //HANDLE hContact; ICQUser *u; - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { proto = GetContactProto(hContact); if (proto && !mir_strcmp(proto, protoName)) { if ((u = getUserByContact(hContact)) == nullptr) { diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp index b09b9b9248..2c0c9b0860 100644 --- a/protocols/IRCG/src/clist.cpp +++ b/protocols/IRCG/src/clist.cpp @@ -140,7 +140,7 @@ bool CIrcProto::CList_SetAllOffline(BYTE ChatsToo) DisconnectAllDCCSessions(false); - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (isChatRoom(hContact)) continue; @@ -168,7 +168,7 @@ MCONTACT CIrcProto::CList_FindContact(CONTACT *user) wchar_t* lowercasename = mir_wstrdup(user->name); CharLower(lowercasename); - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (isChatRoom(hContact)) continue; diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index 8ba7681450..a7868bd26b 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -141,7 +141,7 @@ VOID CALLBACK OnlineNotifTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD) if (name.IsEmpty() && name2.IsEmpty()) { DBVARIANT dbv; - for (auto &hContact : ppro->acc_contact_iter()) { + for (auto &hContact : ppro->AccContacts()) { if (ppro->isChatRoom(hContact)) continue; diff --git a/protocols/IcqOscarJ/src/icq_infoupdate.cpp b/protocols/IcqOscarJ/src/icq_infoupdate.cpp index b4f443aa2c..4bfafdb33c 100644 --- a/protocols/IcqOscarJ/src/icq_infoupdate.cpp +++ b/protocols/IcqOscarJ/src/icq_infoupdate.cpp @@ -126,7 +126,7 @@ void CIcqProto::icq_RescanInfoUpdate() bInfoUpdateEnabled = 0; // freeze thread // Queue all outdated users - for (auto &hContact : acc_contact_iter()) + for (auto &hContact : AccContacts()) if (IsMetaInfoChanged(hContact)) // Queue user if (!icq_QueueUser(hContact)) { // The queue is full, pause queuing contacts bInfoPendingUsers = 1; diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index 21b99bdd01..583fa6e919 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -259,7 +259,7 @@ int CIcqProto::OnModulesLoaded(WPARAM, LPARAM) ModuleLoad(0, 0); InitXStatusItems(FALSE); - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { DWORD bXStatus = getContactXStatus(hContact); if (bXStatus > 0) setContactExtraIcon(hContact, bXStatus); diff --git a/protocols/IcqOscarJ/src/icq_server.cpp b/protocols/IcqOscarJ/src/icq_server.cpp index b71737b5c6..2839d7c435 100644 --- a/protocols/IcqOscarJ/src/icq_server.cpp +++ b/protocols/IcqOscarJ/src/icq_server.cpp @@ -178,7 +178,7 @@ void __cdecl CIcqProto::ServerThread(serverthread_start_info *infoParam) StopAvatarThread(); // Offline all contacts - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (getContactStatus(hContact) == ID_STATUS_OFFLINE) continue; diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp index b61fee4701..f1d17036ef 100644 --- a/protocols/IcqOscarJ/src/icq_servlist.cpp +++ b/protocols/IcqOscarJ/src/icq_servlist.cpp @@ -858,7 +858,7 @@ void CIcqProto::LoadServerIDs() nGroups = nServerIDListCount - nStart; - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (wSrvID = getWord(hContact, DBSETTING_SERVLIST_ID, 0)) { ReserveServerID(wSrvID, SSIT_ITEM, 0); nContacts++; @@ -1197,7 +1197,7 @@ void* CIcqProto::collectBuddyGroup(WORD wGroupID, int *count) MCONTACT hContact; WORD wItemID; - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (wGroupID == getWord(hContact, DBSETTING_SERVLIST_GROUP, 0)) { // add only buddys from specified group wItemID = getWord(hContact, DBSETTING_SERVLIST_ID, 0); @@ -1223,7 +1223,7 @@ void* CIcqProto::collectGroups(int *count) int i; WORD wGroupID; - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (wGroupID = getWord(hContact, DBSETTING_SERVLIST_GROUP, 0)) { // add only valid IDs for (i = 0; i < cnt; i++) // check for already added ids if (buf[i] == wGroupID) diff --git a/protocols/IcqOscarJ/src/icq_uploadui.cpp b/protocols/IcqOscarJ/src/icq_uploadui.cpp index 5991d7cfcc..1a6cd6c4c6 100644 --- a/protocols/IcqOscarJ/src/icq_uploadui.cpp +++ b/protocols/IcqOscarJ/src/icq_uploadui.cpp @@ -52,7 +52,7 @@ static void UpdateAllContactsCheckmark(HWND hwndList, CIcqProto* ppro, HANDLE ph { int check = 1; - for (auto &hContact : ppro->acc_contact_iter()) { + for (auto &hContact : ppro->AccContacts()) { HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, hContact, 0); if (hItem) { if (!SendMessage(hwndList, CLM_GETCHECKMARK, (WPARAM)hItem, 0)) { // if any of our contacts is unchecked, uncheck all contacts as well @@ -72,7 +72,7 @@ static int UpdateCheckmarks(HWND hwndList, CIcqProto* ppro, HANDLE phItemAll) int bAll = 1; bListInit = 1; // lock CLC events - for (auto &hContact : ppro->acc_contact_iter()) { + for (auto &hContact : ppro->AccContacts()) { HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, hContact, 0); if (hItem) { if (ppro->getWord(hContact, DBSETTING_SERVLIST_ID, 0)) @@ -93,7 +93,7 @@ static int UpdateCheckmarks(HWND hwndList, CIcqProto* ppro, HANDLE phItemAll) static void DeleteOtherContactsFromControl(HWND hCtrl, CIcqProto* ppro) { - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = (HANDLE)SendMessage(hCtrl, CLM_FINDCONTACT, hContact, 0); if (hItem) if (!ppro->IsICQContact(hContact)) @@ -831,7 +831,7 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg, UINT message, WPARAM wPa if (nm->flags&CLNF_ISINFO) { int check = SendMessage(hClist, CLM_GETCHECKMARK, (WPARAM)hItemAll, 0); - for (auto &hContact : ppro->acc_contact_iter()) { + for (auto &hContact : ppro->AccContacts()) { HANDLE hItem = (HANDLE)SendMessage(hClist, CLM_FINDCONTACT, hContact, 0); if (hItem) SendMessage(hClist, CLM_SETCHECKMARK, (WPARAM)hItem, check); diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp index ceaa122129..399ecf503b 100644 --- a/protocols/IcqOscarJ/src/utilities.cpp +++ b/protocols/IcqOscarJ/src/utilities.cpp @@ -355,7 +355,7 @@ void CIcqProto::InitContactsCache() // build cache mir_cslock l(contactsCacheMutex); - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { DWORD dwUin; uid_str szUid; if (!getContactUid(hContact, &dwUin, &szUid)) @@ -417,7 +417,7 @@ MCONTACT CIcqProto::HContactFromUIN(DWORD dwUin, int *Added) if (hContact) return hContact; - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { DWORD dwContactUin = getContactUin(hContact); if (dwContactUin == dwUin) { AddToContactsCache(hContact, dwUin, nullptr); @@ -480,7 +480,7 @@ MCONTACT CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added) if (hContact) return hContact; - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { DWORD dwContactUin; uid_str szContactUid; if (!getContactUid(hContact, &dwContactUin, &szContactUid)) { @@ -800,7 +800,7 @@ void CIcqProto::ResetSettingsOnListReload() setWord("SrvRecordCount", 0); delSetting(DBSETTING_SERVLIST_UNHANDLED); - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { // All these values will be restored during the serv-list receive setWord(hContact, DBSETTING_SERVLIST_ID, 0); setWord(hContact, DBSETTING_SERVLIST_GROUP, 0); @@ -820,7 +820,7 @@ void CIcqProto::ResetSettingsOnConnect() setByte("SrvVisibility", 0); setDword("IdleTS", 0); - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { setDword(hContact, "LogonTS", 0); setDword(hContact, "IdleTS", 0); setDword(hContact, "TickTS", 0); @@ -837,7 +837,7 @@ void CIcqProto::ResetSettingsOnLoad() setDword("IdleTS", 0); setDword("LogonTS", 0); - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { setDword(hContact, "LogonTS", 0); setDword(hContact, "IdleTS", 0); setDword(hContact, "TickTS", 0); diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index c81f133583..e62e833b17 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -654,7 +654,7 @@ class CGroupchatInviteDlg : public CJabberDlgBase void FilterList(CCtrlClc *) { - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { char *proto = GetContactProto(hContact); if (mir_strcmp(proto, m_proto->m_szModuleName) || m_proto->isChatRoom(hContact)) if (HANDLE hItem = m_clc.FindContact(hContact)) @@ -763,7 +763,7 @@ public: HWND hwndList = GetDlgItem(m_hwnd, IDC_CLIST); // invite users from roster - for (auto &hContact : m_proto->acc_contact_iter()) { + for (auto &hContact : m_proto->AccContacts()) { if (m_proto->isChatRoom(hContact)) continue; diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index 503937a5d0..1e8bfa7b07 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -444,7 +444,7 @@ BOOL CJabberProto::DBCheckIsTransportedContact(const wchar_t *jid, MCONTACT hCon void CJabberProto::CheckAllContactsAreTransported() { - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { ptrW jid(getWStringA(hContact, "jid")); if (jid) DBCheckIsTransportedContact(jid, hContact); diff --git a/protocols/JabberG/src/jabber_list.cpp b/protocols/JabberG/src/jabber_list.cpp index 51beefb3dc..aa7a9b83b8 100644 --- a/protocols/JabberG/src/jabber_list.cpp +++ b/protocols/JabberG/src/jabber_list.cpp @@ -89,7 +89,7 @@ void JABBER_RESOURCE_STATUS::Release() void CJabberProto::ListInit(void) { - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (isChatRoom(hContact)) { ptrW jid(getWStringA(hContact, "ChatRoomID")); if (jid != nullptr) diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index 54ee815d48..703ba1eb43 100755 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -1021,7 +1021,7 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*) } // now it is require to process whole contact list to add not in roster contacts - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { ptrW tszJid(getWStringA(hContact, "jid")); if (tszJid == nullptr) continue; diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index 32ee36c4dc..88304d7830 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -422,7 +422,7 @@ public: SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUES, CB_RESETCONTENT, 0, 0); { - for (auto &hContact : m_proto->acc_contact_iter()) { + for (auto &hContact : m_proto->AccContacts()) { ptrW jid( m_proto->getWStringA(hContact, "jid")); if (jid != nullptr) SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUES, CB_ADDSTRING, 0, jid); @@ -1304,7 +1304,7 @@ void CJabberDlgPrivacyLists::CListResetOptions(HWND) void CJabberDlgPrivacyLists::CListFilter(HWND) { - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { char *proto = GetContactProto(hContact); if (!proto || mir_strcmp(proto, m_proto->m_szModuleName)) if (HANDLE hItem = m_clcClist.FindContact(hContact)) @@ -1361,7 +1361,7 @@ void CJabberDlgPrivacyLists::CListApplyList(HWND hwndList, CPrivacyList *pList) CListResetIcons(hwndList, hItem, bHideIcons); } - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = m_clcClist.FindContact(hContact); if (hItem) CListResetIcons(hwndList, hItem, bHideIcons); @@ -1459,7 +1459,7 @@ void CJabberDlgPrivacyLists::CListBuildList(HWND hwndList, CPrivacyList *pList) pList->AddRule(Jid, szJid, FALSE, dwOrder++, dwPackets); } - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { hItem = m_clcClist.FindContact(hContact); ptrW jid( m_proto->getWStringA(hContact, "jid")); diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index e75eb2fdfa..5c45e3b912 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -301,7 +301,7 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM) CheckAllContactsAreTransported(); // Set all contacts to offline - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { SetContactOfflineStatus(hContact); if (getByte(hContact, "IsTransport", 0)) { diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp index 5343ea2312..6bdefc5412 100644 --- a/protocols/JabberG/src/jabber_rc.cpp +++ b/protocols/JabberG/src/jabber_rc.cpp @@ -464,7 +464,7 @@ int CJabberProto::AdhocOptionsHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe int CJabberProto::RcGetUnreadEventsCount() { int nEventsSent = 0; - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { ptrW jid( getWStringA(hContact, "jid")); if (jid == nullptr) continue; @@ -550,7 +550,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe m_bRcMarkMessagesAsRead = bRemoveCListEvents ? 1 : 0; int nEventsSent = 0; - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { ptrW tszJid( getWStringA(hContact, "jid")); if (tszJid == nullptr) continue; diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index dbadaa861f..8b9cdfd127 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -521,7 +521,7 @@ recvRest: // Set all contacts to offline debugLogA("1"); - for (auto &hContact : acc_contact_iter()) + for (auto &hContact : AccContacts()) SetContactOfflineStatus(hContact); debugLogA("2"); diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp index 2dd3b590a7..5fd2a0f03f 100644 --- a/protocols/MRA/src/MraProto.cpp +++ b/protocols/MRA/src/MraProto.cpp @@ -90,7 +90,7 @@ int CMraProto::OnModulesLoaded(WPARAM, LPARAM) HookProtoEvent(ME_CLIST_GROUPCHANGE, &CMraProto::OnGroupChanged); // всех в offline // тк unsaved values сохран¤ютс¤ их нужно инициализировать - for (auto &hContact : acc_contact_iter()) + for (auto &hContact : AccContacts()) SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID | SCBIF_GROUP_ID | SCBIF_SERVER_FLAG | SCBIF_STATUS), -1, -1, 0, 0, ID_STATUS_OFFLINE, nullptr, nullptr, nullptr); // unsaved values @@ -462,7 +462,7 @@ int CMraProto::SetStatus(int iNewStatus) // всех в offline, только если мы бывали подключены if (dwOldStatusMode > ID_STATUS_OFFLINE) - for (auto &hContact : acc_contact_iter()) + for (auto &hContact : AccContacts()) SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID | SCBIF_GROUP_ID | SCBIF_SERVER_FLAG | SCBIF_STATUS), -1, -1, 0, 0, ID_STATUS_OFFLINE, nullptr, nullptr, nullptr); if (m_hConnection != nullptr) diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index 7355eb65b8..70e1ed567d 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -510,7 +510,7 @@ MCONTACT CMraProto::MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNe //check not already on list CMStringA szEMailLocal; - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (mraGetStringA(hContact, "e-mail", szEMailLocal)) if (szEMailLocal == szEmail) { if (bTemporary == FALSE) diff --git a/protocols/MRA/src/Mra_menus.cpp b/protocols/MRA/src/Mra_menus.cpp index 431e42dcea..b87f16ef5b 100644 --- a/protocols/MRA/src/Mra_menus.cpp +++ b/protocols/MRA/src/Mra_menus.cpp @@ -31,7 +31,7 @@ INT_PTR CMraProto::MraUpdateAllUsersInfo(WPARAM, LPARAM) return 0; if (MessageBox(nullptr, TranslateT("Are you sure?"), TranslateT(MRA_UPD_ALL_USERS_INFO_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) { - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { CMStringA szEmail; if (mraGetStringA(hContact, "e-mail", szEmail)) MraWPRequestByEMail(hContact, ACKTYPE_GETINFO, szEmail); @@ -43,7 +43,7 @@ INT_PTR CMraProto::MraUpdateAllUsersInfo(WPARAM, LPARAM) INT_PTR CMraProto::MraCheckUpdatesUsersAvt(WPARAM, LPARAM) { if (MessageBox(nullptr, TranslateT("Are you sure?"), TranslateT(MRA_CHK_USERS_AVATARS_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) { - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { CMStringA szEmail; if (mraGetStringA(hContact, "e-mail", szEmail)) if (!IsEMailChatAgent(szEmail)) @@ -59,7 +59,7 @@ INT_PTR CMraProto::MraRequestAuthForAll(WPARAM, LPARAM) return 0; if (MessageBox(nullptr, TranslateT("Are you sure?"), TranslateT(MRA_REQ_AUTH_FOR_ALL_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) { - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { DWORD dwContactSeverFlags; if (GetContactBasicInfoW(hContact, nullptr, nullptr, nullptr, &dwContactSeverFlags, nullptr, nullptr, nullptr, nullptr) == NO_ERROR) if (dwContactSeverFlags & CONTACT_INTFLAG_NOT_AUTHORIZED && dwContactSeverFlags != -1) diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp index ea5663733d..35faa0405c 100644 --- a/protocols/MRA/src/Mra_proto.cpp +++ b/protocols/MRA/src/Mra_proto.cpp @@ -1308,7 +1308,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf) if (mraGetStringW(NULL, "AuthMessage", wszAuthMessage) == FALSE) // def auth message wszAuthMessage = TranslateW(MRA_DEFAULT_AUTH_MESSAGE); - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (GetContactBasicInfoW(hContact, &dwID, nullptr, nullptr, nullptr, nullptr, &email, nullptr, nullptr) == NO_ERROR) if (dwID == -1) { if (IsEMailChatAgent(email)) {// чат: ещё раз запросим авторизацию, пометим как видимый в списке, постоянный @@ -1337,7 +1337,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf) } else { // контакт лист почемуто не получили // всех в offline и id в нестандарт - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID | SCBIF_GROUP_ID | SCBIF_SERVER_FLAG | SCBIF_STATUS), -1, -2, 0, 0, ID_STATUS_OFFLINE, nullptr, nullptr, nullptr); // request user info from server diff --git a/protocols/MSN/src/msn_chat.cpp b/protocols/MSN/src/msn_chat.cpp index c484d9f2f6..45f37fb39f 100644 --- a/protocols/MSN/src/msn_chat.cpp +++ b/protocols/MSN/src/msn_chat.cpp @@ -243,7 +243,7 @@ void CMsnProto::MSN_GCRefreshThreadsInfo(void) CMStringA buf; int nThreads = 0; - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (isChatRoom(hContact) != 0) { DBVARIANT dbv; if (getString(hContact, "ChatRoomID", &dbv) == 0) { diff --git a/protocols/MSN/src/msn_contact.cpp b/protocols/MSN/src/msn_contact.cpp index ae5abebf9d..a00547b270 100644 --- a/protocols/MSN/src/msn_contact.cpp +++ b/protocols/MSN/src/msn_contact.cpp @@ -53,7 +53,7 @@ MCONTACT CMsnProto::MSN_HContactFromEmail(const char* wlid, const char* msnNick, MCONTACT CMsnProto::MSN_HContactFromChatID(const char* wlid) { - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (isChatRoom(hContact) != 0) { DBVARIANT dbv; if (getString(hContact, "ChatRoomID", &dbv) == 0) { diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index 8b82cd9231..35280a1610 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -675,7 +675,7 @@ void CMsnProto::MSN_FetchRecentMessages(time_t since) * user conversation according to DB */ MEVENT hDbEvent; - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (!(hDbEvent = db_event_last(hContact))) continue; diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index 85c2344b32..d631d6b1af 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -88,7 +88,7 @@ CMsnProto::CMsnProto(const char* aProtoName, const wchar_t* aUserName) : LoadOptions(); - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { delSetting(hContact, "Status"); delSetting(hContact, "IdleTS"); delSetting(hContact, "p2pMsgId"); diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index 956624daa9..b9c7513840 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -59,7 +59,7 @@ MCONTACT CSkypeProto::GetContactFromAuthEvent(MEVENT hEvent) MCONTACT CSkypeProto::FindContact(const char *skypename) { - for (auto &hContact : acc_contact_iter()) + for (auto &hContact : AccContacts()) if (!mir_strcmpi(skypename, Contacts[hContact])) return hContact; diff --git a/protocols/SkypeWeb/src/skype_dialogs.cpp b/protocols/SkypeWeb/src/skype_dialogs.cpp index 6a58c70d38..1147810864 100644 --- a/protocols/SkypeWeb/src/skype_dialogs.cpp +++ b/protocols/SkypeWeb/src/skype_dialogs.cpp @@ -39,7 +39,7 @@ CSkypeInviteDlg::CSkypeInviteDlg(CSkypeProto *proto) : void CSkypeInviteDlg::OnInitDialog() { - for (auto &hContact : m_proto->acc_contact_iter()) { + for (auto &hContact : m_proto->AccContacts()) { if (!m_proto->isChatRoom(hContact)) { wchar_t *ptszNick = pcli->pfnGetContactDisplayName(hContact, 0); m_combo.AddString(ptszNick, hContact); @@ -77,7 +77,7 @@ void CSkypeGCCreateDlg::OnInitDialog() void CSkypeGCCreateDlg::btnOk_OnOk(CCtrlButton*) { - for (auto &hContact : m_proto->acc_contact_iter()) { + for (auto &hContact : m_proto->AccContacts()) { if (!m_proto->isChatRoom(hContact)) { if (HANDLE hItem = m_clc.FindContact(hContact)) { if (m_clc.GetCheck(hItem)) { @@ -94,7 +94,7 @@ void CSkypeGCCreateDlg::btnOk_OnOk(CCtrlButton*) void CSkypeGCCreateDlg::FilterList(CCtrlClc *) { - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { char *proto = GetContactProto(hContact); if (mir_strcmp(proto, m_proto->m_szModuleName) || m_proto->isChatRoom(hContact)) if (HANDLE hItem = m_clc.FindContact(hContact)) diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp index cc145420b4..6df167f3b4 100644 --- a/protocols/SkypeWeb/src/skype_login.cpp +++ b/protocols/SkypeWeb/src/skype_login.cpp @@ -232,7 +232,7 @@ void CSkypeProto::OnCapabilitiesSended(const NETLIBHTTPREQUEST *response) SendRequest(new SetStatusRequest(MirandaToSkypeStatus(m_iDesiredStatus), li), &CSkypeProto::OnStatusChanged); LIST skypenames(1); - for (auto &hContact : acc_contact_iter()) + for (auto &hContact : AccContacts()) if (!isChatRoom(hContact)) skypenames.insert(getStringA(hContact, SKYPE_SETTINGS_ID)); diff --git a/protocols/Tox/src/tox_avatars.cpp b/protocols/Tox/src/tox_avatars.cpp index 2e39986fa8..ac818546a4 100644 --- a/protocols/Tox/src/tox_avatars.cpp +++ b/protocols/Tox/src/tox_avatars.cpp @@ -64,7 +64,7 @@ void CToxProto::SetToxAvatar(const wchar_t* path) db_set_blob(NULL, m_szModuleName, TOX_SETTINGS_AVATAR_HASH, (void*)hash, TOX_HASH_LENGTH); if (IsOnline()) { - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (GetContactStatus(hContact) == ID_STATUS_OFFLINE) continue; @@ -162,7 +162,7 @@ INT_PTR CToxProto::SetMyAvatar(WPARAM, LPARAM lParam) } if (IsOnline()) { - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (GetContactStatus(hContact) == ID_STATUS_OFFLINE) continue; diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp index 7f945bf1a4..a6ed84d4d7 100644 --- a/protocols/Tox/src/tox_contacts.cpp +++ b/protocols/Tox/src/tox_contacts.cpp @@ -49,7 +49,7 @@ MCONTACT CToxProto::GetContact(const Tox *tox, const int friendNumber) MCONTACT CToxProto::GetContact(const char *pubKey) { MCONTACT hContact = NULL; - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { ptrA contactPubKey(getStringA(hContact, TOX_SETTINGS_ID)); // check only public key part of address if (mir_strncmpi(pubKey, contactPubKey, TOX_PUBLIC_KEY_SIZE) == 0) diff --git a/protocols/Twitter/src/chat.cpp b/protocols/Twitter/src/chat.cpp index 2be12c4f20..a28c44f351 100644 --- a/protocols/Twitter/src/chat.cpp +++ b/protocols/Twitter/src/chat.cpp @@ -145,7 +145,7 @@ void TwitterProto::SetChatStatus(int status) { if (status == ID_STATUS_ONLINE) { // Add all friends to contact list - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (isChatRoom(hContact)) continue; diff --git a/protocols/Twitter/src/contacts.cpp b/protocols/Twitter/src/contacts.cpp index 9e5d80c657..3545862b9c 100644 --- a/protocols/Twitter/src/contacts.cpp +++ b/protocols/Twitter/src/contacts.cpp @@ -211,7 +211,7 @@ bool TwitterProto::IsMyContact(MCONTACT hContact, bool include_chat) MCONTACT TwitterProto::UsernameToHContact(const char *name) { - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (getByte(hContact, "ChatRoom")) continue; diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 918d9441da..39fb340e3b 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -158,7 +158,7 @@ wchar_t* CVkProto::GetUserStoredPassword() void CVkProto::SetAllContactStatuses(int iStatus) { debugLogA("CVkProto::SetAllContactStatuses (%d)", iStatus); - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (isChatRoom(hContact)) SetChatStatus(hContact, iStatus); else if (getWord(hContact, "Status") != iStatus) @@ -178,7 +178,7 @@ MCONTACT CVkProto::FindUser(LONG dwUserid, bool bCreate) if (!dwUserid) return 0; - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { LONG dbUserid = getDword(hContact, "ID", VK_INVALID_USER); if (dbUserid == VK_INVALID_USER) continue; @@ -204,7 +204,7 @@ MCONTACT CVkProto::FindChat(LONG dwUserid) if (!dwUserid) return 0; - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { LONG dbUserid = getDword(hContact, "vk_chat_id", VK_INVALID_USER); if (dbUserid == VK_INVALID_USER) continue; diff --git a/protocols/VKontakte/src/vk_dialogs.cpp b/protocols/VKontakte/src/vk_dialogs.cpp index 09eb855ccf..303592e658 100644 --- a/protocols/VKontakte/src/vk_dialogs.cpp +++ b/protocols/VKontakte/src/vk_dialogs.cpp @@ -157,7 +157,7 @@ CVkInviteChatForm::CVkInviteChatForm(CVkProto *proto) : void CVkInviteChatForm::OnInitDialog() { - for (auto &hContact : m_proto->acc_contact_iter()) { + for (auto &hContact : m_proto->AccContacts()) { if (!m_proto->isChatRoom(hContact)) { wchar_t *pwszNick = pcli->pfnGetContactDisplayName(hContact, 0); m_cbxCombo.AddString(pwszNick, hContact); @@ -195,7 +195,7 @@ void CVkGCCreateForm::OnInitDialog() void CVkGCCreateForm::btnOk_OnOk(CCtrlButton*) { CMStringA szUIds; - for (auto &hContact : m_proto->acc_contact_iter()) { + for (auto &hContact : m_proto->AccContacts()) { if (m_proto->isChatRoom(hContact)) continue; @@ -219,7 +219,7 @@ void CVkGCCreateForm::btnOk_OnOk(CCtrlButton*) void CVkGCCreateForm::FilterList(CCtrlClc*) { - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { char *proto = GetContactProto(hContact); if (mir_strcmp(proto, m_proto->m_szModuleName) || m_proto->isChatRoom(hContact) || m_proto->getDword(hContact, "ID") == VK_FEED_USER) if (HANDLE hItem = m_clCList.FindContact(hContact)) diff --git a/protocols/VKontakte/src/vk_history.cpp b/protocols/VKontakte/src/vk_history.cpp index 4781cb4cdb..d136e80b36 100644 --- a/protocols/VKontakte/src/vk_history.cpp +++ b/protocols/VKontakte/src/vk_history.cpp @@ -61,7 +61,7 @@ INT_PTR __cdecl CVkProto::SvcGetAllServerHistory(WPARAM, LPARAM) if (IDNO == MessageBoxW(nullptr, str, TranslateT("Attention!"), MB_ICONWARNING | MB_YESNO)) return 0; - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { LONG userID = getDword(hContact, "ID", VK_INVALID_USER); if (userID == VK_INVALID_USER || userID == VK_FEED_USER) continue; diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 044b6e5757..3a9c065b6d 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -550,7 +550,7 @@ void CVkProto::RetrieveUsersInfo(bool bFreeOffline, bool bRepeat) CMStringA userIDs; int i = 0; - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { LONG userID = getDword(hContact, "ID", VK_INVALID_USER); if (userID == VK_INVALID_USER || userID == VK_FEED_USER || userID < 0) continue; @@ -602,7 +602,7 @@ void CVkProto::OnReceiveUserInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe MCONTACT hContact; LIST arContacts(10, PtrKeySortT); - for (auto &hContact : acc_contact_iter()) + for (auto &hContact : AccContacts()) if (!isChatRoom(hContact) && !IsGroupUser(hContact)) arContacts.insert((HANDLE)hContact); @@ -755,7 +755,7 @@ void CVkProto::OnReceiveFriends(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq LIST arContacts(10, PtrKeySortT); - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (!isChatRoom(hContact) && !IsGroupUser(hContact)) setByte(hContact, "Auth", 1); db_unset(hContact, m_szModuleName, "ReqAuth"); diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index 4f9b2dcc13..717ad29457 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -271,7 +271,7 @@ void UpdateProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANS static void RemoveUnreadFileEvents(void) { - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { MEVENT hDbEvent = db_event_firstUnread(hContact); while (hDbEvent) { DBEVENTINFO dbei = {}; diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp index dbd9095c82..da0ddf36f6 100644 --- a/src/core/stdmsg/src/msgoptions.cpp +++ b/src/core/stdmsg/src/msgoptions.cpp @@ -461,7 +461,7 @@ public: if (hItemUnknown && g_dat.bTypingUnknown) clist.SetCheck(hItemUnknown, 1); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = clist.FindContact(hContact); if (hItem && db_get_b(hContact, SRMMMOD, SRMSGSET_TYPING, defType)) clist.SetCheck(hItem, 1); @@ -476,7 +476,7 @@ public: if (hItemUnknown) g_dat.bTypingUnknown = clist.GetCheck(hItemUnknown); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = clist.FindContact(hContact); if (hItem) db_set_b(hContact, SRMMMOD, SRMSGSET_TYPING, clist.GetCheck(hItem)); diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 30a4565263..60b5bbea0f 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -240,7 +240,7 @@ static void RestoreUnreadMessageAlerts(void) { OBJLIST arEvents(10, NumericKeySortT); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { for (MEVENT hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) { bool autoPopup = false; diff --git a/src/mir_app/src/DefaultExtraIcons.cpp b/src/mir_app/src/DefaultExtraIcons.cpp index ec4e4315c2..a8906d8055 100644 --- a/src/mir_app/src/DefaultExtraIcons.cpp +++ b/src/mir_app/src/DefaultExtraIcons.cpp @@ -312,7 +312,7 @@ void DefaultExtraIcons_Load() p.hExtraIcon = ExtraIcon_RegisterIcolib(p.name, p.desc, Skin_GetIconName(p.iSkinIcon), nullptr, 0, p.flags); } - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { SetExtraIcons(hContact); SetVisibility(hContact, -1, false); SetGender(hContact, -1, false); diff --git a/src/mir_app/src/ExtraIcon.cpp b/src/mir_app/src/ExtraIcon.cpp index 95d093feaf..7aa92878a4 100644 --- a/src/mir_app/src/ExtraIcon.cpp +++ b/src/mir_app/src/ExtraIcon.cpp @@ -67,7 +67,7 @@ void ExtraIcon::applyIcons() if (!isEnabled()) return; - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { // Clear to assert that it will be cleared Clist_SetExtraIcon(hContact, m_slot, INVALID_HANDLE_VALUE); applyIcon(hContact); diff --git a/src/mir_app/src/chat_clist.cpp b/src/mir_app/src/chat_clist.cpp index 5fb50bca59..19f51fdd3d 100644 --- a/src/mir_app/src/chat_clist.cpp +++ b/src/mir_app/src/chat_clist.cpp @@ -83,7 +83,7 @@ BOOL SetOffline(MCONTACT hContact, BOOL) BOOL SetAllOffline(BOOL, const char *pszModule) { - for (auto &hContact : contact_iter(pszModule)) { + for (auto &hContact : Contacts(pszModule)) { char *szProto = GetContactProto(hContact); if (!chatApi.MM_FindModule(szProto)) continue; @@ -223,7 +223,7 @@ BOOL AddEvent(MCONTACT hContact, HICON hIcon, MEVENT hEvent, int type, wchar_t* MCONTACT FindRoom(const char *pszModule, const wchar_t *pszRoom) { - for (auto &hContact : contact_iter(pszModule)) { + for (auto &hContact : Contacts(pszModule)) { if (!db_get_b(hContact, pszModule, "ChatRoom", 0)) continue; diff --git a/src/mir_app/src/clcitems.cpp b/src/mir_app/src/clcitems.cpp index 704ecf0ef0..45bcaee71c 100644 --- a/src/mir_app/src/clcitems.cpp +++ b/src/mir_app/src/clcitems.cpp @@ -105,7 +105,7 @@ ClcGroup* fnAddGroup(HWND hwnd, ClcData *dat, const wchar_t *szName, DWORD flags group->totalMembers = 0; if (flags != (DWORD)-1 && pNextField == nullptr && calcTotalMembers) { DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { ClcCacheEntry *cache = cli.pfnGetCacheEntry(hContact); if (!mir_wstrcmp(cache->tszGroup, szName) && (style & CLS_SHOWHIDDEN || !cache->bIsHidden)) group->totalMembers++; @@ -359,7 +359,7 @@ void fnRebuildEntireList(HWND hwnd, ClcData *dat) cli.pfnAddGroup(hwnd, dat, szGroupName, groupFlags, i, 0); } - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { int nHiddenStatus = cli.pfnGetContactHiddenStatus(hContact, nullptr, dat); if (((style & CLS_SHOWHIDDEN) && nHiddenStatus != -1) || !nHiddenStatus) { ClcCacheEntry *pce = cli.pfnGetCacheEntry(hContact); diff --git a/src/mir_app/src/clistgroups.cpp b/src/mir_app/src/clistgroups.cpp index 8527a131cc..5660cc9c91 100644 --- a/src/mir_app/src/clistgroups.cpp +++ b/src/mir_app/src/clistgroups.cpp @@ -203,7 +203,7 @@ MIR_APP_DLL(int) Clist_GroupDelete(MGROUP hGroup) szNewParent[0] = '\0'; } - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { ptrW tszGroupName(db_get_wsa(hContact, "CList", "Group")); if (mir_wstrcmp(tszGroupName, pGroup->groupName+1)) continue; @@ -342,7 +342,7 @@ static int RenameGroupWithMove(int groupId, const wchar_t *szName, int move) arByName.insert(pGroup); // must rename setting in all child contacts too - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { ClcCacheEntry *cache = cli.pfnGetCacheEntry(hContact); if (!mir_wstrcmp(cache->tszGroup, oldName)) { db_set_ws(hContact, "CList", "Group", szName); diff --git a/src/mir_app/src/contact.cpp b/src/mir_app/src/contact.cpp index d365c01d83..8970bd293b 100644 --- a/src/mir_app/src/contact.cpp +++ b/src/mir_app/src/contact.cpp @@ -38,7 +38,7 @@ static int GetContactStatus(MCONTACT hContact) void fnLoadContactTree(void) { int hideOffline = db_get_b(0, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT); - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { int status = GetContactStatus(hContact); if ((!hideOffline || status != ID_STATUS_OFFLINE) && !db_get_b(hContact, "CList", "Hidden", 0)) cli.pfnChangeContactIcon(hContact, cli.pfnIconFromStatusMode(GetContactProto(hContact), status, hContact)); diff --git a/src/mir_app/src/ignore.cpp b/src/mir_app/src/ignore.cpp index 7ee5f1ec7f..37d5471e88 100644 --- a/src/mir_app/src/ignore.cpp +++ b/src/mir_app/src/ignore.cpp @@ -172,7 +172,7 @@ static void SaveItemMask(HWND hwndList, MCONTACT hContact, HANDLE hItem, const c static void SetAllContactIcons(HWND hwndList) { - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, hContact, 0); if (hItem && SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(IGNOREEVENT_MAX, 0)) == EMPTY_EXTRA_ICON) { DWORD proto1Caps, proto4Caps; @@ -297,7 +297,7 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM case 0: switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_FINDCONTACT, hContact, 0); if (hItem) SaveItemMask(GetDlgItem(hwndDlg, IDC_LIST), hContact, hItem, "Mask1"); if (SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0)) diff --git a/src/mir_app/src/meta_addto.cpp b/src/mir_app/src/meta_addto.cpp index 13adca2900..fe31f4713d 100644 --- a/src/mir_app/src/meta_addto.cpp +++ b/src/mir_app/src/meta_addto.cpp @@ -43,7 +43,7 @@ static int FillList(HWND list, BOOL sort) int i = 0; // The DB is searched through, to get all the metacontacts - for (auto &hMetaUser : contact_iter()) { + for (auto &hMetaUser : Contacts()) { // if it's not a MetaContact, go to the next DBCachedContact *cc = CheckMeta(hMetaUser); if (cc == nullptr) diff --git a/src/mir_app/src/meta_main.cpp b/src/mir_app/src/meta_main.cpp index c8d8824c87..1c1df89bf1 100644 --- a/src/mir_app/src/meta_main.cpp +++ b/src/mir_app/src/meta_main.cpp @@ -77,7 +77,7 @@ int LoadMetacontacts(void) db_set_resident(META_PROTO, "IdleTS"); // set all contacts to 'offline', and initialize subcontact counter for db consistency check - for (auto &hContact : contact_iter(META_PROTO)) { + for (auto &hContact : Contacts(META_PROTO)) { db_set_w(hContact, META_PROTO, "Status", ID_STATUS_OFFLINE); db_set_dw(hContact, META_PROTO, "IdleTS", 0); } diff --git a/src/mir_app/src/meta_utils.cpp b/src/mir_app/src/meta_utils.cpp index 2c85284f71..5b590129c0 100644 --- a/src/mir_app/src/meta_utils.cpp +++ b/src/mir_app/src/meta_utils.cpp @@ -321,7 +321,7 @@ int Meta_HideLinkedContacts(void) DBVARIANT dbv, dbv2; char buffer[512]; - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { DBCachedContact *cc = currDb->m_cache->GetCachedContact(hContact); if (cc == nullptr || cc->parentID == 0) continue; @@ -385,7 +385,7 @@ int Meta_HideMetaContacts(bool bHide) // set status suppression bool bSuppress = bHide ? FALSE : g_metaOptions.bSuppressStatus; - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { bool bSet; DBCachedContact *cc = currDb->m_cache->GetCachedContact(hContact); if (cc->IsSub()) { // show on hide, reverse flag @@ -411,7 +411,7 @@ int Meta_HideMetaContacts(bool bHide) int Meta_SuppressStatus(bool suppress) { - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) if (db_mc_isSub(hContact)) CallService((suppress) ? MS_IGNORE_IGNORE : MS_IGNORE_UNIGNORE, hContact, IGNOREEVENT_USERONLINE); @@ -449,7 +449,7 @@ int Meta_CopyContactNick(DBCachedContact *ccMeta, MCONTACT hContact) int Meta_SetAllNicks() { - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { DBCachedContact *cc = CheckMeta(hContact); if (cc == nullptr) continue; diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 8decb6d44b..fc95a820d8 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -488,4 +488,4 @@ Image_LoadFromMem @505 Image_Resize @506 Image_Save @507 GetDatabasePlugin @508 -?acc_contact_iter@PROTO_INTERFACE@@QBE?AVcontact_iter@@XZ @509 NONAME +?AccContacts@PROTO_INTERFACE@@QBE?AVContacts@@XZ @509 NONAME diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index b09d9d1218..45f671088e 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -488,4 +488,4 @@ Image_LoadFromMem @505 Image_Resize @506 Image_Save @507 GetDatabasePlugin @508 -?acc_contact_iter@PROTO_INTERFACE@@QEBA?AVcontact_iter@@XZ @509 NONAME +?AccContacts@PROTO_INTERFACE@@QEBA?AVContacts@@XZ @509 NONAME diff --git a/src/mir_app/src/options_ei.cpp b/src/mir_app/src/options_ei.cpp index 006272ad62..0afc0b9b98 100644 --- a/src/mir_app/src/options_ei.cpp +++ b/src/mir_app/src/options_ei.cpp @@ -77,7 +77,7 @@ BOOL ScreenToClient(HWND hWnd, LPRECT lpRect) static void RemoveExtraIcons(int slot) { - for (auto &hContact : contact_iter()) + for (auto &hContact : Contacts()) Clist_SetExtraIcon(hContact, slot, INVALID_HANDLE_VALUE); } diff --git a/src/mir_app/src/proto_utils.cpp b/src/mir_app/src/proto_utils.cpp index e86454b858..53301d7269 100644 --- a/src/mir_app/src/proto_utils.cpp +++ b/src/mir_app/src/proto_utils.cpp @@ -64,7 +64,7 @@ MIR_APP_DLL(INT_PTR) ProtoBroadcastAck(const char *szModule, MCONTACT hContact, void PROTO_INTERFACE::setAllContactStatuses(int iStatus, bool bSkipChats) { - for (auto &hContact : acc_contact_iter()) { + for (auto &hContact : AccContacts()) { if (isChatRoom(hContact)) { if (!bSkipChats && iStatus == ID_STATUS_OFFLINE) { ptrW wszRoom(getWStringA(hContact, "ChatRoomID")); diff --git a/src/mir_app/src/visibility.cpp b/src/mir_app/src/visibility.cpp index e3c13a1c34..e90fd88e05 100644 --- a/src/mir_app/src/visibility.cpp +++ b/src/mir_app/src/visibility.cpp @@ -100,7 +100,7 @@ static void ResetListOptions(HWND hwndList) static void SetAllContactIcons(HWND hwndList) { - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, hContact, 0); if (hItem == nullptr) continue; @@ -235,7 +235,7 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP case 0: if (((LPNMHDR)lParam)->code == PSN_APPLY) { - for (auto &hContact : contact_iter()) { + for (auto &hContact : Contacts()) { HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_FINDCONTACT, hContact, 0); if (hItem == nullptr) continue; -- cgit v1.2.3