From e19a213605f1974c2000a9f2b1b7d6d4666cdb90 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 25 Jun 2018 20:43:51 +0300 Subject: duplicate cache item removed to avoid rare crashes --- plugins/Clist_blind/src/contact.cpp | 8 ++++---- plugins/Clist_blind/src/init.cpp | 17 ++++++++--------- plugins/Clist_blind/src/stdafx.h | 2 ++ plugins/Clist_modern/src/modern_clc.cpp | 12 ++++++------ plugins/Clist_modern/src/modern_clc.h | 2 +- plugins/Clist_modern/src/modern_clcitems.cpp | 2 -- plugins/Clist_modern/src/modern_clcpaint.cpp | 8 ++++---- plugins/Clist_modern/src/modern_clcutils.cpp | 2 +- plugins/Clist_modern/src/modern_contact.cpp | 4 ++-- plugins/Clist_nicer/src/clc.cpp | 6 +++--- plugins/Clist_nicer/src/clc.h | 3 +++ plugins/Clist_nicer/src/clcitems.cpp | 16 ++++++++-------- plugins/Clist_nicer/src/clistmenus.cpp | 4 ++-- plugins/Clist_nicer/src/contact.cpp | 9 ++++----- 14 files changed, 48 insertions(+), 47 deletions(-) (limited to 'plugins') diff --git a/plugins/Clist_blind/src/contact.cpp b/plugins/Clist_blind/src/contact.cpp index f9881fcd1b..2b42024382 100644 --- a/plugins/Clist_blind/src/contact.cpp +++ b/plugins/Clist_blind/src/contact.cpp @@ -54,8 +54,8 @@ int CompareContacts(const ClcContact* c1, const ClcContact* c2) { MCONTACT a = c1->hContact, b = c2->hContact; - int statusa = db_get_w(a, c1->proto, "Status", ID_STATUS_OFFLINE); - int statusb = db_get_w(b, c2->proto, "Status", ID_STATUS_OFFLINE); + int statusa = db_get_w(a, c1->pce->szProto, "Status", ID_STATUS_OFFLINE); + int statusb = db_get_w(b, c2->pce->szProto, "Status", ID_STATUS_OFFLINE); if (g_bSortByProto) { /* deal with statuses, online contacts have to go above offline */ @@ -63,8 +63,8 @@ int CompareContacts(const ClcContact* c1, const ClcContact* c2) return 2 * (statusa == ID_STATUS_OFFLINE) - 1; } /* both are online, now check protocols */ - if (c1->proto != nullptr && c2->proto != nullptr) { - int rc = mir_strcmp(c1->proto, c2->proto); + if (c1->pce->szProto != nullptr && c2->pce->szProto != nullptr) { + int rc = mir_strcmp(c1->pce->szProto, c2->pce->szProto); if (rc != 0) return rc; } diff --git a/plugins/Clist_blind/src/init.cpp b/plugins/Clist_blind/src/init.cpp index 69d8883d96..118de95447 100644 --- a/plugins/Clist_blind/src/init.cpp +++ b/plugins/Clist_blind/src/init.cpp @@ -387,31 +387,30 @@ wchar_t* GetStatusName(struct ClcContact *item) int status; status_name[0] = '\0'; - if (item->hContact == NULL || item->proto == nullptr) + if (item->hContact == NULL || item->pce->szProto == nullptr) return status_name; // Get XStatusName - MyDBGetContactSettingTString(item->hContact, item->proto, "XStatusName", status_name, _countof(status_name), nullptr); + MyDBGetContactSettingTString(item->hContact, item->pce->szProto, "XStatusName", status_name, _countof(status_name), nullptr); if (status_name[0] != '\0') return status_name; // Get status name - status = db_get_w(item->hContact, item->proto, "Status", ID_STATUS_OFFLINE); + status = db_get_w(item->hContact, item->pce->szProto, "Status", ID_STATUS_OFFLINE); mir_wstrncpy(status_name, Clist_GetStatusModeDescription(status, 0), _countof(status_name)); return status_name; } - wchar_t status_message[256]; wchar_t* GetStatusMessage(struct ClcContact *item) { status_message[0] = '\0'; - if (item->hContact == NULL || item->proto == nullptr) + if (item->hContact == NULL || item->pce->szProto == nullptr) return status_message; // Get XStatusMsg - MyDBGetContactSettingTString(item->hContact, item->proto, "XStatusMsg", status_message, _countof(status_message), nullptr); + MyDBGetContactSettingTString(item->hContact, item->pce->szProto, "XStatusMsg", status_message, _countof(status_message), nullptr); if (status_message[0] != '\0') return status_message; @@ -430,15 +429,15 @@ wchar_t* GetProtoName(struct ClcContact *item) #endif proto_name[0] = '\0'; - if (item->hContact == NULL || item->proto == nullptr) { + if (item->hContact == NULL || item->pce->szProto == nullptr) { mir_wstrncpy(proto_name, TranslateT("Unknown protocol"), _countof(proto_name)); return proto_name; } - PROTOACCOUNT *acc = Proto_GetAccount(item->proto); + PROTOACCOUNT *acc = Proto_GetAccount(item->pce->szProto); if (acc == nullptr) { #ifdef UNICODE - CallProtoService(item->proto, PS_GETNAME, sizeof(description), (LPARAM)description); + CallProtoService(item->pce->szProto, PS_GETNAME, sizeof(description), (LPARAM)description); mir_snwprintf(proto_name, L"%S", description); #else CallProtoService(item->proto, PS_GETNAME, sizeof(proto_name), (LPARAM)proto_name); diff --git a/plugins/Clist_blind/src/stdafx.h b/plugins/Clist_blind/src/stdafx.h index 62ce6c4d07..f819286769 100644 --- a/plugins/Clist_blind/src/stdafx.h +++ b/plugins/Clist_blind/src/stdafx.h @@ -46,6 +46,8 @@ struct CMPlugin : public PLUGIN int Load() override; }; +struct ClcCacheEntry : public ClcCacheEntryBase {}; + struct ClcContact : public ClcContactBase {}; struct ClcData : public ClcDataBase diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index bf60ce87c9..5aa6926c45 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -952,7 +952,7 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPAR cliGetRowByIndex(dat, dat->iDragItem, &contSour, nullptr); if (contSour->isChat()) break; - if (contSour->type == CLCIT_CONTACT && mir_strcmp(contSour->proto, META_PROTO)) { + if (contSour->type == CLCIT_CONTACT && mir_strcmp(contSour->pce->szProto, META_PROTO)) { if (!contSour->iSubNumber) hNewCursor = LoadCursor(g_hMirApp, MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta else @@ -965,7 +965,7 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPAR cliGetRowByIndex(dat, dat->iDragItem, &contSour, nullptr); if (contSour->isChat() || contDest->isChat()) break; - if (contSour->type == CLCIT_CONTACT && mir_strcmp(contSour->proto, META_PROTO)) { + if (contSour->type == CLCIT_CONTACT && mir_strcmp(contSour->pce->szProto, META_PROTO)) { if (!contSour->iSubNumber) hNewCursor = LoadCursor(g_hMirApp, MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta else if (contSour->subcontacts == contDest) @@ -980,7 +980,7 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPAR cliGetRowByIndex(dat, dat->iDragItem, &contSour, nullptr); if (contSour->isChat() || contDest->isChat()) break; - if (contSour->type == CLCIT_CONTACT && mir_strcmp(contSour->proto, META_PROTO)) { + if (contSour->type == CLCIT_CONTACT && mir_strcmp(contSour->pce->szProto, META_PROTO)) { if (!contSour->iSubNumber) hNewCursor = LoadCursor(g_hMirApp, MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta else if (contDest->subcontacts == contSour->subcontacts) @@ -1084,7 +1084,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, break; if (contSour->type == CLCIT_CONTACT) { MCONTACT hcontact = contSour->hContact; - if (mir_strcmp(contSour->proto, META_PROTO)) { + if (mir_strcmp(contSour->pce->szProto, META_PROTO)) { if (!contSour->iSubNumber) { MCONTACT hDest = contDest->hContact; mir_snwprintf(Wording, TranslateT("Do you want contact '%s' to be converted to metacontact and '%s' be added to it?"), contDest->szText, contSour->szText); @@ -1121,7 +1121,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, if (contSour->isChat() || contDest->isChat()) break; if (contSour->type == CLCIT_CONTACT) { - if (!mir_strcmp(contSour->proto, META_PROTO)) + if (!mir_strcmp(contSour->pce->szProto, META_PROTO)) break; if (!contSour->iSubNumber) { MCONTACT hcontact = contSour->hContact; @@ -1163,7 +1163,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, if (contSour->isChat() || contDest->isChat()) break; if (contSour->type == CLCIT_CONTACT) { - if (!mir_strcmp(contSour->proto, META_PROTO)) + if (!mir_strcmp(contSour->pce->szProto, META_PROTO)) break; if (!contSour->iSubNumber) { MCONTACT hcontact = contSour->hContact; diff --git a/plugins/Clist_modern/src/modern_clc.h b/plugins/Clist_modern/src/modern_clc.h index a4dff8a27d..aae64ead66 100644 --- a/plugins/Clist_modern/src/modern_clc.h +++ b/plugins/Clist_modern/src/modern_clc.h @@ -204,7 +204,7 @@ struct ClcContact : public ClcContactBase { return (style & CLS_CHECKBOXES && type == CLCIT_CONTACT) || (style & CLS_GROUPCHECKBOXES && type == CLCIT_GROUP) || (type == CLCIT_INFO && flags & CLCIIF_CHECKBOX); } __forceinline bool isChat() const - { return (type == CLCIT_CONTACT) && (db_get_b(hContact, proto, "ChatRoom", 0) != 0); + { return (type == CLCIT_CONTACT) && (db_get_b(hContact, pce->szProto, "ChatRoom", 0) != 0); } }; diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index d5c6efd7b0..593fe7fb9d 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -63,7 +63,6 @@ void AddSubcontacts(ClcData *dat, ClcContact *cont, BOOL showOfflineHereGroup) p.iImage = Clist_GetContactIcon(pdnce->hContact); memset(p.iExtraImage, 0xFF, sizeof(p.iExtraImage)); - p.proto = pdnce->szProto; p.type = CLCIT_CONTACT; p.flags = 0; p.iSubNumber = i + 1; @@ -129,7 +128,6 @@ static void _LoadDataToContact(ClcContact *cont, ClcCacheEntry *pdnce, ClcGroup cont->lastPaintCounter = 0; cont->bImageIsSpecial = false; cont->hContact = hContact; - cont->proto = szProto; if (szProto != nullptr && !Clist_IsHiddenMode(dat, pdnce->m_iStatus)) cont->flags |= CONTACTF_ONLINE; diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp index 31fdb61c53..a62f2174a3 100644 --- a/plugins/Clist_modern/src/modern_clcpaint.cpp +++ b/plugins/Clist_modern/src/modern_clcpaint.cpp @@ -519,7 +519,7 @@ MODERNMASK* CLCPaint::_GetCLCContactRowBackModernMask(ClcGroup *group, ClcContac } else _AddParamShort(mpModernMask, hi_Type, hi_Contact); - AddParam(mpModernMask, HASH[hi_Protocol], Drawing->proto, 0); + AddParam(mpModernMask, HASH[hi_Protocol], Drawing->pce->szProto, 0); _AddParamShort(mpModernMask, hi_RootGroup, (group && group->parent == nullptr) ? hi_True : hi_False); switch (GetContactCachedStatus(Drawing->hContact)) { case ID_STATUS_ONLINE: _AddParamShort(mpModernMask, hi_Status, hi_ONLINE); break; @@ -1233,7 +1233,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R break; case SETTING_AVATAR_OVERLAY_TYPE_PROTOCOL: { - int item = g_clistApi.pfnIconFromStatusMode(Drawing->proto, Drawing->proto == nullptr ? ID_STATUS_OFFLINE : GetContactCachedStatus(Drawing->hContact), Drawing->hContact); + int item = g_clistApi.pfnIconFromStatusMode(Drawing->pce->szProto, Drawing->pce->szProto == nullptr ? ID_STATUS_OFFLINE : GetContactCachedStatus(Drawing->hContact), Drawing->hContact); if (item != -1) _DrawStatusIcon(Drawing, dat, item, hdcMem, p_rect.left, p_rect.top, ICON_HEIGHT, ICON_HEIGHT, @@ -2474,7 +2474,7 @@ void CLCPaint::_DrawContactAvatar(HDC hdcMem, ClcData *dat, ClcContact *Drawing, overlayIdx = g_pAvatarOverlayIcons[GetContactCachedStatus(Drawing->hContact) - ID_STATUS_OFFLINE].listID; break; case SETTING_AVATAR_OVERLAY_TYPE_PROTOCOL: - overlayIdx = g_clistApi.pfnIconFromStatusMode(Drawing->proto, Drawing->proto == nullptr ? ID_STATUS_OFFLINE : GetContactCachedStatus(Drawing->hContact), Drawing->hContact); + overlayIdx = g_clistApi.pfnIconFromStatusMode(Drawing->pce->szProto, Drawing->pce->szProto == nullptr ? ID_STATUS_OFFLINE : GetContactCachedStatus(Drawing->hContact), Drawing->hContact); break; case SETTING_AVATAR_OVERLAY_TYPE_CONTACT: overlayIdx = Drawing->iImage; @@ -2548,7 +2548,7 @@ void CLCPaint::_DrawContactAvatar(HDC hdcMem, ClcData *dat, ClcContact *Drawing, break; case SETTING_AVATAR_OVERLAY_TYPE_PROTOCOL: { - int item = g_clistApi.pfnIconFromStatusMode(Drawing->proto, Drawing->proto == nullptr ? ID_STATUS_OFFLINE : GetContactCachedStatus(Drawing->hContact), Drawing->hContact); + int item = g_clistApi.pfnIconFromStatusMode(Drawing->pce->szProto, Drawing->pce->szProto == nullptr ? ID_STATUS_OFFLINE : GetContactCachedStatus(Drawing->hContact), Drawing->hContact); if (item != -1) _DrawStatusIcon(Drawing, dat, item, hdcMem, ptOverlay.x, ptOverlay.y, ICON_HEIGHT, ICON_HEIGHT, diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp index 8c24177588..aeb2aca4bf 100644 --- a/plugins/Clist_modern/src/modern_clcutils.cpp +++ b/plugins/Clist_modern/src/modern_clcutils.cpp @@ -407,7 +407,7 @@ int GetDropTargetInformation(HWND hwnd, ClcData *dat, POINT pt) } dat->selection = hit; - if (!mir_strcmp(contact->proto, META_PROTO)) + if (!mir_strcmp(contact->pce->szProto, META_PROTO)) return DROPTARGET_ONMETACONTACT; if (contact->iSubNumber) return DROPTARGET_ONSUBCONTACT; diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp index b44777478a..bbd309e280 100644 --- a/plugins/Clist_modern/src/modern_contact.cpp +++ b/plugins/Clist_modern/src/modern_contact.cpp @@ -125,9 +125,9 @@ int cliCompareContacts(const ClcContact *contact1, const ClcContact *contact2) break; case SORTBY_PROTO: - if (contact1->proto == nullptr || contact2->proto == nullptr) + if (contact1->pce->szProto == nullptr || contact2->pce->szProto == nullptr) continue; - r = GetProtoIndex(contact1->proto) - GetProtoIndex(contact2->proto); + r = GetProtoIndex(contact1->pce->szProto) - GetProtoIndex(contact2->pce->szProto); break; case SORTBY_RATE: diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index cbc7fe3c7f..f26da696c6 100644 --- a/plugins/Clist_nicer/src/clc.cpp +++ b/plugins/Clist_nicer/src/clc.cpp @@ -464,7 +464,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L p = cfg::getCache(wParam, nullptr); else { p = contact->pExtra; - szProto = contact->proto; + szProto = contact->pce->szProto; } GetCachedStatusMsg(p, szProto); PostMessage(hwnd, INTM_INVALIDATE, 0, contact ? contact->hContact : 0); @@ -473,7 +473,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L case INTM_STATUSCHANGED: if (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr)) { - WORD wStatus = db_get_w(wParam, contact->proto, "Status", ID_STATUS_OFFLINE); + WORD wStatus = db_get_w(wParam, contact->pce->szProto, "Status", ID_STATUS_OFFLINE); if (cfg::dat.bNoOfflineAvatars && wStatus != ID_STATUS_OFFLINE && contact->wStatus == ID_STATUS_OFFLINE) { contact->wStatus = wStatus; if (cfg::dat.bAvatarServiceAvail && contact->ace == nullptr) @@ -488,7 +488,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr)) break; - contact->proto = GetContactProto(wParam); + contact->pce->szProto = GetContactProto(wParam); g_clistApi.pfnInvalidateDisplayNameCacheEntry(wParam); mir_wstrncpy(contact->szText, Clist_GetContactDisplayName(wParam), _countof(contact->szText)); diff --git a/plugins/Clist_nicer/src/clc.h b/plugins/Clist_nicer/src/clc.h index c7ccfd1c7f..0b2a09be22 100644 --- a/plugins/Clist_nicer/src/clc.h +++ b/plugins/Clist_nicer/src/clc.h @@ -117,6 +117,9 @@ struct TExtraCache BOOL isChatRoom; }; +struct ClcCacheEntry : public ClcCacheEntryBase +{}; + struct ClcContact : public ClcContactBase { BOOL bIsMeta; diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index d415dfb92d..095ba1e2eb 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -96,11 +96,11 @@ ClcContact* AddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hCo { ClcContact *p = coreCli.pfnAddContactToGroup(dat, group, hContact); - p->wStatus = db_get_w(hContact, p->proto, "Status", ID_STATUS_OFFLINE); - p->xStatus = db_get_b(hContact, p->proto, "XStatusId", 0); + p->wStatus = db_get_w(hContact, p->pce->szProto, "Status", ID_STATUS_OFFLINE); + p->xStatus = db_get_b(hContact, p->pce->szProto, "XStatusId", 0); - if (p->proto) - p->bIsMeta = !mir_strcmp(p->proto, META_PROTO); + if (p->pce->szProto) + p->bIsMeta = !mir_strcmp(p->pce->szProto, META_PROTO); else p->bIsMeta = FALSE; if (p->bIsMeta && !(cfg::dat.dwFlags & CLUI_USEMETAICONS)) { @@ -119,10 +119,10 @@ ClcContact* AddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hCo if (dat->bisEmbedded) p->pExtra = nullptr; else { - p->pExtra = cfg::getCache(p->hContact, p->proto); + p->pExtra = cfg::getCache(p->hContact, p->pce->szProto); GetExtendedInfo(p, dat); if (p->pExtra) - p->pExtra->proto_status_item = GetProtocolStatusItem(p->bIsMeta ? p->metaProto : p->proto); + p->pExtra->proto_status_item = GetProtocolStatusItem(p->bIsMeta ? p->metaProto : p->pce->szProto); LoadAvatarForContact(p); // notify other plugins to re-supply their extra images (icq for xstatus, mBirthday etc...) @@ -317,7 +317,7 @@ void GetExtendedInfo(ClcContact *contact, ClcData *dat) if (dat->bisEmbedded || contact == nullptr) return; - if (contact->proto == nullptr || contact->hContact == 0) + if (contact->pce->szProto == nullptr || contact->hContact == 0) return; TExtraCache *p = contact->pExtra; @@ -329,7 +329,7 @@ void GetExtendedInfo(ClcContact *contact, ClcData *dat) return; p->valid = TRUE; - p->isChatRoom = db_get_b(contact->hContact, contact->proto, "ChatRoom", 0); + p->isChatRoom = db_get_b(contact->hContact, contact->pce->szProto, "ChatRoom", 0); } void LoadSkinItemToCache(TExtraCache *cEntry) diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp index 28a8555f09..a5fd27c1fe 100644 --- a/plugins/Clist_nicer/src/clistmenus.cpp +++ b/plugins/Clist_nicer/src/clistmenus.cpp @@ -105,7 +105,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA SetWindowText(hWnd, szTitle); Window_SetSkinIcon_IcoLib(hWnd, SKINICON_OTHER_MIRANDA); - pCaps = CallProtoService(contact ? contact->proto : GetContactProto(hContact), PS_GETCAPS, PFLAGNUM_1, 0); + pCaps = CallProtoService(contact ? contact->pce->szProto : GetContactProto(hContact), PS_GETCAPS, PFLAGNUM_1, 0); Utils::enableDlgControl(hWnd, IDC_IGN_ALWAYSONLINE, pCaps & PF1_INVISLIST ? TRUE : FALSE); Utils::enableDlgControl(hWnd, IDC_IGN_ALWAYSOFFLINE, pCaps & PF1_VISLIST ? TRUE : FALSE); CheckDlgButton(hWnd, IDC_IGN_PRIORITY, db_get_b(hContact, "CList", "Priority", 0) ? BST_CHECKED : BST_UNCHECKED); @@ -287,7 +287,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA ClcContact *contact = nullptr; if (Clist_FindItem(g_clistApi.hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr)) { if (contact) { - WORD wApparentMode = db_get_w(contact->hContact, contact->proto, "ApparentMode", 0); + WORD wApparentMode = db_get_w(contact->hContact, contact->pce->szProto, "ApparentMode", 0); CheckDlgButton(hWnd, IDC_IGN_ALWAYSOFFLINE, wApparentMode == ID_STATUS_OFFLINE ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hWnd, IDC_IGN_ALWAYSONLINE, wApparentMode == ID_STATUS_ONLINE ? BST_CHECKED : BST_UNCHECKED); diff --git a/plugins/Clist_nicer/src/contact.cpp b/plugins/Clist_nicer/src/contact.cpp index 9e3933a039..e3b4016a02 100644 --- a/plugins/Clist_nicer/src/contact.cpp +++ b/plugins/Clist_nicer/src/contact.cpp @@ -160,14 +160,13 @@ int __forceinline INTSORT_CompareContacts(const ClcContact* c1, const ClcContact { wchar_t *namea, *nameb; int statusa, statusb; - char *szProto1, *szProto2; int rc; if (c1 == nullptr || c2 == nullptr) return 0; - szProto1 = c1->proto; - szProto2 = c2->proto; + char *szProto1 = c1->pce->szProto; + char *szProto2 = c2->pce->szProto; statusa = c1->wStatus; statusb = c2->wStatus; // make sure, sticky contacts are always at the beginning of the group/list @@ -221,9 +220,9 @@ int __forceinline INTSORT_CompareContacts(const ClcContact* c1, const ClcContact case SORTBY_PROTO: if (c1->bIsMeta) - szProto1 = c1->metaProto ? c1->metaProto : c1->proto; + szProto1 = c1->metaProto ? c1->metaProto : c1->pce->szProto; if (c2->bIsMeta) - szProto2 = c2->metaProto ? c2->metaProto : c2->proto; + szProto2 = c2->metaProto ? c2->metaProto : c2->pce->szProto; rc = GetProtoIndex(szProto1) - GetProtoIndex(szProto2); -- cgit v1.2.3