diff options
Diffstat (limited to 'protocols/IcqOscarJ/src/UI')
-rw-r--r-- | protocols/IcqOscarJ/src/UI/askauthentication.cpp | 92 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/UI/icqoscar.h | 2 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/UI/loginpassword.cpp | 90 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/UI/userinfotab.cpp | 291 |
4 files changed, 0 insertions, 475 deletions
diff --git a/protocols/IcqOscarJ/src/UI/askauthentication.cpp b/protocols/IcqOscarJ/src/UI/askauthentication.cpp deleted file mode 100644 index 508478801f..0000000000 --- a/protocols/IcqOscarJ/src/UI/askauthentication.cpp +++ /dev/null @@ -1,92 +0,0 @@ -// ---------------------------------------------------------------------------80
-// ICQ plugin for Miranda Instant Messenger
-// ________________________________________
-//
-// Copyright © 2000-2001 Richard Hughes, Roland Rabien, Tristan Van de Vreede
-// Copyright © 2001-2002 Jon Keating, Richard Hughes
-// Copyright © 2002-2004 Martin Öberg, Sam Kothari, Robert Rainwater
-// Copyright © 2004-2008 Joe Kucera
-// Copyright © 2012-2014 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, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-// -----------------------------------------------------------------------------
-
-#include "icqoscar.h"
-
-struct AskAuthParam
-{
- CIcqProto* ppro;
- MCONTACT hContact;
-};
-
-static INT_PTR CALLBACK AskAuthProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- AskAuthParam* dat = (AskAuthParam*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
-
- switch (msg) {
- case WM_INITDIALOG:
- dat = (AskAuthParam*)lParam;
- if (!dat->hContact || !dat->ppro->icqOnline())
- EndDialog(hwndDlg, 0);
-
- TranslateDialogDefault(hwndDlg);
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
- SendDlgItemMessage(hwndDlg, IDC_EDITAUTH, EM_LIMITTEXT, (WPARAM)255, 0);
- SetDlgItemText(hwndDlg, IDC_EDITAUTH, TranslateT("Please authorize me to add you to my contact list."));
- return TRUE;
-
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDOK:
- if (dat->ppro->icqOnline())
- {
- DWORD dwUin;
- uid_str szUid;
- if ( dat->ppro->getContactUid(dat->hContact, &dwUin, &szUid))
- return TRUE; // Invalid contact
-
- char* szReason = GetDlgItemTextUtf(hwndDlg, IDC_EDITAUTH);
- dat->ppro->icq_sendAuthReqServ(dwUin, szUid, szReason);
- SAFE_FREE((void**)&szReason);
-
- // auth bug fix (thx Bio)
- if (dat->ppro->m_bSsiEnabled && dwUin)
- dat->ppro->resetServContactAuthState(dat->hContact);
-
- EndDialog(hwndDlg, 0);
- }
- return TRUE;
-
- case IDCANCEL:
- EndDialog(hwndDlg, 0);
- return TRUE;
- }
-
- break;
-
- case WM_CLOSE:
- EndDialog(hwndDlg,0);
- return TRUE;
- }
-
- return FALSE;
-}
-
-INT_PTR CIcqProto::RequestAuthorization(WPARAM wParam, LPARAM)
-{
- AskAuthParam param = { this, wParam };
- DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ASKAUTH), NULL, AskAuthProc, (LPARAM)¶m);
- return 0;
-}
diff --git a/protocols/IcqOscarJ/src/UI/icqoscar.h b/protocols/IcqOscarJ/src/UI/icqoscar.h deleted file mode 100644 index 77283f6f7f..0000000000 --- a/protocols/IcqOscarJ/src/UI/icqoscar.h +++ /dev/null @@ -1,2 +0,0 @@ -/* For MinGW sake */
-#include "../icqoscar.h"
diff --git a/protocols/IcqOscarJ/src/UI/loginpassword.cpp b/protocols/IcqOscarJ/src/UI/loginpassword.cpp deleted file mode 100644 index 0d21873878..0000000000 --- a/protocols/IcqOscarJ/src/UI/loginpassword.cpp +++ /dev/null @@ -1,90 +0,0 @@ -// ---------------------------------------------------------------------------80
-// ICQ plugin for Miranda Instant Messenger
-// ________________________________________
-//
-// Copyright © 2000-2001 Richard Hughes, Roland Rabien, Tristan Van de Vreede
-// Copyright © 2001-2002 Jon Keating, Richard Hughes
-// Copyright © 2002-2004 Martin Öberg, Sam Kothari, Robert Rainwater
-// Copyright © 2004-2009 Joe Kucera
-// Copyright © 2012-2014 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, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-// -----------------------------------------------------------------------------
-
-#include "icqoscar.h"
-
-INT_PTR CALLBACK LoginPasswdDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- CIcqProto* ppro = (CIcqProto*)GetWindowLongPtr( hwndDlg, GWLP_USERDATA );
-
- switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
-
- ppro = (CIcqProto*)lParam;
- SetWindowLongPtr( hwndDlg, GWLP_USERDATA, lParam );
-
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_GetIconByHandle(ppro->m_hProtoIcon, true));
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)Skin_GetIconByHandle(ppro->m_hProtoIcon));
- {
- DWORD dwUin = ppro->getContactUin(NULL);
-
- TCHAR pszUIN[MAX_PATH];
- mir_sntprintf(pszUIN, SIZEOF(pszUIN), TranslateT("Enter a password for UIN %u:"), dwUin);
- SetDlgItemText(hwndDlg, IDC_INSTRUCTION, pszUIN);
-
- SendDlgItemMessage(hwndDlg, IDC_LOGINPW, EM_LIMITTEXT, PASSWORDMAXLEN - 1, 0);
-
- CheckDlgButton(hwndDlg, IDC_SAVEPASS, ppro->getByte("RememberPass", 0) ? BST_CHECKED : BST_UNCHECKED);
- }
- break;
-
- case WM_DESTROY:
- Skin_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_GETICON, ICON_BIG, 0));
- Skin_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_GETICON, ICON_SMALL, 0));
- break;
-
- case WM_CLOSE:
- EndDialog(hwndDlg, 0);
- break;
-
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDOK:
- ppro->m_bRememberPwd = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SAVEPASS);
- ppro->setByte("RememberPass", ppro->m_bRememberPwd);
-
- GetDlgItemTextA(hwndDlg, IDC_LOGINPW, ppro->m_szPassword, SIZEOF(ppro->m_szPassword));
-
- ppro->icq_login(ppro->m_szPassword);
-
- EndDialog(hwndDlg, IDOK);
- break;
-
- case IDCANCEL:
- ppro->SetCurrentStatus(ID_STATUS_OFFLINE);
- EndDialog(hwndDlg, IDCANCEL);
- break;
- }
- break;
- }
-
- return FALSE;
-}
-
-void CIcqProto::RequestPassword()
-{
- DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_LOGINPW), NULL, LoginPasswdDlgProc, LPARAM(this));
-}
diff --git a/protocols/IcqOscarJ/src/UI/userinfotab.cpp b/protocols/IcqOscarJ/src/UI/userinfotab.cpp deleted file mode 100644 index 322019553f..0000000000 --- a/protocols/IcqOscarJ/src/UI/userinfotab.cpp +++ /dev/null @@ -1,291 +0,0 @@ -// ---------------------------------------------------------------------------80
-// ICQ plugin for Miranda Instant Messenger
-// ________________________________________
-//
-// Copyright © 2000-2001 Richard Hughes, Roland Rabien, Tristan Van de Vreede
-// Copyright © 2001-2002 Jon Keating, Richard Hughes
-// Copyright © 2002-2004 Martin Öberg, Sam Kothari, Robert Rainwater
-// Copyright © 2004-2010 Joe Kucera
-// Copyright © 2012-2014 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, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-// -----------------------------------------------------------------------------
-// DESCRIPTION:
-//
-// Code for User details ICQ specific pages
-// -----------------------------------------------------------------------------
-
-#include "icqoscar.h"
-
-#define SVS_NORMAL 0
-#define SVS_ZEROISUNSPEC 2
-#define SVS_IP 3
-#define SVS_SIGNED 6
-#define SVS_ICQVERSION 8
-#define SVS_TIMESTAMP 9
-#define SVS_STATUSID 10
-
-extern const char *nameXStatus[];
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-static void SetValue(CIcqProto* ppro, HWND hwndDlg, int idCtrl, MCONTACT hContact, char* szModule, char* szSetting, int special)
-{
- DBVARIANT dbv = { 0 };
- char str[MAX_PATH];
- char* pstr = NULL;
- int unspecified = 0;
- int bUtf = 0, bDbv = 0, bAlloc = 0;
-
- dbv.type = DBVT_DELETED;
-
- if ((hContact == NULL) && ((int)szModule < 0x100)) {
- dbv.type = (BYTE)szModule;
-
- switch ((int)szModule) {
- case DBVT_BYTE:
- dbv.cVal = (BYTE)szSetting;
- break;
- case DBVT_WORD:
- dbv.wVal = (WORD)szSetting;
- break;
- case DBVT_DWORD:
- dbv.dVal = (DWORD)szSetting;
- break;
- case DBVT_ASCIIZ:
- dbv.pszVal = pstr = szSetting;
- break;
- default:
- unspecified = 1;
- dbv.type = DBVT_DELETED;
- }
- }
- else {
- if (szModule == NULL)
- unspecified = 1;
- else {
- unspecified = db_get(hContact, szModule, szSetting, &dbv);
- bDbv = 1;
- }
- }
-
- if (!unspecified) {
- switch (dbv.type) {
- case DBVT_BYTE:
- unspecified = (special == SVS_ZEROISUNSPEC && dbv.bVal == 0);
- pstr = _itoa(special == SVS_SIGNED ? dbv.cVal : dbv.bVal, str, 10);
- break;
-
- case DBVT_WORD:
- if (special == SVS_ICQVERSION) {
- if (dbv.wVal != 0) {
- char szExtra[80];
-
- mir_snprintf(str, SIZEOF(str), "%d", dbv.wVal);
- pstr = str;
-
- if (hContact && ppro->IsDirectConnectionOpen(hContact, DIRECTCONN_STANDARD, 1)) {
- ICQTranslateUtfStatic(LPGEN(" (DC Established)"), szExtra, SIZEOF(szExtra));
- strcat(str, (char*)szExtra);
- bUtf = 1;
- }
- }
- else
- unspecified = 1;
- }
- else if (special == SVS_STATUSID) {
- char *pszStatus = MirandaStatusToStringUtf(dbv.wVal);
- BYTE bXStatus = ppro->getContactXStatus(hContact);
-
- if (bXStatus) {
- char *pXName = ppro->getSettingStringUtf(hContact, DBSETTING_XSTATUS_NAME, NULL);
- if (pXName == NULL) // give default name
- pXName = ICQTranslateUtf(nameXStatus[bXStatus - 1]);
-
- mir_snprintf(str, SIZEOF(str), "%s (%s)", pszStatus, pXName);
- SAFE_FREE((void**)&pXName);
- }
- else strncpy_s(str, pszStatus, _TRUNCATE);
-
- bUtf = 1;
- SAFE_FREE(&pszStatus);
- pstr = str;
- unspecified = 0;
- }
- else {
- unspecified = (special == SVS_ZEROISUNSPEC && dbv.wVal == 0);
- pstr = _itoa(special == SVS_SIGNED ? dbv.sVal : dbv.wVal, str, 10);
- }
- break;
-
- case DBVT_DWORD:
- unspecified = (special == SVS_ZEROISUNSPEC && dbv.dVal == 0);
- if (special == SVS_IP) {
- struct in_addr ia;
- ia.S_un.S_addr = htonl(dbv.dVal);
- pstr = inet_ntoa(ia);
- if (dbv.dVal == 0)
- unspecified = 1;
- }
- else if (special == SVS_TIMESTAMP) {
- if (dbv.dVal == 0)
- unspecified = 1;
- else
- pstr = time2text(dbv.dVal);
- }
- else
- pstr = _itoa(special == SVS_SIGNED ? dbv.lVal : dbv.dVal, str, 10);
- break;
-
- case DBVT_ASCIIZ:
- case DBVT_WCHAR:
- unspecified = (special == SVS_ZEROISUNSPEC && dbv.pszVal[0] == '\0');
- if (!unspecified && pstr != szSetting) {
- pstr = ppro->getSettingStringUtf(hContact, szModule, szSetting, NULL);
- bUtf = 1;
- bAlloc = 1;
- }
- if (idCtrl == IDC_UIN)
- SetDlgItemText(hwndDlg, IDC_UINSTATIC, TranslateT("ScreenName:"));
- break;
-
- default:
- pstr = str;
- strcpy(str, "???");
- break;
- }
- }
-
- EnableDlgItem(hwndDlg, idCtrl, !unspecified);
- if (unspecified)
- SetDlgItemText(hwndDlg, idCtrl, TranslateT("<not specified>"));
- else if (bUtf)
- SetDlgItemTextUtf(hwndDlg, idCtrl, pstr);
- else
- SetDlgItemTextA(hwndDlg, idCtrl, pstr);
-
- if (bDbv)
- db_free(&dbv);
-
- if (bAlloc)
- SAFE_FREE(&pstr);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-static INT_PTR CALLBACK IcqDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
- break;
-
- case WM_NOTIFY:
- switch (((LPNMHDR)lParam)->idFrom) {
- case 0:
- switch (((LPNMHDR)lParam)->code) {
- case PSN_PARAMCHANGED:
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, ((PSHNOTIFY*)lParam)->lParam);
- break;
-
- case PSN_INFOCHANGED:
- CIcqProto* ppro = (CIcqProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- if (!ppro)
- break;
-
- char* szProto;
- MCONTACT hContact = (MCONTACT)((LPPSHNOTIFY)lParam)->lParam;
-
- if (hContact == NULL)
- szProto = ppro->m_szModuleName;
- else
- szProto = GetContactProto(hContact);
-
- if (!szProto)
- break;
-
- SetValue(ppro, hwndDlg, IDC_UIN, hContact, szProto, UNIQUEIDSETTING, SVS_NORMAL);
- SetValue(ppro, hwndDlg, IDC_ONLINESINCE, hContact, szProto, "LogonTS", SVS_TIMESTAMP);
- SetValue(ppro, hwndDlg, IDC_IDLETIME, hContact, szProto, "IdleTS", SVS_TIMESTAMP);
- SetValue(ppro, hwndDlg, IDC_IP, hContact, szProto, "IP", SVS_IP);
- SetValue(ppro, hwndDlg, IDC_REALIP, hContact, szProto, "RealIP", SVS_IP);
-
- if (hContact) {
- SetValue(ppro, hwndDlg, IDC_PORT, hContact, szProto, "UserPort", SVS_ZEROISUNSPEC);
- SetValue(ppro, hwndDlg, IDC_VERSION, hContact, szProto, "Version", SVS_ICQVERSION);
- SetValue(ppro, hwndDlg, IDC_MIRVER, hContact, szProto, "MirVer", SVS_ZEROISUNSPEC);
- if (ppro->getByte(hContact, "ClientID", 0))
- ppro->setDword(hContact, "TickTS", 0);
- SetValue(ppro, hwndDlg, IDC_SYSTEMUPTIME, hContact, szProto, "TickTS", SVS_TIMESTAMP);
- SetValue(ppro, hwndDlg, IDC_STATUS, hContact, szProto, "Status", SVS_STATUSID);
- }
- else {
- char str[MAX_PATH];
- WORD v[4];
- CallService(MS_SYSTEM_GETFILEVERSION, 0, (LPARAM)&v);
- mir_snprintf(str, SIZEOF(str), "Miranda NG %d.%d.%d.%d (ICQ %s)", v[0], v[1], v[2], v[3], __VERSION_STRING_DOTS);
-
- SetValue(ppro, hwndDlg, IDC_PORT, hContact, (char*)DBVT_WORD, (char*)ppro->wListenPort, SVS_ZEROISUNSPEC);
- SetValue(ppro, hwndDlg, IDC_VERSION, hContact, (char*)DBVT_WORD, (char*)ICQ_VERSION, SVS_ICQVERSION);
- SetValue(ppro, hwndDlg, IDC_MIRVER, hContact, (char*)DBVT_ASCIIZ, str, SVS_ZEROISUNSPEC);
- SetDlgItemText(hwndDlg, IDC_SUPTIME, TranslateT("Member since:"));
- SetValue(ppro, hwndDlg, IDC_SYSTEMUPTIME, hContact, szProto, "MemberTS", SVS_TIMESTAMP);
- SetValue(ppro, hwndDlg, IDC_STATUS, hContact, (char*)DBVT_WORD, (char*)ppro->m_iStatus, SVS_STATUSID);
- }
- }
- }
- break;
-
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDCANCEL:
- SendMessage(GetParent(hwndDlg), msg, wParam, lParam);
- break;
- }
- break;
- }
-
- return FALSE;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-int CIcqProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam)
-{
- if ((!IsICQContact(lParam)) && lParam)
- return 0;
-
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.flags = ODPF_TCHAR | ODPF_DONTTRANSLATE;
- odp.hInstance = hInst;
- odp.dwInitParam = LPARAM(this);
- odp.pfnDlgProc = IcqDlgProc;
- odp.position = -1900000000;
- odp.ptszTitle = m_tszUserName;
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_ICQ);
- UserInfo_AddPage(wParam, &odp);
-
- if (!lParam) {
- TCHAR buf[200];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s Details"), m_tszUserName);
- odp.ptszTitle = buf;
-
- odp.position = -1899999999;
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_CHANGEINFO);
- odp.pfnDlgProc = ChangeInfoDlgProc;
- UserInfo_AddPage(wParam, &odp);
- }
- return 0;
-}
|