diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-30 16:26:36 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-30 16:26:36 +0000 |
commit | 8c85373fcb86aae9a09e19cae045fa667ba929a4 (patch) | |
tree | 6e9d763efadca018c658b7ece8c100ac86e4e70f /protocols/IcqOscarJ/src/icqosc_svcs.cpp | |
parent | 540f5010d9ebdec65b09bdc71fcd6cdf2010beaf (diff) |
some helpers wiped out of ICQ
git-svn-id: http://svn.miranda-ng.org/main/trunk@2567 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ/src/icqosc_svcs.cpp')
-rw-r--r-- | protocols/IcqOscarJ/src/icqosc_svcs.cpp | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/protocols/IcqOscarJ/src/icqosc_svcs.cpp b/protocols/IcqOscarJ/src/icqosc_svcs.cpp index ee6dd1731c..11fc36f385 100644 --- a/protocols/IcqOscarJ/src/icqosc_svcs.cpp +++ b/protocols/IcqOscarJ/src/icqosc_svcs.cpp @@ -173,7 +173,7 @@ INT_PTR CIcqProto::GetInfoSetting(WPARAM wParam, LPARAM lParam) rc = LookupDatabaseSetting(interestsField, code, cgs->pValue, type);
}
// Release database memory
- ICQFreeVariant(&dbv);
+ db_free(&dbv);
}
return rc;
@@ -408,13 +408,13 @@ INT_PTR CIcqProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam) if (getSetting(pai->hContact, "AvatarHash", &dbv) || dbv.type != DBVT_BLOB || (dbv.cpbVal != 0x14 && dbv.cpbVal != 0x09))
{
- ICQFreeVariant(&dbv);
+ db_free(&dbv);
return GAIR_NOAVATAR; // we did not found avatar hash or hash invalid - no avatar available
}
if (getContactUid(pai->hContact, &dwUIN, &szUID))
{
- ICQFreeVariant(&dbv);
+ db_free(&dbv);
return GAIR_NOAVATAR; // we do not support avatars for invalid contacts
}
@@ -433,7 +433,7 @@ INT_PTR CIcqProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam) { // hashes are the same
if (_taccess(tszFile, 0) == 0)
{
- ICQFreeVariant(&dbv);
+ db_free(&dbv);
return GAIR_SUCCESS; // we have found the avatar file, whoala
}
@@ -450,12 +450,12 @@ INT_PTR CIcqProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam) GetAvatarData(pai->hContact, dwUIN, szUID, dbv.pbVal, dbv.cpbVal, tszFile);
lstrcpyn(pai->filename, tszFile, SIZEOF(pai->filename)); // Avatar API does not support unicode :-(
- ICQFreeVariant(&dbv);
+ db_free(&dbv);
return GAIR_WAITFOR;
}
}
- ICQFreeVariant(&dbv);
+ db_free(&dbv);
return GAIR_NOAVATAR;
}
@@ -667,10 +667,10 @@ HANDLE CIcqProto::AddToListByUIN(DWORD dwUin, DWORD dwFlags) HANDLE hContact = HContactFromUIN(dwUin, &bAdded);
if (hContact)
{
- if (!(dwFlags & PALF_TEMPORARY) && DBGetContactSettingByte(hContact, "CList", "NotOnList", 0))
+ if (!(dwFlags & PALF_TEMPORARY) && db_get_b(hContact, "CList", "NotOnList", 0))
{
setContactHidden(hContact, 0);
- DBDeleteContactSetting(hContact, "CList", "NotOnList");
+ db_unset(hContact, "CList", "NotOnList");
}
return hContact; // Success
@@ -686,10 +686,10 @@ HANDLE CIcqProto::AddToListByUID(const char *szUID, DWORD dwFlags) HANDLE hContact = HContactFromUID(0, szUID, &bAdded);
if (hContact)
{
- if (!(dwFlags & PALF_TEMPORARY) && DBGetContactSettingByte(hContact, "CList", "NotOnList", 0))
+ if (!(dwFlags & PALF_TEMPORARY) && db_get_b(hContact, "CList", "NotOnList", 0))
{
setContactHidden(hContact, 0);
- DBDeleteContactSetting(hContact, "CList", "NotOnList");
+ db_unset(hContact, "CList", "NotOnList");
}
return hContact; // Success
@@ -709,7 +709,7 @@ void CIcqProto::ICQAddRecvEvent(HANDLE hContact, WORD wType, PROTORECVEVENT* pre if (pre->flags & PREF_UTF)
flags |= DBEF_UTF;
- if (hContact && DBGetContactSettingByte(hContact, "CList", "Hidden", 0))
+ if (hContact && db_get_b(hContact, "CList", "Hidden", 0))
{
DWORD dwUin;
uid_str szUid;
@@ -727,39 +727,39 @@ void CIcqProto::ICQAddRecvEvent(HANDLE hContact, WORD wType, PROTORECVEVENT* pre AddEvent(hContact, wType, pre->timestamp, flags, cbBlob, pBlob);
}
-INT_PTR __cdecl CIcqProto::IcqAddCapability(WPARAM wParam, LPARAM lParam) -{ - ICQ_CUSTOMCAP *icqCustomCapIn = (ICQ_CUSTOMCAP *)lParam; - ICQ_CUSTOMCAP *icqCustomCap = (ICQ_CUSTOMCAP *)malloc(sizeof(ICQ_CUSTOMCAP)); - memcpy(icqCustomCap, icqCustomCapIn, sizeof(ICQ_CUSTOMCAP)); - CustomCapList.push_back(icqCustomCap); -// MessageBoxA(NULL, ((ICQ_CUSTOMCAP *)(lstCustomCaps->items[lstCustomCaps->realCount-1]))->name, "custom cap", MB_OK); - return 0; -} - - -INT_PTR __cdecl CIcqProto::IcqCheckCapability(WPARAM wParam, LPARAM lParam) -{ - int res = 0; - DBCONTACTGETSETTING dbcgs; - DBVARIANT dbvariant; - HANDLE hContact = (HANDLE)wParam; - ICQ_CUSTOMCAP *icqCustomCap = (ICQ_CUSTOMCAP *)lParam; - dbcgs.pValue = &dbvariant; - dbcgs.szModule = m_szModuleName; - dbcgs.szSetting = "CapBuf"; - - CallService(MS_DB_CONTACT_GETSETTING, (WPARAM)hContact, (LPARAM)&dbcgs); - - if (dbvariant.type == DBVT_BLOB) - { - res = MatchCapability(dbvariant.pbVal, dbvariant.cpbVal, (const capstr*)&icqCustomCap->caps, 0x10)?1:0; // FIXME: Why icqCustomCap->caps is not capstr? - } - - CallService(MS_DB_CONTACT_FREEVARIANT,0,(LPARAM)(DBVARIANT*)&dbvariant); - - return res; -} +INT_PTR __cdecl CIcqProto::IcqAddCapability(WPARAM wParam, LPARAM lParam)
+{
+ ICQ_CUSTOMCAP *icqCustomCapIn = (ICQ_CUSTOMCAP *)lParam;
+ ICQ_CUSTOMCAP *icqCustomCap = (ICQ_CUSTOMCAP *)malloc(sizeof(ICQ_CUSTOMCAP));
+ memcpy(icqCustomCap, icqCustomCapIn, sizeof(ICQ_CUSTOMCAP));
+ CustomCapList.push_back(icqCustomCap);
+// MessageBoxA(NULL, ((ICQ_CUSTOMCAP *)(lstCustomCaps->items[lstCustomCaps->realCount-1]))->name, "custom cap", MB_OK);
+ return 0;
+}
+
+
+INT_PTR __cdecl CIcqProto::IcqCheckCapability(WPARAM wParam, LPARAM lParam)
+{
+ int res = 0;
+ DBCONTACTGETSETTING dbcgs;
+ DBVARIANT dbvariant;
+ HANDLE hContact = (HANDLE)wParam;
+ ICQ_CUSTOMCAP *icqCustomCap = (ICQ_CUSTOMCAP *)lParam;
+ dbcgs.pValue = &dbvariant;
+ dbcgs.szModule = m_szModuleName;
+ dbcgs.szSetting = "CapBuf";
+
+ CallService(MS_DB_CONTACT_GETSETTING, (WPARAM)hContact, (LPARAM)&dbcgs);
+
+ if (dbvariant.type == DBVT_BLOB)
+ {
+ res = MatchCapability(dbvariant.pbVal, dbvariant.cpbVal, (const capstr*)&icqCustomCap->caps, 0x10)?1:0; // FIXME: Why icqCustomCap->caps is not capstr?
+ }
+
+ CallService(MS_DB_CONTACT_FREEVARIANT,0,(LPARAM)(DBVARIANT*)&dbvariant);
+
+ return res;
+}
|