From 1979fd80424d16b2e489f9b57d01d9c7811d25a2 Mon Sep 17 00:00:00 2001 From: dartraiden Date: Mon, 2 Jan 2023 21:10:29 +0300 Subject: Update copyrights --- protocols/Facebook/src/dialogs.cpp | 156 ++++++++++++++++++------------------- 1 file changed, 78 insertions(+), 78 deletions(-) (limited to 'protocols/Facebook/src/dialogs.cpp') diff --git a/protocols/Facebook/src/dialogs.cpp b/protocols/Facebook/src/dialogs.cpp index 4e9e215b86..1938c94448 100644 --- a/protocols/Facebook/src/dialogs.cpp +++ b/protocols/Facebook/src/dialogs.cpp @@ -1,78 +1,78 @@ -/* - -Facebook plugin for Miranda Instant Messenger -_____________________________________________ - -Copyright © 2009-11 Michal Zelinka, 2011-17 Robert Pösel, 2017-22 Miranda NG team - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -*/ - -#include "stdafx.h" - -INT_PTR CALLBACK FBAccountProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) -{ - FacebookProto *proto = reinterpret_cast(GetWindowLongPtr(hwnd, GWLP_USERDATA)); - - switch (message) { - - case WM_INITDIALOG: - { - TranslateDialogDefault(hwnd); - - proto = reinterpret_cast(lparam); - SetWindowLongPtr(hwnd, GWLP_USERDATA, lparam); - - ptrA login(db_get_sa(0, proto->ModuleName(), DBKEY_LOGIN)); - if (login != nullptr) - SetDlgItemTextA(hwnd, IDC_UN, login); - - ptrA password(db_get_sa(0, proto->ModuleName(), DBKEY_PASS)); - if (password != nullptr) - SetDlgItemTextA(hwnd, IDC_PW, password); - - //if (!proto->isOffline()) { - // SendDlgItemMessage(hwnd, IDC_UN, EM_SETREADONLY, 1, 0); - // SendDlgItemMessage(hwnd, IDC_PW, EM_SETREADONLY, 1, 0); - //} - return TRUE; - } - case WM_COMMAND: - if (HIWORD(wparam) == EN_CHANGE && reinterpret_cast(lparam) == GetFocus()) { - switch (LOWORD(wparam)) { - case IDC_UN: - case IDC_PW: - SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); - } - } - break; - - case WM_NOTIFY: - if (reinterpret_cast(lparam)->code == PSN_APPLY) { - char str[128]; - - GetDlgItemTextA(hwnd, IDC_UN, str, _countof(str)); - db_set_s(0, proto->ModuleName(), DBKEY_LOGIN, str); - - GetDlgItemTextA(hwnd, IDC_PW, str, _countof(str)); - db_set_s(0, proto->ModuleName(), DBKEY_PASS, str); - return TRUE; - } - break; - - } - - return FALSE; -} +/* + +Facebook plugin for Miranda Instant Messenger +_____________________________________________ + +Copyright © 2009-11 Michal Zelinka, 2011-17 Robert Pösel, 2017-23 Miranda NG team + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +*/ + +#include "stdafx.h" + +INT_PTR CALLBACK FBAccountProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) +{ + FacebookProto *proto = reinterpret_cast(GetWindowLongPtr(hwnd, GWLP_USERDATA)); + + switch (message) { + + case WM_INITDIALOG: + { + TranslateDialogDefault(hwnd); + + proto = reinterpret_cast(lparam); + SetWindowLongPtr(hwnd, GWLP_USERDATA, lparam); + + ptrA login(db_get_sa(0, proto->ModuleName(), DBKEY_LOGIN)); + if (login != nullptr) + SetDlgItemTextA(hwnd, IDC_UN, login); + + ptrA password(db_get_sa(0, proto->ModuleName(), DBKEY_PASS)); + if (password != nullptr) + SetDlgItemTextA(hwnd, IDC_PW, password); + + //if (!proto->isOffline()) { + // SendDlgItemMessage(hwnd, IDC_UN, EM_SETREADONLY, 1, 0); + // SendDlgItemMessage(hwnd, IDC_PW, EM_SETREADONLY, 1, 0); + //} + return TRUE; + } + case WM_COMMAND: + if (HIWORD(wparam) == EN_CHANGE && reinterpret_cast(lparam) == GetFocus()) { + switch (LOWORD(wparam)) { + case IDC_UN: + case IDC_PW: + SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); + } + } + break; + + case WM_NOTIFY: + if (reinterpret_cast(lparam)->code == PSN_APPLY) { + char str[128]; + + GetDlgItemTextA(hwnd, IDC_UN, str, _countof(str)); + db_set_s(0, proto->ModuleName(), DBKEY_LOGIN, str); + + GetDlgItemTextA(hwnd, IDC_PW, str, _countof(str)); + db_set_s(0, proto->ModuleName(), DBKEY_PASS, str); + return TRUE; + } + break; + + } + + return FALSE; +} -- cgit v1.2.3