From fd602fafce02247a045dc94a104bcf949113c80f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 22 Jun 2015 23:07:42 +0000 Subject: code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@14337 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp | 12 +- plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp | 12 +- plugins/FileAsMessage/src/main.cpp | 1 - plugins/MenuItemEx/src/main.cpp | 2 - plugins/Msg_Export/src/main.cpp | 2 - plugins/MyDetails/src/mydetails.cpp | 4 +- plugins/TabSRMM/src/globals.cpp | 2 - protocols/Tlen/src/tlen.cpp | 4 +- protocols/Xfire/src/main.cpp | 197 ++++++--------------- 9 files changed, 70 insertions(+), 166 deletions(-) diff --git a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp index df9afbc0ab..c3240e099b 100644 --- a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp +++ b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp @@ -830,7 +830,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popupp mi.position = popuppos++; mi.pszName = LPGEN("&Top"); mi.pszService = CLUIFRAMESSETALIGNALTOP; - mi.pszContactOwner = (char *)alTop; + mi.pszContactOwner = (char*)alTop; menuid = pfnAdd(&mi); if (frameid == -1) _hmiAlignTop = menuid; else g_pfwFrames[framepos].MenuHandles.MIAlignTop = menuid; @@ -840,7 +840,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popupp mi.position = popuppos++; mi.pszName = LPGEN("&Client"); mi.pszService = CLUIFRAMESSETALIGNALCLIENT; - mi.pszContactOwner = (char *)alClient; + mi.pszContactOwner = (char*)alClient; menuid = pfnAdd(&mi); if (frameid == -1) _hmiAlignClient = menuid; else g_pfwFrames[framepos].MenuHandles.MIAlignClient = menuid; @@ -849,7 +849,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popupp mi.position = popuppos++; mi.pszName = LPGEN("&Bottom"); mi.pszService = CLUIFRAMESSETALIGNALBOTTOM; - mi.pszContactOwner = (char *)alBottom; + mi.pszContactOwner = (char*)alBottom; menuid = pfnAdd(&mi); if (frameid == -1) _hmiAlignBottom = menuid; else g_pfwFrames[framepos].MenuHandles.MIAlignBottom = menuid; @@ -860,7 +860,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popupp mi.pszName = LPGEN("&Position"); mi.flags = CMIF_CHILDPOPUP | CMIF_ROOTPOPUP; mi.pszService = ""; - mi.pszContactOwner = (char *)0; + mi.pszContactOwner = (char*)0; menuid = pfnAdd(&mi); if (frameid == -1) _hmiPosRoot = menuid; else g_pfwFrames[framepos].MenuHandles.MIPosRoot = menuid; @@ -870,7 +870,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popupp mi.pszName = LPGEN("&Up"); mi.flags = CMIF_CHILDPOPUP; mi.pszService = CLUIFRAMESMOVEUP; - mi.pszContactOwner = (char *)1; + mi.pszContactOwner = (char*)1; menuid = pfnAdd(&mi); if (frameid == -1) _hmiPosUp = menuid; else g_pfwFrames[framepos].MenuHandles.MIPosUp = menuid; @@ -878,7 +878,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popupp mi.position = popuppos++; mi.pszName = LPGEN("&Down"); mi.pszService = CLUIFRAMESMOVEDOWN; - mi.pszContactOwner = (char *)-1; + mi.pszContactOwner = (char*)-1; menuid = pfnAdd(&mi); if (frameid == -1) _hmiPosDown = menuid; else g_pfwFrames[framepos].MenuHandles.MIPosDown = menuid; diff --git a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp index f511244c27..e791c07baa 100644 --- a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp +++ b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp @@ -676,7 +676,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popuppos, HGE mi.position = popuppos++; mi.pszName = LPGEN("&Top"); mi.pszService = CLUIFRAMESSETALIGNALTOP; - mi.pszContactOwner = (char *)alTop; + mi.pszContactOwner = (char*)alTop; menuid = pfnAdd(&mi); if (frameid == -1) contMIAlignTop = menuid; else Frames[framepos].MenuHandles.MIAlignTop = menuid; @@ -685,7 +685,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popuppos, HGE mi.position = popuppos++; mi.pszName = LPGEN("&Client"); mi.pszService = CLUIFRAMESSETALIGNALCLIENT; - mi.pszContactOwner = (char *)alClient; + mi.pszContactOwner = (char*)alClient; menuid = pfnAdd(&mi); if (frameid == -1) contMIAlignClient = menuid; else Frames[framepos].MenuHandles.MIAlignClient = menuid; @@ -694,7 +694,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popuppos, HGE mi.position = popuppos++; mi.pszName = LPGEN("&Bottom"); mi.pszService = CLUIFRAMESSETALIGNALBOTTOM; - mi.pszContactOwner = (char *)alBottom; + mi.pszContactOwner = (char*)alBottom; menuid = pfnAdd(&mi); if (frameid == -1) contMIAlignBottom = menuid; else Frames[framepos].MenuHandles.MIAlignBottom = menuid; @@ -706,7 +706,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popuppos, HGE mi.pszName = LPGEN("&Position"); mi.flags = CMIF_CHILDPOPUP | CMIF_ROOTPOPUP; mi.pszService = ""; - mi.pszContactOwner = (char *)0; + mi.pszContactOwner = (char*)0; menuid = pfnAdd(&mi); mi.hParentMenu = menuid; @@ -714,14 +714,14 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popuppos, HGE mi.pszName = LPGEN("&Up"); mi.flags = CMIF_CHILDPOPUP; mi.pszService = CLUIFRAMESMOVEUP; - mi.pszContactOwner = (char *)1; + mi.pszContactOwner = (char*)1; pfnAdd(&mi); mi.position = popuppos++; mi.pszName = LPGEN("&Down"); mi.flags = CMIF_CHILDPOPUP; mi.pszService = CLUIFRAMESMOVEDOWN; - mi.pszContactOwner = (char *)-1; + mi.pszContactOwner = (char*)-1; pfnAdd(&mi); return 0; } diff --git a/plugins/FileAsMessage/src/main.cpp b/plugins/FileAsMessage/src/main.cpp index 279307f86f..ae7188e548 100644 --- a/plugins/FileAsMessage/src/main.cpp +++ b/plugins/FileAsMessage/src/main.cpp @@ -179,7 +179,6 @@ static int OnModulesLoaded(WPARAM wparam, LPARAM lparam) mi.hIcon = hIcons[ICON_MAIN]; mi.pszName = LPGEN("File As Message..."); mi.pszService = SERVICE_NAME "/FESendFile"; - mi.pszContactOwner = NULL; mi.flags = CMIF_NOTOFFLINE; Menu_AddContactMenuItem(&mi); return 0; diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index b3716522f7..e7ab90d826 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -959,8 +959,6 @@ static int PluginInit(WPARAM, LPARAM) CLISTMENUITEM mi = { 0 }; mi.flags = CMIF_UNICODE; - mi.hIcon = NULL; - mi.pszContactOwner = NULL; mi.position = 120000; mi.ptszName = LPGENT("Always visible"); diff --git a/plugins/Msg_Export/src/main.cpp b/plugins/Msg_Export/src/main.cpp index 144d80eec2..7a0b2e571d 100755 --- a/plugins/Msg_Export/src/main.cpp +++ b/plugins/Msg_Export/src/main.cpp @@ -115,8 +115,6 @@ int MainInit(WPARAM /*wparam*/, LPARAM /*lparam*/) if (!bReplaceHistory) { CLISTMENUITEM mi = { 0 }; - mi.flags = 0; - mi.pszContactOwner = NULL; //all contacts mi.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_EXPORT_MESSAGE)); mi.position = 1000090100; mi.pszName = LPGEN("Open E&xported History"); diff --git a/plugins/MyDetails/src/mydetails.cpp b/plugins/MyDetails/src/mydetails.cpp index 76ed521dcd..f9d321e780 100644 --- a/plugins/MyDetails/src/mydetails.cpp +++ b/plugins/MyDetails/src/mydetails.cpp @@ -91,10 +91,10 @@ static int MainInit(WPARAM, LPARAM) mi.flags = CMIF_ROOTPOPUP | CMIF_TCHAR; mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_USERDETAILS); mi.ptszName = LPGENT("My details"); - HANDLE hMenuRoot = Menu_AddMainMenuItem(&mi); + HGENMENU hMenuRoot = Menu_AddMainMenuItem(&mi); mi.flags = CMIF_CHILDPOPUP | CMIF_TCHAR; - mi.ptszPopupName = (TCHAR *)hMenuRoot; + mi.hParentMenu = hMenuRoot; mi.popupPosition = 0; mi.icolibItem = NULL; diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index 8707a2f165..fa8c3b2bf5 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -328,7 +328,6 @@ int CGlobals::ModulesLoaded(WPARAM, LPARAM) CLISTMENUITEM mi = { 0 }; mi.position = -500050005; mi.hIcon = PluginConfig.g_iconContainer; - mi.pszContactOwner = NULL; mi.pszName = LPGEN("&Messaging settings..."); mi.pszService = MS_TABMSG_SETUSERPREFS; PluginConfig.m_UserMenuItem = Menu_AddContactMenuItem(&mi); @@ -336,7 +335,6 @@ int CGlobals::ModulesLoaded(WPARAM, LPARAM) if (sendLater->isAvail()) { mi.position = -500050006; mi.hIcon = 0; - mi.pszContactOwner = NULL; mi.pszName = LPGEN("&Send later job list..."); mi.pszService = MS_TABMSG_SLQMGR; PluginConfig.m_UserMenuItem = Menu_AddMainMenuItem(&mi); diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp index fbf6d2a30a..744a33c2f5 100644 --- a/protocols/Tlen/src/tlen.cpp +++ b/protocols/Tlen/src/tlen.cpp @@ -260,8 +260,8 @@ int TlenProtocol::PreShutdown(WPARAM wParam, LPARAM lParam) void TlenProtocol::initMenuItems() { - char text[_MAX_PATH]; - strncpy_s(text, sizeof(text), m_szModuleName, _TRUNCATE); + char text[MAX_PATH]; + strncpy_s(text, m_szModuleName, _TRUNCATE); char *pSvcName = text + mir_strlen(text); CLISTMENUITEM mi = { 0 }; diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp index e42b373204..ab71efc9ee 100644 --- a/protocols/Xfire/src/main.cpp +++ b/protocols/Xfire/src/main.cpp @@ -197,7 +197,6 @@ extern void Scan4Games(LPVOID lparam); INT_PTR RemoveFriend(WPARAM wParam, LPARAM lParam); INT_PTR BlockFriend(WPARAM wParam, LPARAM lParam); INT_PTR StartThisGame(WPARAM wParam, LPARAM lParam); -int IconLibChanged(WPARAM wParam, LPARAM lParam); void SetAvatar2(LPVOID lparam); int ExtraListRebuild(WPARAM wparam, LPARAM lparam); @@ -1113,14 +1112,14 @@ extern "C" __declspec(dllexport) int Load(void) if (!(XFireAvatarFolder = FoldersRegisterCustomPath(protocolname, "Avatars", AvatarsFolder))) CreateDirectoryA(AvatarsFolder, NULL); - //erweiterte Kontextmenüpunkte + // erweiterte Kontextmenüpunkte CLISTMENUITEM mi = { 0 }; mi.ptszPopupName = _T(protocolname); mi.flags = CMIF_TCHAR; char servicefunction[100]; - //gotoprofilemenüpunkt + // gotoprofilemenüpunkt mir_strcpy(servicefunction, protocolname); mir_strcat(servicefunction, "GotoProfile"); CreateServiceFunction(servicefunction, GotoProfile); @@ -1131,102 +1130,77 @@ extern "C" __declspec(dllexport) int Load(void) mi.ptszName = LPGENT("&XFire Online Profile"); Menu_AddContactMenuItem(&mi); - //gotoxfireclansitemenüpunkt + // gotoxfireclansitemenüpunkt mir_strcpy(servicefunction, protocolname); mir_strcat(servicefunction, "GotoXFireClanSite"); CreateServiceFunction(servicefunction, GotoXFireClanSite); - mi.pszService = servicefunction; - mi.position = 500090000; - mi.pszContactOwner = protocolname; mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP)); mi.ptszName = LPGENT("XFire &Clan Site"); gotoclansite = Menu_AddContactMenuItem(&mi); - //kopiermenüpunkt + // kopiermenüpunkt mir_strcpy(servicefunction, protocolname); mir_strcat(servicefunction, "GetIPPort"); CreateServiceFunction(servicefunction, GetIPPort); - mi.pszService = servicefunction; - mi.position = 500090000; mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP)); - mi.pszContactOwner = protocolname; mi.ptszName = LPGENT("C&opy Server Address and Port"); copyipport = Menu_AddContactMenuItem(&mi); - //kopiermenüpunkt + // kopiermenüpunkt mir_strcpy(servicefunction, protocolname); mir_strcat(servicefunction, "VoiceIPPort"); CreateServiceFunction(servicefunction, GetVIPPort); - mi.pszService = servicefunction; - mi.position = 500090000; mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP)); - mi.pszContactOwner = protocolname; mi.ptszName = LPGENT("Cop&y Voice Server Address and Port"); vipport = Menu_AddContactMenuItem(&mi); - //joinmenüpunkt + // joinmenüpunkt mir_strcpy(servicefunction, protocolname); mir_strcat(servicefunction, "JoinGame"); CreateServiceFunction(servicefunction, JoinGame); - mi.pszService = servicefunction; - mi.position = 500090000; mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP)); - mi.pszContactOwner = protocolname; mi.ptszName = LPGENT("Join &Game..."); joingame = Menu_AddContactMenuItem(&mi); - //joinmenüpunkt + // playmenüpunkt mir_strcpy(servicefunction, protocolname); mir_strcat(servicefunction, "StartThisGame"); CreateServiceFunction(servicefunction, StartThisGame); - mi.pszService = servicefunction; - mi.position = 500090000; mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP)); - mi.pszContactOwner = protocolname; mi.ptszName = LPGENT("Play this game..."); startthisgame = Menu_AddContactMenuItem(&mi); - //remove friend + // remove friend mir_strcpy(servicefunction, protocolname); mir_strcat(servicefunction, "RemoveFriend"); CreateServiceFunction(servicefunction, RemoveFriend); - mi.pszService = servicefunction; mi.position = 2000070000; mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP)); - mi.pszContactOwner = protocolname; mi.ptszName = LPGENT("Remove F&riend..."); removefriend = Menu_AddContactMenuItem(&mi); - //block user + // block user mir_strcpy(servicefunction, protocolname); mir_strcat(servicefunction, "BlockFriend"); CreateServiceFunction(servicefunction, BlockFriend); - mi.pszService = servicefunction; - mi.position = 2000070000; mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP)); - mi.pszContactOwner = protocolname; mi.ptszName = LPGENT("Block U&ser..."); blockfriend = Menu_AddContactMenuItem(&mi); - //my fire profile + // my fire profile mir_strcpy(servicefunction, protocolname); mir_strcat(servicefunction, "GotoProfile2"); CreateServiceFunction(servicefunction, GotoProfile2); - mi.pszService = servicefunction; mi.position = 500090000; mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP)); - mi.pszContactOwner = protocolname; mi.ptszName = LPGENT("&My XFire Online Profile"); Menu_AddMainMenuItem(&mi); - //my activity protocol + // my activity protocol mir_strcpy(servicefunction, protocolname); mir_strcat(servicefunction, "GotoProfileAct"); CreateServiceFunction(servicefunction, GotoProfileAct); - mi.pszService = servicefunction; - mi.position = 500090000; mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP)); - mi.pszContactOwner = protocolname; mi.ptszName = LPGENT("&Activity Report"); Menu_AddMainMenuItem(&mi); @@ -1234,20 +1208,14 @@ extern "C" __declspec(dllexport) int Load(void) mir_strcpy(servicefunction, protocolname); mir_strcat(servicefunction, "ReScanMyGames"); CreateServiceFunction(servicefunction, ReScanMyGames); - mi.pszService = servicefunction; - mi.position = 500090000; mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP)); - mi.pszContactOwner = protocolname; mi.ptszName = LPGENT("&Rescan my games..."); Menu_AddMainMenuItem(&mi); mir_strcpy(servicefunction, protocolname); mir_strcat(servicefunction, "SetNick"); CreateServiceFunction(servicefunction, SetNickDlg); - mi.pszService = servicefunction; - mi.position = 500090000; mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP)); - mi.pszContactOwner = protocolname; mi.ptszName = LPGENT("Set &Nickname"); Menu_AddMainMenuItem(&mi); @@ -1268,7 +1236,8 @@ extern "C" __declspec(dllexport) int Load(void) } //funktion liefert für xstatusid den passenden ico zurück, für tipper zb notwendig -INT_PTR GetXStatusIcon(WPARAM wParam, LPARAM lParam) { +INT_PTR GetXStatusIcon(WPARAM wParam, LPARAM lParam) +{ if (lParam == LR_SHARED) { if (wParam > 1) @@ -1425,18 +1394,14 @@ static void ConnectingThread(LPVOID params) if (myClient != NULL&&myClient->client != NULL) myClient->run(); - else - { + else { mir_cslock lck(connectingMutex); return; } if (myClient->client->connected) - { sendonrecieve = TRUE; - } - else - { + else { if (db_get_w(NULL, protocolname, "noconnectfailedbox", 0) == 0) MSGBOXE(Translate("Unable to connect to XFire.")); wParam = ID_STATUS_OFFLINE; } @@ -3115,37 +3080,26 @@ void CreateGroup(char*grpn, char*field) { INT_PTR SetAwayMsg(WPARAM wParam, LPARAM lParam) { mir_cslock lck(modeMsgsMutex); - if ((char*)lParam == NULL) - { + if ((char*)lParam == NULL) { if (wParam == ID_STATUS_ONLINE) - { mir_strcpy(statusmessage[0], ""); - } - else if (wParam != ID_STATUS_OFFLINE/*&&db_get_b(NULL,protocolname,"nocustomaway",0)==0*/) - { + else if (wParam != ID_STATUS_OFFLINE) mir_snprintf(statusmessage[1], _countof(statusmessage[1]), "(AFK) %s", Translate("Away from Keyboard")); - } } - else - { + else { if (wParam == ID_STATUS_ONLINE) - { mir_strcpy(statusmessage[0], (char*)lParam); - } else if (wParam != ID_STATUS_OFFLINE) { if (db_get_b(NULL, protocolname, "nocustomaway", 0) == 0 && mir_strlen((char*)lParam) > 0) { mir_snprintf(statusmessage[1], _countof(statusmessage[1]), "(AFK) %s", (char*)lParam); //mir_strcpy(statusmessage[1],( char* )lParam); } - else - mir_snprintf(statusmessage[1], _countof(statusmessage[1]), "(AFK) %s", Translate("Away from Keyboard")); + else mir_snprintf(statusmessage[1], _countof(statusmessage[1]), "(AFK) %s", Translate("Away from Keyboard")); } } - if (myClient != NULL) - { - if (myClient->client->connected) - { + if (myClient != NULL) { + if (myClient->client->connected) { if (bpStatus == ID_STATUS_ONLINE) myClient->Status(statusmessage[0]); else if (wParam != ID_STATUS_ONLINE&&wParam != ID_STATUS_OFFLINE) @@ -3155,25 +3109,16 @@ INT_PTR SetAwayMsg(WPARAM wParam, LPARAM lParam) return 0; } -/*static void SendAMAck( LPVOID param ) -{ -ptrT statusMsg( db_get_tsa((HANDLE)param, protocolname, "XStatusMsg")); -ProtoBroadcastAck(protocolname, (HANDLE)param, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)statusMsg); -}*/ - INT_PTR SetNickName(WPARAM newnick, LPARAM lparam) { if (newnick == NULL) - { return FALSE; - } if (myClient != NULL) - if (myClient->client->connected) - { - myClient->setNick((char*)newnick); - db_set_s(NULL, protocolname, "Nick", (char*)newnick); - return TRUE; + if (myClient->client->connected) { + myClient->setNick((char*)newnick); + db_set_s(NULL, protocolname, "Nick", (char*)newnick); + return TRUE; } return FALSE; } @@ -3183,32 +3128,32 @@ INT_PTR SendPrefs(WPARAM wparam, LPARAM lparam) { if (myClient != NULL) if (myClient->client->connected) { - PrefsPacket prefs; - for (int i = 0; i < XFIRE_RECVPREFSPACKET_MAXCONFIGS; i++) - prefs.config[i] = xfireconfig[i]; + PrefsPacket prefs; + for (int i = 0; i < XFIRE_RECVPREFSPACKET_MAXCONFIGS; i++) + prefs.config[i] = xfireconfig[i]; - myClient->client->send(&prefs); - return TRUE; + myClient->client->send(&prefs); + return TRUE; } return FALSE; } int ContactDeleted(WPARAM hContact, LPARAM lParam) { - if (!db_get_b(hContact, protocolname, "DontSendDenyPacket", 0)) - if (db_get_b(hContact, "CList", "NotOnList", 0)) - { - if (myClient != NULL) - if (myClient->client->connected) - { - DBVARIANT dbv2; - if (!db_get(hContact, protocolname, "Username", &dbv2)) { - SendDenyInvitationPacket deny; - deny.name = dbv2.pszVal; - myClient->client->send(&deny); - } + if (!db_get_b(hContact, protocolname, "DontSendDenyPacket", 0)) { + if (db_get_b(hContact, "CList", "NotOnList", 0)) { + if (myClient != NULL) { + if (myClient->client->connected) { + DBVARIANT dbv2; + if (!db_get(hContact, protocolname, "Username", &dbv2)) { + SendDenyInvitationPacket deny; + deny.name = dbv2.pszVal; + myClient->client->send(&deny); + } + } } } + } return 0; } @@ -3234,24 +3179,15 @@ INT_PTR RemoveFriend(WPARAM hContact, LPARAM lParam) { char temp[256]; DBVARIANT dbv; - - if (!db_get_s(hContact, protocolname, "Username", &dbv)) - { + if (!db_get_s(hContact, protocolname, "Username", &dbv)) { mir_snprintf(temp, _countof(temp), Translate("Do you really want to delete your friend %s?"), dbv.pszVal); - if (MessageBoxA(NULL, temp, Translate("Confirm Delete"), MB_YESNO | MB_ICONQUESTION) == IDYES) - { - if (myClient != NULL) - { - if (myClient->client->connected) - { + if (MessageBoxA(NULL, temp, Translate("Confirm Delete"), MB_YESNO | MB_ICONQUESTION) == IDYES) { + if (myClient != NULL) { + if (myClient->client->connected) { SendRemoveBuddyPacket removeBuddy; - removeBuddy.userid = db_get_dw(hContact, protocolname, "UserId", 0); - if (removeBuddy.userid != 0) - { myClient->client->send(&removeBuddy); - } } } } @@ -3263,15 +3199,10 @@ INT_PTR RemoveFriend(WPARAM hContact, LPARAM lParam) INT_PTR BlockFriend(WPARAM hContact, LPARAM lParam) { DBVARIANT dbv; - - if (!db_get_s(hContact, protocolname, "Username", &dbv)) - { - if (MessageBox(NULL, TranslateT("Block this user from ever contacting you again?"), TranslateT("Block Confirmation"), MB_YESNO | MB_ICONQUESTION) == IDYES) - { - if (myClient != NULL) - { - if (myClient->client->connected) - { + if (!db_get_s(hContact, protocolname, "Username", &dbv)) { + if (MessageBox(NULL, TranslateT("Block this user from ever contacting you again?"), TranslateT("Block Confirmation"), MB_YESNO | MB_ICONQUESTION) == IDYES) { + if (myClient != NULL) { + if (myClient->client->connected) { db_set_b(NULL, "XFireBlock", dbv.pszVal, 1); SendDenyInvitationPacket deny; @@ -3332,8 +3263,8 @@ INT_PTR JoinGame(WPARAM hContact, LPARAM lParam) return 0; } - -int doneQuery(WPARAM wParam, LPARAM lParam) { +int doneQuery(WPARAM wParam, LPARAM lParam) +{ char temp[256]; BuddyListEntry* bud = (BuddyListEntry*)wParam; gServerstats* gameinfo = (gServerstats*)lParam; @@ -3350,31 +3281,11 @@ int doneQuery(WPARAM wParam, LPARAM lParam) { return 0; } -static INT_PTR SetNickDlg(WPARAM wParam, LPARAM lParam) { +static INT_PTR SetNickDlg(WPARAM wParam, LPARAM lParam) +{ return ShowSetNick(); } - -int IconLibChanged(WPARAM wParam, LPARAM lParam) { - /*int x=0; - char temp[255]; - for(int i=0;i<1024;i++) - { - if (icocache[i].hicon>0) - { - //ImageList_ReplaceIcon(hAdvancedStatusIcon,(int)icocache[i].handle,icocache[i].hicon); - HANDLE before=icocache[i].handle; - icocache[i].handle=(HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)icocache[i].hicon, 0); - mir_snprintf(temp, _countof(temp), "before: %d after: %d", before, icocache[i].handle); - MessageBoxA(NULL,temp,temp,0); - DrawIcon(GetDC(NULL),x,0,(HICON)CallService(MS_SKIN2_GETICONBYHANDLE,0,(LPARAM)icocache[i].handle)); - x+=32; - } - }*/ - return 0; -} - - INT_PTR GetAvatarInfo(WPARAM wParam, LPARAM lParam) { PROTO_AVATAR_INFORMATION* pai = (PROTO_AVATAR_INFORMATION*)lParam; -- cgit v1.2.3