diff options
author | George Hazan <ghazan@miranda.im> | 2018-07-24 11:11:26 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-07-24 11:11:26 +0300 |
commit | d296f9f99daf102b9af5d56690e2bd00d61c1267 (patch) | |
tree | 39311caaf80abf0b47ecb78cf94dc8157b193575 /plugins/BuddyPounce | |
parent | ffc521e5d5e9bd66feb65afe0046b3fc7e073356 (diff) |
database:
- senseless fiels ptszVal removed from DBVARIANT, pwszVal is used instead;
- if you want db_get to return a string, you need to use db_get_s.
Diffstat (limited to 'plugins/BuddyPounce')
-rw-r--r-- | plugins/BuddyPounce/src/dialog.cpp | 8 | ||||
-rw-r--r-- | plugins/BuddyPounce/src/main.cpp | 14 |
2 files changed, 11 insertions, 11 deletions
diff --git a/plugins/BuddyPounce/src/dialog.cpp b/plugins/BuddyPounce/src/dialog.cpp index 727d9107d1..430f6359c5 100644 --- a/plugins/BuddyPounce/src/dialog.cpp +++ b/plugins/BuddyPounce/src/dialog.cpp @@ -66,11 +66,11 @@ void getDefaultMessage(HWND hwnd, UINT control, MCONTACT hContact) {
DBVARIANT dbv;
if (!db_get_ws(hContact, MODULENAME, "PounceMsg", &dbv)) {
- SetDlgItemText(hwnd, control, dbv.ptszVal);
+ SetDlgItemText(hwnd, control, dbv.pwszVal);
db_free(&dbv);
}
else if (!db_get_ws(NULL, MODULENAME, "PounceMsg", &dbv)) {
- SetDlgItemText(hwnd, control, dbv.ptszVal);
+ SetDlgItemText(hwnd, control, dbv.pwszVal);
db_free(&dbv);
}
}
@@ -513,7 +513,7 @@ INT_PTR CALLBACK SendPounceDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP if (db_get_ws(spdps->hContact, MODULENAME, "PounceMsg", &dbv))
DestroyWindow(hwnd);
else {
- SetDlgItemText(hwnd, IDC_MESSAGE, dbv.ptszVal);
+ SetDlgItemText(hwnd, IDC_MESSAGE, dbv.pwszVal);
db_free(&dbv);
}
}
@@ -570,7 +570,7 @@ INT_PTR CALLBACK PounceSentDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP if (db_get_ws(hContact, MODULENAME, "PounceMsg", &dbv))
DestroyWindow(hwnd);
else {
- SetDlgItemText(hwnd, IDC_MESSAGE, dbv.ptszVal);
+ SetDlgItemText(hwnd, IDC_MESSAGE, dbv.pwszVal);
db_free(&dbv);
}
}
diff --git a/plugins/BuddyPounce/src/main.cpp b/plugins/BuddyPounce/src/main.cpp index 41853700b2..53e56be61a 100644 --- a/plugins/BuddyPounce/src/main.cpp +++ b/plugins/BuddyPounce/src/main.cpp @@ -50,8 +50,8 @@ int MsgAck(WPARAM, LPARAM lParam) DBEVENTINFO dbei = {};
DBVARIANT dbv;
int reuse = db_get_b(ack->hContact, MODULENAME, "Reuse", 0);
- if (!db_get_ws(ack->hContact, MODULENAME, "PounceMsg", &dbv) && (dbv.ptszVal[0] != '\0')) {
- T2Utf pszUtf(dbv.ptszVal);
+ if (!db_get_ws(ack->hContact, MODULENAME, "PounceMsg", &dbv) && (dbv.pwszVal[0] != '\0')) {
+ T2Utf pszUtf(dbv.pwszVal);
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.flags = DBEF_UTF | DBEF_SENT;
dbei.szModule = (char*)ack->szModule;
@@ -141,7 +141,7 @@ int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) if (newStatus != oldStatus && hContact != NULL && newStatus != ID_STATUS_OFFLINE) {
DBVARIANT dbv;
- if (!db_get_ws(hContact, MODULENAME, "PounceMsg", &dbv) && (dbv.ptszVal[0] != '\0')) {
+ if (!db_get_ws(hContact, MODULENAME, "PounceMsg", &dbv) && (dbv.pwszVal[0] != '\0')) {
// check my status
if (statusCheck(db_get_w(hContact, MODULENAME, "SendIfMyStatusIsFLAG", 0), Proto_GetStatus(szProto))
// check the contacts status
@@ -150,14 +150,14 @@ int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) if (CheckDate(hContact)) {
if (db_get_w(hContact, MODULENAME, "ConfirmTimeout", 0)) {
SendPounceDlgProcStruct *spdps = (SendPounceDlgProcStruct *)mir_alloc(sizeof(SendPounceDlgProcStruct));
- wchar_t *message = mir_wstrdup(dbv.ptszVal); // will get free()ed in the send confirm window proc
+ wchar_t *message = mir_wstrdup(dbv.pwszVal); // will get free()ed in the send confirm window proc
spdps->hContact = hContact;
spdps->message = message;
CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_CONFIRMSEND), nullptr, SendPounceDlgProc, (LPARAM)spdps);
// set the confirmation window to send the msg when the timeout is done
mir_free(message);
}
- else SendPounce(dbv.ptszVal, hContact);
+ else SendPounce(dbv.pwszVal, hContact);
}
}
db_free(&dbv);
@@ -196,9 +196,9 @@ INT_PTR AddToPounce(WPARAM wParam, LPARAM lParam) DBVARIANT dbv;
if (!db_get_ws(hContact, MODULENAME, "PounceMsg", &dbv))
{
- wchar_t* newPounce = (wchar_t*)mir_alloc(mir_wstrlen(dbv.ptszVal) + mir_wstrlen(message) + 1);
+ wchar_t* newPounce = (wchar_t*)mir_alloc(mir_wstrlen(dbv.pwszVal) + mir_wstrlen(message) + 1);
if (!newPounce) return 1;
- mir_wstrcpy(newPounce, dbv.ptszVal);
+ mir_wstrcpy(newPounce, dbv.pwszVal);
mir_wstrcat(newPounce, message);
db_set_ws(hContact, MODULENAME, "PounceMsg", newPounce);
mir_free(newPounce);
|