diff options
Diffstat (limited to 'plugins/MirFox')
-rw-r--r-- | plugins/MirFox/src/MirandaInterface.cpp | 6 | ||||
-rw-r--r-- | plugins/MirFox/src/MirfoxData.cpp | 25 | ||||
-rw-r--r-- | plugins/MirFox/src/common.h | 2 |
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>
|