diff options
author | George Hazan <george.hazan@gmail.com> | 2013-06-23 12:32:12 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-06-23 12:32:12 +0000 |
commit | 8788bb35e10ef5403a08388d33ed4ab2ff7d67df (patch) | |
tree | b79e5efbfb02418b1276442a59e7722252cf39c8 /protocols | |
parent | 05ccb4dcd0b507fb000426667ed3f25c0b93db2b (diff) |
new helper applied instead of MS_DB_SETSETTINGRESIDENT
git-svn-id: http://svn.miranda-ng.org/main/trunk@5094 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/IRCG/src/ircproto.cpp | 4 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/icq_db.cpp | 10 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/icq_proto.cpp | 20 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/icq_proto.h | 1 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_proto.cpp | 21 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_xstatus.cpp | 13 | ||||
-rw-r--r-- | protocols/MRA/src/MraProto.cpp | 28 | ||||
-rw-r--r-- | protocols/MRA/src/MraProto.h | 2 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_functions.cpp | 7 | ||||
-rw-r--r-- | protocols/MSN/src/msn_proto.cpp | 22 | ||||
-rw-r--r-- | protocols/Yahoo/src/services.cpp | 32 |
11 files changed, 52 insertions, 108 deletions
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index 8c9981234e..de23f16b83 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -73,9 +73,7 @@ CIrcProto::CIrcProto(const char* szModuleName, const TCHAR* tszUserName) : InitPrefs();
- char text[ MAX_PATH ];
- mir_snprintf( text, sizeof( text ), "%s/Status", m_szModuleName);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)text);
+ db_set_resident(m_szModuleName, "Status");
CList_SetAllOffline(true);
diff --git a/protocols/IcqOscarJ/src/icq_db.cpp b/protocols/IcqOscarJ/src/icq_db.cpp index ed45b307db..65899ae703 100644 --- a/protocols/IcqOscarJ/src/icq_db.cpp +++ b/protocols/IcqOscarJ/src/icq_db.cpp @@ -29,16 +29,6 @@ // -----------------------------------------------------------------------------
#include "icqoscar.h"
-void CIcqProto::CreateResidentSetting(const char *szSetting)
-{
- char pszSetting[2*MAX_PATH];
-
- strcpy(pszSetting, m_szModuleName);
- strcat(pszSetting, "/");
- strcat(pszSetting, szSetting);
- CallService(MS_DB_SETSETTINGRESIDENT, 1, (WPARAM)pszSetting);
-}
-
int CIcqProto::getSetting(HANDLE hContact, const char *szSetting, DBVARIANT *dbv)
{
return db_get_s(hContact, m_szModuleName, szSetting, dbv, 0);
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index 9d388548ba..95ba89e838 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -111,16 +111,16 @@ CIcqProto::CIcqProto( const char* aProtoName, const TCHAR* aUserName ) : m_avatarsMutex = new icq_critical_section();
// Initialize temporary DB settings
- CreateResidentSetting("Status"); // NOTE: XStatus cannot be temporary
- CreateResidentSetting("TemporaryVisible");
- CreateResidentSetting("TickTS");
- CreateResidentSetting("IdleTS");
- CreateResidentSetting("AwayTS");
- CreateResidentSetting("LogonTS");
- CreateResidentSetting("DCStatus");
- CreateResidentSetting("CapBuf"); //capabilities bufer
- CreateResidentSetting(DBSETTING_STATUS_NOTE_TIME);
- CreateResidentSetting(DBSETTING_STATUS_MOOD);
+ db_set_resident(m_szModuleName, "Status"); // NOTE: XStatus cannot be temporary
+ db_set_resident(m_szModuleName, "TemporaryVisible");
+ db_set_resident(m_szModuleName, "TickTS");
+ db_set_resident(m_szModuleName, "IdleTS");
+ db_set_resident(m_szModuleName, "AwayTS");
+ db_set_resident(m_szModuleName, "LogonTS");
+ db_set_resident(m_szModuleName, "DCStatus");
+ db_set_resident(m_szModuleName, "CapBuf"); //capabilities bufer
+ db_set_resident(m_szModuleName, DBSETTING_STATUS_NOTE_TIME);
+ db_set_resident(m_szModuleName, DBSETTING_STATUS_MOOD);
// Setup services
CreateProtoService(PS_CREATEACCMGRUI, &CIcqProto::OnCreateAccMgrUI );
diff --git a/protocols/IcqOscarJ/src/icq_proto.h b/protocols/IcqOscarJ/src/icq_proto.h index a7f7ce8994..024a2eb1ab 100644 --- a/protocols/IcqOscarJ/src/icq_proto.h +++ b/protocols/IcqOscarJ/src/icq_proto.h @@ -430,7 +430,6 @@ struct CIcqProto : public PROTO_INTERFACE //----| icq_db.cpp |------------------------------------------------------------------
HANDLE AddEvent(HANDLE hContact, WORD wType, DWORD dwTime, DWORD flags, DWORD cbBlob, PBYTE pBlob);
- void CreateResidentSetting(const char* szSetting);
HANDLE FindFirstContact();
HANDLE FindNextContact(HANDLE hContact);
int IsICQContact(HANDLE hContact);
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 4de089e843..e03cf896ae 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -171,20 +171,13 @@ CJabberProto::CJabberProto(const char* aProtoName, const TCHAR *aUserName) : *m_savedPassword = 0;
- char text[ MAX_PATH ];
- mir_snprintf(text, sizeof(text), "%s/Status", m_szModuleName);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)text);
- mir_snprintf(text, sizeof(text), "%s/%s", m_szModuleName, DBSETTING_DISPLAY_UID);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)text);
-
- mir_snprintf(text, sizeof(text), "%s/SubscriptionText", m_szModuleName);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)text);
- mir_snprintf(text, sizeof(text), "%s/Subscription", m_szModuleName);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)text);
- mir_snprintf(text, sizeof(text), "%s/Auth", m_szModuleName);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)text);
- mir_snprintf(text, sizeof(text), "%s/Grant", m_szModuleName);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)text);
+ db_set_resident(m_szModuleName, "Status");
+ db_set_resident(m_szModuleName, DBSETTING_DISPLAY_UID);
+
+ db_set_resident(m_szModuleName, "SubscriptionText");
+ db_set_resident(m_szModuleName, "Subscription");
+ db_set_resident(m_szModuleName, "Auth");
+ db_set_resident(m_szModuleName, "Grant");
DBVARIANT dbv;
if ( !JGetStringT(NULL, "XmlLang", &dbv)) {
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 0a97bba749..6cbedb9267 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -1458,14 +1458,11 @@ INT_PTR __cdecl CJabberProto::OnSetXStatusEx(WPARAM wParam, LPARAM lParam) void CJabberProto::RegisterAdvStatusSlot(const char *pszSlot)
{
char szSetting[256];
- mir_snprintf(szSetting, SIZEOF(szSetting), "AdvStatus/%s/%s/id", m_szModuleName, pszSlot);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "AdvStatus/%s/%s/icon", m_szModuleName, pszSlot);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "AdvStatus/%s/%s/title", m_szModuleName, pszSlot);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "AdvStatus/%s/%s/text", m_szModuleName, pszSlot);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)szSetting);
+ mir_snprintf(szSetting, SIZEOF(szSetting), "AdvStatus/%s/%s", m_szModuleName, pszSlot);
+ db_set_resident(szSetting, "id");
+ db_set_resident(szSetting, "icon");
+ db_set_resident(szSetting, "title");
+ db_set_resident(szSetting, "text");
}
void CJabberProto::ResetAdvStatus(HANDLE hContact, const char *pszSlot)
diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp index 51ce197008..5aa836733f 100644 --- a/protocols/MRA/src/MraProto.cpp +++ b/protocols/MRA/src/MraProto.cpp @@ -106,20 +106,20 @@ int CMraProto::OnModulesLoaded(WPARAM, LPARAM) SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS), -1, -1, 0, 0, ID_STATUS_OFFLINE, NULL, 0, NULL, 0, NULL, 0);
// unsaved values
- DB_MraCreateResidentSetting("Status");// NOTE: XStatus cannot be temporary
- DB_MraCreateResidentSetting("LogonTS");
- DB_MraCreateResidentSetting("ContactID");
- DB_MraCreateResidentSetting("GroupID");
- DB_MraCreateResidentSetting("ContactFlags");
- DB_MraCreateResidentSetting("ContactSeverFlags");
- DB_MraCreateResidentSetting("HooksLocked");
- DB_MraCreateResidentSetting(DBSETTING_CAPABILITIES);
- DB_MraCreateResidentSetting(DBSETTING_XSTATUSNAME);
- DB_MraCreateResidentSetting(DBSETTING_XSTATUSMSG);
- DB_MraCreateResidentSetting(DBSETTING_BLOGSTATUSTIME);
- DB_MraCreateResidentSetting(DBSETTING_BLOGSTATUSID);
- DB_MraCreateResidentSetting(DBSETTING_BLOGSTATUS);
- DB_MraCreateResidentSetting(DBSETTING_BLOGSTATUSMUSIC);
+ db_set_resident(m_szModuleName, "Status");// NOTE: XStatus cannot be temporary
+ db_set_resident(m_szModuleName, "LogonTS");
+ db_set_resident(m_szModuleName, "ContactID");
+ db_set_resident(m_szModuleName, "GroupID");
+ db_set_resident(m_szModuleName, "ContactFlags");
+ db_set_resident(m_szModuleName, "ContactSeverFlags");
+ db_set_resident(m_szModuleName, "HooksLocked");
+ db_set_resident(m_szModuleName, DBSETTING_CAPABILITIES);
+ db_set_resident(m_szModuleName, DBSETTING_XSTATUSNAME);
+ db_set_resident(m_szModuleName, DBSETTING_XSTATUSMSG);
+ db_set_resident(m_szModuleName, DBSETTING_BLOGSTATUSTIME);
+ db_set_resident(m_szModuleName, DBSETTING_BLOGSTATUSID);
+ db_set_resident(m_szModuleName, DBSETTING_BLOGSTATUS);
+ db_set_resident(m_szModuleName, DBSETTING_BLOGSTATUSMUSIC);
// destroy all chat sessions
if (bChatExists)
diff --git a/protocols/MRA/src/MraProto.h b/protocols/MRA/src/MraProto.h index f1205fbbd4..2ba636de92 100644 --- a/protocols/MRA/src/MraProto.h +++ b/protocols/MRA/src/MraProto.h @@ -255,8 +255,6 @@ struct CMraProto : public PROTO_INTERFACE void MraAddrListStoreToContact(HANDLE hContact, MRA_ADDR_LIST *pmalAddrList);
- void DB_MraCreateResidentSetting(LPSTR lpszValueName);
-
DWORD GetContactFlags(HANDLE hContact);
DWORD SetContactFlags(HANDLE hContact, DWORD dwContactFlag);
DWORD GetContactBasicInfoW(HANDLE hContact, DWORD *pdwID, DWORD *pdwGroupID, DWORD *pdwContactFlag, DWORD *pdwContactSeverFlags, DWORD *pdwStatus, LPSTR lpszEMail, size_t dwEMailSize, size_t *pdwEMailSize, LPWSTR lpwszNick, size_t dwNickSize, size_t *pdwNickSize, LPSTR lpszPhones, size_t dwPhonesSize, size_t *pdwPhonesSize);
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index 4ecd258377..d4a5f657ac 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -202,13 +202,6 @@ void MraAddrListFree(MRA_ADDR_LIST *pmalAddrList) }
}
-void CMraProto::DB_MraCreateResidentSetting(LPSTR lpszValueName)
-{
- char szSetting[2*MAX_PATH];
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s", m_szModuleName, lpszValueName);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (WPARAM)szSetting);
-}
-
BOOL DB_GetStaticStringA(HANDLE hContact, LPCSTR lpszModule, LPCSTR lpszValueName, LPSTR lpszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize)
{
BOOL bRet = FALSE;
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index e37531d34c..3834980ec7 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -43,24 +43,13 @@ CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) : lsAvatarQueue(1),
msgCache(5, CompareId)
{
- char path[MAX_PATH];
-
ProtoConstructor(this, aProtoName, aUserName);
- mir_snprintf(path, sizeof(path), "%s/Status", m_szModuleName);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);
-
- mir_snprintf(path, sizeof(path), "%s/IdleTS", m_szModuleName);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);
-
- mir_snprintf(path, sizeof(path), "%s/p2pMsgId", m_szModuleName);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);
-
- mir_snprintf(path, sizeof(path), "%s/MobileEnabled", m_szModuleName);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);
-
- mir_snprintf(path, sizeof(path), "%s/MobileAllowed", m_szModuleName);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);
+ db_set_resident(m_szModuleName, "Status");
+ db_set_resident(m_szModuleName, "IdleTS");
+ db_set_resident(m_szModuleName, "p2pMsgId");
+ db_set_resident(m_szModuleName, "MobileEnabled");
+ db_set_resident(m_szModuleName, "MobileAllowed");
// Protocol services and events...
hMSNNudge = CreateProtoEvent("/Nudge");
@@ -101,6 +90,7 @@ CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) : deleteSetting(NULL, "MobileEnabled");
deleteSetting(NULL, "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))
diff --git a/protocols/Yahoo/src/services.cpp b/protocols/Yahoo/src/services.cpp index 64756331db..af4f300282 100644 --- a/protocols/Yahoo/src/services.cpp +++ b/protocols/Yahoo/src/services.cpp @@ -536,27 +536,13 @@ void CYahooProto::LoadYahooServices( void ) //----| Set resident variables |------------------------------------------------------
- mir_snprintf(path, SIZEOF(path), "%s/Status", m_szModuleName);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);
-
- mir_snprintf(path, SIZEOF(path), "%s/YStatus", m_szModuleName);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);
-
- mir_snprintf(path, SIZEOF(path), "%s/YAway", m_szModuleName);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);
-
- mir_snprintf(path, SIZEOF(path), "%s/Mobile", m_szModuleName);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);
-
- mir_snprintf(path, SIZEOF(path), "%s/YGMsg", m_szModuleName);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);
-
- mir_snprintf(path, SIZEOF(path), "%s/IdleTS", m_szModuleName);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);
-
- mir_snprintf(path, SIZEOF(path), "%s/PictLastCheck", m_szModuleName);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);
-
- mir_snprintf(path, SIZEOF(path), "%s/PictLoading", m_szModuleName);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);
+ db_set_resident(m_szModuleName, "Mobile");
+ db_set_resident(m_szModuleName, "IdleTS");
+ db_set_resident(m_szModuleName, "PictLastCheck");
+ db_set_resident(m_szModuleName, "PictLoading");
+ db_set_resident(m_szModuleName, "Status");
+
+ db_set_resident(m_szModuleName, "YAway");
+ db_set_resident(m_szModuleName, "YGMsg");
+ db_set_resident(m_szModuleName, "YStatus");
}
|