summaryrefslogtreecommitdiff
path: root/protocols/JabberG
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-26 16:50:14 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-26 16:50:14 +0000
commitc992cb2fdc11f1cac4bc5cbce26e8e2bb3b57da0 (patch)
tree697bdbf38a8a1f6b828a8bfbd08a478e19a82c6b /protocols/JabberG
parentf616294363c642d138f9dc0ef6eceae639e2434c (diff)
- microkernel addded;
- version bumped to 0.92.2 git-svn-id: http://svn.miranda-ng.org/main/trunk@641 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG')
-rw-r--r--protocols/JabberG/jabber.h2
-rw-r--r--protocols/JabberG/jabber_chat.cpp2
-rw-r--r--protocols/JabberG/jabber_libstr.cpp26
-rw-r--r--protocols/JabberG/jabber_menu.cpp36
-rw-r--r--protocols/JabberG/jabber_thread.cpp4
5 files changed, 21 insertions, 49 deletions
diff --git a/protocols/JabberG/jabber.h b/protocols/JabberG/jabber.h
index d3b13bf447..6cc58b4fb4 100644
--- a/protocols/JabberG/jabber.h
+++ b/protocols/JabberG/jabber.h
@@ -655,8 +655,6 @@ int ReloadIconsEventHook(WPARAM wParam, LPARAM lParam);
void __stdcall replaceStr( char*& dest, const char* src );
void __stdcall replaceStr( WCHAR*& dest, const WCHAR* src );
int lstrcmp_null(const TCHAR *s1, const TCHAR *s2);
-char* __stdcall rtrim( char *string );
-TCHAR* __stdcall rtrim( TCHAR *string );
//---- jabber_menu.c ------------------------------------------------
diff --git a/protocols/JabberG/jabber_chat.cpp b/protocols/JabberG/jabber_chat.cpp
index fc2662f94c..ac17a992b1 100644
--- a/protocols/JabberG/jabber_chat.cpp
+++ b/protocols/JabberG/jabber_chat.cpp
@@ -1532,7 +1532,7 @@ int CJabberProto::JabberGcEventHook(WPARAM, LPARAM lParam)
switch ( gch->pDest->iType ) {
case GC_USER_MESSAGE:
if ( gch->pszText && lstrlen( gch->ptszText) > 0 ) {
- rtrim( gch->ptszText );
+ trtrim( gch->ptszText );
if ( m_bJabberOnline ) {
TCHAR* buf = NEWTSTR_ALLOCA(gch->ptszText);
diff --git a/protocols/JabberG/jabber_libstr.cpp b/protocols/JabberG/jabber_libstr.cpp
index 78565bfa1a..955e949d1e 100644
--- a/protocols/JabberG/jabber_libstr.cpp
+++ b/protocols/JabberG/jabber_libstr.cpp
@@ -42,19 +42,6 @@ void __stdcall replaceStr( WCHAR*& dest, const WCHAR* src )
dest = ( src != NULL ) ? mir_wstrdup( src ) : NULL;
}
-char* __stdcall rtrim( char *string )
-{
- char* p = string + strlen( string ) - 1;
-
- while ( p >= string ) {
- if ( *p != ' ' && *p != '\t' && *p != '\n' && *p != '\r' )
- break;
-
- *p-- = 0;
- }
- return string;
-}
-
int lstrcmp_null(const TCHAR *s1, const TCHAR *s2)
{
if (!s1 && !s2) return 0;
@@ -62,16 +49,3 @@ int lstrcmp_null(const TCHAR *s1, const TCHAR *s2)
if (!s2) return 1;
return lstrcmp(s1, s2);
}
-
-TCHAR* __stdcall rtrim( TCHAR *string )
-{
- TCHAR* p = string + _tcslen( string ) - 1;
-
- while ( p >= string ) {
- if ( *p != ' ' && *p != '\t' && *p != '\n' && *p != '\r' )
- break;
-
- *p-- = 0;
- }
- return string;
-}
diff --git a/protocols/JabberG/jabber_menu.cpp b/protocols/JabberG/jabber_menu.cpp
index b489a793d8..e0c99757b3 100644
--- a/protocols/JabberG/jabber_menu.cpp
+++ b/protocols/JabberG/jabber_menu.cpp
@@ -204,7 +204,7 @@ void g_MenuInit( void )
hPrebuildMenuHook = HookEvent( ME_CLIST_PREBUILDCONTACTMENU, JabberPrebuildContactMenu );
- li.List_InsertPtr( &arServices, CreateServiceFunction( "Jabber/MenuChoose", JabberMenuChooseService ));
+ List_InsertPtr( &arServices, CreateServiceFunction( "Jabber/MenuChoose", JabberMenuChooseService ));
TMenuParam mnu = {0};
mnu.cbSize = sizeof(mnu);
@@ -233,7 +233,7 @@ void g_MenuInit( void )
mi.icolibItem = g_GetIconHandle( IDI_REQUEST );
mi.pszService = "Jabber/ReqAuth";
g_hMenuRequestAuth = Menu_AddContactMenuItem(&mi);
- li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuHandleRequestAuth ));
+ List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuHandleRequestAuth ));
// "Grant authorization"
mi.pszService = "Jabber/GrantAuth";
@@ -241,7 +241,7 @@ void g_MenuInit( void )
mi.position = -2000001001;
mi.icolibItem = g_GetIconHandle( IDI_GRANT );
g_hMenuGrantAuth = Menu_AddContactMenuItem(&mi);
- li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuHandleGrantAuth ));
+ List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuHandleGrantAuth ));
// Revoke auth
mi.pszService = "Jabber/RevokeAuth";
@@ -249,7 +249,7 @@ void g_MenuInit( void )
mi.position = -2000001002;
mi.icolibItem = g_GetIconHandle( IDI_AUTHREVOKE );
g_hMenuRevokeAuth = Menu_AddContactMenuItem(&mi);
- li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuRevokeAuth ));
+ List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuRevokeAuth ));
// "Convert Chat/Contact"
mi.pszService = "Jabber/ConvertChatContact";
@@ -257,7 +257,7 @@ void g_MenuInit( void )
mi.position = -1999901004;
mi.icolibItem = g_GetIconHandle( IDI_USER2ROOM );
g_hMenuConvert = Menu_AddContactMenuItem(&mi);
- li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuConvertChatContact ));
+ List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuConvertChatContact ));
// "Add to roster"
mi.pszService = "Jabber/AddToRoster";
@@ -265,7 +265,7 @@ void g_MenuInit( void )
mi.position = -1999901005;
mi.icolibItem = g_GetIconHandle( IDI_ADDROSTER );
g_hMenuRosterAdd = Menu_AddContactMenuItem(&mi);
- li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuRosterAdd ));
+ List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuRosterAdd ));
// "Add to Bookmarks"
mi.pszService = "Jabber/AddToBookmarks";
@@ -273,7 +273,7 @@ void g_MenuInit( void )
mi.position = -1999901006;
mi.icolibItem = g_GetIconHandle( IDI_BOOKMARKS);
g_hMenuAddBookmark = Menu_AddContactMenuItem(&mi);
- li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuBookmarkAdd ));
+ List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuBookmarkAdd ));
// Login/logout
mi.pszService = "Jabber/TransportLogin";
@@ -281,7 +281,7 @@ void g_MenuInit( void )
mi.position = -1999901007;
mi.icolibItem = g_GetIconHandle( IDI_LOGIN );
g_hMenuLogin = Menu_AddContactMenuItem(&mi);
- li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuTransportLogin ));
+ List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuTransportLogin ));
// Retrieve nicks
mi.pszService = "Jabber/TransportGetNicks";
@@ -289,7 +289,7 @@ void g_MenuInit( void )
mi.position = -1999901008;
mi.icolibItem = g_GetIconHandle( IDI_REFRESH );
g_hMenuRefresh = Menu_AddContactMenuItem(&mi);
- li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuTransportResolve ));
+ List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuTransportResolve ));
// Run Commands
mi.pszService = "Jabber/RunCommands";
@@ -297,7 +297,7 @@ void g_MenuInit( void )
mi.position = -1999901009;
mi.icolibItem = g_GetIconHandle( IDI_COMMAND );
g_hMenuCommands = Menu_AddContactMenuItem(&mi);
- li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberContactMenuRunCommands ));
+ List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberContactMenuRunCommands ));
// Send Note
mi.pszService = "Jabber/SendNote";
@@ -305,7 +305,7 @@ void g_MenuInit( void )
mi.position = -1999901010;
mi.icolibItem = g_GetIconHandle( IDI_SEND_NOTE);
g_hMenuSendNote = Menu_AddContactMenuItem(&mi);
- li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuSendNote ));
+ List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuSendNote ));
// Direct Presence
mi.pszService = "Jabber/DirectPresenceDummySvc";
@@ -328,7 +328,7 @@ void g_MenuInit( void )
mi.hParentMenu = g_hMenuDirectPresence[0];
mi.icolibItem = LoadSkinnedIcon(PresenceModeArray[i].icon);
g_hMenuDirectPresence[i+1] = Menu_AddContactMenuItem(&mi);
- li.List_InsertPtr( &arServices, CreateServiceFunctionParam( mi.pszService, JabberMenuHandleDirectPresence, PresenceModeArray[i].mode ));
+ List_InsertPtr( &arServices, CreateServiceFunctionParam( mi.pszService, JabberMenuHandleDirectPresence, PresenceModeArray[i].mode ));
}
mi.flags &= ~CMIF_ROOTHANDLE;
@@ -349,7 +349,7 @@ void g_MenuInit( void )
mi.icolibItem = g_GetIconHandle( IDI_JABBER );
mi.flags |= CMIF_ROOTHANDLE;
g_hMenuResourcesActive = Menu_AddContactMenuItem(&mi);
- li.List_InsertPtr( &arServices, CreateServiceFunctionParam( mi.pszService, JabberMenuHandleResource, MENUITEM_LASTSEEN ));
+ List_InsertPtr( &arServices, CreateServiceFunctionParam( mi.pszService, JabberMenuHandleResource, MENUITEM_LASTSEEN ));
mi.pszService = "Jabber/UseResource_server";
mi.pszName = LPGEN("Server's Choice");
@@ -357,7 +357,7 @@ void g_MenuInit( void )
mi.pszPopupName = (char *)g_hMenuResourcesRoot;
mi.icolibItem = g_GetIconHandle( IDI_NODE_SERVER );
g_hMenuResourcesServer = Menu_AddContactMenuItem(&mi);
- li.List_InsertPtr( &arServices, CreateServiceFunctionParam( mi.pszService, JabberMenuHandleResource, MENUITEM_SERVER ));
+ List_InsertPtr( &arServices, CreateServiceFunctionParam( mi.pszService, JabberMenuHandleResource, MENUITEM_SERVER ));
}
void g_MenuUninit( void )
@@ -374,7 +374,7 @@ void g_MenuUninit( void )
UnhookEvent( hPrebuildMenuHook );
for (int i = 0; i < arServices.realCount; i++)
DestroyServiceFunction( arServices.items[i] );
- li.List_Destroy( &arServices );
+ List_Destroy( &arServices );
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -988,20 +988,20 @@ int g_OnModernToolbarInit(WPARAM, LPARAM)
button.defPos = 1000;
button.tbbFlags = TBBF_SHOWTOOLTIP|TBBF_VISIBLE;
- li.List_InsertPtr( &arServices, CreateServiceFunction("JABBER/*/Groupchat", g_ToolbarHandleJoinGroupchat ));
+ List_InsertPtr( &arServices, CreateServiceFunction("JABBER/*/Groupchat", g_ToolbarHandleJoinGroupchat ));
button.pszButtonID = button.pszServiceName = "JABBER/*/Groupchat";
button.pszTooltipUp = button.pszTooltipUp = button.pszButtonName = "Join conference";
button.hSecondaryIconHandle = button.hPrimaryIconHandle = (HANDLE)g_GetIconHandle(IDI_GROUP);
JCallService(MS_TB_ADDBUTTON, 0, (LPARAM)&button);
- li.List_InsertPtr( &arServices, CreateServiceFunction("JABBER/*/Bookmarks", g_ToolbarHandleBookmarks ));
+ List_InsertPtr( &arServices, CreateServiceFunction("JABBER/*/Bookmarks", g_ToolbarHandleBookmarks ));
button.pszButtonID = button.pszServiceName = "JABBER/*/Bookmarks";
button.pszTooltipUp = button.pszTooltipUp = button.pszButtonName = "Open bookmarks";
button.hSecondaryIconHandle = button.hPrimaryIconHandle = (HANDLE)g_GetIconHandle(IDI_BOOKMARKS);
button.defPos++;
JCallService(MS_TB_ADDBUTTON, 0, (LPARAM)&button);
- li.List_InsertPtr( &arServices, CreateServiceFunction("JABBER/*/ServiceDiscovery", g_ToolbarHandleServiceDiscovery ));
+ List_InsertPtr( &arServices, CreateServiceFunction("JABBER/*/ServiceDiscovery", g_ToolbarHandleServiceDiscovery ));
button.pszButtonID = button.pszServiceName = "JABBER/*/ServiceDiscovery";
button.pszTooltipUp = button.pszTooltipUp = button.pszButtonName = "Service discovery";
button.hSecondaryIconHandle = button.hPrimaryIconHandle = (HANDLE)g_GetIconHandle(IDI_SERVICE_DISCOVERY);
diff --git a/protocols/JabberG/jabber_thread.cpp b/protocols/JabberG/jabber_thread.cpp
index 5635c10a57..4bd558b048 100644
--- a/protocols/JabberG/jabber_thread.cpp
+++ b/protocols/JabberG/jabber_thread.cpp
@@ -289,7 +289,7 @@ LBL_Exit:
JFreeVariant( &dbv );
}
- if ( *rtrim(info->username) == '\0' ) {
+ if ( *trtrim(info->username) == '\0' ) {
DWORD dwSize = SIZEOF( info->username );
if ( GetUserName( info->username, &dwSize ))
JSetStringT( NULL, "LoginName", info->username );
@@ -297,7 +297,7 @@ LBL_Exit:
info->username[0] = 0;
}
- if ( *rtrim(info->username) == '\0' ) {
+ if ( *trtrim(info->username) == '\0' ) {
Log( "Thread ended, login name is not configured" );
JSendBroadcast( NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_BADUSERID );
LBL_FatalError: