summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-15 17:43:23 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-15 17:43:23 +0000
commitb43dcf000f703e3ef421350f74208cf4c7cdea77 (patch)
treeb4c4de1422fd5f6945f2f71c649a28f45d614fd7
parent3b3200e91d1c76f0fdd6565c3c3bc1824d1a4a03 (diff)
git-svn-id: http://svn.miranda-ng.org/main/trunk@979 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/Gadu-Gadu/avatar.cpp8
-rw-r--r--protocols/Gadu-Gadu/core.cpp34
-rw-r--r--protocols/Gadu-Gadu/dialogs.cpp14
-rw-r--r--protocols/Gadu-Gadu/filetransfer.cpp16
-rw-r--r--protocols/Gadu-Gadu/gg.cpp4
-rw-r--r--protocols/Gadu-Gadu/gg_proto.cpp10
-rw-r--r--protocols/Gadu-Gadu/groupchat.cpp14
-rw-r--r--protocols/Gadu-Gadu/image.cpp6
-rw-r--r--protocols/Gadu-Gadu/import.cpp8
-rw-r--r--protocols/Gadu-Gadu/oauth.cpp4
-rw-r--r--protocols/Gadu-Gadu/services.cpp4
-rw-r--r--protocols/Gadu-Gadu/userutils.cpp2
12 files changed, 62 insertions, 62 deletions
diff --git a/protocols/Gadu-Gadu/avatar.cpp b/protocols/Gadu-Gadu/avatar.cpp
index 74c90748cc..2dc6de1bbd 100644
--- a/protocols/Gadu-Gadu/avatar.cpp
+++ b/protocols/Gadu-Gadu/avatar.cpp
@@ -196,7 +196,7 @@ void __cdecl GGPROTO::avatarrequestthread(void*)
mir_free(data);
LeaveCriticalSection(&avatar_mutex);
- getAvatarFileInfo( db_get_b(hContact, m_szModuleName, GG_KEY_UIN, 0), &AvatarURL, &AvatarType);
+ getAvatarFileInfo( db_get_dw(hContact, m_szModuleName, GG_KEY_UIN, 0), &AvatarURL, &AvatarType);
if (AvatarURL != NULL && strlen(AvatarURL) > 0)
db_set_s(hContact, m_szModuleName, GG_KEY_AVATARURL, AvatarURL);
else
@@ -303,7 +303,7 @@ void __cdecl GGPROTO::getuseravatarthread(void*)
char *AvatarURL;
int AvatarType;
- getAvatarFileInfo( db_get_b(NULL, m_szModuleName, GG_KEY_UIN, 0), &AvatarURL, &AvatarType);
+ getAvatarFileInfo( db_get_dw(NULL, m_szModuleName, GG_KEY_UIN, 0), &AvatarURL, &AvatarType);
if (AvatarURL != NULL && strlen(AvatarURL) > 0)
db_set_s(NULL, m_szModuleName, GG_KEY_AVATARURL, AvatarURL);
else
@@ -318,7 +318,7 @@ void __cdecl GGPROTO::getuseravatarthread(void*)
void GGPROTO::getUserAvatar()
{
if (db_get_b(NULL, m_szModuleName, GG_KEY_ENABLEAVATARS, GG_KEYDEF_ENABLEAVATARS)
- && db_get_b(NULL, m_szModuleName, GG_KEY_UIN, 0))
+ && db_get_dw(NULL, m_szModuleName, GG_KEY_UIN, 0))
forkthread(&GGPROTO::getuseravatarthread, NULL);
}
@@ -333,7 +333,7 @@ void __cdecl GGPROTO::setavatarthread(void *param)
int file_fd, avatardatalen, datalen, contentlen, contentendlen, res = 0, repeat = 0;
netlog("gg_setavatar(): Trying to set user avatar using %s...", szFilename);
- UIN2ID(db_get_b(NULL, m_szModuleName, GG_KEY_UIN, 0), uin);
+ UIN2ID( db_get_dw(NULL, m_szModuleName, GG_KEY_UIN, 0), uin);
file_fd = _topen(szFilename, _O_RDONLY | _O_BINARY, _S_IREAD);
if (file_fd == -1) {
diff --git a/protocols/Gadu-Gadu/core.cpp b/protocols/Gadu-Gadu/core.cpp
index 735b3536bc..5ed36c8eaf 100644
--- a/protocols/Gadu-Gadu/core.cpp
+++ b/protocols/Gadu-Gadu/core.cpp
@@ -322,7 +322,7 @@ void __cdecl GGPROTO::mainthread(void *)
}
// Readup number
- if (!(p.uin = db_get_b(NULL, m_szModuleName, GG_KEY_UIN, 0)))
+ if (!(p.uin = db_get_dw(NULL, m_szModuleName, GG_KEY_UIN, 0)))
{
netlog("gg_mainthread(%x): No Gadu-Gadu number specified. Exiting.", this);
broadcastnewstatus(ID_STATUS_OFFLINE);
@@ -429,7 +429,7 @@ retry:
&& errno == EACCES
&& (db_get_b(NULL, m_szModuleName, GG_KEY_ARECONNECT, GG_KEYDEF_ARECONNECT) || (hostnum < hostcount - 1)))
{
- DWORD dwInterval = db_get_b(NULL, m_szModuleName, GG_KEY_RECONNINTERVAL, GG_KEYDEF_RECONNINTERVAL), dwResult;
+ DWORD dwInterval = db_get_dw(NULL, m_szModuleName, GG_KEY_RECONNINTERVAL, GG_KEYDEF_RECONNINTERVAL), dwResult;
BOOL bRetry = TRUE;
hConnStopEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
@@ -461,7 +461,7 @@ retry:
{
// Successfully connected
logonTime = time(NULL);
- db_set_w(NULL, m_szModuleName, GG_KEY_LOGONTIME, logonTime);
+ db_set_dw(NULL, m_szModuleName, GG_KEY_LOGONTIME, logonTime);
EnterCriticalSection(&sess_mutex);
sess = sess;
LeaveCriticalSection(&sess_mutex);
@@ -552,7 +552,7 @@ retry:
// Statuslist notify (version >= 6.0)
case GG_EVENT_NOTIFY60:
{
- uin_t uin = (uin_t)db_get_b(NULL, m_szModuleName, GG_KEY_UIN, 0);
+ uin_t uin = (uin_t)db_get_dw(NULL, m_szModuleName, GG_KEY_UIN, 0);
int i;
for(i = 0; e->event.notify60[i].uin; i++) {
if (e->event.notify60[i].uin == uin) continue;
@@ -742,7 +742,7 @@ retry:
{
HANDLE hContact = getcontact(e->event.status60.uin, 0, 0, NULL);
int oldstatus = db_get_w(hContact, m_szModuleName, GG_KEY_STATUS, (WORD)ID_STATUS_OFFLINE);
- uin_t uin = (uin_t)db_get_b(NULL, m_szModuleName, GG_KEY_UIN, 0);
+ uin_t uin = (uin_t)db_get_dw(NULL, m_szModuleName, GG_KEY_UIN, 0);
if (e->event.status60.uin == uin)
{
@@ -828,7 +828,7 @@ retry:
// RichEdit format included (image)
if (e->event.msg.formats_length &&
db_get_b(NULL, m_szModuleName, GG_KEY_IMGRECEIVE, GG_KEYDEF_IMGRECEIVE) &&
- !(db_get_b(getcontact(e->event.msg.sender, 1, 0, NULL), "Ignore", "Mask1", 0) & IGNOREEVENT_MESSAGE))
+ !(db_get_dw(getcontact(e->event.msg.sender, 1, 0, NULL), "Ignore", "Mask1", 0) & IGNOREEVENT_MESSAGE))
{
char *formats = (char*)e->event.msg.formats;
int len = 0, formats_len = e->event.msg.formats_length, add_ptr;
@@ -867,7 +867,7 @@ retry:
GCDEST gcdest = {m_szModuleName, chat, GC_EVENT_MESSAGE};
GCEVENT gcevent = {sizeof(GCEVENT), &gcdest};
- UIN2ID(db_get_b(NULL, m_szModuleName, GG_KEY_UIN, 0), id);
+ UIN2ID( db_get_dw(NULL, m_szModuleName, GG_KEY_UIN, 0), id);
gcevent.pszUID = id;
gcevent.pszText = e->event.multilogon_msg.message;
@@ -1007,7 +1007,7 @@ retry:
dcc7->contact = getcontact(dcc7->peer_uin, 0, 0, NULL);
// Check if user is on the list and if it is my uin
- if (!dcc7->contact || db_get_b(NULL, m_szModuleName, GG_KEY_UIN, -1) != dcc7->uin) {
+ if (!dcc7->contact || db_get_dw(NULL, m_szModuleName, GG_KEY_UIN, -1) != dcc7->uin) {
gg_dcc7_free(dcc7);
e->event.dcc7_new = NULL;
break;
@@ -1181,7 +1181,7 @@ retry:
broadcastnewstatus(ID_STATUS_OFFLINE);
setalloffline();
- db_set_w(NULL, m_szModuleName, GG_KEY_LOGONTIME, 0);
+ db_set_dw(NULL, m_szModuleName, GG_KEY_LOGONTIME, 0);
// If it was unwanted disconnection reconnect
if (m_iDesiredStatus != ID_STATUS_OFFLINE
@@ -1252,7 +1252,7 @@ int GGPROTO::contactdeleted(WPARAM wParam, LPARAM lParam)
uin_t uin; int type;
DBVARIANT dbv;
- uin = (uin_t)db_get_b(hContact, m_szModuleName, GG_KEY_UIN, 0);
+ uin = (uin_t)db_get_dw(hContact, m_szModuleName, GG_KEY_UIN, 0);
type = db_get_b(hContact, m_szModuleName, "ChatRoom", 0);
// Terminate conference if contact is deleted
@@ -1390,7 +1390,7 @@ void GGPROTO::notifyuser(HANDLE hContact, int refresh)
{
uin_t uin;
if (!hContact) return;
- if (isonline() && (uin = (uin_t)db_get_b(hContact, m_szModuleName, GG_KEY_UIN, 0)))
+ if (isonline() && (uin = (uin_t)db_get_dw(hContact, m_szModuleName, GG_KEY_UIN, 0)))
{
// Check if user should be invisible
// Or be blocked ?
@@ -1460,7 +1460,7 @@ void GGPROTO::notifyall()
while (hContact && cc < count)
{
szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
- if (szProto != NULL && !strcmp(szProto, m_szModuleName) && (uins[cc] = db_get_b(hContact, m_szModuleName, GG_KEY_UIN, 0)))
+ if (szProto != NULL && !strcmp(szProto, m_szModuleName) && (uins[cc] = db_get_dw(hContact, m_szModuleName, GG_KEY_UIN, 0)))
{
if ((db_get_w(hContact, m_szModuleName, GG_KEY_APPARENT, (WORD) ID_STATUS_ONLINE) == ID_STATUS_OFFLINE) ||
db_get_b(hContact, "CList", "NotOnList", 0))
@@ -1497,7 +1497,7 @@ HANDLE GGPROTO::getcontact(uin_t uin, int create, int inlist, TCHAR *szNick)
while (hContact) {
char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
if (szProto != NULL && !strcmp(szProto, m_szModuleName)) {
- if ((uin_t)db_get_b(hContact, m_szModuleName, GG_KEY_UIN, 0) == uin
+ if ((uin_t)db_get_dw(hContact, m_szModuleName, GG_KEY_UIN, 0) == uin
&& db_get_b(hContact, m_szModuleName, "ChatRoom", 0) == 0)
{
if (inlist) {
@@ -1528,7 +1528,7 @@ HANDLE GGPROTO::getcontact(uin_t uin, int create, int inlist, TCHAR *szNick)
if (!inlist)
db_set_b(hContact, "CList", "NotOnList", 1);
- db_set_w(hContact, m_szModuleName, GG_KEY_UIN, (DWORD) uin);
+ db_set_dw(hContact, m_szModuleName, GG_KEY_UIN, (DWORD) uin);
db_set_w(hContact, m_szModuleName, GG_KEY_STATUS, ID_STATUS_OFFLINE);
// If nick specified use it
@@ -1565,7 +1565,7 @@ HANDLE GGPROTO::getcontact(uin_t uin, int create, int inlist, TCHAR *szNick)
getavatarinfo((WPARAM)GAIF_FORCE, (LPARAM)&pai);
// Change status of the contact with our own UIN (if got yourself added to the contact list)
- if (db_get_b(NULL, m_szModuleName, GG_KEY_UIN, 0) == uin) {
+ if (db_get_dw(NULL, m_szModuleName, GG_KEY_UIN, 0) == uin) {
char *szMsg;
EnterCriticalSection(&modemsg_mutex);
szMsg = mir_strdup(getstatusmsg(m_iStatus));
@@ -1683,12 +1683,12 @@ void GGPROTO::changecontactstatus(uin_t uin, int status, const char *idescr, int
db_unset(hContact, "CList", GG_KEY_STATUSDESCR);
// Store contact ip and port
- if (remote_ip) db_set_w(hContact, m_szModuleName, GG_KEY_CLIENTIP, (DWORD) swap32(remote_ip));
+ if (remote_ip) db_set_dw(hContact, m_szModuleName, GG_KEY_CLIENTIP, (DWORD) swap32(remote_ip));
if (remote_port) db_set_w(hContact, m_szModuleName, GG_KEY_CLIENTPORT, (WORD) remote_port);
if (version)
{
char sversion[48];
- db_set_w(hContact, m_szModuleName, GG_KEY_CLIENTVERSION, (DWORD) version);
+ db_set_dw(hContact, m_szModuleName, GG_KEY_CLIENTVERSION, (DWORD) version);
mir_snprintf(sversion, sizeof(sversion), "%sGadu-Gadu %s", (version & 0x00ffffff) > 0x2b ? "Nowe " : "", gg_version2string(version));
db_set_s(hContact, m_szModuleName, "MirVer", sversion);
}
diff --git a/protocols/Gadu-Gadu/dialogs.cpp b/protocols/Gadu-Gadu/dialogs.cpp
index 6a626f2d55..345624715b 100644
--- a/protocols/Gadu-Gadu/dialogs.cpp
+++ b/protocols/Gadu-Gadu/dialogs.cpp
@@ -160,7 +160,7 @@ void GGPROTO::checknewuser(uin_t uin, const char* passwd)
{
char oldpasswd[128];
DBVARIANT dbv;
- uin_t olduin = (uin_t)db_get_b(NULL, m_szModuleName, GG_KEY_UIN, 0);
+ uin_t olduin = (uin_t)db_get_dw(NULL, m_szModuleName, GG_KEY_UIN, 0);
oldpasswd[0] = '\0';
if (!db_get_s(NULL, m_szModuleName, GG_KEY_PASSWORD, &dbv, DBVT_ASCIIZ))
@@ -215,7 +215,7 @@ static INT_PTR CALLBACK gg_genoptsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
TranslateDialogDefault(hwndDlg);
- if (num = db_get_b(NULL, gg->m_szModuleName, GG_KEY_UIN, 0))
+ if (num = db_get_dw(NULL, gg->m_szModuleName, GG_KEY_UIN, 0))
{
SetDlgItemTextA(hwndDlg, IDC_UIN, ditoa(num));
ShowWindow(GetDlgItem(hwndDlg, IDC_CREATEACCOUNT), SW_HIDE);
@@ -383,7 +383,7 @@ static INT_PTR CALLBACK gg_genoptsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
ShowWindow(GetDlgItem(hwndDlg, IDC_RELOADREQD), SW_SHOW);
// Update uin
- if (num = db_get_b(NULL, gg->m_szModuleName, GG_KEY_UIN, 0))
+ if (num = db_get_dw(NULL, gg->m_szModuleName, GG_KEY_UIN, 0))
SetDlgItemTextA(hwndDlg, IDC_UIN, ditoa(num));
else
SetDlgItemTextA(hwndDlg, IDC_UIN, "");
@@ -442,7 +442,7 @@ static INT_PTR CALLBACK gg_genoptsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
GetDlgItemTextA(hwndDlg, IDC_PASSWORD, str, sizeof(str));
CallService(MS_DB_CRYPT_ENCODESTRING, sizeof(str), (LPARAM) str);
gg->checknewuser(uin, str);
- db_set_w(NULL, gg->m_szModuleName, GG_KEY_UIN, uin);
+ db_set_dw(NULL, gg->m_szModuleName, GG_KEY_UIN, uin);
db_set_s(NULL, gg->m_szModuleName, GG_KEY_PASSWORD, str);
// Write Gadu-Gadu email
@@ -923,7 +923,7 @@ INT_PTR CALLBACK gg_acc_mgr_guidlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
TranslateDialogDefault(hwndDlg);
- if (num = db_get_b(NULL, gg->m_szModuleName, GG_KEY_UIN, 0))
+ if (num = db_get_dw(NULL, gg->m_szModuleName, GG_KEY_UIN, 0))
SetDlgItemTextA(hwndDlg, IDC_UIN, ditoa(num));
if (!db_get_s(NULL, gg->m_szModuleName, GG_KEY_PASSWORD, &dbv, DBVT_ASCIIZ)) {
CallService(MS_DB_CRYPT_DECODESTRING, strlen(dbv.pszVal) + 1, (LPARAM) dbv.pszVal);
@@ -962,7 +962,7 @@ INT_PTR CALLBACK gg_acc_mgr_guidlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
ShowWindow(GetDlgItem(hwndDlg, IDC_RELOADREQD), SW_SHOW);
// Update uin
- if (num = db_get_b(NULL, gg->m_szModuleName, GG_KEY_UIN, 0))
+ if (num = db_get_dw(NULL, gg->m_szModuleName, GG_KEY_UIN, 0))
SetDlgItemTextA(hwndDlg, IDC_UIN, ditoa(num));
else
SetDlgItemTextA(hwndDlg, IDC_UIN, "");
@@ -1001,7 +1001,7 @@ INT_PTR CALLBACK gg_acc_mgr_guidlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
GetDlgItemTextA(hwndDlg, IDC_PASSWORD, str, sizeof(str));
CallService(MS_DB_CRYPT_ENCODESTRING, sizeof(str), (LPARAM) str);
gg->checknewuser(uin, str);
- db_set_w(NULL, gg->m_szModuleName, GG_KEY_UIN, uin);
+ db_set_dw(NULL, gg->m_szModuleName, GG_KEY_UIN, uin);
db_set_s(NULL, gg->m_szModuleName, GG_KEY_PASSWORD, str);
// Write Gadu-Gadu email
diff --git a/protocols/Gadu-Gadu/filetransfer.cpp b/protocols/Gadu-Gadu/filetransfer.cpp
index 4c58c59b15..d7c7aa52d5 100644
--- a/protocols/Gadu-Gadu/filetransfer.cpp
+++ b/protocols/Gadu-Gadu/filetransfer.cpp
@@ -66,9 +66,9 @@ void GGPROTO::dccconnect(uin_t uin)
if (!hContact) return;
// Read user IP and port
- ip = swap32(db_get_b(hContact, m_szModuleName, GG_KEY_CLIENTIP, 0));
+ ip = swap32(db_get_dw(hContact, m_szModuleName, GG_KEY_CLIENTIP, 0));
port = db_get_w(hContact, m_szModuleName, GG_KEY_CLIENTPORT, 0);
- myuin = db_get_b(NULL, m_szModuleName, GG_KEY_UIN, 0);
+ myuin = db_get_dw(NULL, m_szModuleName, GG_KEY_UIN, 0);
// If not port nor ip nor my uin (?) specified
if (!ip || !port || !uin) return;
@@ -136,7 +136,7 @@ void __cdecl GGPROTO::dccmainthread(void*)
netlog("gg_dccmainthread(): DCC Server Thread Starting");
// Readup number
- if (!(uin = db_get_b(NULL, m_szModuleName, GG_KEY_UIN, 0)))
+ if (!(uin = db_get_dw(NULL, m_szModuleName, GG_KEY_UIN, 0)))
{
netlog("gg_dccmainthread(): No Gadu-Gadu number specified. Exiting.");
if (hEvent) SetEvent(hEvent);
@@ -388,7 +388,7 @@ void __cdecl GGPROTO::dccmainthread(void*)
netlog("gg_dccmainthread(): Client: %d, Client accept.", dcc->peer_uin);
// Check if user is on the list and if it is my uin
if (getcontact(dcc->peer_uin, 0, 0, NULL) &&
- db_get_b(NULL, m_szModuleName, GG_KEY_UIN, -1) == dcc->uin)
+ db_get_dw(NULL, m_szModuleName, GG_KEY_UIN, -1) == dcc->uin)
break;
// Kill unauthorized dcc
@@ -892,11 +892,11 @@ HANDLE GGPROTO::SendFile(HANDLE hContact, const PROTOCHAR* szDescription, PROTOC
filename = mir_t2a(ppszFiles[0]);
// Read user IP and port
- ip = swap32(db_get_b(hContact, m_szModuleName, GG_KEY_CLIENTIP, 0));
+ ip = swap32(db_get_dw(hContact, m_szModuleName, GG_KEY_CLIENTIP, 0));
port = db_get_w(hContact, m_szModuleName, GG_KEY_CLIENTPORT, 0);
- myuin = db_get_b(NULL, m_szModuleName, GG_KEY_UIN, 0);
- uin = db_get_b(hContact, m_szModuleName, GG_KEY_UIN, 0);
- ver = db_get_b(hContact, m_szModuleName, GG_KEY_CLIENTVERSION, 0);
+ myuin = db_get_dw(NULL, m_szModuleName, GG_KEY_UIN, 0);
+ uin = db_get_dw(hContact, m_szModuleName, GG_KEY_UIN, 0);
+ ver = db_get_dw(hContact, m_szModuleName, GG_KEY_CLIENTVERSION, 0);
// Use DCC7 if a contact is using at least version 7.6 or unknown version
if ((ver & 0x00ffffff) >= 0x29 || !ver) {
diff --git a/protocols/Gadu-Gadu/gg.cpp b/protocols/Gadu-Gadu/gg.cpp
index 11f2e3ce2d..1ec516f8da 100644
--- a/protocols/Gadu-Gadu/gg.cpp
+++ b/protocols/Gadu-Gadu/gg.cpp
@@ -200,7 +200,7 @@ void GGPROTO::cleanuplastplugin(DWORD version)
db_unset(NULL, m_szModuleName, "ShowNotOnMyList");
// Store this plugin version
- db_set_w(NULL, m_szModuleName, GG_PLUGINVERSION, pluginInfo.version);
+ db_set_dw(NULL, m_szModuleName, GG_PLUGINVERSION, pluginInfo.version);
}
//////////////////////////////////////////////////////////
@@ -258,7 +258,7 @@ static int gg_prebuildcontactmenu(WPARAM wParam, LPARAM lParam)
mi.cbSize = sizeof(mi);
mi.flags = CMIM_NAME | CMIM_FLAGS | CMIF_ICONFROMICOLIB;
- if (db_get_b(hContact, gg->m_szModuleName, GG_KEY_UIN, 0) == db_get_b(NULL, gg->m_szModuleName, GG_KEY_UIN, 0) ||
+ if ( db_get_dw(hContact, gg->m_szModuleName, GG_KEY_UIN, 0) == db_get_b(NULL, gg->m_szModuleName, GG_KEY_UIN, 0) ||
db_get_b(hContact, gg->m_szModuleName, "ChatRoom", 0) ||
db_get_b(hContact, "CList", "NotOnList", 0))
mi.flags |= CMIF_HIDDEN;
diff --git a/protocols/Gadu-Gadu/gg_proto.cpp b/protocols/Gadu-Gadu/gg_proto.cpp
index f9097a9900..2b8a8d4910 100644
--- a/protocols/Gadu-Gadu/gg_proto.cpp
+++ b/protocols/Gadu-Gadu/gg_proto.cpp
@@ -61,10 +61,10 @@ GGPROTO::GGPROTO(const char* pszProtoName, const TCHAR* tszUserName)
// Offline contacts and clear logon time
setalloffline();
- db_set_w(NULL, m_szModuleName, GG_KEY_LOGONTIME, 0);
+ db_set_dw(NULL, m_szModuleName, GG_KEY_LOGONTIME, 0);
DWORD dwVersion;
- if ((dwVersion = db_get_b(NULL, m_szModuleName, GG_PLUGINVERSION, 0)) < pluginInfo.version)
+ if ((dwVersion = db_get_dw(NULL, m_szModuleName, GG_PLUGINVERSION, 0)) < pluginInfo.version)
cleanuplastplugin(dwVersion);
links_instance_init();
@@ -228,7 +228,7 @@ int GGPROTO::GetInfo(HANDLE hContact, int infoType)
}
// Add uin and search it
- gg_pubdir50_add(req, GG_PUBDIR50_UIN, ditoa((uin_t)db_get_b(hContact, m_szModuleName, GG_KEY_UIN, 0)));
+ gg_pubdir50_add(req, GG_PUBDIR50_UIN, ditoa((uin_t)db_get_dw(hContact, m_szModuleName, GG_KEY_UIN, 0)));
gg_pubdir50_seq_set(req, GG_SEQ_INFO);
netlog("gg_getinfo(): Requesting user info.", req->seq);
@@ -582,7 +582,7 @@ int GGPROTO::SendMsg(HANDLE hContact, int flags, const char *msg)
{
uin_t uin;
- if (msg && isonline() && (uin = (uin_t)db_get_b(hContact, m_szModuleName, GG_KEY_UIN, 0)))
+ if (msg && isonline() && (uin = (uin_t)db_get_dw(hContact, m_szModuleName, GG_KEY_UIN, 0)))
{
int seq;
EnterCriticalSection(&sess_mutex);
@@ -731,7 +731,7 @@ int GGPROTO::SetAwayMsg(int iStatus, const PROTOCHAR *msgt)
int GGPROTO::UserIsTyping(HANDLE hContact, int type)
{
- uin_t uin = db_get_b(hContact, m_szModuleName, GG_KEY_UIN, 0);
+ uin_t uin = db_get_dw(hContact, m_szModuleName, GG_KEY_UIN, 0);
if (!uin || !isonline()) return 0;
diff --git a/protocols/Gadu-Gadu/groupchat.cpp b/protocols/Gadu-Gadu/groupchat.cpp
index 31fe5d37e8..6127764890 100644
--- a/protocols/Gadu-Gadu/groupchat.cpp
+++ b/protocols/Gadu-Gadu/groupchat.cpp
@@ -132,7 +132,7 @@ int GGPROTO::gc_event(WPARAM wParam, LPARAM lParam)
|| !gch->pDest->pszID
|| !gch->pDest->pszModule
|| lstrcmpiA(gch->pDest->pszModule, m_szModuleName)
- || !(uin = db_get_b(NULL, m_szModuleName, GG_KEY_UIN, 0))
+ || !(uin = db_get_dw(NULL, m_szModuleName, GG_KEY_UIN, 0))
|| !(chat = gc_lookup(gch->pDest->pszID)))
return 0;
@@ -343,7 +343,7 @@ char* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_count)
gcdest.iType = GC_EVENT_JOIN;
// Add myself
- if (uin = db_get_b(NULL, m_szModuleName, GG_KEY_UIN, 0))
+ if (uin = db_get_dw(NULL, m_szModuleName, GG_KEY_UIN, 0))
{
UIN2ID(uin, id);
if (!db_get_s(NULL, m_szModuleName, GG_KEY_NICK, &dbv, DBVT_TCHAR)) {
@@ -484,7 +484,7 @@ static INT_PTR CALLBACK gg_gc_openconfdlg(HWND hwndDlg, UINT message, WPARAM wPa
if (hItem && SendMessage(hwndList, CLM_GETCHECKMARK, (WPARAM)hItem, 0))
{
HANDLE hMetaContact = gg_getsubcontact(gg, hContact); // MetaContacts support
- participants[i++] = db_get_b(hMetaContact ? hMetaContact : hContact, gg->m_szModuleName, GG_KEY_UIN, 0);
+ participants[i++] = db_get_dw(hMetaContact ? hMetaContact : hContact, gg->m_szModuleName, GG_KEY_UIN, 0);
}
hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
}
@@ -542,15 +542,15 @@ static INT_PTR CALLBACK gg_gc_openconfdlg(HWND hwndDlg, UINT message, WPARAM wPa
if (hMetaContact)
{
szProto = gg->m_szModuleName;
- uin = (uin_t)db_get_b(hMetaContact, gg->m_szModuleName, GG_KEY_UIN, 0);
+ uin = (uin_t)db_get_dw(hMetaContact, gg->m_szModuleName, GG_KEY_UIN, 0);
}
else
{
szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- uin = (uin_t)db_get_b(hContact, gg->m_szModuleName, GG_KEY_UIN, 0);
+ uin = (uin_t)db_get_dw(hContact, gg->m_szModuleName, GG_KEY_UIN, 0);
}
- if (szProto == NULL || lstrcmpA(szProto, gg->m_szModuleName) || !uin || uin == db_get_b(NULL, gg->m_szModuleName, GG_KEY_UIN, 0))
+ if (szProto == NULL || lstrcmpA(szProto, gg->m_szModuleName) || !uin || uin == db_get_dw(NULL, gg->m_szModuleName, GG_KEY_UIN, 0))
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_DELETEITEM, (WPARAM)hItem, 0);
}
hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
@@ -635,7 +635,7 @@ INT_PTR GGPROTO::gc_openconf(WPARAM wParam, LPARAM lParam)
int GGPROTO::gc_changenick(HANDLE hContact, char *pszNick)
{
list_t l;
- uin_t uin = db_get_b(hContact, m_szModuleName, GG_KEY_UIN, 0);
+ uin_t uin = db_get_dw(hContact, m_szModuleName, GG_KEY_UIN, 0);
if (!uin || !pszNick) return 0;
netlog("gg_gc_changenick(): Nickname for uin %d changed to %s.", uin, pszNick);
diff --git a/protocols/Gadu-Gadu/image.cpp b/protocols/Gadu-Gadu/image.cpp
index 8cf2db6a2d..342c2549de 100644
--- a/protocols/Gadu-Gadu/image.cpp
+++ b/protocols/Gadu-Gadu/image.cpp
@@ -621,7 +621,7 @@ static INT_PTR CALLBACK gg_img_dlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (dat->lpImages && gg->isonline())
{
- uin_t uin = (uin_t)db_get_b(dat->hContact, gg->m_szModuleName, GG_KEY_UIN, 0);
+ uin_t uin = (uin_t)db_get_dw(dat->hContact, gg->m_szModuleName, GG_KEY_UIN, 0);
struct gg_msg_richtext_format *r = NULL;
struct gg_msg_richtext_image *p = NULL;
LPVOID pvData = NULL;
@@ -904,7 +904,7 @@ int GGPROTO::img_display(HANDLE hContact, void *img)
if (!dat)
{
dat = gg_img_recvdlg(this, hContact);
- dat->uin = db_get_b(hContact, m_szModuleName, GG_KEY_UIN, 0);
+ dat->uin = db_get_dw(hContact, m_szModuleName, GG_KEY_UIN, 0);
while (WaitForSingleObjectEx(dat->hEvent, INFINITE, TRUE) != WAIT_OBJECT_0);
CloseHandle(dat->hEvent);
@@ -1121,7 +1121,7 @@ GGIMAGEDLGDATA* gg_img_find(GGPROTO *gg, uin_t uin, uint32_t crc32)
dat = (GGIMAGEDLGDATA *)l->data;
if (!dat) break;
- c_uin = db_get_b(dat->hContact, dat->gg->m_szModuleName, GG_KEY_UIN, 0);
+ c_uin = db_get_dw(dat->hContact, dat->gg->m_szModuleName, GG_KEY_UIN, 0);
if (!dat->bReceiving && dat->lpImages && dat->lpImages->crc32 == crc32 && c_uin == uin)
{
diff --git a/protocols/Gadu-Gadu/import.cpp b/protocols/Gadu-Gadu/import.cpp
index c07e2c2006..6d03d4782c 100644
--- a/protocols/Gadu-Gadu/import.cpp
+++ b/protocols/Gadu-Gadu/import.cpp
@@ -162,7 +162,7 @@ char *gg_makecontacts(GGPROTO *gg, int cr)
}
string_append_c(s, ';');
// Readup Uin
- string_append(s, ditoa(db_get_b(hContact, gg->m_szModuleName, GG_KEY_UIN, 0)));
+ string_append(s, ditoa(db_get_dw(hContact, gg->m_szModuleName, GG_KEY_UIN, 0)));
string_append_c(s, ';');
// Readup Mail (fixed: uses stored editable mails)
if (!db_get_s(hContact, "UserInfo", "Mye-mail0", &dbv, DBVT_ASCIIZ))
@@ -337,7 +337,7 @@ INT_PTR GGPROTO::import_server(WPARAM wParam, LPARAM lParam)
}
else return 0;
- if (!(uin = db_get_b(NULL, m_szModuleName, GG_KEY_UIN, 0)))
+ if (!(uin = db_get_dw(NULL, m_szModuleName, GG_KEY_UIN, 0)))
return 0;
// Making contacts list
@@ -384,7 +384,7 @@ INT_PTR GGPROTO::remove_server(WPARAM wParam, LPARAM lParam)
}
else return 0;
- if (!(uin = db_get_b(NULL, m_szModuleName, GG_KEY_UIN, 0)))
+ if (!(uin = db_get_dw(NULL, m_szModuleName, GG_KEY_UIN, 0)))
return 0;
// Making contacts list
@@ -563,7 +563,7 @@ INT_PTR GGPROTO::export_server(WPARAM wParam, LPARAM lParam)
}
else return 0;
- if (!(uin = db_get_b(NULL, m_szModuleName, GG_KEY_UIN, 0)))
+ if (!(uin = db_get_dw(NULL, m_szModuleName, GG_KEY_UIN, 0)))
return 0;
// Making contacts list
diff --git a/protocols/Gadu-Gadu/oauth.cpp b/protocols/Gadu-Gadu/oauth.cpp
index d652a79020..43983edb6d 100644
--- a/protocols/Gadu-Gadu/oauth.cpp
+++ b/protocols/Gadu-Gadu/oauth.cpp
@@ -361,7 +361,7 @@ char* GGPROTO::oauth_header(const char *httpmethod, const char *url)
char *res, uin[32], *password = NULL, *token = NULL, *token_secret = NULL;
DBVARIANT dbv;
- UIN2ID(db_get_b(NULL, m_szModuleName, GG_KEY_UIN, 0), uin);
+ UIN2ID( db_get_dw(NULL, m_szModuleName, GG_KEY_UIN, 0), uin);
if (!db_get_s(NULL, m_szModuleName, GG_KEY_PASSWORD, &dbv, DBVT_ASCIIZ)) {
CallService(MS_DB_CRYPT_DECODESTRING, (WPARAM)(int)strlen(dbv.pszVal) + 1, (LPARAM)dbv.pszVal);
password = mir_strdup(dbv.pszVal);
@@ -395,7 +395,7 @@ int GGPROTO::oauth_receivetoken()
int res = 0;
HANDLE nlc = NULL;
- UIN2ID(db_get_b(NULL, m_szModuleName, GG_KEY_UIN, 0), uin);
+ UIN2ID( db_get_dw(NULL, m_szModuleName, GG_KEY_UIN, 0), uin);
if (!db_get_s(NULL, m_szModuleName, GG_KEY_PASSWORD, &dbv, DBVT_ASCIIZ)) {
CallService(MS_DB_CRYPT_DECODESTRING, strlen(dbv.pszVal) + 1, (LPARAM)dbv.pszVal);
password = mir_strdup(dbv.pszVal);
diff --git a/protocols/Gadu-Gadu/services.cpp b/protocols/Gadu-Gadu/services.cpp
index 921553fadb..a172d10609 100644
--- a/protocols/Gadu-Gadu/services.cpp
+++ b/protocols/Gadu-Gadu/services.cpp
@@ -116,7 +116,7 @@ int GGPROTO::refreshstatus(int status)
LeaveCriticalSection(&sess_mutex);
}
// Change status of the contact with our own UIN (if got yourself added to the contact list)
- changecontactstatus(db_get_b(NULL, m_szModuleName, GG_KEY_UIN, 0), status_m2gg(status, szMsg != NULL), szMsg, 0, 0, 0, 0);
+ changecontactstatus( db_get_dw(NULL, m_szModuleName, GG_KEY_UIN, 0), status_m2gg(status, szMsg != NULL), szMsg, 0, 0, 0, 0);
broadcastnewstatus(status);
mir_free(szMsg);
}
@@ -172,7 +172,7 @@ INT_PTR GGPROTO::getavatarinfo(WPARAM wParam, LPARAM lParam)
char *AvatarURL = NULL;
INT_PTR result = GAIR_NOAVATAR;
DBVARIANT dbv;
- uin_t uin = (uin_t)db_get_b(pai->hContact, m_szModuleName, GG_KEY_UIN, 0);
+ uin_t uin = (uin_t)db_get_dw(pai->hContact, m_szModuleName, GG_KEY_UIN, 0);
netlog("gg_getavatarinfo(): Requesting avatar information for %d.", uin);
diff --git a/protocols/Gadu-Gadu/userutils.cpp b/protocols/Gadu-Gadu/userutils.cpp
index c8476f821d..5982d93aa7 100644
--- a/protocols/Gadu-Gadu/userutils.cpp
+++ b/protocols/Gadu-Gadu/userutils.cpp
@@ -54,7 +54,7 @@ void *gg_doregister(GGPROTO *gg, char *newPass, char *newEmail)
}
else
{
- db_set_w(NULL, gg->m_szModuleName, GG_KEY_UIN, s->uin);
+ db_set_dw(NULL, gg->m_szModuleName, GG_KEY_UIN, s->uin);
CallService(MS_DB_CRYPT_ENCODESTRING, strlen(newPass) + 1, (LPARAM) newPass);
gg->checknewuser(s->uin, newPass);
db_set_s(NULL, gg->m_szModuleName, GG_KEY_PASSWORD, newPass);