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/MirandaG15/src/CAppletManager.cpp | 6 +-- plugins/MirandaG15/src/CChatScreen.cpp | 3 +- plugins/MirandaG15/src/CContactList.cpp | 4 +- plugins/MirandaG15/src/Miranda.cpp | 64 ++++++++++++++++--------------- 4 files changed, 40 insertions(+), 37 deletions(-) (limited to 'plugins/MirandaG15/src') diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index f6a2c7440c..37fa929a4e 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -445,7 +445,7 @@ bool CAppletManager::ActivateChatScreen(MCONTACT hContact) tstring CAppletManager::GetContactDisplayname(MCONTACT hContact,bool bShortened) { if(!bShortened || !CConfig::GetBoolSetting(NOTIFY_NICKCUTOFF)) - return (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR); + return pcli->pfnGetContactDisplayName(hContact, 0); tstring strNick = GetContactDisplayname(hContact,false); if(strNick.length() > (tstring::size_type)CConfig::GetIntSetting(NOTIFY_NICKCUTOFF_OFFSET)) @@ -1527,7 +1527,7 @@ int CAppletManager::HookStatusChanged(WPARAM wParam, LPARAM lParam) tstring strName = CAppletManager::GetContactDisplayname(Event.hContact,true); // Get status String - Event.strValue = toTstring((char *) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, iStatus, 0)); + Event.strValue = toTstring(pcli->pfnGetStatusModeDescription(iStatus, 0)); // check if this is an irc protocol CIRCConnection *pIRCCon = CAppletManager::GetInstance()->GetIRCConnection(strProto); @@ -1688,7 +1688,7 @@ int CAppletManager::HookProtoAck(WPARAM wParam, LPARAM lParam) Event.strValue = strProto; // set the event description / summary - tstring strStatus = toTstring((char *) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, iNewStatus, 0)); + tstring strStatus = toTstring(pcli->pfnGetStatusModeDescription(iNewStatus, 0)); Event.strDescription = _T("(") + Event.strValue + _T(") ")+ TranslateString(_T("You are now %s"),strStatus.c_str()); Event.strSummary = TranslateString(_T("Protocol status change")); diff --git a/plugins/MirandaG15/src/CChatScreen.cpp b/plugins/MirandaG15/src/CChatScreen.cpp index 51c6a85b92..0f374d3aa4 100644 --- a/plugins/MirandaG15/src/CChatScreen.cpp +++ b/plugins/MirandaG15/src/CChatScreen.cpp @@ -180,7 +180,6 @@ void CChatScreen::UpdateLabels() { tstring strNickname = CAppletManager::GetContactDisplayname(m_hContact); char *szProto = GetContactProto(m_hContact); - char *szStatus = NULL; m_iStatus = ID_STATUS_OFFLINE; tstring strProto = _T(""); @@ -191,7 +190,7 @@ void CChatScreen::UpdateLabels() m_iStatus = db_get_w(m_hContact,szProto,"Status",ID_STATUS_OFFLINE); } - szStatus = (char *) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, m_iStatus, 0); + TCHAR *szStatus = pcli->pfnGetStatusModeDescription(m_iStatus, 0); if(szStatus != NULL) strStatus = toTstring(szStatus); diff --git a/plugins/MirandaG15/src/CContactList.cpp b/plugins/MirandaG15/src/CContactList.cpp index fdaacbbe85..8ce8cb2856 100644 --- a/plugins/MirandaG15/src/CContactList.cpp +++ b/plugins/MirandaG15/src/CContactList.cpp @@ -111,7 +111,7 @@ void CContactList::AddContact(MCONTACT hContact) return; int iStatus = db_get_w(hContact,szProto,"Status",ID_STATUS_OFFLINE); - char *szStatus = (char *) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, iStatus, 0); + TCHAR *szStatus = pcli->pfnGetStatusModeDescription(iStatus, 0); CContactListEntry *psContact = new CContactListEntry(); @@ -724,7 +724,7 @@ void CContactList::OnStatusChange(MCONTACT hContact,int iStatus) int iOldStatus = pItemData->iStatus; // Update the list entry - char *szStatus = (char *) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, iStatus, 0); + TCHAR *szStatus = pcli->pfnGetStatusModeDescription(iStatus, 0); if(szStatus != NULL) pItemData->strStatus =toTstring(szStatus); diff --git a/plugins/MirandaG15/src/Miranda.cpp b/plugins/MirandaG15/src/Miranda.cpp index d40cbc86fa..1515978515 100644 --- a/plugins/MirandaG15/src/Miranda.cpp +++ b/plugins/MirandaG15/src/Miranda.cpp @@ -58,6 +58,7 @@ bool g_bInitialized; // Plugin Information +CLIST_INTERFACE *pcli; HINSTANCE hInstance; int hLangpack; @@ -87,40 +88,43 @@ void UnInit(); //************************************************************************ // Exported Functions //************************************************************************ -extern "C" { - __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) - { - return &pluginInfoEx; - } + +EXTERN_C __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) +{ + return &pluginInfoEx; +} - // Called by Miranda to load the plugin. - // We defer initialization until Miranda's module loading process completed and return 0 to - // mark success, everything else will cause the plugin to be freed right away. - int __declspec(dllexport) Load() - { - g_bInitialized = false; - InitDebug(); - TRACE(_T("Plugin loaded\n")); - // Schedule actual initialization for later - HookEvent(ME_SYSTEM_MODULESLOADED, Init); - return 0; - } +// Called by Miranda to load the plugin. +// We defer initialization until Miranda's module loading process completed and return 0 to +// mark success, everything else will cause the plugin to be freed right away. +EXTERN_C int __declspec(dllexport) Load() +{ + mir_getLP(&pluginInfoEx); + mir_getCLI(); + + g_bInitialized = false; + + InitDebug(); + TRACE(_T("Plugin loaded\n")); + // Schedule actual initialization for later + HookEvent(ME_SYSTEM_MODULESLOADED, Init); + return 0; +} - // Called by Miranda when the plugin should unload itself. - int __declspec(dllexport) Unload(void) - { - if(!g_bInitialized) { - TRACE(_T("ERROR: Unload requested, but plugin is not initialized?!\n")); - return 0; - } - TRACE(_T("-------------------------------------------\nUnloading started\n")); - UnInit(); - TRACE(_T("Unloading successful\n")); - TRACE(_T("Cleaning up: ")); - UnInitDebug(); - TRACE(_T("OK!\n")); +// Called by Miranda when the plugin should unload itself. +EXTERN_C int __declspec(dllexport) Unload(void) +{ + if(!g_bInitialized) { + TRACE(_T("ERROR: Unload requested, but plugin is not initialized?!\n")); return 0; } + TRACE(_T("-------------------------------------------\nUnloading started\n")); + UnInit(); + TRACE(_T("Unloading successful\n")); + TRACE(_T("Cleaning up: ")); + UnInitDebug(); + TRACE(_T("OK!\n")); + return 0; } //************************************************************************ -- cgit v1.2.3