summaryrefslogtreecommitdiff
path: root/plugins/Chat/services.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Chat/services.c')
-rw-r--r--plugins/Chat/services.c40
1 files changed, 12 insertions, 28 deletions
diff --git a/plugins/Chat/services.c b/plugins/Chat/services.c
index 37f7a2c71c..5687e9cb99 100644
--- a/plugins/Chat/services.c
+++ b/plugins/Chat/services.c
@@ -291,20 +291,15 @@ static INT_PTR Service_GetInfo(WPARAM wParam,LPARAM lParam)
if ( gci->Flags & COUNT ) gci->iCount = si->nUsersInNicklist;
if ( gci->Flags & USERS ) gci->pszUsers = SM_GetUsers(si);
- #if defined( _UNICODE )
- if ( si->dwFlags & GC_UNICODE ) {
- if ( gci->Flags & ID ) gci->pszID = si->ptszID;
- if ( gci->Flags & NAME ) gci->pszName = si->ptszName;
- }
- else {
- if ( gci->Flags & ID ) gci->pszID = ( TCHAR* )si->pszID;
- if ( gci->Flags & NAME ) gci->pszName = ( TCHAR* )si->pszName;
- }
- #else
+ if ( si->dwFlags & GC_UNICODE ) {
if ( gci->Flags & ID ) gci->pszID = si->ptszID;
if ( gci->Flags & NAME ) gci->pszName = si->ptszName;
- #endif
-
+ }
+ else {
+ if ( gci->Flags & ID ) gci->pszID = ( TCHAR* )si->pszID;
+ if ( gci->Flags & NAME ) gci->pszName = ( TCHAR* )si->pszName;
+ }
+
LeaveCriticalSection(&cs);
return 0;
}
@@ -324,11 +319,6 @@ static INT_PTR Service_Register(WPARAM wParam, LPARAM lParam)
if (gcr->cbSize != SIZEOF_STRUCT_GCREGISTER_V1)
return GC_REGISTER_WRONGVER;
- #ifndef _UNICODE
- if (gcr->dwFlags & GC_UNICODE)
- return GC_REGISTER_NOUNICODE;
- #endif
-
EnterCriticalSection(&cs);
mi = MM_AddModule( gcr->pszModule );
@@ -405,13 +395,11 @@ static INT_PTR Service_NewChat(WPARAM wParam, LPARAM lParam)
si->iLogFilterFlags = (int)DBGetContactSettingDword(NULL, "Chat", "FilterFlags", 0x03E0);
si->bFilterEnabled = DBGetContactSettingByte(NULL, "Chat", "FilterEnabled", 0);
si->bNicklistEnabled = DBGetContactSettingByte(NULL, "Chat", "ShowNicklist", 1);
- #if defined( _UNICODE )
- if ( !( gcw->dwFlags & GC_UNICODE )) {
- si->pszID = mir_strdup( gcw->pszID );
- si->pszName = mir_strdup( gcw->pszName );
- }
- #endif
-
+ if ( !( gcw->dwFlags & GC_UNICODE )) {
+ si->pszID = mir_strdup( gcw->pszID );
+ si->pszName = mir_strdup( gcw->pszName );
+ }
+
if ( mi->bColor ) {
si->iFG = 4;
si->bFGSet = TRUE;
@@ -627,7 +615,6 @@ static INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam)
EnterCriticalSection(&cs);
-#ifdef _UNICODE
if ( !( gce->dwFlags & GC_UNICODE )) {
save_gce = *gce;
save_gcd = *gce->pDest;
@@ -638,7 +625,6 @@ static INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam)
gce->ptszText = a2tf( gce->ptszText, gce->dwFlags );
gce->ptszUserInfo = a2tf( gce->ptszUserInfo, gce->dwFlags );
}
-#endif
// Do different things according to type of event
switch(gcd->iType) {
@@ -780,7 +766,6 @@ static INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam)
LBL_Exit:
LeaveCriticalSection(&cs);
-#ifdef _UNICODE
if ( !( gce->dwFlags & GC_UNICODE )) {
mir_free((void*)gce->ptszText );
mir_free((void*)gce->ptszNick );
@@ -791,7 +776,6 @@ LBL_Exit:
*gce = save_gce;
*gce->pDest = save_gcd;
}
-#endif
return iRetVal;
}