summaryrefslogtreecommitdiff
path: root/protocols/Omegle/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-11-12 21:44:56 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-11-12 21:44:56 +0300
commit53fe3e46177d17b4941610de19f5cc6210700cb4 (patch)
treeb67a6bc208dad141f9db14035cd7e42ff2a51872 /protocols/Omegle/src
parent488214ac8af0c4aeb1a5c1d8fd48368daaf4c4c7 (diff)
db_* functions replaced with g_plugin calls
Diffstat (limited to 'protocols/Omegle/src')
-rw-r--r--protocols/Omegle/src/chat.cpp2
-rw-r--r--protocols/Omegle/src/communication.cpp18
-rw-r--r--protocols/Omegle/src/dialogs.cpp22
3 files changed, 21 insertions, 21 deletions
diff --git a/protocols/Omegle/src/chat.cpp b/protocols/Omegle/src/chat.cpp
index ad42a0601f..3c47ff23dd 100644
--- a/protocols/Omegle/src/chat.cpp
+++ b/protocols/Omegle/src/chat.cpp
@@ -287,7 +287,7 @@ void OmegleProto::SetChatStatus(int status)
facy.nick_ = db_get_wsa(NULL, m_szModuleName, OMEGLE_KEY_NAME);
if (facy.nick_ == NULL) {
facy.nick_ = mir_wstrdup(TranslateT("You"));
- db_set_ws(NULL, m_szModuleName, OMEGLE_KEY_NAME, facy.nick_);
+ db_set_ws(0, m_szModuleName, OMEGLE_KEY_NAME, facy.nick_);
}
// Add self contact
diff --git a/protocols/Omegle/src/communication.cpp b/protocols/Omegle/src/communication.cpp
index 096656e31a..2f8ab42bd5 100644
--- a/protocols/Omegle/src/communication.cpp
+++ b/protocols/Omegle/src/communication.cpp
@@ -146,7 +146,7 @@ bool Omegle_client::handle_error(const std::string &method, bool force_disconnec
if (force_disconnect)
result = false;
- else if (error_count_ <= (UINT)db_get_b(NULL, parent->m_szModuleName, OMEGLE_KEY_TIMEOUTS_LIMIT, OMEGLE_TIMEOUTS_LIMIT))
+ else if (error_count_ <= (UINT)db_get_b(0, parent->m_szModuleName, OMEGLE_KEY_TIMEOUTS_LIMIT, OMEGLE_TIMEOUTS_LIMIT))
result = true;
else
result = false;
@@ -167,7 +167,7 @@ std::string Omegle_client::get_server(bool not_last)
{
int q = not_last ? 1 : 0;
- int server = db_get_b(NULL, parent->m_szModuleName, OMEGLE_KEY_SERVER, 0);
+ int server = db_get_b(0, parent->m_szModuleName, OMEGLE_KEY_SERVER, 0);
if (server < 0 || server >= (int)(_countof(servers) - q))
server = 0;
@@ -181,7 +181,7 @@ std::string Omegle_client::get_server(bool not_last)
std::string Omegle_client::get_language()
{
- int language = db_get_b(NULL, parent->m_szModuleName, OMEGLE_KEY_LANGUAGE, 0);
+ int language = db_get_b(0, parent->m_szModuleName, OMEGLE_KEY_LANGUAGE, 0);
if (language < 0 || language >= (_countof(languages)))
language = 0;
@@ -314,10 +314,10 @@ bool Omegle_client::start()
else {
data = "&ask=" + utils::url::encode(this->question_);
data += "&cansavequestion=";
- data += db_get_b(NULL, parent->m_szModuleName, OMEGLE_KEY_REUSE_QUESTION, 0) ? "1" : "0";
+ data += db_get_b(0, parent->m_szModuleName, OMEGLE_KEY_REUSE_QUESTION, 0) ? "1" : "0";
}
}
- else if (db_get_b(NULL, parent->m_szModuleName, OMEGLE_KEY_MEET_COMMON, 0))
+ else if (db_get_b(0, parent->m_szModuleName, OMEGLE_KEY_MEET_COMMON, 0))
{
DBVARIANT dbv;
if (!db_get_utf(NULL, parent->m_szModuleName, OMEGLE_KEY_INTERESTS, &dbv))
@@ -363,7 +363,7 @@ bool Omegle_client::start()
}
}
- if (db_get_b(NULL, parent->m_szModuleName, OMEGLE_KEY_SERVER_INFO, 0))
+ if (db_get_b(0, parent->m_szModuleName, OMEGLE_KEY_SERVER_INFO, 0))
{
std::string count = get_page(OMEGLE_REQUEST_COUNT);
if (!count.empty()) {
@@ -598,7 +598,7 @@ bool Omegle_client::events()
Srmm_SetStatusText(parent->GetChatHandle(), nullptr);
// Stranger disconnected
- if (db_get_b(NULL, parent->m_szModuleName, OMEGLE_KEY_DONT_STOP, 0))
+ if (db_get_b(0, parent->m_szModuleName, OMEGLE_KEY_DONT_STOP, 0))
{
Skin_PlaySound("StrangerChange");
parent->NewChat();
@@ -616,7 +616,7 @@ bool Omegle_client::events()
parent->UpdateChat(nullptr, strT);
// Stranger disconnected
- if (db_get_b(NULL, parent->m_szModuleName, OMEGLE_KEY_DONT_STOP, 0))
+ if (db_get_b(0, parent->m_szModuleName, OMEGLE_KEY_DONT_STOP, 0))
{
Skin_PlaySound("StrangerChange");
parent->NewChat();
@@ -644,7 +644,7 @@ bool Omegle_client::events()
if (newStranger && !spy_mode_) {
// We got new stranger in this event, lets say him "Hi message" if enabled
- if (db_get_b(NULL, parent->m_szModuleName, OMEGLE_KEY_HI_ENABLED, 0)) {
+ if (db_get_b(0, parent->m_szModuleName, OMEGLE_KEY_HI_ENABLED, 0)) {
DBVARIANT dbv;
if (!db_get_utf(NULL, parent->m_szModuleName, OMEGLE_KEY_HI, &dbv)) {
std::vector<std::string> messages;
diff --git a/protocols/Omegle/src/dialogs.cpp b/protocols/Omegle/src/dialogs.cpp
index e972efa885..06e4504721 100644
--- a/protocols/Omegle/src/dialogs.cpp
+++ b/protocols/Omegle/src/dialogs.cpp
@@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
static BOOL LoadDBCheckState(OmegleProto* ppro, HWND hwnd, int idCtrl, const char* szSetting, BYTE bDef = 0)
{
- BOOL state = db_get_b(NULL, ppro->m_szModuleName, szSetting, bDef);
+ BOOL state = db_get_b(0, ppro->m_szModuleName, szSetting, bDef);
CheckDlgButton(hwnd, idCtrl, state ? BST_CHECKED : BST_UNCHECKED);
return state;
}
@@ -32,7 +32,7 @@ static BOOL LoadDBCheckState(OmegleProto* ppro, HWND hwnd, int idCtrl, const cha
static BOOL StoreDBCheckState(OmegleProto* ppro, HWND hwnd, int idCtrl, const char* szSetting)
{
BOOL state = IsDlgButtonChecked(hwnd, idCtrl);
- db_set_b(NULL, ppro->m_szModuleName, szSetting, (BYTE)state);
+ db_set_b(0, ppro->m_szModuleName, szSetting, (BYTE)state);
return state;
}
@@ -49,7 +49,7 @@ static void StoreDBText(OmegleProto* ppro, HWND hwnd, int idCtrl, const char* sz
GetDlgItemText(hwnd, idCtrl, tstr, _countof(tstr));
if (tstr[0] != '\0')
- db_set_ws(NULL, ppro->m_szModuleName, szSetting, tstr);
+ db_set_ws(0, ppro->m_szModuleName, szSetting, tstr);
else
db_unset(NULL, ppro->m_szModuleName, szSetting);
}
@@ -71,12 +71,12 @@ INT_PTR CALLBACK OmegleAccountProc(HWND hwnd, UINT message, WPARAM wparam, LPARA
SendDlgItemMessageA(hwnd, IDC_SERVER, CB_INSERTSTRING, 0, reinterpret_cast<LPARAM>(Translate(servers[0])));
for (size_t i = 1; i < _countof(servers); i++)
SendDlgItemMessageA(hwnd, IDC_SERVER, CB_INSERTSTRING, i, reinterpret_cast<LPARAM>(servers[i]));
- SendDlgItemMessage(hwnd, IDC_SERVER, CB_SETCURSEL, db_get_b(NULL, proto->m_szModuleName, OMEGLE_KEY_SERVER, 0), 0);
+ SendDlgItemMessage(hwnd, IDC_SERVER, CB_SETCURSEL, db_get_b(0, proto->m_szModuleName, OMEGLE_KEY_SERVER, 0), 0);
// Language
for (size_t i = 0; i < _countof(languages); i++)
SendDlgItemMessageA(hwnd, IDC_LANGUAGE, CB_INSERTSTRING, i, reinterpret_cast<LPARAM>(Translate(languages[i].lang)));
- SendDlgItemMessage(hwnd, IDC_LANGUAGE, CB_SETCURSEL, db_get_b(NULL, proto->m_szModuleName, OMEGLE_KEY_LANGUAGE, 0), 0);
+ SendDlgItemMessage(hwnd, IDC_LANGUAGE, CB_SETCURSEL, db_get_b(0, proto->m_szModuleName, OMEGLE_KEY_LANGUAGE, 0), 0);
LoadDBText(proto, hwnd, IDC_NAME, OMEGLE_KEY_NAME);
LoadDBText(proto, hwnd, IDC_INTERESTS, OMEGLE_KEY_INTERESTS);
@@ -110,8 +110,8 @@ INT_PTR CALLBACK OmegleAccountProc(HWND hwnd, UINT message, WPARAM wparam, LPARA
if (reinterpret_cast<NMHDR*>(lparam)->code == PSN_APPLY) {
proto = reinterpret_cast<OmegleProto*>(GetWindowLongPtr(hwnd, GWLP_USERDATA));
- db_set_b(NULL, proto->m_szModuleName, OMEGLE_KEY_SERVER, SendDlgItemMessage(hwnd, IDC_SERVER, CB_GETCURSEL, 0, 0));
- db_set_b(NULL, proto->m_szModuleName, OMEGLE_KEY_LANGUAGE, SendDlgItemMessage(hwnd, IDC_LANGUAGE, CB_GETCURSEL, 0, 0));
+ db_set_b(0, proto->m_szModuleName, OMEGLE_KEY_SERVER, SendDlgItemMessage(hwnd, IDC_SERVER, CB_GETCURSEL, 0, 0));
+ db_set_b(0, proto->m_szModuleName, OMEGLE_KEY_LANGUAGE, SendDlgItemMessage(hwnd, IDC_LANGUAGE, CB_GETCURSEL, 0, 0));
StoreDBText(proto, hwnd, IDC_NAME, OMEGLE_KEY_NAME);
StoreDBText(proto, hwnd, IDC_INTERESTS, OMEGLE_KEY_INTERESTS);
@@ -142,12 +142,12 @@ INT_PTR CALLBACK OmegleOptionsProc(HWND hwnd, UINT message, WPARAM wparam, LPARA
SendDlgItemMessageA(hwnd, IDC_SERVER, CB_INSERTSTRING, 0, reinterpret_cast<LPARAM>(Translate(servers[0])));
for (size_t i = 1; i < _countof(servers); i++)
SendDlgItemMessageA(hwnd, IDC_SERVER, CB_INSERTSTRING, i, reinterpret_cast<LPARAM>(servers[i]));
- SendDlgItemMessage(hwnd, IDC_SERVER, CB_SETCURSEL, db_get_b(NULL, proto->m_szModuleName, OMEGLE_KEY_SERVER, 0), 0);
+ SendDlgItemMessage(hwnd, IDC_SERVER, CB_SETCURSEL, db_get_b(0, proto->m_szModuleName, OMEGLE_KEY_SERVER, 0), 0);
// Language
for (size_t i = 0; i < _countof(languages); i++)
SendDlgItemMessageA(hwnd, IDC_LANGUAGE, CB_INSERTSTRING, i, reinterpret_cast<LPARAM>(Translate(languages[i].lang)));
- SendDlgItemMessage(hwnd, IDC_LANGUAGE, CB_SETCURSEL, db_get_b(NULL, proto->m_szModuleName, OMEGLE_KEY_LANGUAGE, 0), 0);
+ SendDlgItemMessage(hwnd, IDC_LANGUAGE, CB_SETCURSEL, db_get_b(0, proto->m_szModuleName, OMEGLE_KEY_LANGUAGE, 0), 0);
LoadDBText(proto, hwnd, IDC_NAME, OMEGLE_KEY_NAME);
LoadDBText(proto, hwnd, IDC_INTERESTS, OMEGLE_KEY_INTERESTS);
@@ -198,8 +198,8 @@ INT_PTR CALLBACK OmegleOptionsProc(HWND hwnd, UINT message, WPARAM wparam, LPARA
if (reinterpret_cast<NMHDR*>(lparam)->code == PSN_APPLY) {
proto = reinterpret_cast<OmegleProto*>(GetWindowLongPtr(hwnd, GWLP_USERDATA));
- db_set_b(NULL, proto->m_szModuleName, OMEGLE_KEY_SERVER, SendDlgItemMessage(hwnd, IDC_SERVER, CB_GETCURSEL, 0, 0));
- db_set_b(NULL, proto->m_szModuleName, OMEGLE_KEY_LANGUAGE, SendDlgItemMessage(hwnd, IDC_LANGUAGE, CB_GETCURSEL, 0, 0));
+ db_set_b(0, proto->m_szModuleName, OMEGLE_KEY_SERVER, SendDlgItemMessage(hwnd, IDC_SERVER, CB_GETCURSEL, 0, 0));
+ db_set_b(0, proto->m_szModuleName, OMEGLE_KEY_LANGUAGE, SendDlgItemMessage(hwnd, IDC_LANGUAGE, CB_GETCURSEL, 0, 0));
StoreDBText(proto, hwnd, IDC_NAME, OMEGLE_KEY_NAME);
StoreDBText(proto, hwnd, IDC_INTERESTS, OMEGLE_KEY_INTERESTS);