summaryrefslogtreecommitdiff
path: root/plugins/ShellExt
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-30 18:59:38 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-30 18:59:38 +0000
commit10bc9e42dfba6ed8be41199243d688c2e367dc0d (patch)
tree891aca91eeb2feddb6c76498c4eb880689360fe6 /plugins/ShellExt
parent5dac5be47f2d9af8cbceead6511ff4c0fc40bab5 (diff)
MS_CLIST_GETSTATUSMODEDESCRIPTION & MS_CLIST_GETCONTACTDISPLAYNAME replaced with pcli->* members
git-svn-id: http://svn.miranda-ng.org/main/trunk@14459 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ShellExt')
-rw-r--r--plugins/ShellExt/src/main.cpp2
-rw-r--r--plugins/ShellExt/src/shlcom.cpp29
2 files changed, 13 insertions, 18 deletions
diff --git a/plugins/ShellExt/src/main.cpp b/plugins/ShellExt/src/main.cpp
index c71028a40d..b4d4b09ef1 100644
--- a/plugins/ShellExt/src/main.cpp
+++ b/plugins/ShellExt/src/main.cpp
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "shlcom.h"
+CLIST_INTERFACE *pcli;
HINSTANCE hInst;
int hLangpack;
bool bIsVistaPlus;
@@ -161,6 +162,7 @@ STDAPI DllUnregisterServer()
extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&pluginInfoEx);
+ mir_getCLI();
InvokeThreadServer();
HookEvent(ME_OPT_INITIALISE, OnOptionsInit);
diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp
index 0ace778b30..a1ecc1c505 100644
--- a/plugins/ShellExt/src/shlcom.cpp
+++ b/plugins/ShellExt/src/shlcom.cpp
@@ -299,25 +299,19 @@ bool ipcGetSortedContacts(THeaderIPC *ipch, int *pSlot, bool bGroupMode)
dwContacts = i;
qsort(pContacts, dwContacts, sizeof(TSlotInfo), SortContact);
- DBVARIANT dbv;
- int n, rc;
// create an IPC slot for each contact and store display name, etc
for (i=0; i < dwContacts; i++) {
- char *szContact = (char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)pContacts[i].hContact, 0);
+ ptrA szContact(mir_t2a(pcli->pfnGetContactDisplayName(pContacts[i].hContact, 0)));
if (szContact != NULL) {
- n = 0;
- rc = 1;
- if (bGroupMode) {
- rc = db_get_s(pContacts[i].hContact, "CList", "Group", &dbv);
- if (!rc)
- n = lstrlenA(dbv.pszVal) + 1;
- }
+ ptrA szGroup;
+ if (bGroupMode)
+ szGroup = db_get_sa(pContacts[i].hContact, "CList", "Group");
+
int cch = lstrlenA(szContact) + 1;
- TSlotIPC *pct = ipcAlloc(ipch, cch + 1 + n);
- if (pct == NULL) {
- db_free(&dbv);
+ TSlotIPC *pct = ipcAlloc(ipch, cch + 1 + lstrlenA(szGroup) + 1);
+ if (pct == NULL)
break;
- }
+
// lie about the actual size of the TSlotIPC
pct->cbStrSection = cch;
LPSTR szSlot = LPSTR(pct) + sizeof(TSlotIPC);
@@ -330,10 +324,9 @@ bool ipcGetSortedContacts(THeaderIPC *ipch, int *pSlot, bool bGroupMode)
if (ipch->ContactsBegin == NULL)
ipch->ContactsBegin = pct;
szSlot += cch + 1;
- if (rc == 0) {
- pct->hGroup = murmur_hash(dbv.pszVal);
- lstrcpyA(szSlot, dbv.pszVal);
- db_free(&dbv);
+ if (szGroup != 0) {
+ pct->hGroup = murmur_hash(szGroup);
+ lstrcpyA(szSlot, szGroup);
}
else {
pct->hGroup = 0;