From 2f10a9e6cc4782d61f0f15bbff36209af922bd34 Mon Sep 17 00:00:00 2001 From: mataes2007 Date: Thu, 17 Nov 2011 18:10:43 +0000 Subject: =?UTF-8?q?=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D1=8B?= =?UTF-8?q?=20=D0=B8=20=D0=BF=D0=BE=D0=B4=D1=87=D0=B8=D1=89=D0=B5=D0=BD?= =?UTF-8?q?=D1=8B=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=BD?= =?UTF-8?q?=D1=8B=D0=B5=20=D0=BF=D0=BB=D0=B0=D0=B3=D0=B8=D0=BD=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@174 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb --- lastseen-mod/main.c | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) (limited to 'lastseen-mod/main.c') diff --git a/lastseen-mod/main.c b/lastseen-mod/main.c index 362bad1..6e60405 100644 --- a/lastseen-mod/main.c +++ b/lastseen-mod/main.c @@ -19,25 +19,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. File name : $URL: http://svn.berlios.de/svnroot/repos/mgoodies/trunk/lastseen-mod/main.c $ Revision : $Rev: 1571 $ -Last change on : $Date: 2007-12-30 03:55:51 +0200 (Вс, 30 дек 2007) $ +Last change on : $Date: 2007-12-30 04:55:51 +0300 (Вс, 30 дек 2007) $ Last change by : $Author: y_b $ */ #include "seen.h" HINSTANCE hInstance; -HANDLE ehdb=NULL,ehproto=NULL,ehmissed=NULL,ehuserinfo=NULL,ehmissed_proto=NULL; +HANDLE ehdb = NULL, ehproto = NULL, ehmissed = NULL, ehuserinfo = NULL, ehmissed_proto = NULL, hOptInit = NULL, hMainInit = NULL; PLUGINLINK *pluginLink; +struct MM_INTERFACE mmi; +int hLangpack; char authemail[] = "fscking@spammer.oip.info";//the correct e-mail shall be constructed in DllMain PLUGININFOEX pluginInfo={ sizeof(PLUGININFOEX), #ifndef PERMITNSN - "Last seen plugin mod", + "Last seen", #else - "Last seen plugin mod (NSNCompat)", + "Last seen", #endif PLUGIN_MAKE_VERSION(5,0,4,7), - "Log when a user was last seen online and which users were online while you were away", + "Log when a user was last seen online and which users were online while you were away.", "Heiko Schillinger, YB", authemail, " 2001-2002 Heiko Schillinger, 2003 modified by Bruno Rino, 2005-7 Modified by YB", @@ -54,8 +56,8 @@ PLUGININFOEX pluginInfo={ #define TRANSNUMBER 2 DBVTranslation idleTr[TRANSNUMBER]={ - {(TranslateFunc*)any_to_IdleNotidleUnknown, L"Any to Idle/Not Idle/Unknown",0}, - {(TranslateFunc*)any_to_Idle, L"Any to /Idle or empty",0} + {(TranslateFunc*)any_to_IdleNotidleUnknown, _T("Any to Idle/Not Idle/Unknown"),0}, + {(TranslateFunc*)any_to_Idle, _T("Any to /Idle or empty"),0} }; @@ -83,14 +85,14 @@ int MainInit(WPARAM wparam,LPARAM lparam) memset(&contactQueue[0], 0, contactQueueSize); contactQueueSize = 16; includeIdle = (BOOL )DBGetContactSettingByte(NULL,S_MOD,"IdleSupport",1); - HookEvent(ME_OPT_INITIALISE,OptionsInit); + hOptInit = HookEvent(ME_OPT_INITIALISE, OptionsInit); if(DBGetContactSettingByte(NULL,S_MOD,"MenuItem",1)) { InitMenuitem(); } if(DBGetContactSettingByte(NULL,S_MOD,"UserinfoTab",1)) - ehuserinfo=HookEvent(ME_USERINFO_INITIALISE,UserinfoInit); + ehuserinfo = HookEvent(ME_USERINFO_INITIALISE,UserinfoInit); if(DBGetContactSettingByte(NULL,S_MOD,"FileOutput",0)) InitFileOutput(); @@ -125,16 +127,6 @@ int MainInit(WPARAM wparam,LPARAM lparam) return 0; } -__declspec(dllexport) PLUGININFOEX * MirandaPluginInfo(DWORD mirandaVersion) -{ - if ( mirandaVersion < PLUGIN_MAKE_VERSION(0,5,2,0)) { - MessageBox( NULL, _T("The LastSeen-mod plugin cannot be loaded. Your Miranda is too old."), _T("SeenPlugin"), MB_OK|MB_ICONWARNING|MB_SETFOREGROUND|MB_TOPMOST ); - return NULL; - } - if ( mirandaVersion < PLUGIN_MAKE_VERSION( 0,7,0,17 )) pluginInfo.cbSize = sizeof( PLUGININFO ); - return &pluginInfo; -} - __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD mirandaVersion) { pluginInfo.cbSize = sizeof( PLUGININFOEX ); @@ -155,9 +147,13 @@ __declspec(dllexport) const MUUID * MirandaPluginInterfaces(void) __declspec(dllexport)int Unload(void) { UnhookEvent(ehdb); - if(ehmissed!=NULL) UnhookEvent(ehmissed); + if(ehmissed) UnhookEvent(ehmissed); UnhookEvent(ehproto); - if(ehmissed_proto)UnhookEvent(ehmissed_proto); + if(ehmissed_proto) UnhookEvent(ehmissed_proto); + UnhookEvent(hOptInit); + UnhookEvent(hMainInit); + if (ehuserinfo) UnhookEvent(ehuserinfo); + UninitMenuitem(); // free(contactQueue); return 0; } @@ -176,12 +172,14 @@ BOOL WINAPI DllMain(HINSTANCE hinst,DWORD fdwReason,LPVOID lpvReserved) int __declspec(dllexport)Load(PLUGINLINK *link) { pluginLink=link; + mir_getMMI(&mmi); + mir_getLP(&pluginInfo); // this isn't required for most events // but the ME_USERINFO_INITIALISE // I decided to hook all events after // everything is loaded because it seems // to be safer in my opinion - HookEvent(ME_SYSTEM_MODULESLOADED,MainInit); + hMainInit = HookEvent(ME_SYSTEM_MODULESLOADED,MainInit); return 0; } -- cgit v1.2.3