From b8a02a2b98e7b0e6a8a54cb140a873039d9c6d3d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 30 Jun 2012 13:33:28 +0000 Subject: - setting thread names; - warning fixes; - code cleaning; - option to disable sounds during idle git-svn-id: http://svn.miranda-ng.org/main/trunk@692 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SeenPlugin/utils.cpp | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to 'plugins/SeenPlugin/utils.cpp') diff --git a/plugins/SeenPlugin/utils.cpp b/plugins/SeenPlugin/utils.cpp index e33d6edfa0..533882977e 100644 --- a/plugins/SeenPlugin/utils.cpp +++ b/plugins/SeenPlugin/utils.cpp @@ -596,36 +596,22 @@ int addContactToQueue(HANDLE hContact){ static DWORD __stdcall waitThread(logthread_info* infoParam) { -// char str[MAXMODULELABELLENGTH]; -// sprintf(str,"In Thread: %s; %s; %s\n", -// infoParam->sProtoName, -// (char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)infoParam->hContact,0), -// (const char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,(WPARAM)infoParam->courStatus,0) -// ); -// OutputDebugStringA(str); WORD prevStatus = DBGetContactSettingWord(infoParam->hContact,S_MOD,"StatusTriger",ID_STATUS_OFFLINE); Sleep(1500); // I hope in 1.5 second all the needed info will be set - if (includeIdle){ - if (DBGetContactSettingDword(infoParam->hContact,infoParam->sProtoName,"IdleTS",0)) { + if (includeIdle) + if (DBGetContactSettingDword(infoParam->hContact,infoParam->sProtoName,"IdleTS",0)) infoParam->courStatus &=0x7FFF; - } - } + if (infoParam->courStatus != prevStatus){ DBWriteContactSettingWord(infoParam->hContact,S_MOD,"OldStatus",(WORD)(prevStatus|0x8000)); - if (includeIdle){ + if (includeIdle) DBWriteContactSettingByte(infoParam->hContact,S_MOD,"OldIdle",(BYTE)((prevStatus&0x8000)==0)); - } + DBWriteContactSettingWord(infoParam->hContact,S_MOD,"StatusTriger",infoParam->courStatus); } -// sprintf(str,"OutThread: %s; %s; %s\n", -// infoParam->sProtoName, -// (char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)infoParam->hContact,0), -// (const char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,(WPARAM)infoParam->courStatus,0) -// ); -// infoParam->hContact = 0; //declare the slot as empty + contactQueue[infoParam->queueIndex] = 0; free(infoParam); -// OutputDebugStringA(str); return 0; } -- cgit v1.2.3