diff options
author | George Hazan <george.hazan@gmail.com> | 2013-04-05 22:27:16 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-04-05 22:27:16 +0000 |
commit | 007b4c7301f0d26a72f89f74e9929f42e24eb3e6 (patch) | |
tree | b1ee30b70c6e36d1a06aed6885cb80dc560a68ca /protocols/IRCG/src | |
parent | f4a1bbc6ba4b8137cb868639ac146aa97e97e9df (diff) |
- rest of menus cleared;
- old database macroses wiped out from all plugins (left in m_database.h for compatibility)
git-svn-id: http://svn.miranda-ng.org/main/trunk@4324 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IRCG/src')
-rw-r--r-- | protocols/IRCG/src/clist.cpp | 30 | ||||
-rw-r--r-- | protocols/IRCG/src/commandmonitor.cpp | 48 | ||||
-rw-r--r-- | protocols/IRCG/src/input.cpp | 8 | ||||
-rw-r--r-- | protocols/IRCG/src/irclib.cpp | 4 | ||||
-rw-r--r-- | protocols/IRCG/src/ircproto.cpp | 14 | ||||
-rw-r--r-- | protocols/IRCG/src/options.cpp | 24 | ||||
-rw-r--r-- | protocols/IRCG/src/services.cpp | 24 | ||||
-rw-r--r-- | protocols/IRCG/src/tools.cpp | 42 | ||||
-rw-r--r-- | protocols/IRCG/src/ui_utils.cpp | 20 | ||||
-rw-r--r-- | protocols/IRCG/src/userinfo.cpp | 32 | ||||
-rw-r--r-- | protocols/IRCG/src/windows.cpp | 16 |
11 files changed, 131 insertions, 131 deletions
diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp index e2b0454a35..d3f4aed5de 100644 --- a/protocols/IRCG/src/clist.cpp +++ b/protocols/IRCG/src/clist.cpp @@ -32,8 +32,8 @@ BOOL CIrcProto::CList_AddDCCChat(const CMString& name, const CMString& hostmask, CONTACT usertemp = { (TCHAR*)name.c_str(), NULL, NULL, false, false, true};
hc = CList_FindContact( &usertemp );
- if ( hc && DBGetContactSettingByte( hc, "CList", "NotOnList", 0) == 0
- && DBGetContactSettingByte(hc,"CList", "Hidden", 0) == 0)
+ if ( hc && db_get_b( hc, "CList", "NotOnList", 0) == 0
+ && db_get_b(hc,"CList", "Hidden", 0) == 0)
{
bFlag = true;
}
@@ -93,9 +93,9 @@ HANDLE CIrcProto::CList_AddContact(CONTACT * user, bool InList, bool SetOnline) HANDLE hContact = CList_FindContact(user);
if ( hContact ) {
if ( InList )
- DBDeleteContactSetting( hContact, "CList", "NotOnList" );
+ db_unset( hContact, "CList", "NotOnList" );
setTString(hContact, "Nick", user->name);
- DBDeleteContactSetting(hContact, "CList", "Hidden");
+ db_unset(hContact, "CList", "Hidden");
if (SetOnline && getWord(hContact, "Status", ID_STATUS_OFFLINE)== ID_STATUS_OFFLINE)
setWord(hContact, "Status", ID_STATUS_ONLINE);
return hContact;
@@ -107,10 +107,10 @@ HANDLE CIrcProto::CList_AddContact(CONTACT * user, bool InList, bool SetOnline) CallService( MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM)m_szModuleName );
if ( InList )
- DBDeleteContactSetting(hContact, "CList", "NotOnList");
+ db_unset(hContact, "CList", "NotOnList");
else
- DBWriteContactSettingByte(hContact, "CList", "NotOnList", 1);
- DBDeleteContactSetting(hContact, "CList", "Hidden");
+ db_set_b(hContact, "CList", "NotOnList", 1);
+ db_unset(hContact, "CList", "Hidden");
setTString(hContact, "Nick", user->name);
setTString(hContact, "Default", user->name);
setWord(hContact, "Status", SetOnline ? ID_STATUS_ONLINE:ID_STATUS_OFFLINE);
@@ -131,7 +131,7 @@ HANDLE CIrcProto::CList_SetOffline(struct CONTACT * user) setString(hContact, "Host", "");
setTString(hContact, "Nick", dbv.ptszVal);
setWord(hContact, "Status", ID_STATUS_OFFLINE);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return hContact;
} }
@@ -156,9 +156,9 @@ bool CIrcProto::CList_SetAllOffline(BYTE ChatsToo) else if ( !getTString( hContact, "Default", &dbv )) {
setTString( hContact, "Nick", dbv.ptszVal);
setWord( hContact, "Status", ID_STATUS_OFFLINE );
- DBFreeVariant( &dbv );
+ db_free( &dbv );
}
- DBDeleteContactSetting( hContact, m_szModuleName, "IP" );
+ db_unset( hContact, m_szModuleName, "IP" );
setString( hContact, "User", "" );
setString( hContact, "Host", "" );
} }
@@ -227,11 +227,11 @@ HANDLE CIrcProto::CList_FindContact (CONTACT* user) hContact_temp = hContact;
} }
- if ( DBDefault ) DBFreeVariant(&dbv1);
- if ( DBNick ) DBFreeVariant(&dbv2);
- if ( DBWildcard ) DBFreeVariant(&dbv3);
- if ( DBUser ) DBFreeVariant(&dbv4);
- if ( DBHost ) DBFreeVariant(&dbv5);
+ if ( DBDefault ) db_free(&dbv1);
+ if ( DBNick ) db_free(&dbv2);
+ if ( DBWildcard ) db_free(&dbv3);
+ if ( DBUser ) db_free(&dbv4);
+ if ( DBHost ) db_free(&dbv5);
if ( hContact_temp != NULL ) {
mir_free(lowercasename);
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index bd6021e292..752e764ccf 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -148,19 +148,19 @@ VOID CALLBACK OnlineNotifTimerProc( HWND, UINT, UINT_PTR idEvent, DWORD ) BYTE bRoom = ppro->getByte(hContact, "ChatRoom", 0);
if ( bRoom == 0 ) {
BYTE bDCC = ppro->getByte(hContact, "DCC", 0);
- BYTE bHidden = DBGetContactSettingByte(hContact,"CList", "Hidden", 0);
+ BYTE bHidden = db_get_b(hContact,"CList", "Hidden", 0);
if ( bDCC == 0 && bHidden == 0 ) {
if ( !ppro->getTString( hContact, "Default", &dbv )) {
BYTE bAdvanced = ppro->getByte(hContact, "AdvancedMode", 0) ;
if ( !bAdvanced ) {
- DBFreeVariant( &dbv );
+ db_free( &dbv );
if ( !ppro->getTString( hContact, "Nick", &dbv )) {
ppro->m_namesToUserhost += CMString(dbv.ptszVal) + _T(" ");
- DBFreeVariant( &dbv );
+ db_free( &dbv );
}
}
else {
- DBFreeVariant( &dbv );
+ db_free( &dbv );
DBVARIANT dbv2;
TCHAR* DBNick = NULL;
@@ -175,8 +175,8 @@ VOID CALLBACK OnlineNotifTimerProc( HWND, UINT, UINT_PTR idEvent, DWORD ) else if ( DBWildcard )
ppro->m_namesToWho += CMString(DBWildcard) + _T(" ");
- if ( DBNick ) DBFreeVariant(&dbv);
- if ( DBWildcard ) DBFreeVariant(&dbv2);
+ if ( DBNick ) db_free(&dbv);
+ if ( DBWildcard ) db_free(&dbv2);
} } } } }
hContact = db_find_next(hContact);
@@ -714,7 +714,7 @@ bool CIrcProto::OnIrc_PRIVMSG( const CIrcMessage* pmsg ) if (( m_ignore && IsIgnored( pmsg->prefix.sNick, pmsg->prefix.sUser, pmsg->prefix.sHost, 'q' ))) {
HANDLE hContact = CList_FindContact( &user );
- if ( !hContact || ( hContact && DBGetContactSettingByte( hContact,"CList", "Hidden", 0) == 1 ))
+ if ( !hContact || ( hContact && db_get_b( hContact,"CList", "Hidden", 0) == 1 ))
return true;
}
@@ -1082,8 +1082,8 @@ bool CIrcProto::IsCTCP( const CIrcMessage* pmsg ) // check if it should be ignored
if ( m_DCCChatIgnore == 1 ||
m_DCCChatIgnore == 2 && hContact &&
- DBGetContactSettingByte(hContact,"CList", "NotOnList", 0) == 0 &&
- DBGetContactSettingByte(hContact,"CList", "Hidden", 0) == 0)
+ db_get_b(hContact,"CList", "NotOnList", 0) == 0 &&
+ db_get_b(hContact,"CList", "Hidden", 0) == 0)
{
CMString host = pmsg->prefix.sUser + _T("@") + pmsg->prefix.sHost;
CList_AddDCCChat(pmsg->prefix.sNick, host, dwAdr, iPort); // add a CHAT event to the clist
@@ -1431,10 +1431,10 @@ bool CIrcProto::OnIrc_ENDNAMES( const CIrcMessage* pmsg ) else CallChatEvent( SESSION_INITDONE, (LPARAM)&gce);
if ( save.IsEmpty())
- DBDeleteContactSetting(NULL, m_szModuleName, "JTemp");
+ db_unset(NULL, m_szModuleName, "JTemp");
else
setTString("JTemp", save.c_str());
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else CallChatEvent( SESSION_INITDONE, (LPARAM)&gce);
@@ -1791,13 +1791,13 @@ bool CIrcProto::OnIrc_WHOIS_NO_USER( const CIrcMessage* pmsg ) else {
if ( !getTString( hContact, "UWildcard", &dbv2 )) {
DoUserhostWithReason(2, ((CMString)_T("S") + dbv2.ptszVal).c_str(), true, dbv2.ptszVal );
- DBFreeVariant(&dbv2);
+ db_free(&dbv2);
}
else DoUserhostWithReason(2, ((CMString)_T("S") + dbv.ptszVal).c_str(), true, dbv.ptszVal );
}
setString(hContact, "User", "");
setString(hContact, "Host", "");
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} } }
ShowMessage( pmsg );
@@ -1855,10 +1855,10 @@ bool CIrcProto::OnIrc_JOINERROR( const CIrcMessage* pmsg ) save += command + _T(" ");
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if ( save.IsEmpty())
- DBDeleteContactSetting( NULL, m_szModuleName, "JTemp" );
+ db_unset( NULL, m_szModuleName, "JTemp" );
else
setTString( "JTemp", save.c_str());
} }
@@ -2018,13 +2018,13 @@ bool CIrcProto::OnIrc_WHO_END( const CIrcMessage* pmsg ) setString(hContact, "Host", "");
}
LBL_Exit:
- if ( DBDefault ) DBFreeVariant(&dbv1);
- if ( DBNick ) DBFreeVariant(&dbv2);
- if ( DBWildcard ) DBFreeVariant(&dbv3);
- if ( DBUser ) DBFreeVariant(&dbv4);
- if ( DBHost ) DBFreeVariant(&dbv5);
- if ( DBManUser ) DBFreeVariant(&dbv6);
- if ( DBManHost ) DBFreeVariant(&dbv7);
+ if ( DBDefault ) db_free(&dbv1);
+ if ( DBNick ) db_free(&dbv2);
+ if ( DBWildcard ) db_free(&dbv3);
+ if ( DBUser ) db_free(&dbv4);
+ if ( DBHost ) db_free(&dbv5);
+ if ( DBManUser ) db_free(&dbv6);
+ if ( DBManHost ) db_free(&dbv7);
}
mir_free( UserList );
}
@@ -2291,7 +2291,7 @@ void CIrcProto::OnIrcDefault( const CIrcMessage* pmsg ) void CIrcProto::OnIrcDisconnected()
{
m_statusMessage = _T("");
- DBDeleteContactSetting(NULL, m_szModuleName, "JTemp");
+ db_unset(NULL, m_szModuleName, "JTemp");
bTempDisableCheck = false;
bTempForceCheck = false;
m_iTempCheckTime = 0;
@@ -2432,7 +2432,7 @@ int CIrcProto::DoPerform( const char* event ) PostIrcMessageWnd( NULL, NULL, dbv.ptszVal );
else
mir_forkthread( AwayWarningThread, NULL );
- DBFreeVariant( &dbv );
+ db_free( &dbv );
return 1;
}
return 0;
diff --git a/protocols/IRCG/src/input.cpp b/protocols/IRCG/src/input.cpp index eafeae75fb..2f87cb1409 100644 --- a/protocols/IRCG/src/input.cpp +++ b/protocols/IRCG/src/input.cpp @@ -52,7 +52,7 @@ void CIrcProto::FormatMsg(CMString& text) DBVARIANT dbv;
if ( !getTString( "PNick", &dbv )) {
sNick4Perform = dbv.ptszVal;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} }
ReplaceString( sNewNick, NICKSUBSTITUTE, sNick4Perform.c_str());
@@ -579,7 +579,7 @@ BOOL CIrcProto::DoHardcodedCommand( CMString text, TCHAR* window, HANDLE hContac CMString S = _T("S");
S += dbv1.ptszVal;
DoUserhostWithReason(2, S.c_str(), true, dbv1.ptszVal);
- DBFreeVariant(&dbv1);
+ db_free(&dbv1);
}
else {
CMString S = _T("S");
@@ -653,7 +653,7 @@ BOOL CIrcProto::DoHardcodedCommand( CMString text, TCHAR* window, HANDLE hContac if ( !getTString( hContact, "UWildcard", &dbv1 )) {
S += dbv1.ptszVal;
DoUserhostWithReason(2, S.c_str(), true, dbv1.ptszVal );
- DBFreeVariant( &dbv1 );
+ db_free( &dbv1 );
}
else {
S += two;
@@ -825,7 +825,7 @@ bool CIrcProto::PostIrcMessageWnd( TCHAR* window, HANDLE hContact, const TCHAR* if ( hContact && !getTString( hContact, "Nick", &dbv )) {
lstrcpyn( windowname, dbv.ptszVal, 255);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else if ( window )
lstrcpyn( windowname, window, 255 );
diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp index e6fd017765..0ebc2d4da0 100644 --- a/protocols/IRCG/src/irclib.cpp +++ b/protocols/IRCG/src/irclib.cpp @@ -552,11 +552,11 @@ CDccSession* CIrcProto::FindDCCRecvByPortAndName(int iPort, const TCHAR* szName) DBVARIANT dbv;
if ( !getTString(p->di->hContact, "Nick", &dbv)) {
if ( p->di->iType == DCC_SEND && !p->di->bSender && !lstrcmpi( szName, dbv.ptszVal) && iPort == p->di->iPort ) {
- DBFreeVariant(&dbv);
+ db_free(&dbv);
LeaveCriticalSection(&m_dcc);
return p;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index 95df8741a2..55566a75c0 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -196,7 +196,7 @@ int CIrcProto::OnModulesLoaded( WPARAM, LPARAM ) NETLIBUSER nlu = {0};
TCHAR name[128];
- DBDeleteContactSetting( NULL, m_szModuleName, "JTemp" );
+ db_unset( NULL, m_szModuleName, "JTemp" );
nlu.cbSize = sizeof(nlu);
nlu.flags = NUF_OUTGOING|NUF_INCOMING|NUF_HTTPCONNS|NUF_TCHAR;
@@ -305,10 +305,10 @@ int CIrcProto::OnModulesLoaded( WPARAM, LPARAM ) String s = performToConvert[i];
DBVARIANT dbv;
if ( !getTString( s, &dbv )) {
- DBDeleteContactSetting( NULL, m_szModuleName, s );
+ db_unset( NULL, m_szModuleName, s );
s.MakeUpper();
setTString( s, dbv.ptszVal );
- DBFreeVariant( &dbv );
+ db_free( &dbv );
} }
setByte( "PerformConversionDone", 1 );
@@ -362,7 +362,7 @@ HANDLE __cdecl CIrcProto::AddToList( int, PROTOSEARCHRESULT* psr ) if ( !getTString(hContact, "UWildcard", &dbv1 )) {
S += dbv1.ptszVal;
DoUserhostWithReason(2, S, true, dbv1.ptszVal);
- DBFreeVariant( &dbv1 );
+ db_free( &dbv1 );
}
else {
S += user.name;
@@ -787,7 +787,7 @@ HANDLE __cdecl CIrcProto::SendFile( HANDLE hContact, const TCHAR*, TCHAR** ppszF index++;
}
- DBFreeVariant( &dbv );
+ db_free( &dbv );
} }
if (dci)
@@ -953,14 +953,14 @@ HANDLE __cdecl CIrcProto::GetAwayMsg( HANDLE hContact ) if ( hContact && !getTString( hContact, "Nick", &dbv)) {
int i = getWord( hContact, "Status", ID_STATUS_OFFLINE );
if ( i != ID_STATUS_AWAY) {
- DBFreeVariant( &dbv);
+ db_free( &dbv);
return 0;
}
CMString S = _T("WHOIS ");
S += dbv.ptszVal;
if (IsConnected())
SendIrcMessage( S.c_str(), false);
- DBFreeVariant( &dbv);
+ db_free( &dbv);
} }
return (HANDLE)1;
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index d05b07df1a..a0103154d7 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -52,7 +52,7 @@ void CIrcProto::ReadSettings( TDbSetting* sets, int count ) ptr[len] = 0;
}
else *( char** )ptr = mir_strdup( dbv.pszVal );
- DBFreeVariant( &dbv );
+ db_free( &dbv );
}
else {
if ( p->size != -1 )
@@ -69,7 +69,7 @@ void CIrcProto::ReadSettings( TDbSetting* sets, int count ) *( TCHAR* )&ptr[len*sizeof(TCHAR)] = 0;
}
else *( TCHAR** )ptr = mir_tstrdup( dbv.ptszVal );
- DBFreeVariant( &dbv );
+ db_free( &dbv );
}
else {
if ( p->size != -1 ) {
@@ -115,7 +115,7 @@ void CIrcProto::WriteSettings( TDbSetting* sets, int count ) static int sttServerEnum( const char* szSetting, LPARAM )
{
DBVARIANT dbv;
- if ( DBGetContactSettingString( NULL, SERVERSMODULE, szSetting, &dbv ))
+ if ( db_get_s( NULL, SERVERSMODULE, szSetting, &dbv ))
return 0;
SERVER_INFO* pData = new SERVER_INFO;
@@ -159,7 +159,7 @@ static int sttServerEnum( const char* szSetting, LPARAM ) lstrcpynA( pData->m_group, p1, p2-p1+1 );
g_servers.insert( pData );
- DBFreeVariant( &dbv );
+ db_free( &dbv );
return 0;
}
@@ -814,7 +814,7 @@ void CConnectPrefsDlg::OnApply() mir_snprintf(TextLine, sizeof(TextLine), "SERVER:SSL%u%s:%d-%dGROUP:%s", pData->m_iSSL, pData->m_address, pData->m_portStart, pData->m_portEnd, pData->m_group);
else
mir_snprintf(TextLine, sizeof(TextLine), "SERVER:%s:%d-%dGROUP:%s", pData->m_address, pData->m_portStart, pData->m_portEnd, pData->m_group);
- DBWriteContactSettingString( NULL, SERVERSMODULE, pData->m_name, TextLine );
+ db_set_s( NULL, SERVERSMODULE, pData->m_name, TextLine );
// combobox might contain new items
if ( g_servers.find( pData ) == NULL )
@@ -1211,7 +1211,7 @@ void COtherPrefsDlg::OnApply() if ( !pPerf->mText.IsEmpty())
m_proto->setTString( pPerf->mSetting.c_str(), pPerf->mText.c_str());
else
- DBDeleteContactSetting( NULL, m_proto->m_szModuleName, pPerf->mSetting.c_str());
+ db_unset( NULL, m_proto->m_szModuleName, pPerf->mSetting.c_str());
} }
m_proto->WriteSettings( OtherSettings, SIZEOF( OtherSettings ));
}
@@ -1225,7 +1225,7 @@ void COtherPrefsDlg::addPerformComboValue( int idx, const char* szValueName ) DBVARIANT dbv;
if ( !m_proto->getTString( sSetting.c_str(), &dbv )) {
pPref = new PERFORM_INFO( sSetting.c_str(), dbv.ptszVal );
- DBFreeVariant( &dbv );
+ db_free( &dbv );
}
else pPref = new PERFORM_INFO( sSetting.c_str(), _T(""));
m_performCombo.SetItemData( idx, ( LPARAM )pPref );
@@ -1407,7 +1407,7 @@ void CIrcProto::InitIgnore( void ) CMString flags = GetWord( dbv.ptszVal, 1 );
CMString network = GetWord( dbv.ptszVal, 2 );
m_ignoreItems.insert( new CIrcIgnoreItem( mask.c_str(), flags.c_str(), network.c_str()));
- DBFreeVariant( &dbv );
+ db_free( &dbv );
} }
void CIrcProto::RewriteIgnoreSettings( void )
@@ -1417,7 +1417,7 @@ void CIrcProto::RewriteIgnoreSettings( void ) int i=0;
for ( ;; ) {
mir_snprintf( settingName, sizeof(settingName), "IGNORE:%d", i++ );
- if ( DBDeleteContactSetting( NULL, m_szModuleName, settingName ))
+ if ( db_unset( NULL, m_szModuleName, settingName ))
break;
}
@@ -1733,11 +1733,11 @@ void CIrcProto::InitPrefs(void) int x = getDword( "SizeOfListBottom", -1 );
if ( x != -1 ) {
- DBDeleteContactSetting( NULL, m_szModuleName, "SizeOfListBottom" );
+ db_unset( NULL, m_szModuleName, "SizeOfListBottom" );
setDword( "channelList_height", x );
}
if (( x = getDword( "SizeOfListWidth", -1 )) != -1 ) {
- DBDeleteContactSetting( NULL, m_szModuleName, "SizeOfListWidth" );
+ db_unset( NULL, m_szModuleName, "SizeOfListWidth" );
setDword( "channelList_width", x );
}
@@ -1892,7 +1892,7 @@ static void sttImportIni( const TCHAR* szIniFile ) memcpy( buf2, p, int(p1-p));
buf2[ int(p1-p) ] = 0;
- DBWriteContactSettingString( NULL, SERVERSMODULE, buf2, p1 );
+ db_set_s( NULL, SERVERSMODULE, buf2, p1 );
}
fclose( serverFile );
::_tremove( szIniFile );
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index c8204ac5d6..31706f1858 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -248,7 +248,7 @@ int __cdecl CIrcProto::OnContactDeleted(WPARAM wp, LPARAM) dcc->Disconnect();
} }
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -262,7 +262,7 @@ INT_PTR __cdecl CIrcProto::OnJoinChat(WPARAM wp, LPARAM) if ( !getTString(( HANDLE )wp, "Nick", &dbv)) {
if ( getByte(( HANDLE )wp, "ChatRoom", 0) == GCW_CHATROOM)
PostIrcMessage( _T("/JOIN %s"), dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -288,7 +288,7 @@ INT_PTR __cdecl CIrcProto::OnLeaveChat(WPARAM wp, LPARAM) gcd.ptszID = ( TCHAR* )S.c_str();
CallChatEvent( SESSION_TERMINATE, (LPARAM)&gce);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -302,7 +302,7 @@ INT_PTR __cdecl CIrcProto::OnMenuChanSettings(WPARAM wp, LPARAM) DBVARIANT dbv;
if ( !getTString( hContact, "Nick", &dbv )) {
PostIrcMessageWnd(dbv.ptszVal, NULL, _T("/CHANNELMANAGER"));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -316,7 +316,7 @@ INT_PTR __cdecl CIrcProto::OnMenuWhois(WPARAM wp, LPARAM) if ( !getTString(( HANDLE )wp, "Nick", &dbv)) {
PostIrcMessage( _T("/WHOIS %s %s"), dbv.ptszVal, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -352,10 +352,10 @@ INT_PTR __cdecl CIrcProto::OnMenuIgnore(WPARAM wp, LPARAM) PostIrcMessage( _T("/IGNORE %%question=\"%s\",\"%s\",\"*!*@%S\" %s"),
TranslateT("Please enter the hostmask (nick!user@host) \nNOTE! Contacts on your contact list are never ignored"),
TranslateT("Ignore"), host, S.c_str());
- DBFreeVariant(&dbv1);
+ db_free(&dbv1);
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -649,7 +649,7 @@ int __cdecl CIrcProto::GCEventHook(WPARAM wParam,LPARAM lParam) DBVARIANT dbv;
if ( !getTString( "Nick", &dbv )) {
PostIrcMessage( _T("/nickserv SENDPASS %s"), dbv.ptszVal);
- DBFreeVariant( &dbv );
+ db_free( &dbv );
} }
break;
case 10: // nickserv set new password
@@ -940,7 +940,7 @@ int __cdecl CIrcProto::GCMenuHook(WPARAM, LPARAM lParam) gcmi->nItems = SIZEOF(nickItems);
gcmi->Item = nickItems;
- BOOL bIsInList = (hContact && DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) == 0);
+ BOOL bIsInList = (hContact && db_get_b(hContact, "CList", "NotOnList", 0) == 0);
gcmi->Item[gcmi->nItems-1].bDisabled = bIsInList;
unsigned long ulAdr = 0;
@@ -1033,12 +1033,12 @@ int __cdecl CIrcProto::OnMenuPreBuild(WPARAM wParam, LPARAM) if ( !getString( hContact, "Host", &dbv3)) {
if (dbv3.pszVal[0] == 0)
bEnabled = false;
- DBFreeVariant(&dbv3);
+ db_free(&dbv3);
}
}
Menu_ShowItem(hUMenuIgnore, bEnabled);
}
- DBFreeVariant( &dbv );
+ db_free( &dbv );
}
}
@@ -1063,7 +1063,7 @@ int __cdecl CIrcProto::OnDbSettingChanged(WPARAM wParam, LPARAM lParam) if ( !getTString( hContact, "Nick", &dbv )) {
if ( getByte( "MirVerAutoRequest", 1))
PostIrcMessage( _T("/PRIVMSG %s \001VERSION\001"), dbv.ptszVal );
- DBFreeVariant( &dbv );
+ db_free( &dbv );
} }
return 0;
}
diff --git a/protocols/IRCG/src/tools.cpp b/protocols/IRCG/src/tools.cpp index a665eb205c..a656313cc2 100644 --- a/protocols/IRCG/src/tools.cpp +++ b/protocols/IRCG/src/tools.cpp @@ -25,83 +25,83 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // Standard functions
int CIrcProto::getByte( const char* name, BYTE defaultValue )
-{ return DBGetContactSettingByte( NULL, m_szModuleName, name, defaultValue );
+{ return db_get_b( NULL, m_szModuleName, name, defaultValue );
}
int CIrcProto::getByte( HANDLE hContact, const char* name, BYTE defaultValue )
-{ return DBGetContactSettingByte(hContact, m_szModuleName, name, defaultValue );
+{ return db_get_b(hContact, m_szModuleName, name, defaultValue );
}
int CIrcProto::getDword( const char* name, DWORD defaultValue )
-{ return DBGetContactSettingDword( NULL, m_szModuleName, name, defaultValue );
+{ return db_get_dw( NULL, m_szModuleName, name, defaultValue );
}
int CIrcProto::getDword( HANDLE hContact, const char* name, DWORD defaultValue )
-{ return DBGetContactSettingDword(hContact, m_szModuleName, name, defaultValue );
+{ return db_get_dw(hContact, m_szModuleName, name, defaultValue );
}
int CIrcProto::getString( const char* name, DBVARIANT* result )
-{ return DBGetContactSettingString( NULL, m_szModuleName, name, result );
+{ return db_get_s( NULL, m_szModuleName, name, result );
}
int CIrcProto::getString( HANDLE hContact, const char* name, DBVARIANT* result )
-{ return DBGetContactSettingString( hContact, m_szModuleName, name, result );
+{ return db_get_s( hContact, m_szModuleName, name, result );
}
int CIrcProto::getTString( const char* name, DBVARIANT* result )
-{ return DBGetContactSettingTString( NULL, m_szModuleName, name, result );
+{ return db_get_ts( NULL, m_szModuleName, name, result );
}
int CIrcProto::getTString( HANDLE hContact, const char* name, DBVARIANT* result )
-{ return DBGetContactSettingTString( hContact, m_szModuleName, name, result );
+{ return db_get_ts( hContact, m_szModuleName, name, result );
}
int CIrcProto::getWord( const char* name, WORD defaultValue )
-{ return DBGetContactSettingWord( NULL, m_szModuleName, name, defaultValue );
+{ return db_get_w( NULL, m_szModuleName, name, defaultValue );
}
int CIrcProto::getWord( HANDLE hContact, const char* name, WORD defaultValue )
-{ return DBGetContactSettingWord(hContact, m_szModuleName, name, defaultValue );
+{ return db_get_w(hContact, m_szModuleName, name, defaultValue );
}
void CIrcProto::setByte( const char* name, BYTE value )
-{ DBWriteContactSettingByte(NULL, m_szModuleName, name, value );
+{ db_set_b(NULL, m_szModuleName, name, value );
}
void CIrcProto::setByte( HANDLE hContact, const char* name, BYTE value )
-{ DBWriteContactSettingByte(hContact, m_szModuleName, name, value );
+{ db_set_b(hContact, m_szModuleName, name, value );
}
void CIrcProto::setDword( const char* name, DWORD value )
-{ DBWriteContactSettingDword(NULL, m_szModuleName, name, value );
+{ db_set_dw(NULL, m_szModuleName, name, value );
}
void CIrcProto::setDword( HANDLE hContact, const char* name, DWORD value )
-{ DBWriteContactSettingDword(hContact, m_szModuleName, name, value );
+{ db_set_dw(hContact, m_szModuleName, name, value );
}
void CIrcProto::setString( const char* name, const char* value )
-{ DBWriteContactSettingString(NULL, m_szModuleName, name, value );
+{ db_set_s(NULL, m_szModuleName, name, value );
}
void CIrcProto::setString( HANDLE hContact, const char* name, const char* value )
-{ DBWriteContactSettingString(hContact, m_szModuleName, name, value );
+{ db_set_s(hContact, m_szModuleName, name, value );
}
void CIrcProto::setTString( const char* name, const TCHAR* value )
-{ DBWriteContactSettingTString(NULL, m_szModuleName, name, value );
+{ db_set_ts(NULL, m_szModuleName, name, value );
}
void CIrcProto::setTString( HANDLE hContact, const char* name, const TCHAR* value )
-{ DBWriteContactSettingTString(hContact, m_szModuleName, name, value );
+{ db_set_ts(hContact, m_szModuleName, name, value );
}
void CIrcProto::setWord( const char* name, int value )
-{ DBWriteContactSettingWord(NULL, m_szModuleName, name, value );
+{ db_set_w(NULL, m_szModuleName, name, value );
}
void CIrcProto::setWord( HANDLE hContact, const char* name, int value )
-{ DBWriteContactSettingWord(hContact, m_szModuleName, name, value );
+{ db_set_w(hContact, m_szModuleName, name, value );
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -126,7 +126,7 @@ void CIrcProto::AddToJTemp(TCHAR op, CMString& sCommand) DBVARIANT dbv;
if ( !getTString( "JTemp", &dbv )) {
res = CMString(dbv.ptszVal) + _T(" ") + res;
- DBFreeVariant( &dbv );
+ db_free( &dbv );
}
setTString("JTemp", res.c_str());
diff --git a/protocols/IRCG/src/ui_utils.cpp b/protocols/IRCG/src/ui_utils.cpp index c1cf19309f..b86263dbfd 100644 --- a/protocols/IRCG/src/ui_utils.cpp +++ b/protocols/IRCG/src/ui_utils.cpp @@ -1757,15 +1757,15 @@ CDbLink::~CDbLink() mir_free(m_szSetting);
mir_free(m_szDefault);
if (dbv.type != DBVT_DELETED)
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
DWORD CDbLink::LoadInt()
{
switch (m_type) {
- case DBVT_BYTE: return DBGetContactSettingByte(NULL, m_szModule, m_szSetting, m_iDefault);
- case DBVT_WORD: return DBGetContactSettingWord(NULL, m_szModule, m_szSetting, m_iDefault);
- case DBVT_DWORD: return DBGetContactSettingDword(NULL, m_szModule, m_szSetting, m_iDefault);
+ case DBVT_BYTE: return db_get_b(NULL, m_szModule, m_szSetting, m_iDefault);
+ case DBVT_WORD: return db_get_w(NULL, m_szModule, m_szSetting, m_iDefault);
+ case DBVT_DWORD: return db_get_dw(NULL, m_szModule, m_szSetting, m_iDefault);
default: return m_iDefault;
}
}
@@ -1773,16 +1773,16 @@ DWORD CDbLink::LoadInt() void CDbLink::SaveInt(DWORD value)
{
switch (m_type) {
- case DBVT_BYTE: DBWriteContactSettingByte(NULL, m_szModule, m_szSetting, (BYTE)value); break;
- case DBVT_WORD: DBWriteContactSettingWord(NULL, m_szModule, m_szSetting, (WORD)value); break;
- case DBVT_DWORD: DBWriteContactSettingDword(NULL, m_szModule, m_szSetting, value); break;
+ case DBVT_BYTE: db_set_b(NULL, m_szModule, m_szSetting, (BYTE)value); break;
+ case DBVT_WORD: db_set_w(NULL, m_szModule, m_szSetting, (WORD)value); break;
+ case DBVT_DWORD: db_set_dw(NULL, m_szModule, m_szSetting, value); break;
}
}
TCHAR* CDbLink::LoadText()
{
- if (dbv.type != DBVT_DELETED) DBFreeVariant(&dbv);
- if (!DBGetContactSettingTString(NULL, m_szModule, m_szSetting, &dbv))
+ if (dbv.type != DBVT_DELETED) db_free(&dbv);
+ if (!db_get_ts(NULL, m_szModule, m_szSetting, &dbv))
{
if (dbv.type == DBVT_TCHAR)
return dbv.ptszVal;
@@ -1795,7 +1795,7 @@ TCHAR* CDbLink::LoadText() void CDbLink::SaveText(TCHAR *value)
{
- DBWriteContactSettingTString(NULL, m_szModule, m_szSetting, value);
+ db_set_ts(NULL, m_szModule, m_szSetting, value);
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/IRCG/src/userinfo.cpp b/protocols/IRCG/src/userinfo.cpp index 35a23f3ca1..ef79488499 100644 --- a/protocols/IRCG/src/userinfo.cpp +++ b/protocols/IRCG/src/userinfo.cpp @@ -66,24 +66,24 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM SetDlgItemText( m_hwnd, IDC_DEFAULT, TranslateT(STR_BASIC));
if ( !p->ppro->getTString( p->hContact, "Default", &dbv)) {
SetDlgItemText( m_hwnd, IDC_WILDCARD, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else {
SetDlgItemText( m_hwnd, IDC_DEFAULT, TranslateT(STR_ADVANCED));
if ( !p->ppro->getTString( p->hContact, "UWildcard", &dbv)) {
SetDlgItemText( m_hwnd, IDC_WILDCARD, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} }
if ( !p->ppro->getTString( p->hContact, "UUser", &dbv)) {
SetDlgItemText( m_hwnd, IDC_USER, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if ( !p->ppro->getTString( p->hContact, "UHost", &dbv)) {
SetDlgItemText( m_hwnd, IDC_HOST, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
ProtoBroadcastAck(p->ppro->m_szModuleName, p->hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
}
@@ -119,17 +119,17 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM S += _T(")");
if (( lstrlen(temp) < 4 && lstrlen(temp)) || !WCCmp(CharLower(temp), CharLower(dbv.ptszVal))) {
MessageBox( NULL, TranslateTS( S.c_str()), TranslateT( "IRC error" ), MB_OK | MB_ICONERROR );
- DBFreeVariant( &dbv );
+ db_free( &dbv );
return FALSE;
}
- DBFreeVariant( &dbv );
+ db_free( &dbv );
}
GetDlgItemText( m_hwnd, IDC_WILDCARD, temp, SIZEOF(temp));
if ( lstrlen( GetWord(temp, 0).c_str()))
p->ppro->setTString( p->hContact, "UWildcard", GetWord(temp, 0).c_str());
else
- DBDeleteContactSetting( p->hContact, p->ppro->m_szModuleName, "UWildcard");
+ db_unset( p->hContact, p->ppro->m_szModuleName, "UWildcard");
}
p->ppro->setByte( p->hContact, "AdvancedMode", bAdvanced);
@@ -138,13 +138,13 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM if (lstrlen(GetWord(temp, 0).c_str()))
p->ppro->setTString( p->hContact, "UUser", GetWord(temp, 0).c_str());
else
- DBDeleteContactSetting( p->hContact, p->ppro->m_szModuleName, "UUser");
+ db_unset( p->hContact, p->ppro->m_szModuleName, "UUser");
GetDlgItemText( m_hwnd, IDC_HOST, temp, SIZEOF(temp));
if (lstrlen(GetWord(temp, 0).c_str()))
p->ppro->setTString( p->hContact, "UHost", GetWord(temp, 0).c_str());
else
- DBDeleteContactSetting( p->hContact, p->ppro->m_szModuleName, "UHost");
+ db_unset( p->hContact, p->ppro->m_szModuleName, "UHost");
EnableWindow(GetDlgItem( m_hwnd, IDC_BUTTON), FALSE);
}
@@ -154,9 +154,9 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM SetDlgItemTextA( m_hwnd, IDC_WILDCARD, "");
SetDlgItemTextA( m_hwnd, IDC_HOST, "" );
SetDlgItemTextA( m_hwnd, IDC_USER, "" );
- DBDeleteContactSetting( p->hContact, p->ppro->m_szModuleName, "UWildcard");
- DBDeleteContactSetting( p->hContact, p->ppro->m_szModuleName, "UUser");
- DBDeleteContactSetting( p->hContact, p->ppro->m_szModuleName, "UHost");
+ db_unset( p->hContact, p->ppro->m_szModuleName, "UWildcard");
+ db_unset( p->hContact, p->ppro->m_szModuleName, "UUser");
+ db_unset( p->hContact, p->ppro->m_szModuleName, "UHost");
EnableWindow(GetDlgItem( m_hwnd, IDC_BUTTON), FALSE );
EnableWindow(GetDlgItem( m_hwnd, IDC_BUTTON2), FALSE );
}
@@ -167,7 +167,7 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM DBVARIANT dbv;
if ( !p->ppro->getTString( p->hContact, "Default", &dbv )) {
SetDlgItemText( m_hwnd, IDC_WILDCARD, dbv.ptszVal );
- DBFreeVariant( &dbv );
+ db_free( &dbv );
}
EnableWindow(GetDlgItem( m_hwnd, IDC_WILDCARD), FALSE );
}
@@ -177,7 +177,7 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM SetDlgItemText( m_hwnd, IDC_DEFAULT, TranslateT(STR_ADVANCED));
if ( !p->ppro->getTString( p->hContact, "UWildcard", &dbv )) {
SetDlgItemText( m_hwnd, IDC_WILDCARD, dbv.ptszVal );
- DBFreeVariant( &dbv );
+ db_free( &dbv );
}
EnableWindow(GetDlgItem( m_hwnd, IDC_WILDCARD), true);
}
@@ -202,10 +202,10 @@ int __cdecl CIrcProto::OnInitUserInfo(WPARAM wParam, LPARAM lParam) DBVARIANT dbv;
if ( !getTString( hContact, "Default", &dbv )) {
if ( IsChannel( dbv.ptszVal )) {
- DBFreeVariant( &dbv );
+ db_free( &dbv );
return 0;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
OPTIONSDIALOGPAGE odp = { 0 };
diff --git a/protocols/IRCG/src/windows.cpp b/protocols/IRCG/src/windows.cpp index c20ceebc1c..354f8aec0e 100644 --- a/protocols/IRCG/src/windows.cpp +++ b/protocols/IRCG/src/windows.cpp @@ -220,7 +220,7 @@ void CNickDlg::OnInitDialog() if ( !GetWord( dbv.ptszVal, i).IsEmpty())
SendDlgItemMessage( m_hwnd, IDC_ENICK, CB_ADDSTRING, 0, (LPARAM)GetWord(dbv.ptszVal, i).c_str());
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} }
void CNickDlg::OnDestroy()
@@ -243,7 +243,7 @@ void CNickDlg::OnOk( CCtrlButton* ) if ( !s.IsEmpty() && s != szTemp)
S += _T(" ") + s;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
m_proto->setTString( "RecentNicks", S.c_str());
}
@@ -517,7 +517,7 @@ void CJoinDlg::OnInitDialog() ReplaceString( S, _T("%newl"), _T(" "));
SendDlgItemMessage( m_hwnd, IDC_ENICK, CB_ADDSTRING, 0, (LPARAM)S.c_str());
} }
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} }
void CJoinDlg::OnDestroy()
@@ -546,7 +546,7 @@ void CJoinDlg::OnOk( CCtrlButton* ) if ( !W.IsEmpty() && W != SL)
S += _T(" ") + W;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
m_proto->setTString("RecentChannels", S.c_str());
}
@@ -582,19 +582,19 @@ void CQuickDlg::OnInitDialog() DBVARIANT dbv;
if ( !m_proto->getString( "ServerName", &dbv )) {
m_si->m_address = mir_strdup( dbv.pszVal );
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else m_si->m_address = mir_strdup( Translate("Type new server address here"));
if ( !m_proto->getString( "PortStart", &dbv )) {
m_si->m_portStart = atoi( dbv.pszVal );
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else m_si->m_portStart = 6667;
if ( !m_proto->getString( "PortEnd", &dbv )) {
m_si->m_portEnd = atoi( dbv.pszVal );
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else m_si->m_portEnd = 6667;
@@ -1287,7 +1287,7 @@ void CManagerDlg::InitManager( int mode, const TCHAR* window ) #endif
m_topic.SendMsg( CB_ADDSTRING, 0, (LPARAM)S.c_str());
} }
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
mir_free(p);
}
|