summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-07-10 20:25:14 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-07-10 20:25:14 +0000
commite0541caf997ee59ed3d06485001476fcca429f86 (patch)
treef38a912ad271c7199c3bb386bc8f850e5d3d588b
parent1b8c910296597f394c0996017cfe4095fb55568d (diff)
protocol DB helpers for MSN
git-svn-id: http://svn.miranda-ng.org/main/trunk@5319 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/MSN/src/msn_auth.cpp2
-rw-r--r--protocols/MSN/src/msn_commands.cpp22
-rw-r--r--protocols/MSN/src/msn_contact.cpp8
-rw-r--r--protocols/MSN/src/msn_menu.cpp2
-rw-r--r--protocols/MSN/src/msn_misc.cpp6
-rw-r--r--protocols/MSN/src/msn_opts.cpp127
-rw-r--r--protocols/MSN/src/msn_p2p.cpp2
-rw-r--r--protocols/MSN/src/msn_proto.cpp14
-rw-r--r--protocols/MSN/src/msn_proto.h1
-rw-r--r--protocols/MSN/src/msn_soapab.cpp14
-rw-r--r--protocols/MSN/src/msn_soapstore.cpp2
-rw-r--r--protocols/MSN/src/msn_srv.cpp8
-rw-r--r--protocols/MSN/src/msn_std.cpp4
-rw-r--r--protocols/MSN/src/msn_svcs.cpp8
14 files changed, 96 insertions, 124 deletions
diff --git a/protocols/MSN/src/msn_auth.cpp b/protocols/MSN/src/msn_auth.cpp
index 178d36763c..7ee1ff538e 100644
--- a/protocols/MSN/src/msn_auth.cpp
+++ b/protocols/MSN/src/msn_auth.cpp
@@ -322,7 +322,7 @@ int CMsnProto::MSN_GetPassportAuth(void)
}
}
else
- setString(NULL, "MsnPassportHost", szPassportHost);
+ setString("MsnPassportHost", szPassportHost);
mir_free(szPassportHost);
MSN_DebugLog("MSN_CheckRedirector exited with errorCode = %d", retVal);
diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp
index d696d0d709..41d622b965 100644
--- a/protocols/MSN/src/msn_commands.cpp
+++ b/protocols/MSN/src/msn_commands.cpp
@@ -419,7 +419,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
if (hContact != NULL && mirver != NULL)
{
setString(hContact, "MirVer", mirver);
- deleteSetting(hContact, "StdMirVer");
+ delSetting(hContact, "StdMirVer");
}
}
else if (!ubmMsg && !info->firstMsgRecv)
@@ -831,7 +831,7 @@ void CMsnProto::sttProcessStatusMessage(char* buf, unsigned len, const char* wli
const char* szCrntMda = ezxml_txt(ezxml_child(xmli, "CurrentMedia"));
if (!*szCrntMda)
{
- deleteSetting(hContact, "ListeningTo");
+ delSetting(hContact, "ListeningTo");
ezxml_free(xmli);
return;
}
@@ -855,7 +855,7 @@ void CMsnProto::sttProcessStatusMessage(char* buf, unsigned len, const char* wli
// Now let's mount the final string
if (pCount <= 4)
{
- deleteSetting(hContact, "ListeningTo");
+ delSetting(hContact, "ListeningTo");
ezxml_free(xmli);
return;
}
@@ -872,7 +872,7 @@ void CMsnProto::sttProcessStatusMessage(char* buf, unsigned len, const char* wli
}
if (!foundUsefullInfo)
{
- deleteSetting(hContact, "ListeningTo");
+ delSetting(hContact, "ListeningTo");
ezxml_free(xmli);
return;
}
@@ -1392,7 +1392,7 @@ LBL_InvalidCommand:
if (pszUrl)
setString(hContact, "AvatarUrl", pszUrl);
else
- deleteSetting(hContact, "AvatarUrl");
+ delSetting(hContact, "AvatarUrl");
if (hContact != NULL) {
char szSavedHash[64] = "";
@@ -1411,17 +1411,17 @@ LBL_InvalidCommand:
}
else {
remove:
- deleteSetting(hContact, "AvatarHash");
- deleteSetting(hContact, "AvatarSavedHash");
- deleteSetting(hContact, "AvatarUrl");
- deleteSetting(hContact, "PictContext");
- deleteSetting(hContact, "PictSavedContext");
+ delSetting(hContact, "AvatarHash");
+ delSetting(hContact, "AvatarSavedHash");
+ delSetting(hContact, "AvatarUrl");
+ delSetting(hContact, "PictContext");
+ delSetting(hContact, "PictSavedContext");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, 0);
}
}
else if (lastStatus == ID_STATUS_OFFLINE)
- deleteSetting(hContact, "MirVer");
+ delSetting(hContact, "MirVer");
break;
}
diff --git a/protocols/MSN/src/msn_contact.cpp b/protocols/MSN/src/msn_contact.cpp
index 93bad80d1e..630635e546 100644
--- a/protocols/MSN/src/msn_contact.cpp
+++ b/protocols/MSN/src/msn_contact.cpp
@@ -68,7 +68,7 @@ void CMsnProto::MSN_SetContactDb(HANDLE hContact, const char *szEmail)
if ((listId & LIST_BL) && tApparentMode == 0)
setWord(hContact, "ApparentMode", ID_STATUS_OFFLINE);
else if ((listId & LIST_AL) && tApparentMode != 0)
- deleteSetting(hContact, "ApparentMode");
+ delSetting(hContact, "ApparentMode");
}
if (cont->netId == NETID_MOB)
@@ -80,7 +80,7 @@ void CMsnProto::MSN_SetContactDb(HANDLE hContact, const char *szEmail)
if (listId & LIST_LL)
setByte(hContact, "LocalList", 1);
else
- deleteSetting(hContact, "LocalList");
+ delSetting(hContact, "LocalList");
}
@@ -151,8 +151,8 @@ bool CMsnProto::MSN_AddUser(HANDLE hContact, const char* email, int netId, int f
res = MSN_ABAddDelContactGroup(id , NULL, "ABContactDelete");
if (res) AddDelUserContList(email, flags, netId, true);
- deleteSetting(hContact, "GroupID");
- deleteSetting(hContact, "ID");
+ delSetting(hContact, "GroupID");
+ delSetting(hContact, "ID");
MSN_RemoveEmptyGroups();
}
}
diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp
index eb0bf372b2..1e277d2b59 100644
--- a/protocols/MSN/src/msn_menu.cpp
+++ b/protocols/MSN/src/msn_menu.cpp
@@ -40,7 +40,7 @@ INT_PTR CMsnProto::MsnBlockCommand(WPARAM wParam, LPARAM)
getStaticString(hContact, "e-mail", tEmail, sizeof(tEmail));
if (Lists_IsInList(LIST_BL, tEmail))
- deleteSetting(hContact, "ApparentMode");
+ delSetting(hContact, "ApparentMode");
else
setWord(hContact, "ApparentMode", ID_STATUS_OFFLINE);
}
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp
index 183f50c6c0..4f84bc2556 100644
--- a/protocols/MSN/src/msn_misc.cpp
+++ b/protocols/MSN/src/msn_misc.cpp
@@ -232,7 +232,7 @@ void CMsnProto::MSN_GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, size_t c
mir_free(szAvatarHash);
}
else {
- deleteSetting(hContact, "PictContext");
+ delSetting(hContact, "PictContext");
if (cbLen) pszDest[0] = 0;
}
db_free(&dbv);
@@ -382,8 +382,8 @@ int CMsnProto::MSN_SetMyAvatar(const TCHAR* sztFname, void* pData, size_t cbLen
char *szAvatarHash = arrayToHex(sha1d, sizeof(sha1d));
if (strcmp(szAvatarHashdOld, szAvatarHash))
{
- setString(NULL, "PictObject", szEncodedBuffer);
- setString(NULL, "AvatarHash", szAvatarHash);
+ setString("PictObject", szEncodedBuffer);
+ setString("AvatarHash", szAvatarHash);
}
mir_free(szAvatarHash);
}
diff --git a/protocols/MSN/src/msn_opts.cpp b/protocols/MSN/src/msn_opts.cpp
index 934e996c43..2351be7f5f 100644
--- a/protocols/MSN/src/msn_opts.cpp
+++ b/protocols/MSN/src/msn_opts.cpp
@@ -330,23 +330,21 @@ static INT_PTR CALLBACK DlgProcMsnConnOpts(HWND hwndDlg, UINT msg, WPARAM wParam
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
CMsnProto* proto = (CMsnProto*)lParam;
- if (!proto->getString(NULL, "DirectServer", &dbv))
+ if (!proto->getString("DirectServer", &dbv))
{
SetDlgItemTextA(hwndDlg, IDC_DIRECTSERVER, dbv.pszVal);
db_free(&dbv);
}
- else
- SetDlgItemTextA(hwndDlg, IDC_DIRECTSERVER, MSN_DEFAULT_LOGIN_SERVER);
+ else SetDlgItemTextA(hwndDlg, IDC_DIRECTSERVER, MSN_DEFAULT_LOGIN_SERVER);
- if (!proto->getString(NULL, "GatewayServer", &dbv))
+ if (!proto->getString("GatewayServer", &dbv))
{
SetDlgItemTextA(hwndDlg, IDC_GATEWAYSERVER, dbv.pszVal);
db_free(&dbv);
}
- else
- SetDlgItemTextA(hwndDlg, IDC_GATEWAYSERVER, MSN_DEFAULT_GATEWAY);
+ else SetDlgItemTextA(hwndDlg, IDC_GATEWAYSERVER, MSN_DEFAULT_GATEWAY);
- CheckDlgButton(hwndDlg, IDC_SLOWSEND, proto->getByte("SlowSend", 0));
+ CheckDlgButton(hwndDlg, IDC_SLOWSEND, proto->getByte("SlowSend", 0));
SendDlgItemMessage(hwndDlg, IDC_HOSTOPT, CB_ADDSTRING, 0, (LPARAM)TranslateT("Automatically obtain host/port"));
SendDlgItemMessage(hwndDlg, IDC_HOSTOPT, CB_ADDSTRING, 0, (LPARAM)TranslateT("Manually specify host/port"));
@@ -357,15 +355,12 @@ static INT_PTR CALLBACK DlgProcMsnConnOpts(HWND hwndDlg, UINT msg, WPARAM wParam
char ipaddr[256] = "";
if (gethst == 1)
- {
if (proto->getStaticString(NULL, "YourHost", ipaddr, sizeof(ipaddr)))
gethst = 0;
- }
+
if (gethst == 0)
- {
- mir_snprintf(ipaddr, sizeof(ipaddr), "%s", proto->msnLoggedIn ?
- proto->MyConnection.GetMyExtIPStr() : "");
- }
+ mir_snprintf(ipaddr, sizeof(ipaddr), "%s", proto->msnLoggedIn ? proto->MyConnection.GetMyExtIPStr() : "");
+
SendDlgItemMessage(hwndDlg, IDC_HOSTOPT, CB_SETCURSEL, gethst, 0);
if (ipaddr[0])
SetDlgItemTextA(hwndDlg, IDC_YOURHOST, ipaddr);
@@ -403,8 +398,7 @@ static INT_PTR CALLBACK DlgProcMsnConnOpts(HWND hwndDlg, UINT msg, WPARAM wParam
if (HIWORD(wParam) == BN_CLICKED)
{
- switch(LOWORD(wParam))
- {
+ switch(LOWORD(wParam)) {
case IDC_SLOWSEND:
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
@@ -422,15 +416,15 @@ static INT_PTR CALLBACK DlgProcMsnConnOpts(HWND hwndDlg, UINT msg, WPARAM wParam
GetDlgItemTextA(hwndDlg, IDC_DIRECTSERVER, str, sizeof(str));
if (strcmp(str, MSN_DEFAULT_LOGIN_SERVER))
- proto->setString(NULL, "DirectServer", str);
+ proto->setString("DirectServer", str);
else
- proto->deleteSetting(NULL, "DirectServer");
+ proto->delSetting("DirectServer");
GetDlgItemTextA(hwndDlg, IDC_GATEWAYSERVER, str, sizeof(str));
if (strcmp(str, MSN_DEFAULT_GATEWAY))
- proto->setString(NULL, "GatewayServer", str);
+ proto->setString("GatewayServer", str);
else
- proto->deleteSetting(NULL, "GatewayServer");
+ proto->delSetting("GatewayServer");
proto->setByte("SlowSend", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SLOWSEND ));
if (proto->getByte("SlowSend", FALSE))
@@ -451,15 +445,12 @@ static INT_PTR CALLBACK DlgProcMsnConnOpts(HWND hwndDlg, UINT msg, WPARAM wParam
if (gethst == 0)
{
GetDlgItemTextA(hwndDlg, IDC_YOURHOST, str, sizeof(str));
- proto->setString(NULL, "YourHost", str);
+ proto->setString("YourHost", str);
}
- else
- proto->deleteSetting(NULL, "YourHost");
+ else proto->delSetting("YourHost");
if (gethst != gethst2)
- {
proto->ForkThread(&CMsnProto::MSNConnDetectThread, NULL);
- }
if (reconnectRequired && proto->msnLoggedIn)
MessageBox(hwndDlg, TranslateT("The changes you have made require you to reconnect to the MSN Messenger network before they take effect"),
@@ -479,33 +470,28 @@ static INT_PTR CALLBACK DlgProcMsnConnOpts(HWND hwndDlg, UINT msg, WPARAM wParam
static INT_PTR CALLBACK DlgProcHotmailPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
static bool bEnabled;
+ CMsnProto* proto = (CMsnProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- switch(msg)
- {
+ switch(msg) {
case WM_INITDIALOG:
- {
- TranslateDialogDefault(hwndDlg);
- bEnabled = false;
-
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
- CMsnProto* proto = (CMsnProto*)lParam;
-
- int disableHotmailPopup = proto->getByte("DisableHotmail", 0);
+ TranslateDialogDefault(hwndDlg);
+ bEnabled = false;
- CheckDlgButton(hwndDlg, IDC_DISABLEHOTMAILPOPUP, disableHotmailPopup);
- CheckDlgButton(hwndDlg, IDC_DISABLEHOTMAILTRAY, proto->getByte("DisableHotmailTray", 1));
- CheckDlgButton(hwndDlg, IDC_DISABLEHOTMAILCL, proto->getByte("DisableHotmailCL", 0));
- CheckDlgButton(hwndDlg, IDC_DISABLEHOTJUNK, proto->getByte("DisableHotmailJunk", 0));
- CheckDlgButton(hwndDlg, IDC_NOTIFY_ENDSESSION, proto->getByte("EnableSessionPopup", 0));
- CheckDlgButton(hwndDlg, IDC_NOTIFY_FIRSTMSG, proto->getByte("EnableDeliveryPopup", 0));
- CheckDlgButton(hwndDlg, IDC_ERRORS_USING_POPUPS, proto->getByte("ShowErrorsAsPopups", 0));
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
+ proto = (CMsnProto*)lParam;
+ CheckDlgButton(hwndDlg, IDC_DISABLEHOTMAILPOPUP, proto->getByte("DisableHotmail", 0));
+ CheckDlgButton(hwndDlg, IDC_DISABLEHOTMAILTRAY, proto->getByte("DisableHotmailTray", 1));
+ CheckDlgButton(hwndDlg, IDC_DISABLEHOTMAILCL, proto->getByte("DisableHotmailCL", 0));
+ CheckDlgButton(hwndDlg, IDC_DISABLEHOTJUNK, proto->getByte("DisableHotmailJunk", 0));
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_ENDSESSION, proto->getByte("EnableSessionPopup", 0));
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_FIRSTMSG, proto->getByte("EnableDeliveryPopup", 0));
+ CheckDlgButton(hwndDlg, IDC_ERRORS_USING_POPUPS, proto->getByte("ShowErrorsAsPopups", 0));
+
+ bEnabled = true;
+ return TRUE;
- bEnabled = true;
- return TRUE;
- }
case WM_COMMAND:
- switch (LOWORD(wParam))
- {
+ switch (LOWORD(wParam)) {
case IDC_DISABLEHOTMAILPOPUP:
case IDC_DISABLEHOTMAILTRAY:
case IDC_DISABLEHOTMAILCL:
@@ -520,35 +506,27 @@ static INT_PTR CALLBACK DlgProcHotmailPopupOpts(HWND hwndDlg, UINT msg, WPARAM w
break;
case WM_NOTIFY: //Here we have pressed either the OK or the APPLY button.
- switch(((LPNMHDR)lParam)->idFrom)
- {
+ switch(((LPNMHDR)lParam)->idFrom) {
case 0:
- switch (((LPNMHDR)lParam)->code)
- {
+ switch (((LPNMHDR)lParam)->code) {
case PSN_RESET:
- {
- CMsnProto* proto = (CMsnProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- proto->LoadOptions();
- return TRUE;
- }
-
+ proto->LoadOptions();
+ return TRUE;
+
case PSN_APPLY:
- {
- CMsnProto* proto = (CMsnProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
-
- proto->MyOptions.ShowErrorsAsPopups = IsDlgButtonChecked(hwndDlg, IDC_ERRORS_USING_POPUPS) != 0;
- proto->setByte("ShowErrorsAsPopups", proto->MyOptions.ShowErrorsAsPopups);
-
- proto->setByte("DisableHotmail", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DISABLEHOTMAILPOPUP));
- proto->setByte("DisableHotmailCL", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DISABLEHOTMAILCL));
- proto->setByte("DisableHotmailTray", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DISABLEHOTMAILTRAY));
- proto->setByte("DisableHotmailJunk",(BYTE)IsDlgButtonChecked(hwndDlg, IDC_DISABLEHOTJUNK));
- proto->setByte("EnableDeliveryPopup", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_FIRSTMSG));
- proto->setByte("EnableSessionPopup", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_ENDSESSION));
-
- HANDLE hContact = proto->MSN_HContactFromEmail(proto->MyOptions.szEmail);
- if (hContact) proto->displayEmailCount(hContact);
- }
+ proto->MyOptions.ShowErrorsAsPopups = IsDlgButtonChecked(hwndDlg, IDC_ERRORS_USING_POPUPS) != 0;
+ proto->setByte("ShowErrorsAsPopups", proto->MyOptions.ShowErrorsAsPopups);
+
+ proto->setByte("DisableHotmail", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DISABLEHOTMAILPOPUP));
+ proto->setByte("DisableHotmailCL", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DISABLEHOTMAILCL));
+ proto->setByte("DisableHotmailTray", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DISABLEHOTMAILTRAY));
+ proto->setByte("DisableHotmailJunk",(BYTE)IsDlgButtonChecked(hwndDlg, IDC_DISABLEHOTJUNK));
+ proto->setByte("EnableDeliveryPopup", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_FIRSTMSG));
+ proto->setByte("EnableSessionPopup", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_ENDSESSION));
+
+ HANDLE hContact = proto->MSN_HContactFromEmail(proto->MyOptions.szEmail);
+ if (hContact)
+ proto->displayEmailCount(hContact);
return TRUE;
}
break;
@@ -561,8 +539,7 @@ static INT_PTR CALLBACK DlgProcHotmailPopupOpts(HWND hwndDlg, UINT msg, WPARAM w
static INT_PTR CALLBACK DlgProcAccMgrUI(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch(msg)
- {
+ switch(msg) {
case WM_INITDIALOG:
{
TranslateDialogDefault(hwndDlg);
@@ -638,7 +615,7 @@ static INT_PTR CALLBACK DlgProcAccMgrUI(HWND hwndDlg, UINT msg, WPARAM wParam, L
if (szPlace[0])
proto->setTString("Place", szPlace);
else
- proto->deleteSetting(NULL, "Place");
+ proto->delSetting("Place");
return TRUE;
}
diff --git a/protocols/MSN/src/msn_p2p.cpp b/protocols/MSN/src/msn_p2p.cpp
index b87455d070..9c3c60489b 100644
--- a/protocols/MSN/src/msn_p2p.cpp
+++ b/protocols/MSN/src/msn_p2p.cpp
@@ -204,7 +204,7 @@ void CMsnProto::p2p_pictureTransferFailed(filetransfer* ft)
PROTO_AVATAR_INFORMATIONT AI = {0};
AI.cbSize = sizeof(AI);
AI.hContact = ft->std.hContact;
- deleteSetting(ft->std.hContact, "AvatarHash");
+ delSetting(ft->std.hContact, "AvatarHash");
ProtoBroadcastAck(AI.hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, &AI, 0);
}
break;
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp
index 188533496d..9e8390c03e 100644
--- a/protocols/MSN/src/msn_proto.cpp
+++ b/protocols/MSN/src/msn_proto.cpp
@@ -81,19 +81,19 @@ CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) :
LoadOptions();
for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
- deleteSetting(hContact, "Status");
- deleteSetting(hContact, "IdleTS");
- deleteSetting(hContact, "p2pMsgId");
- deleteSetting(hContact, "AccList");
+ delSetting(hContact, "Status");
+ delSetting(hContact, "IdleTS");
+ delSetting(hContact, "p2pMsgId");
+ delSetting(hContact, "AccList");
}
- deleteSetting(NULL, "MobileEnabled");
- deleteSetting(NULL, "MobileAllowed");
+ delSetting("MobileEnabled");
+ delSetting("MobileAllowed");
char path[MAX_PATH];
if (getStaticString(NULL, "LoginServer", path, sizeof(path)) == 0 &&
(strcmp(path, MSN_DEFAULT_LOGIN_SERVER) == 0 ||
strcmp(path, MSN_DEFAULT_GATEWAY) == 0))
- deleteSetting(NULL, "LoginServer");
+ delSetting("LoginServer");
if (MyOptions.SlowSend) {
if (db_get_dw(NULL, "SRMsg", "MessageTimeout", 10000) < 60000)
diff --git a/protocols/MSN/src/msn_proto.h b/protocols/MSN/src/msn_proto.h
index 9e346a996e..b5bd1e8173 100644
--- a/protocols/MSN/src/msn_proto.h
+++ b/protocols/MSN/src/msn_proto.h
@@ -565,7 +565,6 @@ struct CMsnProto : public PROTO<CMsnProto>
//////////////////////////////////////////////////////////////////////////////////////
TCHAR* GetContactNameT(HANDLE hContact);
- void deleteSetting(HANDLE hContact, const char* valueName);
int getStaticString(HANDLE hContact, const char* valueName, char* dest, unsigned dest_len);
int getStringUtf(HANDLE hContact, const char* name, DBVARIANT* result);
diff --git a/protocols/MSN/src/msn_soapab.cpp b/protocols/MSN/src/msn_soapab.cpp
index 9dce4dbdae..d072097b6b 100644
--- a/protocols/MSN/src/msn_soapab.cpp
+++ b/protocols/MSN/src/msn_soapab.cpp
@@ -102,9 +102,9 @@ void CMsnProto::UpdateABHost(const char* service, const char* url)
mir_snprintf(hostname, sizeof(hostname), "ABHost-%s", service);
if (url)
- setString(NULL, hostname, url);
+ setString(hostname, url);
else
- deleteSetting(NULL, hostname);
+ delSetting(hostname);
}
void CMsnProto::UpdateABCacheKey(ezxml_t bdy, bool isSharing)
@@ -612,7 +612,7 @@ bool CMsnProto::MSN_SharingMyProfile(bool allowRecurse)
void CMsnProto::SetAbParam(HANDLE hContact, const char *name, const char *par)
{
if (*par) setStringUtf(hContact, name, (char*)par);
-// else deleteSetting(hContact, "FirstName");
+// else delSetting(hContact, "FirstName");
}
// "ABFindAll", "ABFindByContacts", "ABFindContactsPaged"
@@ -859,7 +859,7 @@ bool CMsnProto::MSN_ABFind(const char* szMethod, const char* szGuid, bool deltas
break;
default:
- deleteSetting(hContact, "Transport");
+ delSetting(hContact, "Transport");
}
szTmp = ezxml_txt(ezxml_child(contInf, "CID"));
@@ -887,9 +887,9 @@ bool CMsnProto::MSN_ABFind(const char* szMethod, const char* szGuid, bool deltas
}
else
{
- // deleteSetting(hContact, "BirthYear");
- // deleteSetting(hContact, "BirthMonth");
- // deleteSetting(hContact, "BirthDay");
+ // delSetting(hContact, "BirthYear");
+ // delSetting(hContact, "BirthMonth");
+ // delSetting(hContact, "BirthDay");
}
szTmp = ezxml_txt(ezxml_child(contInf, "comment"));
diff --git a/protocols/MSN/src/msn_soapstore.cpp b/protocols/MSN/src/msn_soapstore.cpp
index b0c7a17473..d0fffdc3d5 100644
--- a/protocols/MSN/src/msn_soapstore.cpp
+++ b/protocols/MSN/src/msn_soapstore.cpp
@@ -86,7 +86,7 @@ void CMsnProto::UpdateStoreHost(const char* service, const char* url)
char hostname[128];
mir_snprintf(hostname, sizeof(hostname), "StoreHost-%s", service);
- setString(NULL, hostname, url);
+ setString(hostname, url);
}
void CMsnProto::UpdateStoreCacheKey(ezxml_t bdy)
diff --git a/protocols/MSN/src/msn_srv.cpp b/protocols/MSN/src/msn_srv.cpp
index a3fc024b1b..5e92edd0f9 100644
--- a/protocols/MSN/src/msn_srv.cpp
+++ b/protocols/MSN/src/msn_srv.cpp
@@ -81,7 +81,7 @@ void CMsnProto::MSN_DeleteServerGroup(LPCSTR szId)
if (!getStaticString(msc->hContact, "GroupID", szGroupID, sizeof(szGroupID)))
{
if (strcmp(szGroupID, szId) == 0)
- deleteSetting(msc->hContact, "GroupID");
+ delSetting(msc->hContact, "GroupID");
}
}
MSN_DeleteGroup(szId);
@@ -171,7 +171,7 @@ void CMsnProto::MSN_MoveContactToGroup(HANDLE hContact, const char* grpName)
if (bDelete)
{
MSN_ABAddDelContactGroup(szContactID, szGroupID, "ABGroupContactDelete");
- deleteSetting(hContact, "GroupID");
+ delSetting(hContact, "GroupID");
}
if (bInsert)
@@ -307,7 +307,7 @@ void CMsnProto::MSN_SyncContactToServerGroup(HANDLE hContact, const char* szCont
{
if (szGrpName[0])
db_unset(hContact, "CList", "Group");
- deleteSetting(hContact, "GroupID");
+ delSetting(hContact, "GroupID");
}
}
@@ -319,7 +319,7 @@ void CMsnProto::MSN_SendNicknameUtf(const char* nickname)
if (nickname[0])
setStringUtf(NULL, "Nick", nickname);
else
- deleteSetting(NULL, "Nick");
+ delSetting("Nick");
MSN_SetNicknameUtf(nickname[0] ? nickname : MyOptions.szEmail);
diff --git a/protocols/MSN/src/msn_std.cpp b/protocols/MSN/src/msn_std.cpp
index 890f37b706..2b7d56a6df 100644
--- a/protocols/MSN/src/msn_std.cpp
+++ b/protocols/MSN/src/msn_std.cpp
@@ -26,10 +26,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/////////////////////////////////////////////////////////////////////////////////////////
// Standard functions
-void CMsnProto::deleteSetting(HANDLE hContact, const char* valueName)
-{ db_unset(hContact, m_szModuleName, valueName);
-}
-
int CMsnProto::getStringUtf(HANDLE hContact, const char* name, DBVARIANT* result)
{ return db_get_utf(hContact, m_szModuleName, name, result);
}
diff --git a/protocols/MSN/src/msn_svcs.cpp b/protocols/MSN/src/msn_svcs.cpp
index 40dc63464f..4b4a0b3170 100644
--- a/protocols/MSN/src/msn_svcs.cpp
+++ b/protocols/MSN/src/msn_svcs.cpp
@@ -122,7 +122,7 @@ INT_PTR CMsnProto::GetAvatarInfo(WPARAM wParam,LPARAM lParam)
WORD wStatus = getWord(AI->hContact, "Status", ID_STATUS_OFFLINE);
if (wStatus == ID_STATUS_OFFLINE) {
- deleteSetting(AI->hContact, "AvatarHash");
+ delSetting(AI->hContact, "AvatarHash");
PROTO_AVATAR_INFORMATIONT* fakeAI = new PROTO_AVATAR_INFORMATIONT;
*fakeAI = *AI;
ForkThread(&CMsnProto::sttFakeAvatarAck, fakeAI);
@@ -190,8 +190,8 @@ INT_PTR CMsnProto::SetAvatar(WPARAM wParam, LPARAM lParam)
if (szFileName == NULL)
{
- deleteSetting(NULL, "PictObject");
- deleteSetting(NULL, "AvatarHash");
+ delSetting("PictObject");
+ delSetting("AvatarHash");
ForkThread(&CMsnProto::msn_storeAvatarThread, NULL);
}
else
@@ -353,7 +353,7 @@ INT_PTR CMsnProto::SetCurrentMedia(WPARAM wParam, LPARAM lParam)
// Set user text
if (msnCurrentMedia.cbSize == 0)
- deleteSetting(NULL, "ListeningTo");
+ delSetting("ListeningTo");
else
{
TCHAR *text;