summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Gadu-Gadu/gg.c14
-rw-r--r--protocols/IRCG/irc.h1
-rw-r--r--protocols/IRCG/tools.cpp12
-rw-r--r--protocols/IcqOscarJ/init.cpp3
-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
-rw-r--r--protocols/MSN/msn_chat.cpp2
-rw-r--r--protocols/MSN/msn_global.h12
-rw-r--r--protocols/MSN/msn_libstr.cpp45
-rw-r--r--protocols/MSN/msn_mail.cpp2
13 files changed, 30 insertions, 131 deletions
diff --git a/protocols/Gadu-Gadu/gg.c b/protocols/Gadu-Gadu/gg.c
index 8e573ba6ce..6cb5abf554 100644
--- a/protocols/Gadu-Gadu/gg.c
+++ b/protocols/Gadu-Gadu/gg.c
@@ -452,6 +452,7 @@ static GGPROTO *gg_proto_init(const char* pszProtoName, const TCHAR* tszUserName
DWORD dwVersion;
GGPROTO *gg = (GGPROTO *)mir_alloc(sizeof(GGPROTO));
char szVer[MAX_PATH];
+ char name[128];
NETLIBUSER nlu = { 0 };
ZeroMemory(gg, sizeof(GGPROTO));
@@ -486,16 +487,9 @@ static GGPROTO *gg_proto_init(const char* pszProtoName, const TCHAR* tszUserName
nlu.cbSize = sizeof(nlu);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS;
nlu.szSettingsModule = gg->proto.m_szModuleName;
- if (gg->unicode_core) {
- WCHAR name[128];
- _snwprintf(name, SIZEOF(name), TranslateW(L"%s connection"), gg->proto.m_tszUserName);
- nlu.ptszDescriptiveName = (TCHAR *)name;
- nlu.flags |= NUF_UNICODE;
- } else {
- char name[128];
- mir_snprintf(name, SIZEOF(name), Translate("%s connection"), gg->proto.m_tszUserName);
- nlu.ptszDescriptiveName = name;
- }
+ mir_snprintf(name, SIZEOF(name), Translate("%s connection"), gg->proto.m_tszUserName);
+ nlu.ptszDescriptiveName = name;
+
gg->netlib = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
// Register services
diff --git a/protocols/IRCG/irc.h b/protocols/IRCG/irc.h
index 823efec68e..41591b388a 100644
--- a/protocols/IRCG/irc.h
+++ b/protocols/IRCG/irc.h
@@ -727,7 +727,6 @@ const TCHAR* __stdcall GetWordAddress(const TCHAR* text, int index);
void __stdcall RemoveLinebreaks( CMString& Message );
TCHAR* __stdcall my_strstri(const TCHAR *s1, const TCHAR *s2) ;
TCHAR* __stdcall DoColorCodes (const TCHAR* text, bool bStrip, bool bReplacePercent);
-char* __stdcall rtrim( char *string );
String& __stdcall ReplaceString (String& text, const char* replaceme, const char* newword);
String __stdcall GetWord(const char* text, int index);
diff --git a/protocols/IRCG/tools.cpp b/protocols/IRCG/tools.cpp
index d9218b2b42..83ac7ae60f 100644
--- a/protocols/IRCG/tools.cpp
+++ b/protocols/IRCG/tools.cpp
@@ -149,18 +149,6 @@ void CIrcProto::IrcHookEvent( const char* szEvent, IrcEventFunc pFunc )
::HookEventObj( szEvent, ( MIRANDAHOOKOBJ )*( void** )&pFunc, this );
}
-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;
-}
-
CMString __stdcall GetWord(const TCHAR* text, int index)
{
if ( text && *text ) {
diff --git a/protocols/IcqOscarJ/init.cpp b/protocols/IcqOscarJ/init.cpp
index ada5e55a93..2e05d249ab 100644
--- a/protocols/IcqOscarJ/init.cpp
+++ b/protocols/IcqOscarJ/init.cpp
@@ -111,9 +111,6 @@ static int OnModulesLoaded( WPARAM, LPARAM )
extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
{
pluginLink = link;
- mir_getLI( &li );
- mir_getMMI( &mmi );
- mir_getUTFI( &utfi );
mir_getMD5I( &md5i );
mir_getLP( &pluginInfo );
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:
diff --git a/protocols/MSN/msn_chat.cpp b/protocols/MSN/msn_chat.cpp
index 490f1d453c..eb3411d4ce 100644
--- a/protocols/MSN/msn_chat.cpp
+++ b/protocols/MSN/msn_chat.cpp
@@ -345,7 +345,7 @@ int CMsnProto::MSN_GCEventHook(WPARAM, LPARAM lParam)
ThreadData* thread = MSN_GetThreadByChatId(gch->pDest->ptszID);
if (thread)
{
- rtrim(gch->ptszText); // remove the ending linebreak
+ trtrim(gch->ptszText); // remove the ending linebreak
TCHAR* pszMsg = UnEscapeChatTags(NEWTSTR_ALLOCA(gch->ptszText));
thread->sendMessage('N', NULL, NETID_MSN, UTF8(pszMsg), 0);
diff --git a/protocols/MSN/msn_global.h b/protocols/MSN/msn_global.h
index 306244f896..2b2ef91a70 100644
--- a/protocols/MSN/msn_global.h
+++ b/protocols/MSN/msn_global.h
@@ -212,12 +212,6 @@ void overrideStr(TCHAR*& dest, const TCHAR* src, bool unicode, const TCHAR* de
void replaceStr(char*& dest, const char* src);
void replaceStr(wchar_t*& dest, const wchar_t* src);
-char* __fastcall ltrimp(char* str);
-char* __fastcall rtrim(char* string);
-wchar_t* __fastcall rtrim(wchar_t* string);
-
-__inline char* lrtrimp(char* str) { return ltrimp(rtrim(str)); };
-
char* arrayToHex(BYTE* data, size_t datasz);
inline unsigned short _htons(unsigned short s)
@@ -260,7 +254,7 @@ struct STRLIST : public LIST<char>
for (int i=0; i < count; i++)
mir_free(items[i]);
- li.List_Destroy((SortedList*)this);
+ List_Destroy((SortedList*)this);
}
int insertn(const char* p) { return insert(mir_strdup(p)); }
@@ -268,13 +262,13 @@ struct STRLIST : public LIST<char>
int remove(int idx)
{
mir_free(items[idx]);
- return li.List_Remove((SortedList*)this, idx);
+ return List_Remove((SortedList*)this, idx);
}
int remove(const char* p)
{
int idx;
- return li.List_GetIndex((SortedList*)this, (char*)p, &idx) == 1 ? remove(idx) : -1;
+ return List_GetIndex((SortedList*)this, (char*)p, &idx) == 1 ? remove(idx) : -1;
}
};
diff --git a/protocols/MSN/msn_libstr.cpp b/protocols/MSN/msn_libstr.cpp
index 50756b7ccd..9cb83bbb63 100644
--- a/protocols/MSN/msn_libstr.cpp
+++ b/protocols/MSN/msn_libstr.cpp
@@ -57,51 +57,6 @@ void overrideStr(TCHAR*& dest, const TCHAR* src, bool unicode, const TCHAR* def)
dest = mir_tstrdup(def);
}
-char* __fastcall ltrimp(char* str)
-{
- if (str == NULL) return NULL;
- char* p = str;
-
- for (;;)
- {
- switch (*p)
- {
- case ' ': case '\t': case '\n': case '\r':
- ++p; break;
- default:
- return p;
- }
- }
-}
-
-char* __fastcall 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;
-}
-
-wchar_t* __fastcall rtrim(wchar_t* string)
-{
- wchar_t* p = string + wcslen(string) - 1;
-
- while (p >= string)
- {
- if (*p != ' ' && *p != '\t' && *p != '\n' && *p != '\r')
- break;
-
- *p-- = 0;
- }
- return string;
-}
-
char* arrayToHex(BYTE* data, size_t datasz)
{
char* res = (char*)mir_alloc(2 * datasz + 1);
diff --git a/protocols/MSN/msn_mail.cpp b/protocols/MSN/msn_mail.cpp
index 52d3fcb12b..57996b65ac 100644
--- a/protocols/MSN/msn_mail.cpp
+++ b/protocols/MSN/msn_mail.cpp
@@ -416,7 +416,7 @@ void CMsnProto::displayEmailCount(HANDLE hContact)
}
while (ch && !_istdigit(ch[1]));
if (ch) *ch = 0;
- rtrim(name);
+ trtrim(name);
TCHAR szNick[128];
mir_sntprintf(szNick, SIZEOF(szNick),