From 10bc9e42dfba6ed8be41199243d688c2e367dc0d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 30 Jun 2015 18:59:38 +0000 Subject: 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 --- plugins/MirFox/src/MirandaInterface.cpp | 6 +++++- plugins/MirFox/src/MirfoxData.cpp | 25 +++++++------------------ plugins/MirFox/src/common.h | 2 +- 3 files changed, 13 insertions(+), 20 deletions(-) (limited to 'plugins/MirFox') diff --git a/plugins/MirFox/src/MirandaInterface.cpp b/plugins/MirFox/src/MirandaInterface.cpp index 8bce0ea7fa..8b1b7a0e74 100644 --- a/plugins/MirFox/src/MirandaInterface.cpp +++ b/plugins/MirFox/src/MirandaInterface.cpp @@ -2,6 +2,7 @@ #include "version.h" #include "mirandaInterface.h" +CLIST_INTERFACE *pcli; //Miranda - handle from DllMain HINSTANCE hInst; @@ -83,8 +84,11 @@ static int OnShutdown(WPARAM, LPARAM) } -extern "C" int __declspec(dllexport) Load(void){ +extern "C" int __declspec(dllexport) Load(void) +{ mir_getLP(&pluginInfo); + mir_getCLI(); + HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded); HookEvent(ME_SYSTEM_SHUTDOWN, OnShutdown); diff --git a/plugins/MirFox/src/MirfoxData.cpp b/plugins/MirFox/src/MirfoxData.cpp index abd980f02e..de8c16b1dd 100644 --- a/plugins/MirFox/src/MirfoxData.cpp +++ b/plugins/MirFox/src/MirfoxData.cpp @@ -385,33 +385,22 @@ void MirfoxData::initializeMirandaContacts() logger->log_p(L"initializeMirandaContacts: try to get name for hContact = [" SCNuPTR L"]", mirandaContactsIter->contactHandle); if (mirandaContactsIter->mirandaAccountPtr != NULL){ - - if ( strcmp(mirandaContactsIter->mirandaAccountPtr->szProtoName, "Twitter") == 0){ - //hack for Twitter protocol + if (strcmp(mirandaContactsIter->mirandaAccountPtr->szProtoName, "Twitter") == 0){ + // hack for Twitter protocol DBVARIANT dbv; if (!db_get_s(mirandaContactsIter->contactHandle, mirandaContactsIter->mirandaAccountPtr->szModuleName, "Username", &dbv, DBVT_WCHAR)) { mirandaContactsIter->contactNameW = std::wstring(dbv.pwszVal); db_free(&dbv); } - - } else { - //standard miranda way for another protocols - - mirandaContactsIter->contactNameW = - (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)mirandaContactsIter->contactHandle, GCDNF_TCHAR); - //get contact's display name from clist - } - + else // standard miranda way for another protocols + mirandaContactsIter->contactNameW = pcli->pfnGetContactDisplayName(mirandaContactsIter->contactHandle, 0); } - if (mirandaContactsIter->contactNameW.size() == 0){ - //last chance (if some hack didn't work or mirandaContactsIter->mirandaAccountPtr is NULL) - mirandaContactsIter->contactNameW = - (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)mirandaContactsIter->contactHandle, GCDNF_TCHAR); - //get contact's display name from clist - } + if (mirandaContactsIter->contactNameW.size() == 0) + // last chance (if some hack didn't work or mirandaContactsIter->mirandaAccountPtr is NULL) + mirandaContactsIter->contactNameW = pcli->pfnGetContactDisplayName(mirandaContactsIter->contactHandle, 0); logger->log_p(L"initializeMirandaContacts: got name for hContact = [" SCNuPTR L"] is: [%s]", mirandaContactsIter->contactHandle, &(mirandaContactsIter->contactNameW)==NULL ? L"" : mirandaContactsIter->contactNameW.c_str()); diff --git a/plugins/MirFox/src/common.h b/plugins/MirFox/src/common.h index 90aa3e84c4..05375dbad5 100644 --- a/plugins/MirFox/src/common.h +++ b/plugins/MirFox/src/common.h @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include -- cgit v1.2.3