summaryrefslogtreecommitdiff
path: root/plugins/MirFox/src
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/MirFox/src
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/MirFox/src')
-rw-r--r--plugins/MirFox/src/MirandaInterface.cpp6
-rw-r--r--plugins/MirFox/src/MirfoxData.cpp25
-rw-r--r--plugins/MirFox/src/common.h2
3 files changed, 13 insertions, 20 deletions
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"<null>" : 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 <m_database.h>
#include <m_langpack.h>
#include <m_options.h>
-#include <m_clistint.h>
+#include <m_clist.h>
#include <m_protosvc.h>
#include <m_popup.h>
#include <m_message.h>