diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-02 20:55:18 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-02 20:55:18 +0000 |
commit | 78c0815c4118fe24ab78cce2dc48a6232dcd824a (patch) | |
tree | 8512c50df70b8dd80c919e88ade3419207c95956 /plugins/SeenPlugin | |
parent | ce816d83a8c75808e0eb06832592bffefe4a8dc4 (diff) |
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SeenPlugin')
-rw-r--r-- | plugins/SeenPlugin/file.c | 6 | ||||
-rw-r--r-- | plugins/SeenPlugin/main.c | 4 | ||||
-rw-r--r-- | plugins/SeenPlugin/menu.c | 4 | ||||
-rw-r--r-- | plugins/SeenPlugin/missed.c | 8 | ||||
-rw-r--r-- | plugins/SeenPlugin/options.c | 16 | ||||
-rw-r--r-- | plugins/SeenPlugin/userinfo.c | 4 | ||||
-rw-r--r-- | plugins/SeenPlugin/utils.c | 92 |
7 files changed, 67 insertions, 67 deletions
diff --git a/plugins/SeenPlugin/file.c b/plugins/SeenPlugin/file.c index 97cd2d9c3f..cac37f8c30 100644 --- a/plugins/SeenPlugin/file.c +++ b/plugins/SeenPlugin/file.c @@ -56,9 +56,9 @@ int InitFileOutput(void) *++str=0;
/*
//we dont need this anylonger. the directory is created in filewrite
- if(!CreateDirectory(szmpath,NULL))
+ if (!CreateDirectory(szmpath,NULL))
{
- if(!(GetFileAttributes(szmpath) & FILE_ATTRIBUTE_DIRECTORY))
+ if (!(GetFileAttributes(szmpath) & FILE_ATTRIBUTE_DIRECTORY))
{
MessageBox(NULL,"Directory could not be created\nPlease choose another!","Last seen plugin",MB_OK|MB_ICONERROR);
DBWriteContactSettingByte(NULL,S_MOD,"FileOutput",0);
@@ -78,7 +78,7 @@ static void CreateDirectoryTree(char *szDir) char *pszLastBackslash,szTestDir[MAX_PATH];
lstrcpynA(szTestDir,szDir,sizeof(szTestDir));
- if((dwAttributes=GetFileAttributesA(szTestDir))!=0xffffffff && dwAttributes&FILE_ATTRIBUTE_DIRECTORY) return;
+ if ((dwAttributes=GetFileAttributesA(szTestDir))!=0xffffffff && dwAttributes&FILE_ATTRIBUTE_DIRECTORY) return;
pszLastBackslash=strrchr(szTestDir,'\\');
if(pszLastBackslash==NULL) return;
*pszLastBackslash='\0';
diff --git a/plugins/SeenPlugin/main.c b/plugins/SeenPlugin/main.c index 6e60405058..798077b009 100644 --- a/plugins/SeenPlugin/main.c +++ b/plugins/SeenPlugin/main.c @@ -117,9 +117,9 @@ int MainInit(WPARAM wparam,LPARAM lparam) #ifndef PERMITNSN
SkinAddNewSoundEx("UserOnline",Translate("Alerts"),Translate("Online"));
#endif
- if (ServiceExists(MS_TIPPER_ADDTRANSLATION)){
+ if (ServiceExists(MS_TIPPER_ADDTRANSLATION)) {
int i=0;
- for (i=0;i<TRANSNUMBER;i++){
+ for (i=0;i<TRANSNUMBER;i++) {
CallService(MS_TIPPER_ADDTRANSLATION,0,(LPARAM)&idleTr[i]);
}
}
diff --git a/plugins/SeenPlugin/menu.c b/plugins/SeenPlugin/menu.c index e6b972fec4..c6a5ca8884 100644 --- a/plugins/SeenPlugin/menu.c +++ b/plugins/SeenPlugin/menu.c @@ -51,7 +51,7 @@ int BuildContactMenu(WPARAM wparam,LPARAM lparam) ZeroMemory(&cmi,sizeof(cmi));
cmi.cbSize=sizeof(cmi);
- if(!IsWatchedProtocol(szProto) || !DBGetContactSettingByte(NULL,S_MOD,"MenuItem",1))
+ if (!IsWatchedProtocol(szProto) || !DBGetContactSettingByte(NULL,S_MOD,"MenuItem",1))
{
cmi.flags=CMIM_FLAGS|CMIF_HIDDEN;
}
@@ -61,7 +61,7 @@ int BuildContactMenu(WPARAM wparam,LPARAM lparam) cmi.hIcon=NULL;
cmi.pszName=ParseString(!DBGetContactSetting(NULL,S_MOD,"MenuStamp",&dbv)?dbv.pszVal:DEFAULT_MENUSTAMP,(HANDLE)wparam,0);
- if(!strcmp(cmi.pszName,Translate("<unknown>")))
+ if (!strcmp(cmi.pszName,Translate("<unknown>")))
{
if (IsWatchedProtocol(szProto))
cmi.flags|=CMIF_GRAYED;
diff --git a/plugins/SeenPlugin/missed.c b/plugins/SeenPlugin/missed.c index f6ed40035c..179dd8ee4d 100644 --- a/plugins/SeenPlugin/missed.c +++ b/plugins/SeenPlugin/missed.c @@ -38,7 +38,7 @@ WPARAM IsUserMissed(WPARAM contact) {
int loop=0;
- for(;loop<mcs.count;loop++)
+ for (;loop<mcs.count;loop++)
{
if(mcs.wpcontact[loop]==contact)
return MAKEWPARAM(1,loop);
@@ -155,9 +155,9 @@ int ShowMissed(void) int loop=0;
char sztemp[1024]="",szcount[7];
- if(!mcs.count) return 0;
+ if (!mcs.count) return 0;
- for(;loop<mcs.count;loop++)
+ for (;loop<mcs.count;loop++)
{
strcat(sztemp,(const char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,mcs.wpcontact[loop],0));
if(DBGetContactSettingByte(NULL,S_MOD,"MissedOnes_Count",0))
@@ -233,7 +233,7 @@ int Test(WPARAM wparam,LPARAM lparam) {
WORD missed=IsUserMissed(wparam);
- if(!LOWORD(missed))
+ if (!LOWORD(missed))
{
mcs.times[mcs.count]=1;
mcs.wpcontact[mcs.count++]=wparam;
diff --git a/plugins/SeenPlugin/options.c b/plugins/SeenPlugin/options.c index cf5ab019ba..af1b2fcac1 100644 --- a/plugins/SeenPlugin/options.c +++ b/plugins/SeenPlugin/options.c @@ -62,7 +62,7 @@ INT_PTR CALLBACK OptsPopUpsDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara hasPopups = IsDlgButtonChecked(hdlg,IDC_POPUPS);
EnableWindow(GetDlgItem(hdlg,IDC_POPUPSTAMP),hasPopups);
EnableWindow(GetDlgItem(hdlg,IDC_POPUPSTAMPTEXT),hasPopups);
- for (i=ID_STATUS_OFFLINE;i<=ID_STATUS_OUTTOLUNCH;i++){
+ for (i=ID_STATUS_OFFLINE;i<=ID_STATUS_OUTTOLUNCH;i++) {
DWORD sett;
COLORREF back, text;
sprintf(szstamp, "Col_%d",i-ID_STATUS_OFFLINE);
@@ -86,7 +86,7 @@ INT_PTR CALLBACK OptsPopUpsDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara }
break; //case WM_INITDIALOG
case WM_COMMAND:
- if((HIWORD(wparam)==BN_CLICKED || HIWORD(wparam)==EN_CHANGE) && GetFocus()==(HWND)lparam)
+ if ((HIWORD(wparam)==BN_CLICKED || HIWORD(wparam)==EN_CHANGE) && GetFocus()==(HWND)lparam)
SendMessage(GetParent(hdlg),PSM_CHANGED,0,0);
else if (HIWORD(wparam)==CPN_COLOURCHANGED){
WORD idText, idBack;
@@ -113,18 +113,18 @@ INT_PTR CALLBACK OptsPopUpsDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara }
if(HIWORD(wparam)==BN_CLICKED)
{
- switch(LOWORD(wparam)){
+ switch(LOWORD(wparam)) {
case IDC_POPUPS:
hasPopups = IsDlgButtonChecked(hdlg,IDC_POPUPS);
EnableWindow(GetDlgItem(hdlg,IDC_POPUPSTAMP),hasPopups);
EnableWindow(GetDlgItem(hdlg,IDC_POPUPSTAMPTEXT),hasPopups);
- for (i=ID_STATUS_OFFLINE;i<=ID_STATUS_OUTTOLUNCH;i++){
+ for (i=ID_STATUS_OFFLINE;i<=ID_STATUS_OUTTOLUNCH;i++) {
EnableWindow(GetDlgItem(hdlg,i),hasPopups);
EnableWindow(GetDlgItem(hdlg,i+20),hasPopups);
}
break;
case IDC_DEFAULTCOL:
- for (i=ID_STATUS_OFFLINE;i<=ID_STATUS_OUTTOLUNCH;i++){
+ for (i=ID_STATUS_OFFLINE;i<=ID_STATUS_OUTTOLUNCH;i++) {
DWORD sett;
COLORREF back, text;
sprintf(szstamp, "Col_%d",i-ID_STATUS_OFFLINE);
@@ -156,7 +156,7 @@ INT_PTR CALLBACK OptsPopUpsDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara if (DBGetContactSettingByte(NULL,S_MOD,"UsePopups",0) != checkValue) {
DBWriteContactSettingByte(NULL,S_MOD,"UsePopups",checkValue);
}
- for (i=ID_STATUS_OFFLINE;i<=ID_STATUS_OUTTOLUNCH;i++){
+ for (i=ID_STATUS_OFFLINE;i<=ID_STATUS_OUTTOLUNCH;i++) {
DWORD sett;
COLORREF back=0, text=0;
sprintf(szstamp, "Col_%d",i-ID_STATUS_OFFLINE);
@@ -262,12 +262,12 @@ INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpa break; //case WM_INITDIALOG
case WM_COMMAND:
- if((HIWORD(wparam)==BN_CLICKED || HIWORD(wparam)==EN_CHANGE) && GetFocus()==(HWND)lparam)
+ if ((HIWORD(wparam)==BN_CLICKED || HIWORD(wparam)==EN_CHANGE) && GetFocus()==(HWND)lparam)
if (LOWORD(wparam)!=IDC_VARIABLES)SendMessage(GetParent(hdlg),PSM_CHANGED,0,0);
if(HIWORD(wparam)==BN_CLICKED)
{
- switch(LOWORD(wparam)){
+ switch(LOWORD(wparam)) {
case IDC_MENUITEM:
EnableWindow(GetDlgItem(hdlg,IDC_MENUSTAMP),IsDlgButtonChecked(hdlg,IDC_MENUITEM));
EnableWindow(GetDlgItem(hdlg,IDC_SHOWICON),IsDlgButtonChecked(hdlg,IDC_MENUITEM));
diff --git a/plugins/SeenPlugin/userinfo.c b/plugins/SeenPlugin/userinfo.c index 02f050ea0f..bf23679ba9 100644 --- a/plugins/SeenPlugin/userinfo.c +++ b/plugins/SeenPlugin/userinfo.c @@ -61,7 +61,7 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) MainProc=(WNDPROC)SetWindowLongPtr(GetDlgItem(hdlg,IDC_INFOTEXT),GWLP_WNDPROC,(LONG)EditProc);
szout=strdup(ParseString((!DBGetContactSetting(NULL,S_MOD,"UserStamp",&dbv)?dbv.pszVal:DEFAULT_USERSTAMP),(HANDLE)lparam,0));
SetDlgItemText(hdlg,IDC_INFOTEXT,szout);
- if(!strcmp(szout,Translate("<unknown>")))
+ if (!strcmp(szout,Translate("<unknown>")))
EnableWindow(GetDlgItem(hdlg,IDC_INFOTEXT),FALSE);
free(szout);
DBFreeVariant(&dbv);
@@ -81,7 +81,7 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) int UserinfoInit(WPARAM wparam,LPARAM lparam)
{
char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO,lparam,0);
- if (IsWatchedProtocol(proto)){
+ if (IsWatchedProtocol(proto)) {
OPTIONSDIALOGPAGE uip;
ZeroMemory(&uip,sizeof(uip));
uip.cbSize=sizeof(uip);
diff --git a/plugins/SeenPlugin/utils.c b/plugins/SeenPlugin/utils.c index 5fc880ec75..a7300f873b 100644 --- a/plugins/SeenPlugin/utils.c +++ b/plugins/SeenPlugin/utils.c @@ -142,7 +142,7 @@ DWORD isSeen(HANDLE hcontact, SYSTEMTIME *st){ lst.wHour = DBGetContactSettingWord(hcontact,S_MOD,"Hours",0);
lst.wMinute = DBGetContactSettingWord(hcontact,S_MOD,"Minutes",0);
lst.wSecond = DBGetContactSettingWord(hcontact,S_MOD,"Seconds",0);
- if (SystemTimeToFileTime(&lst,&ft)){
+ if (SystemTimeToFileTime(&lst,&ft)) {
ll = ((LONGLONG)ft.dwHighDateTime<<32)|((LONGLONG)ft.dwLowDateTime);
ll -= NUM100NANOSEC;
ll /= 10000000;
@@ -177,7 +177,7 @@ char *ParseString(char *szstring,HANDLE hcontact,BYTE isfile) SYSTEMTIME st;
sztemp[0] = '\0';
- if (!isSeen(hcontact,&st)){
+ if (!isSeen(hcontact,&st)) {
strcat(sztemp,Translate("<never seen>"));
return sztemp;
}
@@ -185,10 +185,10 @@ char *ParseString(char *szstring,HANDLE hcontact,BYTE isfile) ci.cbSize=sizeof(CONTACTINFO);
ci.hContact=hcontact;
ci.szProto=hcontact?(char *)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hcontact,0):courProtoName;
- for(;loop<strlen(szstring);loop++)
+ for (;loop<strlen(szstring);loop++)
{
if (sztemplen == MAXSIZE) break;
- if((szstring[loop]!='%')&(szstring[loop]!='#'))
+ if ((szstring[loop]!='%')&(szstring[loop]!='#'))
{
strncat(sztemp,szstring+loop,1);
sztemplen++;
@@ -198,7 +198,7 @@ char *ParseString(char *szstring,HANDLE hcontact,BYTE isfile) else
{
wantempty = (szstring[loop]=='#');
- switch(szstring[++loop]){
+ switch(szstring[++loop]) {
case 'Y':
if (!st.wYear) goto LBL_noData;
sztemplen += mir_snprintf(sztemp+sztemplen,MAXSIZE-sztemplen,"%04i",st.wYear);
@@ -239,36 +239,36 @@ LBL_charPtr: goto LBL_charPtr;
case 'E':
- if(!(isetting=st.wMonth))goto LBL_noData;
+ if (!(isetting=st.wMonth))goto LBL_noData;
charPtr = Translate(monthnames[isetting-1]);
goto LBL_charPtr;
case 'e':
- if(!(isetting=st.wMonth))goto LBL_noData;
+ if (!(isetting=st.wMonth))goto LBL_noData;
charPtr = Translate(mnames_short[isetting-1]);
goto LBL_charPtr;
case 'H':
- if((isetting=st.wHour)==-1)goto LBL_noData;
+ if ((isetting=st.wHour)==-1)goto LBL_noData;
goto LBL_2DigNum;
case 'h':
- if((isetting=st.wHour)==-1)goto LBL_noData;
- if(!isetting) isetting=12;
+ if ((isetting=st.wHour)==-1)goto LBL_noData;
+ if (!isetting) isetting=12;
isetting = isetting-((isetting>12)?12:0);
goto LBL_2DigNum;
case 'p':
- if((isetting=st.wHour)==-1)goto LBL_noData;
+ if ((isetting=st.wHour)==-1)goto LBL_noData;
charPtr = (isetting>=12)?"PM":"AM";
goto LBL_charPtr;
case 'M':
- if((isetting=st.wMinute)==-1)goto LBL_noData;
+ if ((isetting=st.wMinute)==-1)goto LBL_noData;
goto LBL_2DigNum;
case 'S':
- if((isetting=st.wHour)==-1)goto LBL_noData;
+ if ((isetting=st.wHour)==-1)goto LBL_noData;
goto LBL_2DigNum;
case 'n':
@@ -276,14 +276,14 @@ LBL_charPtr: goto LBL_charPtr;
case 'N':
ci.dwFlag=CNF_NICK;
- if(!CallService(MS_CONTACT_GETCONTACTINFO,(WPARAM)0,(LPARAM)&ci)){
+ if (!CallService(MS_CONTACT_GETCONTACTINFO,(WPARAM)0,(LPARAM)&ci)) {
charPtr = ci.pszVal;
} else goto LBL_noData;
goto LBL_charPtr;
case 'G':
{
DBVARIANT dbv;
- if (!DBGetContactSetting(hcontact,"CList","Group",&dbv)){
+ if (!DBGetContactSetting(hcontact,"CList","Group",&dbv)) {
strcpy(szdbsetting,dbv.pszVal);
DBFreeVariant(&dbv);
charPtr = szdbsetting;
@@ -294,7 +294,7 @@ LBL_charPtr: case 'u':
ci.dwFlag=CNF_UNIQUEID;
- if(!CallService(MS_CONTACT_GETCONTACTINFO,(WPARAM)0,(LPARAM)&ci))
+ if (!CallService(MS_CONTACT_GETCONTACTINFO,(WPARAM)0,(LPARAM)&ci))
{
switch(ci.type)
{
@@ -339,9 +339,9 @@ LBL_charPtr: goto LBL_charPtr;
case 's':
- if (isetting=DBGetContactSettingWord(hcontact,S_MOD,hcontact?"StatusTriger":courProtoName,0)){
+ if (isetting=DBGetContactSettingWord(hcontact,S_MOD,hcontact?"StatusTriger":courProtoName,0)) {
strcpy(szdbsetting,Translate((const char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,(WPARAM)(isetting|0x8000),0)));
- if (!(isetting&0x8000)){
+ if (!(isetting&0x8000)) {
strcat(szdbsetting,"/");
strcat(szdbsetting,Translate("Idle"));
}
@@ -351,16 +351,16 @@ LBL_charPtr: case 'T':
{
DBVARIANT dbv;
- if (!DBGetContactSetting(hcontact,"CList","StatusMsg",&dbv)){
+ if (!DBGetContactSetting(hcontact,"CList","StatusMsg",&dbv)) {
sztemplen += mir_snprintf(sztemp+sztemplen,MAXSIZE-sztemplen,"%s",dbv.pszVal);
DBFreeVariant(&dbv);
} else goto LBL_noData;
}
break;
case 'o':
- if (isetting=DBGetContactSettingWord(hcontact,S_MOD,hcontact?"OldStatus":courProtoName,0)){
+ if (isetting=DBGetContactSettingWord(hcontact,S_MOD,hcontact?"OldStatus":courProtoName,0)) {
strcpy(szdbsetting,Translate((const char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,(WPARAM)isetting,0)));
- if (includeIdle) if (hcontact) if (DBGetContactSettingByte(hcontact,S_MOD,"OldIdle",0)){
+ if (includeIdle) if (hcontact) if (DBGetContactSettingByte(hcontact,S_MOD,"OldIdle",0)) {
strcat(szdbsetting,"/");
strcat(szdbsetting,Translate("Idle"));
}
@@ -369,9 +369,9 @@ LBL_charPtr: goto LBL_charPtr;
case 'i':
- case 'r': if (isJabber(ci.szProto)){
+ case 'r': if (isJabber(ci.szProto)) {
DBVARIANT dbv;
- if (!DBGetContactSetting(hcontact,ci.szProto,szstring[loop]=='i'?"Resource":"System",&dbv)){
+ if (!DBGetContactSetting(hcontact,ci.szProto,szstring[loop]=='i'?"Resource":"System",&dbv)) {
strcpy(szdbsetting,dbv.pszVal);
DBFreeVariant(&dbv);
charPtr = szdbsetting;
@@ -410,7 +410,7 @@ LBL_charPtr: } else strcpy(szdbsetting,"Miranda");
} else {
DBVARIANT dbv;
- if (!DBGetContactSetting(hcontact,ci.szProto,"MirVer",&dbv)){
+ if (!DBGetContactSetting(hcontact,ci.szProto,"MirVer",&dbv)) {
strcpy(szdbsetting,dbv.pszVal);
DBFreeVariant(&dbv);
} else goto LBL_noData;
@@ -514,9 +514,9 @@ LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa void ShowPopup(HANDLE hcontact, const char * lpzProto, int newStatus){
if(CallService(MS_IGNORE_ISIGNORED,(WPARAM)hcontact,IGNOREEVENT_USERONLINE)) return;
- if (ServiceExists(MS_POPUP_QUERY)){
- if (DBGetContactSettingByte(NULL,S_MOD,"UsePopups",0)){
- if (!DBGetContactSettingByte(hcontact,"CList","Hidden",0)){
+ if (ServiceExists(MS_POPUP_QUERY)) {
+ if (DBGetContactSettingByte(NULL,S_MOD,"UsePopups",0)) {
+ if (!DBGetContactSettingByte(hcontact,"CList","Hidden",0)) {
POPUPDATAEX ppd = {0};
DBVARIANT dbv = {0};
char szstamp[10];
@@ -540,15 +540,15 @@ void ShowPopup(HANDLE hcontact, const char * lpzProto, int newStatus){ void myPlaySound(HANDLE hcontact, WORD newStatus, WORD oldStatus){
if(CallService(MS_IGNORE_ISIGNORED,(WPARAM)hcontact,IGNOREEVENT_USERONLINE)) return;
//oldStatus and hcontact are not used yet
- if (DBGetContactSettingByte(NULL,"Skin","UseSound",1)){
+ if (DBGetContactSettingByte(NULL,"Skin","UseSound",1)) {
char * soundname=0;
if ((newStatus==ID_STATUS_ONLINE) || (newStatus==ID_STATUS_FREECHAT)) soundname = "LastSeenTrackedStatusOnline";
else if (newStatus==ID_STATUS_OFFLINE) soundname = "LastSeenTrackedStatusOffline";
else if (oldStatus==ID_STATUS_OFFLINE) soundname = "LastSeenTrackedStatusFromOffline";
else soundname = "LastSeenTrackedStatusChange";
- if (!DBGetContactSettingByte(NULL,"SkinSoundsOff",soundname,0)){
+ if (!DBGetContactSettingByte(NULL,"SkinSoundsOff",soundname,0)) {
DBVARIANT dbv;
- if (!DBGetContactSetting(NULL,"SkinSounds",soundname,&dbv)){
+ if (!DBGetContactSetting(NULL,"SkinSounds",soundname,&dbv)) {
PlaySoundA(dbv.pszVal, NULL, SND_ASYNC | SND_FILENAME | SND_NOWAIT);
DBFreeVariant(&dbv);
} } } }
@@ -560,7 +560,7 @@ int isContactQueueActive(HANDLE hContact){ // MessageBox(0,"Is myself in the queue: never","LastSeen-Mod",0);
return 0;
}
- for (i=1;i<contactQueueSize;i++){
+ for (i=1;i<contactQueueSize;i++) {
if (contactQueue[i])
if (contactQueue[i]->hContact==hContact) return i;
}
@@ -574,7 +574,7 @@ int addContactToQueue(HANDLE hContact){ // MessageBox(0,"Adding myself to queue","LastSeen-Mod",0);
return 0;
}
- for (i=1;i<contactQueueSize;i++){
+ for (i=1;i<contactQueueSize;i++) {
if (!contactQueue[i]) {
contactQueue[i] = malloc(sizeof(logthread_info));
contactQueue[i]->queueIndex = i;
@@ -645,14 +645,14 @@ int UpdateValues(HANDLE hContact,LPARAM lparam) //if(CallService(MS_IGNORE_ISIGNORED,(WPARAM)hContact,IGNOREEVENT_USERONLINE)) return 0;
isIdleEvent = includeIdle?(strcmp(cws->szSetting,"IdleTS")==0):0;
if (strcmp(cws->szSetting,"Status") && strcmp(cws->szSetting,"StatusTriger") && (isIdleEvent==0)) return 0;
- if (!strcmp(cws->szModule,S_MOD)){
+ if (!strcmp(cws->szModule,S_MOD)) {
//here we will come when Settings/SeenModule/StatusTriger is changed
WORD prevStatus=DBGetContactSettingWord(hContact,S_MOD,"OldStatus",ID_STATUS_OFFLINE);
if (includeIdle){
if (DBGetContactSettingByte(hContact,S_MOD,"OldIdle",0)) prevStatus &= 0x7FFF;
else prevStatus |= 0x8000;
}
- if((cws->value.wVal|0x8000)<=ID_STATUS_OFFLINE)
+ if ((cws->value.wVal|0x8000)<=ID_STATUS_OFFLINE)
{
char * proto;
// avoid repeating the offline status
@@ -670,7 +670,7 @@ int UpdateValues(HANDLE hContact,LPARAM lparam) DBWriteTimeTS(t,hContact);
}
- if(!DBGetContactSettingByte(NULL,S_MOD,"IgnoreOffline",1))
+ if (!DBGetContactSettingByte(NULL,S_MOD,"IgnoreOffline",1))
{
char * sProto;
if(DBGetContactSettingByte(NULL,S_MOD,"FileOutput",0))
@@ -681,7 +681,7 @@ int UpdateValues(HANDLE hContact,LPARAM lparam) PS_GETSTATUS,0,0
)>ID_STATUS_OFFLINE) {
myPlaySound(hContact,ID_STATUS_OFFLINE,prevStatus);
- if(DBGetContactSettingByte(NULL,S_MOD,"UsePopups",0)){
+ if(DBGetContactSettingByte(NULL,S_MOD,"UsePopups",0)) {
ShowPopup(hContact,sProto,ID_STATUS_OFFLINE);
} }
@@ -710,11 +710,11 @@ int UpdateValues(HANDLE hContact,LPARAM lparam) if(DBGetContactSettingByte(hContact,S_MOD,"OnlineAlert",0)) ShowHistory(hContact, 1);
DBWriteContactSettingByte(hContact,S_MOD,"Offline",0);
}
- } else if (IsWatchedProtocol(cws->szModule)){
+ } else if (IsWatchedProtocol(cws->szModule)) {
//here we will come when <User>/<module>/Status is changed or it is idle event and if <module> is watched
if (CallProtoService(cws->szModule,PS_GETSTATUS,0,0)>ID_STATUS_OFFLINE){
int index;
- if (!(index = isContactQueueActive(hContact))){
+ if (!(index = isContactQueueActive(hContact))) {
index = addContactToQueue(hContact);
strncpy(contactQueue[index]->sProtoName,cws->szModule,MAXMODULELABELLENGTH);
//forkthreadex(NULL, 0, waitThread, contactQueue[index], 0, 0);
@@ -738,7 +738,7 @@ int UpdateValues(HANDLE hContact,LPARAM lparam) oldStatus=DBGetContactSettingWord(hContact,"UserOnline","OldStatus",ID_STATUS_OFFLINE);
DBWriteContactSettingWord(hContact,"UserOnline","OldStatus",(WORD)newStatus);
if(DBGetContactSettingByte(hContact,"CList","Hidden",0)) return 0;
- if((newStatus==ID_STATUS_ONLINE || newStatus==ID_STATUS_FREECHAT) &&
+ if ((newStatus==ID_STATUS_ONLINE || newStatus==ID_STATUS_FREECHAT) &&
oldStatus!=ID_STATUS_ONLINE && oldStatus!=ID_STATUS_FREECHAT) {
BYTE supp = db_byte_get(NULL, S_MOD, "SuppCListOnline", 3); //By default no online allert :P
BOOL willAlert = FALSE;
@@ -793,7 +793,7 @@ static DWORD __stdcall cleanThread(logthread_info* infoParam) {
char * contactProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hcontact,0);
if (contactProto) {
- if (!strncmp(infoParam->sProtoName,contactProto,MAXMODULELABELLENGTH)){
+ if (!strncmp(infoParam->sProtoName,contactProto,MAXMODULELABELLENGTH)) {
WORD oldStatus;
if ( (oldStatus = (DBGetContactSettingWord(hcontact,S_MOD,"StatusTriger",ID_STATUS_OFFLINE))|0x8000)>ID_STATUS_OFFLINE){
if (DBGetContactSettingWord(hcontact,contactProto,"Status",ID_STATUS_OFFLINE)==ID_STATUS_OFFLINE){
@@ -846,10 +846,10 @@ int ModeChange(WPARAM wparam,LPARAM lparam) // isetting=CallProtoService(ack->szModule,PS_GETSTATUS,0,0);
isetting=(WORD)ack->lParam;
if (isetting<ID_STATUS_OFFLINE) isetting = ID_STATUS_OFFLINE;
- if ((isetting>ID_STATUS_OFFLINE)&&((WORD)ack->hProcess<=ID_STATUS_OFFLINE)){
+ if ((isetting>ID_STATUS_OFFLINE)&&((WORD)ack->hProcess<=ID_STATUS_OFFLINE)) {
//we have just loged-in
db_dword_set(NULL, "UserOnline", ack->szModule, GetTickCount());
- if (IsWatchedProtocol(ack->szModule)){
+ if (IsWatchedProtocol(ack->szModule)) {
logthread_info *info;
info = (logthread_info *)malloc(sizeof(logthread_info));
strncpy(info->sProtoName,courProtoName,MAXMODULELABELLENGTH);
@@ -863,9 +863,9 @@ int ModeChange(WPARAM wparam,LPARAM lparam) CallService(MS_SYSTEM_FORK_THREAD_EX, 0, (LPARAM)¶ms);
}
- } else if ((isetting==ID_STATUS_OFFLINE)&&((WORD)ack->hProcess>ID_STATUS_OFFLINE)){
+ } else if ((isetting==ID_STATUS_OFFLINE)&&((WORD)ack->hProcess>ID_STATUS_OFFLINE)) {
//we have just loged-off
- if (IsWatchedProtocol(ack->szModule)){
+ if (IsWatchedProtocol(ack->szModule)) {
char *str = malloc(MAXMODULELABELLENGTH+9);
time_t t;
time(&t);
@@ -890,7 +890,7 @@ int ModeChange(WPARAM wparam,LPARAM lparam) short int isDbZero(HANDLE hContact, const char *module_name, const char *setting_name){
DBVARIANT dbv;
- if(!DBGetContactSetting(hContact, module_name, setting_name, &dbv)) {
+ if (!DBGetContactSetting(hContact, module_name, setting_name, &dbv)) {
short int res = 0;
switch (dbv.type) {
case DBVT_BYTE: res=dbv.bVal==0; break;
@@ -932,7 +932,7 @@ WCHAR *any_to_Idle(HANDLE hContact, const char *module_name, const char *setting ack=(ACKDATA *)lparam;
if(ack->type!=ACKTYPE_GETINFO || ack->hContact==NULL) return 0;
- if(((int)ack->hProcess-1)!=(int)ack->lParam) return 0;
+ if (((int)ack->hProcess-1)!=(int)ack->lParam) return 0;
dwsetting=DBGetContactSettingDword(ack->hContact,ack->szModule,"IP",0);
if(dwsetting)
|