diff options
author | George Hazan <ghazan@miranda.im> | 2018-11-14 15:57:47 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-11-14 15:57:47 +0300 |
commit | a6b9f6570b4cb4a425f91d4694e6b027f12cc8b7 (patch) | |
tree | 86960597fbdc0025b12c4e87b8b536dd3d9910fb /plugins/NewAwaySysMod | |
parent | 28b81bbed5d8db354349fd787c3db4123e55d423 (diff) |
hContact, MODULENAME -> g_plugin
Diffstat (limited to 'plugins/NewAwaySysMod')
-rw-r--r-- | plugins/NewAwaySysMod/src/MsgEventAdded.cpp | 6 | ||||
-rw-r--r-- | plugins/NewAwaySysMod/src/Properties.cpp | 6 | ||||
-rw-r--r-- | plugins/NewAwaySysMod/src/Properties.h | 10 |
3 files changed, 11 insertions, 11 deletions
diff --git a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp index 43b596af48..6840363e3f 100644 --- a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp +++ b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp @@ -176,7 +176,7 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam) COptPage AutoreplyOptData(g_AutoreplyOptPage);
AutoreplyOptData.DBToMem();
if (dbei->eventType == EVENTTYPE_MESSAGE)
- db_set_w(hContact, MODULENAME, DB_MESSAGECOUNT, db_get_w(hContact, MODULENAME, DB_MESSAGECOUNT, 0) + 1); // increment message counter
+ g_plugin.setWord(hContact, DB_MESSAGECOUNT, g_plugin.getWord(hContact, DB_MESSAGECOUNT, 0) + 1); // increment message counter
if (AutoreplyOptData.GetValue(StatusModeList[i].DisableReplyCtlID))
return 0;
@@ -210,7 +210,7 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam) int SendCount = (int)AutoreplyOptData.GetValue(IDC_REPLYDLG_SENDCOUNT);
if ((AutoreplyOptData.GetValue(IDC_REPLYDLG_DONTSENDTOICQ) && UIN) || // an icq contact
- (SendCount != -1 && db_get_b(hContact, MODULENAME, DB_SENDCOUNT, 0) >= SendCount))
+ (SendCount != -1 && g_plugin.getByte(hContact, DB_SENDCOUNT, 0) >= SendCount))
return 0;
if ((dbei->eventType == EVENTTYPE_MESSAGE && !AutoreplyOptData.GetValue(IDC_REPLYDLG_EVENTMSG)) ||
@@ -218,7 +218,7 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam) (dbei->eventType == EVENTTYPE_FILE && !AutoreplyOptData.GetValue(IDC_REPLYDLG_EVENTFILE)))
return 0;
- db_set_b(hContact, MODULENAME, DB_SENDCOUNT, db_get_b(hContact, MODULENAME, DB_SENDCOUNT, 0) + 1);
+ g_plugin.setByte(hContact, DB_SENDCOUNT, g_plugin.getByte(hContact, DB_SENDCOUNT, 0) + 1);
GetDynamicStatMsg(hContact); // it updates VarParseData.Message needed for %extratext% in the format
TCString Reply(*(TCString*)AutoreplyOptData.GetValue(IDC_REPLYDLG_PREFIX));
if (Reply != nullptr && ServiceExists(MS_VARS_FORMATSTRING) && !g_SetAwayMsgPage.GetDBValueCopy(IDS_SAWAYMSG_DISABLEVARIABLES)) {
diff --git a/plugins/NewAwaySysMod/src/Properties.cpp b/plugins/NewAwaySysMod/src/Properties.cpp index 2d85ad477c..b746c6d6fc 100644 --- a/plugins/NewAwaySysMod/src/Properties.cpp +++ b/plugins/NewAwaySysMod/src/Properties.cpp @@ -24,9 +24,9 @@ CProtoStates g_ProtoStates; void ResetContactSettingsOnStatusChange(MCONTACT hContact)
{
- db_unset(hContact, MODULENAME, DB_REQUESTCOUNT);
- db_unset(hContact, MODULENAME, DB_SENDCOUNT);
- db_unset(hContact, MODULENAME, DB_MESSAGECOUNT);
+ g_plugin.delSetting(hContact, DB_REQUESTCOUNT);
+ g_plugin.delSetting(hContact, DB_SENDCOUNT);
+ g_plugin.delSetting(hContact, DB_MESSAGECOUNT);
}
void ResetSettingsOnStatusChange(const char *szProto = nullptr, int bResetPersonalMsgs = false, int Status = 0)
diff --git a/plugins/NewAwaySysMod/src/Properties.h b/plugins/NewAwaySysMod/src/Properties.h index fa1e083f7b..506c160076 100644 --- a/plugins/NewAwaySysMod/src/Properties.h +++ b/plugins/NewAwaySysMod/src/Properties.h @@ -421,9 +421,9 @@ public: CString Setting(Parent->ContactStatusToDBSetting(DB_IGNOREREQUESTS, IDC_MOREOPTDLG_PERSTATUSPERSONALSETTINGS));
MCONTACT hContact = (Parent->m_hContact != INVALID_CONTACT_ID) ? Parent->m_hContact : NULL;
if (m_value)
- db_set_b(hContact, MODULENAME, Setting, 1);
+ g_plugin.setByte(hContact, Setting, 1);
else
- db_unset(hContact, MODULENAME, Setting);
+ g_plugin.delSetting(hContact, Setting);
return *this;
}
@@ -445,13 +445,13 @@ public: {
CString Setting(Parent->ContactStatusToDBSetting(DB_ENABLEREPLY, IDC_MOREOPTDLG_PERSTATUSPERSONALSETTINGS));
MCONTACT hContact = (Parent->m_hContact != INVALID_CONTACT_ID) ? Parent->m_hContact : NULL;
- if (db_get_b(hContact, MODULENAME, Setting, VAL_USEDEFAULT) == m_value)
+ if (g_plugin.getByte(hContact, Setting, VAL_USEDEFAULT) == m_value)
return *this;
if (m_value != VAL_USEDEFAULT)
- db_set_b(hContact, MODULENAME, Setting, m_value != 0);
+ g_plugin.setByte(hContact, Setting, m_value != 0);
else
- db_unset(hContact, MODULENAME, Setting);
+ g_plugin.delSetting(hContact, Setting);
return *this;
}
operator int() {return db_get_b((Parent->m_hContact != INVALID_CONTACT_ID) ? Parent->m_hContact : NULL, MODULENAME, Parent->ContactStatusToDBSetting(DB_ENABLEREPLY, IDC_MOREOPTDLG_PERSTATUSPERSONALSETTINGS), Parent->m_hContact ? VAL_USEDEFAULT : AUTOREPLY_DEF_REPLY);}
|