From a68efd9f17a4255a22d7e63741d723f986b23d0e Mon Sep 17 00:00:00 2001 From: sje Date: Sat, 30 Jun 2007 15:07:52 +0000 Subject: download buddies set status on server added away and invisible status git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@221 4f64403b-2f21-0410-a795-97e2b3489a10 --- MySpace/MySpace.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'MySpace/MySpace.cpp') diff --git a/MySpace/MySpace.cpp b/MySpace/MySpace.cpp index cb1da5d..aa229b5 100644 --- a/MySpace/MySpace.cpp +++ b/MySpace/MySpace.cpp @@ -60,6 +60,19 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) { return 0; } +void SetAllOffline() { + char *proto; + HANDLE hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ); + while ( hContact != NULL ) + { + proto = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, ( WPARAM )hContact,0 ); + if ( proto && !strcmp( MODULE, proto)) { + DBWriteContactSettingWord(hContact, MODULE, "Status", ID_STATUS_OFFLINE); + } + hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 ); + } +} + HANDLE hModulesLoaded; extern "C" __declspec (dllexport) int Load(PLUGINLINK *link) { DuplicateHandle( GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &mainThread, THREAD_SET_CONTEXT, FALSE, 0 ); @@ -76,6 +89,8 @@ extern "C" __declspec (dllexport) int Load(PLUGINLINK *link) { RegisterProto(); CreateProtoServices(); + SetAllOffline(); + // hook modules loaded hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded); return 0; -- cgit v1.2.3