Exemplo n.º 1
0
	void OnRequestClick(CCtrlButton*)
	{
		if (IDYES != MessageBox(NULL, TranslateT(szAskSendSms), PRODUCT_NAME, MB_YESNO))
			return;

		ptrA cc(m_cc.GetTextA()), number(m_login.GetTextA());
		string password;
		if (m_proto->Register(REG_STATE_REQ_CODE, string(cc), string(number), string(), password)) {
			if (!password.empty()) {
				MessageBox(NULL, TranslateT(szPasswordSet), PRODUCT_NAME, MB_ICONWARNING);
				m_proto->setString(WHATSAPP_KEY_PASS, password.c_str());
			}
			else {
				m_pw1.Enable(); // unblock sms code entry field
				m_pw2.Enable();
			}
		}
	}
Exemplo n.º 2
0
	void OnRegisterClick(CCtrlButton*)
	{
		if (GetWindowTextLength(m_pw1.GetHwnd()) != 3 || GetWindowTextLength(m_pw2.GetHwnd()) != 3) {
			MessageBox(NULL, TranslateT("Please correctly specify your registration code received by SMS"), PRODUCT_NAME, MB_ICONEXCLAMATION);
			return;
		}

		char code[10];
		GetWindowTextA(m_pw1.GetHwnd(), code, 4);
		GetWindowTextA(m_pw2.GetHwnd(), code + 3, 4);

		string password;
		ptrA cc(m_cc.GetTextA()), number(m_login.GetTextA());
		if (m_proto->Register(REG_STATE_REG_CODE, string(cc), string(number), string(code), password)) {
			m_proto->setString(WHATSAPP_KEY_PASS, password.c_str());
			MessageBox(NULL, TranslateT(szPasswordSet), PRODUCT_NAME, MB_ICONWARNING);
		}
	}
Exemplo n.º 3
0
	void btnOk_OnClick(CCtrlButton*)
	{
		m_proto->m_szInviteJids.clear();

		// invite users from clist
		for (MCONTACT hContact = db_find_first(m_proto->m_szModuleName); hContact; hContact = db_find_next(hContact, m_proto->m_szModuleName)) {
			if (m_proto->isChatRoom(hContact))
				continue;

			if (HANDLE hItem = m_clc.FindContact(hContact)) {
				if (m_clc.GetCheck(hItem)) {
					ptrA jid(m_proto->getStringA(hContact, "ID"));
					if (jid != NULL)
						m_proto->m_szInviteJids.push_back((char*)jid);
				}
			}
		}

		ptrA tszText(m_entry.GetTextA());
		if (tszText != NULL)
			m_proto->m_szInviteJids.push_back(string(tszText));
	}