diff options
Diffstat (limited to 'plugins/Nudge/src/nudge.cpp')
-rw-r--r-- | plugins/Nudge/src/nudge.cpp | 69 |
1 files changed, 30 insertions, 39 deletions
diff --git a/plugins/Nudge/src/nudge.cpp b/plugins/Nudge/src/nudge.cpp index 51b6af9824..5c83b6cfe9 100644 --- a/plugins/Nudge/src/nudge.cpp +++ b/plugins/Nudge/src/nudge.cpp @@ -4,7 +4,7 @@ void CNudge::Save(void) {
char SectionName[512];
mir_snprintf(SectionName,512,"useByProtocol");
- DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->useByProtocol);
+ db_set_b(NULL, "Nudge", SectionName, this->useByProtocol);
mir_snprintf(SectionName,512,"RecvTimeSec");
db_set_dw(NULL, "Nudge", SectionName, this->recvTimeSec);
mir_snprintf(SectionName,512,"SendTimeSec");
@@ -18,51 +18,42 @@ void CNudge::Load(void) {
char SectionName[512];
mir_snprintf(SectionName,512,"useByProtocol");
- this->useByProtocol = DBGetContactSettingByte(NULL, "Nudge", SectionName, FALSE) != 0;
+ this->useByProtocol = db_get_b(NULL, "Nudge", SectionName, FALSE) != 0;
mir_snprintf(SectionName,512,"RecvTimeSec");
- this->recvTimeSec = DBGetContactSettingDword(NULL, "Nudge", SectionName, 30);
+ this->recvTimeSec = db_get_dw(NULL, "Nudge", SectionName, 30);
mir_snprintf(SectionName,512,"SendTimeSec");
- this->sendTimeSec = DBGetContactSettingDword(NULL, "Nudge", SectionName, 30);
+ this->sendTimeSec = db_get_dw(NULL, "Nudge", SectionName, 30);
mir_snprintf(SectionName,512,"ResendDelaySec");
- this->resendDelaySec = DBGetContactSettingDword(NULL, "Nudge", SectionName, 3);
-}
-
-int CNudgeElement::ShowContactMenu(bool show)
-{
- CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = show? CMIM_FLAGS : CMIM_FLAGS | CMIF_HIDDEN ;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hContactMenu, (LPARAM)&mi);
-
- return 0;
+ this->resendDelaySec = db_get_dw(NULL, "Nudge", SectionName, 3);
}
void CNudgeElement::Save(void)
{
char SectionName[512];
mir_snprintf(SectionName,512,"%s-openMessageWindow", ProtocolName);
- DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->openMessageWindow);
+ db_set_b(NULL, "Nudge", SectionName, this->openMessageWindow);
mir_snprintf(SectionName,512,"%s-openContactList", ProtocolName);
- DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->openContactList);
+ db_set_b(NULL, "Nudge", SectionName, this->openContactList);
mir_snprintf(SectionName,512,"%s-useIgnore", ProtocolName);
- DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->useIgnoreSettings);
+ db_set_b(NULL, "Nudge", SectionName, this->useIgnoreSettings);
mir_snprintf(SectionName,512,"%s-showStatus", ProtocolName);
- DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->showStatus);
+ db_set_b(NULL, "Nudge", SectionName, this->showStatus);
mir_snprintf(SectionName,512,"%s-showPopup", ProtocolName);
- DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->showPopup);
+ db_set_b(NULL, "Nudge", SectionName, this->showPopup);
mir_snprintf(SectionName,512,"%s-shakeClist", ProtocolName);
- DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->shakeClist);
+ db_set_b(NULL, "Nudge", SectionName, this->shakeClist);
mir_snprintf(SectionName,512,"%s-shakeChat", ProtocolName);
- DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->shakeChat);
+ db_set_b(NULL, "Nudge", SectionName, this->shakeChat);
mir_snprintf(SectionName,512,"%s-enabled", ProtocolName);
- DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->enabled);
+ db_set_b(NULL, "Nudge", SectionName, this->enabled);
mir_snprintf(SectionName,512,"%s-autoResend", ProtocolName);
- DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->autoResend);
+ db_set_b(NULL, "Nudge", SectionName, this->autoResend);
mir_snprintf(SectionName,512,"%s-statusFlags", ProtocolName);
db_set_dw(NULL, "Nudge", SectionName, this->statusFlags);
mir_snprintf(SectionName,512,"%s-recText", ProtocolName);
- DBWriteContactSettingTString(NULL, "Nudge", SectionName, this->recText);
+ db_set_ts(NULL, "Nudge", SectionName, this->recText);
mir_snprintf(SectionName,512,"%s-senText", ProtocolName);
- DBWriteContactSettingTString(NULL, "Nudge", SectionName, this->senText);
+ db_set_ts(NULL, "Nudge", SectionName, this->senText);
}
@@ -71,42 +62,42 @@ void CNudgeElement::Load(void) DBVARIANT dbv;
char SectionName[512];
mir_snprintf(SectionName,512,"%s-openMessageWindow", ProtocolName);
- this->openMessageWindow = DBGetContactSettingByte(NULL, "Nudge", SectionName, TRUE) != 0;
+ this->openMessageWindow = db_get_b(NULL, "Nudge", SectionName, TRUE) != 0;
mir_snprintf(SectionName,512,"%s-openContactList", ProtocolName);
- this->openContactList = DBGetContactSettingByte(NULL, "Nudge", SectionName, TRUE) != 0;
+ this->openContactList = db_get_b(NULL, "Nudge", SectionName, TRUE) != 0;
mir_snprintf(SectionName,512,"%s-useIgnore", ProtocolName);
- this->useIgnoreSettings = DBGetContactSettingByte(NULL, "Nudge", SectionName, TRUE) != 0;
+ this->useIgnoreSettings = db_get_b(NULL, "Nudge", SectionName, TRUE) != 0;
mir_snprintf(SectionName,512,"%s-showStatus", ProtocolName);
- this->showStatus = DBGetContactSettingByte(NULL, "Nudge", SectionName, TRUE) != 0;
+ this->showStatus = db_get_b(NULL, "Nudge", SectionName, TRUE) != 0;
mir_snprintf(SectionName,512,"%s-showPopup", ProtocolName);
- this->showPopup = DBGetContactSettingByte(NULL, "Nudge", SectionName, TRUE) != 0;
+ this->showPopup = db_get_b(NULL, "Nudge", SectionName, TRUE) != 0;
mir_snprintf(SectionName,512,"%s-shakeClist", ProtocolName);
- this->shakeClist = DBGetContactSettingByte(NULL, "Nudge", SectionName, TRUE) != 0;
+ this->shakeClist = db_get_b(NULL, "Nudge", SectionName, TRUE) != 0;
mir_snprintf(SectionName,512,"%s-shakeChat", ProtocolName);
- this->shakeChat = DBGetContactSettingByte(NULL, "Nudge", SectionName, TRUE) != 0;
+ this->shakeChat = db_get_b(NULL, "Nudge", SectionName, TRUE) != 0;
mir_snprintf(SectionName,512,"%s-enabled", ProtocolName);
- this->enabled = DBGetContactSettingByte(NULL, "Nudge", SectionName, TRUE) != 0;
+ this->enabled = db_get_b(NULL, "Nudge", SectionName, TRUE) != 0;
mir_snprintf(SectionName,512,"%s-autoResend", ProtocolName);
- this->autoResend = DBGetContactSettingByte(NULL, "Nudge", SectionName, FALSE) != 0;
+ this->autoResend = db_get_b(NULL, "Nudge", SectionName, FALSE) != 0;
mir_snprintf(SectionName,512,"%s-statusFlags", ProtocolName);
- this->statusFlags = DBGetContactSettingDword(NULL, "Nudge", SectionName, 967);
+ this->statusFlags = db_get_dw(NULL, "Nudge", SectionName, 967);
mir_snprintf(SectionName,512,"%s-recText", ProtocolName);
- if (!DBGetContactSettingTString(NULL,"Nudge",SectionName,&dbv))
+ if (!db_get_ts(NULL,"Nudge",SectionName,&dbv))
{
_tcsncpy(this->recText,dbv.ptszVal,TEXT_LEN);
if(_tcsclen(this->recText) < 1)
_tcsncpy(this->recText,TranslateT("You received a nudge"),TEXT_LEN);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
_tcsncpy(this->recText,TranslateT("You received a nudge"),TEXT_LEN);
mir_snprintf(SectionName,512,"%s-senText", ProtocolName);
- if (!DBGetContactSettingTString(NULL,"Nudge",SectionName,&dbv))
+ if (!db_get_ts(NULL,"Nudge",SectionName,&dbv))
{
_tcsncpy(this->senText,dbv.ptszVal,TEXT_LEN);
if(_tcsclen(this->senText) < 1)
_tcsncpy(this->senText,TranslateT("You sent a nudge"),TEXT_LEN);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
_tcsncpy(this->senText,TranslateT("You sent a nudge"),TEXT_LEN);
|