From 2c9a9bfed50529645b5b0d5602b2a94b0b5ef900 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 26 Apr 2015 22:42:33 +0000 Subject: unified project for AIM git-svn-id: http://svn.miranda-ng.org/main/trunk@13182 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/AimOscar/src/aim.cpp | 5 +- protocols/AimOscar/src/aim.h | 325 ------------------------------ protocols/AimOscar/src/avatars.cpp | 8 +- protocols/AimOscar/src/away.cpp | 91 ++++----- protocols/AimOscar/src/chat.cpp | 8 +- protocols/AimOscar/src/client.cpp | 14 +- protocols/AimOscar/src/connection.cpp | 2 +- protocols/AimOscar/src/conv.cpp | 8 +- protocols/AimOscar/src/direct_connect.cpp | 2 +- protocols/AimOscar/src/error.cpp | 2 +- protocols/AimOscar/src/file.cpp | 2 +- protocols/AimOscar/src/flap.cpp | 2 +- protocols/AimOscar/src/links.cpp | 2 +- protocols/AimOscar/src/packets.cpp | 2 +- protocols/AimOscar/src/popup.cpp | 2 +- protocols/AimOscar/src/proto.cpp | 46 ++--- protocols/AimOscar/src/proto.h | 2 - protocols/AimOscar/src/proxy.cpp | 2 +- protocols/AimOscar/src/server.cpp | 11 +- protocols/AimOscar/src/services.cpp | 2 +- protocols/AimOscar/src/snac.cpp | 2 +- protocols/AimOscar/src/stdafx.cpp | 18 -- protocols/AimOscar/src/stdafx.cxx | 18 ++ protocols/AimOscar/src/stdafx.h | 320 +++++++++++++++++++++++++++++ protocols/AimOscar/src/theme.cpp | 2 +- protocols/AimOscar/src/thread.cpp | 2 +- protocols/AimOscar/src/tlv.cpp | 2 +- protocols/AimOscar/src/ui.cpp | 2 +- protocols/AimOscar/src/utility.cpp | 2 +- 29 files changed, 437 insertions(+), 469 deletions(-) delete mode 100644 protocols/AimOscar/src/aim.h delete mode 100644 protocols/AimOscar/src/stdafx.cpp create mode 100644 protocols/AimOscar/src/stdafx.cxx create mode 100644 protocols/AimOscar/src/stdafx.h (limited to 'protocols/AimOscar/src') diff --git a/protocols/AimOscar/src/aim.cpp b/protocols/AimOscar/src/aim.cpp index 8586de414e..3809b86ae6 100644 --- a/protocols/AimOscar/src/aim.cpp +++ b/protocols/AimOscar/src/aim.cpp @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "aim.h" +#include "stdafx.h" char AIM_CAP_MIRANDA[16] = "MirandaA"; @@ -75,10 +75,9 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCO //////////////////////////////////////////////////////////////////////////////////////// // OnModulesLoaded - finalizes plugin's configuration on load -static int OnModulesLoaded(WPARAM wParam, LPARAM lParam) +static int OnModulesLoaded(WPARAM, LPARAM) { aim_links_init(); - return 0; } diff --git a/protocols/AimOscar/src/aim.h b/protocols/AimOscar/src/aim.h deleted file mode 100644 index ddf2d6d60c..0000000000 --- a/protocols/AimOscar/src/aim.h +++ /dev/null @@ -1,325 +0,0 @@ -/* -Plugin of Miranda IM for communicating with users of the AIM protocol. -Copyright (c) 2008-2012 Boris Krasnovskiy -Copyright (C) 2005-2006 Aaron Myles Landwehr - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#ifndef AIM_H -#define AIM_H - -//System includes -#include -#include -#include -#include -#include -#include -#include -#include - -//Miranda NG includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -//rest of includes -#include "avatars.h" -#include "utility.h" -#include "chat.h" -#include "direct_connect.h" -#include "conv.h" -#include "file.h" -#include "flap.h" -#include "links.h" -#include "snac.h" -#include "tlv.h" -#include "packets.h" -#include "proxy.h" -#include "resource.h" -#include "proto.h" -#include "theme.h" -#include "ui.h" -#include "version.h" - -// Protocol limits -#define MAX_SCREEN_NAME_LENGTH 97 -#define MAX_GROUP_NAME_LENGTH 48 -#define MAX_NICKNAME_LENGTH 64 -#define MAX_MESSAGE_LENGTH 3978 -#define MAX_STATUS_MESSAGE_LENGTH 251 -#define MAX_AWAY_MESSAGE_LENGTH 4096 -#define MAX_ICON_SIZE 7168 - -// ICBM parameter flags -#define ICBM_CHANNEL_MSGS_ALLOWED 0x00000001 -#define ICBM_MISSED_CALLS_ENABLED 0x00000002 -#define ICBM_EVENTS_ALLOWED 0x00000008 -#define ICBM_SMS_SUPPORTED 0x00000010 -#define ICBM_OFFLINE_MSGS_ALLOWED 0x00000100 - -// SSI preferences -#define SHOW_IDLE 0x00000400 -#define SHOW_RECENT_BUDDIES 0x00020000 -#define SHOW_TYPING 0x00400000 - -//Extended Status Icon Numbers -#define ACCOUNT_TYPE_UNCONFIRMED 1 -#define ACCOUNT_TYPE_CONFIRMED 2 -#define ACCOUNT_TYPE_ICQ 3 -#define ACCOUNT_TYPE_AOL 4 -#define ACCOUNT_TYPE_ADMIN 5 -#define EXTENDED_STATUS_BOT 1 -#define EXTENDED_STATUS_HIPTOP 2 - -//Popup flags -#define MAIL_POPUP 0x04 -#define ERROR_POPUP 0x08 -#define TCHAR_POPUP 0x10 - -//Main Option Window Keys -#define AIM_KEY_SN "SN" -#define AIM_KEY_NK "Nick" -#define AIM_KEY_PW "Password" -#define AIM_KEY_HN "loginhost" -#define AIM_KEY_PN "loginport" -#define AIM_KEY_DC "DelConf"//delivery confirmation -#define AIM_KEY_FP "ForceProxyTransfer" -#define AIM_KEY_HF "HiptopFake" -#define AIM_KEY_AT "DisableATIcons" -#define AIM_KEY_ES "DisableESIcons" -#define AIM_KEY_DM "DisableModeMsg" -#define AIM_KEY_FI "FormatIncoming"//html->bbcodes -#define AIM_KEY_FO "FormatOutgoing"//bbcodes->html -#define AIM_KEY_II "InstantIdle" -#define AIM_KEY_IIT "InstantIdleTS" -#define AIM_KEY_CM "CheckMail" -#define AIM_KEY_MG "ManageGroups" -#define AIM_KEY_DA "DisableAvatars" -#define AIM_KEY_DSSL "DisableSSL" -#define AIM_KEY_FSC "ForceSingleClient" - -#define OTH_KEY_SM "StatusMsg" -#define OTH_KEY_GP "Group" -//Module Name Key -#define MOD_KEY_CL "CList" -//Settings Keys -#define AIM_KEY_PR "Profile" -#define AIM_KEY_LA "LastAwayChange" -//Contact Keys -#define AIM_KEY_BI "BuddyId" -#define AIM_KEY_GI "GroupId" -#define AIM_KEY_ST "Status" -#define AIM_KEY_IT "IdleTS" -#define AIM_KEY_OT "LogonTS" -#define AIM_KEY_MS "MemberTS" -#define AIM_KEY_AC "AccType"//account type -#define AIM_KEY_ET "ESType"//Extended Status type -#define AIM_KEY_MV "MirVer" -#define AIM_KEY_US "Utf8Support" -#define AIM_KEY_NL "NotOnList" -#define AIM_KEY_LM "LastMessage" -#define AIM_KEY_AH "AvatarHash" -#define AIM_KEY_AHT "AvatarType" -#define AIM_KEY_EM "e-mail" -#define AIM_KEY_LV "LastVer" -#define AIM_KEY_TIS "TotalIMsSent" -#define AIM_KEY_TIR "TotalIMsReceived" -#define AIM_KEY_TAM "TotalAwayMessages" -#define AIM_KEY_TTO "TotalTimeOnline" -#define AIM_KEY_BLS "IsBlast" -#define AIM_KEY_NIL "IsNotInList" - -#define AIM_DEFAULT_SERVER "slogin.oscar.aol.com" -#define AIM_DEFAULT_SERVER_NS "login.oscar.aol.com" -#define AIM_PROXY_SERVER "ars.oscar.aol.com" -#define AIM_DEFAULT_PORT 5190 -#define AIM_DEFAULT_SSL_PORT 443 - -//Some Defaults for various things -#define DEFAULT_KEEPALIVE_TIMER 39 // secs -#define DEFAULT_GRACE_PERIOD 60 -#define AIM_DEFAULT_GROUP "miranda merged" -#define SYSTEM_BUDDY "aolsystemmsg" -#define DEFAULT_AWAY_MSG "I am away from my computer right now." -//Md5 Roasting stuff -#define AIM_MD5_STRING "AOL Instant Messenger (SM)" -#define MD5_HASH_LENGTH 16 - -//Aim Version Stuff -#define AIM_CLIENT_MAJOR_VERSION 5 -#define AIM_CLIENT_MINOR_VERSION 9 -#define AIM_CLIENT_LESSER_VERSION 0 -#define AIM_CLIENT_BUILD_NUMBER 0x1772 -#define AIM_CLIENT_ID_NUMBER 0x0109 -#define AIM_CLIENT_DISTRIBUTION_NUMBER 0x0150 - -#define AIM_LANGUAGE "en" -#define AIM_COUNTRY "us" -#define AIM_MSG_TYPE "text/x-aolrtf; charset=\"us-ascii\"" -#define AIM_MSG_TYPE_UNICODE "text/x-aolrtf; charset=\"unicode-2-0\"" -#define AIM_TOOL_VERSION "\x01\x10\x18\xf1" - -//Supported Clients -#define CLIENT_UNKNOWN "?" -#define CLIENT_AIM5 "AIM 5.x" -#define CLIENT_AIM4 "AIM 4.x" -#define CLIENT_AIMEXPRESS5 "AIM Express 5" -#define CLIENT_AIMEXPRESS6 "AIM Express 6" -#define CLIENT_AIMEXPRESS7 "AIM Express 7" -#define CLIENT_ICQ "ICQ" -#define CLIENT_AIM_TRITON "AIM Triton" -#define CLIENT_AIM6_1 "AIM 6.1" -#define CLIENT_AIM6_5 "AIM 6.5" -#define CLIENT_AIM6_8 "AIM 6.8" -#define CLIENT_AIM6_9 "AIM 6.9" -#define CLIENT_AIM7_0 "AIM 7.0" -#define CLIENT_AIMTOC "AIM TOC" -#define CLIENT_BOT "AIM Bot" -#define CLIENT_GAIM "Gaim" -#define CLIENT_PURPLE "Purple" -#define CLIENT_ADIUM "Adium X" -#define CLIENT_GPRS "GPRS" -#define CLIENT_ICHAT "iChat" -#define CLIENT_IM2 "IM2" -#define CLIENT_KOPETE "Kopete" -#define CLIENT_MEEBO "Meebo" -#define CLIENT_DIGSBY "Digsby" -#define CLIENT_BEEJIVE "beejive" -#define CLIENT_MICQ "mICQ" -#define CLIENT_AIMOSCAR "Miranda IM %d.%d.%d.%d (AIM v%d.%d.%d.%d)" -#define CLIENT_OSCARJ "Miranda IM %d.%d.%d.%d%s (ICQ v%d.%d.%d.%d%s)" -#define CLIENT_OSCARSN "Miranda IM %d.%d.%d.%d%s (ICQ S!N v%d.%d.%d.%d%s)%s" -#define CLIENT_OSCARPL "Miranda IM %d.%d.%d.%d%s (ICQ Plus v%d.%d.%d.%d%s)%s" -#define CLIENT_NAIM "naim" -#define CLIENT_QIP "qip" -#define CLIENT_SIM "SIM" -#define CLIENT_SMS "SMS" -#define CLIENT_TERRAIM "TerraIM" -#define CLIENT_TRILLIAN_PRO "Trillian Pro" -#define CLIENT_TRILLIAN "Trillian" -#define CLIENT_TRILLIAN_ASTRA "Trillian Astra" -#define CLIENT_BLAST "Blast Group" - -//Aim Caps -#define AIM_CAPS_LENGTH 16 - -// Official -#define AIM_CAP_SHORT_CAPS "\x09\x46\x00\x00\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_SECURE_IM "\x09\x46\x00\x01\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_XHTML_IM "\x09\x46\x00\x02\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_RTCVIDEO "\x09\x46\x01\x01\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_HAS_MICROPHONE "\x09\x46\x01\x02\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_HAS_CAMERA "\x09\x46\x01\x03\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_RTCAUDIO "\x09\x46\x01\x04\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_HOST_STATUS_TEXT_AWARE "\x09\x46\x01\x0a\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_RT_IM "\x09\x46\x01\x0b\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_SMART_CAPS "\x09\x46\x01\xff\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_FILE_TRANSFER "\x09\x46\x13\x43\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_DIRECT_IM "\x09\x46\x13\x45\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_FILE_SHARING "\x09\x46\x13\x48\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_SUPPORT_ICQ "\x09\x46\x13\x4D\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" - -#define AIM_CAP_AVAILABLE_FOR_CALL "\x09\x46\x01\x05\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_ACA "\x09\x46\x01\x06\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_MULTI_AUDIO "\x09\x46\x01\x07\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_MULTI_VIDEO "\x09\x46\x01\x08\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_VICEROY "\x09\x46\xf0\x04\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_BUDDY_ICON "\x09\x46\x13\x46\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_VOICE_CHAT "\x09\x46\x13\x41\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_DIRECT_PLAY "\x09\x46\x13\x42\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_ICQ_DIRECT_CONNECT "\x09\x46\x13\x44\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_GAMES "\x09\x46\x13\x47\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_ICQ_SERVER_RELAY "\x09\x46\x13\x49\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0"//icq? channel 2 extended, TLV(0x2711) based messages -#define AIM_CAP_CHAT_ROBOTS "\x09\x46\x13\x4A\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_SHARE_BUDDIES "\x09\x46\x13\x4B\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_CHAT "\x74\x8F\x24\x20\x62\x87\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_AMO "\x09\x46\x01\x0c\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" - -// Extensions -#define AIM_CAP_HIPTOP "\x09\x46\x13\x23\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_UTF8 "\x09\x46\x13\x4E\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_UNKNOWN4 "\x09\x46\xf0\x03\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_UNKNOWNC "\x09\x46\xf0\x05\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" -#define AIM_CAP_IM2 "\x74\xed\xc3\x36\x44\xdf\x48\x5b\x8b\x1c\x67\x1a\x1f\x86\x09\x9f" -#define AIM_CAP_TRILLIAN "\xF2\xE7\xC7\xF4\xFE\xAD\x4D\xFB\xB2\x35\x36\x79\x8B\xDF\0\0" -extern char AIM_CAP_MIRANDA[]; //Miranda cap EXTERN - -//Aim Services -#define AIM_SERVICE_GENERIC "\0\x01\0\x04"//version 4 -#define AIM_SERVICE_SSI "\0\x13\0\x03"//version 3 -#define AIM_SERVICE_LOCATION "\0\x02\0\x01"//version 1 -#define AIM_SERVICE_BUDDYLIST "\0\x03\0\x01"//version 1 -#define AIM_SERVICE_MESSAGING "\0\x04\0\x01"//version 1 -#define AIM_SERVICE_INVITATION "\0\x06\0\x01"//version 1 -#define AIM_SERVICE_ADMIN "\0\x07\0\x01"//version 1 -#define AIM_SERVICE_POPUP "\0\x08\0\x01"//version 1 -#define AIM_SERVICE_BOS "\0\x09\0\x01"//version 1 -#define AIM_SERVICE_AVATAR "\0\x10\0\x01"//version 1 -#define AIM_SERVICE_USERLOOKUP "\0\x0A\0\x01"//version 1 -#define AIM_SERVICE_STATS "\0\x0B\0\x01"//version 1 -#define AIM_SERVICE_CHATNAV "\0\x0D\0\x01"//version 1 -#define AIM_SERVICE_DIRSEARCH "\0\x0F\0\x01"//version 1 -#define AIM_SERVICE_CHAT "\0\x0E\0\x01"//version 1 -#define AIM_SERVICE_ICQ "\0\x15\0\x01"//version 1 -#define AIM_SERVICE_MAIL "\0\x18\0\x01"//version 1 -#define AIM_SERVICE_UNKNOWN "\0\x22\0\x01"//version 1 -#define AIM_SERVICE_RATES "\0\x01\0\x02\0\x03\0\x04\0\x05" - -//Aim Statuses -#define AIM_STATUS_WEBAWARE "\0\x01" -#define AIM_STATUS_SHOWIP "\0\x02" -#define AIM_STATUS_BIRTHDAY "\0\x08" -#define AIM_STATUS_WEBFRONT "\0\x20" -#define AIM_STATUS_DCAUTH "\x10\0" -#define AIM_STATUS_DCCONT "\x20\0" -#define AIM_STATUS_NULL "\0\0" - -#define AIM_STATUS_ONLINE 0x00000000 -#define AIM_STATUS_AWAY 0x00000001 -#define AIM_STATUS_DND 0x00000002 -#define AIM_STATUS_OUT 0x00000004 -#define AIM_STATUS_BUSY 0x00000010 -#define AIM_STATUS_CHAT 0x00000020 // Broken. If set, you cannot unset. -#define AIM_STATUS_INVISIBLE 0x00000100 - -extern HINSTANCE hInstance; //plugin dll instance - -#define _strlens(a) (a ? strlen(a) : 0) -#define _strcmps(a,b) (a != b && (!a || !b || strcmp(a, b))) - -//#define ALLOW_BUSY - -#endif diff --git a/protocols/AimOscar/src/avatars.cpp b/protocols/AimOscar/src/avatars.cpp index f36cd8c11d..2d6de87415 100644 --- a/protocols/AimOscar/src/avatars.cpp +++ b/protocols/AimOscar/src/avatars.cpp @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "aim.h" +#include "stdafx.h" void __cdecl CAimProto::avatar_request_thread(void* param) { @@ -74,7 +74,7 @@ void CAimProto::avatar_request_handler(MCONTACT hContact, char* hash, unsigned c char* saved_hash = getStringA(hContact, AIM_KEY_AH); if (hash && _stricmp(hash, "0201d20472") && _stricmp(hash, "2b00003341")) //gaim default icon fix- we don't want their blank icon displaying. { - if (_strcmps(saved_hash, hash)) + if (mir_strcmp(saved_hash, hash)) { setByte(hContact, AIM_KEY_AHT, type); setString(hContact, AIM_KEY_AH, hash); @@ -95,7 +95,7 @@ void CAimProto::avatar_request_handler(MCONTACT hContact, char* hash, unsigned c mir_free(saved_hash); } -void CAimProto::avatar_retrieval_handler(const char* sn, const char* hash, const char* data, int data_len) +void CAimProto::avatar_retrieval_handler(const char* sn, const char* /*hash*/, const char* data, int data_len) { bool res = false; PROTO_AVATAR_INFORMATIONT AI = {0}; @@ -115,7 +115,7 @@ void CAimProto::avatar_retrieval_handler(const char* sn, const char* hash, const res = true; char *my_sn = getStringA(AIM_KEY_SN); - if (!_strcmps(sn, my_sn)) + if (!mir_strcmp(sn, my_sn)) CallService(MS_AV_REPORTMYAVATARCHANGED, (WPARAM)m_szModuleName, 0); mir_free(my_sn); } diff --git a/protocols/AimOscar/src/away.cpp b/protocols/AimOscar/src/away.cpp index 45ed0097cd..3b1665e2c9 100644 --- a/protocols/AimOscar/src/away.cpp +++ b/protocols/AimOscar/src/away.cpp @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "aim.h" +#include "stdafx.h" char** CAimProto::get_status_msg_loc(int status) { @@ -41,7 +41,7 @@ char** CAimProto::get_status_msg_loc(int status) int CAimProto::aim_set_away(HANDLE hServerConn, unsigned short &seqno, const char *amsg, bool set)//user info { - unsigned short offset=0; + unsigned short offset = 0; char* html_msg = NULL; size_t msg_size = 0; if (set) @@ -59,67 +59,62 @@ int CAimProto::aim_set_away(HANDLE hServerConn, unsigned short &seqno, const cha const char* msg = str.getBuf(); const unsigned short msg_len = str.getSize(); - char* buf=(char*)alloca(SNAC_SIZE+TLV_HEADER_SIZE*3+charset_len+msg_len+1); + char* buf = (char*)alloca(SNAC_SIZE + TLV_HEADER_SIZE * 3 + charset_len + msg_len + 1); - aim_writesnac(0x02,0x04,offset,buf); - aim_writetlv(0x03,charset_len,charset,offset,buf); - aim_writetlv(0x04,(unsigned short)msg_len,msg,offset,buf); + aim_writesnac(0x02, 0x04, offset, buf); + aim_writetlv(0x03, charset_len, charset, offset, buf); + aim_writetlv(0x04, (unsigned short)msg_len, msg, offset, buf); -// aim_writetlvchar(0x0f,2,offset,buf); - mir_free(html_msg); - return aim_sendflap(hServerConn,0x02,offset,buf,seqno); + return aim_sendflap(hServerConn, 0x02, offset, buf, seqno); } -int CAimProto::aim_set_status(HANDLE hServerConn,unsigned short &seqno,unsigned long status_type) +int CAimProto::aim_set_status(HANDLE hServerConn, unsigned short &seqno, unsigned long status_type) { - unsigned short offset=0; - char buf[SNAC_SIZE+TLV_HEADER_SIZE*2]; - aim_writesnac(0x01,0x1E,offset,buf); - aim_writetlvlong(0x06,status_type,offset,buf); - return aim_sendflap(hServerConn,0x02,offset,buf,seqno); + unsigned short offset = 0; + char buf[SNAC_SIZE + TLV_HEADER_SIZE * 2]; + aim_writesnac(0x01, 0x1E, offset, buf); + aim_writetlvlong(0x06, status_type, offset, buf); + return aim_sendflap(hServerConn, 0x02, offset, buf, seqno); } -int CAimProto::aim_set_statusmsg(HANDLE hServerConn,unsigned short &seqno,const char *msg)//user info +int CAimProto::aim_set_statusmsg(HANDLE hServerConn, unsigned short &seqno, const char *msg)//user info { - size_t msg_size =_strlens(msg); + size_t msg_size = mir_strlen(msg); + + unsigned short msgoffset = 0; + char* msgbuf = (char*)alloca(10 + msg_size); + if (msg_size) { + char* msgb = (char*)alloca(4 + msg_size); + msgb[0] = (unsigned char)(msg_size >> 8); + msgb[1] = (unsigned char)(msg_size & 0xff); + memcpy(&msgb[2], msg, msg_size); + msgb[msg_size + 2] = 0; + msgb[msg_size + 3] = 0; + + aim_writebartid(2, 4, (unsigned short)(msg_size + 4), msgb, msgoffset, msgbuf); + } + else aim_writebartid(2, 0, 0, NULL, msgoffset, msgbuf); - unsigned short msgoffset=0; - char* msgbuf=(char*)alloca(10+msg_size); + unsigned short offset = 0; + char* buf = (char*)alloca(SNAC_SIZE + TLV_HEADER_SIZE + msgoffset + 8); + aim_writesnac(0x01, 0x1e, offset, buf); + aim_writetlv(0x1d, msgoffset, msgbuf, offset, buf); - if (msg_size) - { - char* msgb=(char*)alloca(4+msg_size); - msgb[0]=(unsigned char)(msg_size >> 8); - msgb[1]=(unsigned char)(msg_size & 0xff); - memcpy(&msgb[2],msg,msg_size); - msgb[msg_size+2]=0; - msgb[msg_size+3]=0; - - aim_writebartid(2,4,(unsigned short)(msg_size+4),msgb,msgoffset,msgbuf); - } - else - aim_writebartid(2,0,0,NULL,msgoffset,msgbuf); - - unsigned short offset=0; - char* buf=(char*)alloca(SNAC_SIZE+TLV_HEADER_SIZE+msgoffset+8); - aim_writesnac(0x01,0x1e,offset,buf); - aim_writetlv(0x1d,msgoffset,msgbuf,offset,buf); - - return aim_sendflap(hServerConn,0x02,offset,buf,seqno); + return aim_sendflap(hServerConn, 0x02, offset, buf, seqno); } -int CAimProto::aim_query_away_message(HANDLE hServerConn,unsigned short &seqno,const char* sn) +int CAimProto::aim_query_away_message(HANDLE hServerConn, unsigned short &seqno, const char* sn) { - unsigned short offset=0; - unsigned short sn_length=(unsigned short)strlen(sn); - char* buf=(char*)alloca(SNAC_SIZE+5+sn_length); - aim_writesnac(0x02,0x15,offset,buf); - aim_writegeneric(4,"\0\0\0\x02",offset,buf); - aim_writegeneric(1,(char*)&sn_length,offset,buf); - aim_writegeneric(sn_length,sn,offset,buf); - int res=aim_sendflap(hServerConn,0x02,offset,buf,seqno)==0; + unsigned short offset = 0; + unsigned short sn_length = (unsigned short)strlen(sn); + char *buf = (char*)alloca(SNAC_SIZE + 5 + sn_length); + aim_writesnac(0x02, 0x15, offset, buf); + aim_writegeneric(4, "\0\0\0\x02", offset, buf); + aim_writegeneric(1, (char*)&sn_length, offset, buf); + aim_writegeneric(sn_length, sn, offset, buf); + int res = aim_sendflap(hServerConn, 0x02, offset, buf, seqno) == 0; return res; } diff --git a/protocols/AimOscar/src/chat.cpp b/protocols/AimOscar/src/chat.cpp index d1b4bb900f..384a08fa18 100644 --- a/protocols/AimOscar/src/chat.cpp +++ b/protocols/AimOscar/src/chat.cpp @@ -15,7 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "aim.h" +#include "stdafx.h" static const COLORREF crCols[16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; @@ -102,7 +102,7 @@ void CAimProto::chat_leave(const char* id) } -int CAimProto::OnGCEvent(WPARAM wParam,LPARAM lParam) +int CAimProto::OnGCEvent(WPARAM, LPARAM lParam) { GCHOOK *gch = (GCHOOK*) lParam; if (!gch) return 1; @@ -188,9 +188,9 @@ int CAimProto::OnGCEvent(WPARAM wParam,LPARAM lParam) return 0; } -int CAimProto::OnGCMenuHook(WPARAM wParam,LPARAM lParam) +int CAimProto::OnGCMenuHook(WPARAM, LPARAM lParam) { - GCMENUITEMS *gcmi= (GCMENUITEMS*) lParam; + GCMENUITEMS *gcmi= (GCMENUITEMS*)lParam; if ( gcmi == NULL || _stricmp(gcmi->pszModule, m_szModuleName )) return 0; diff --git a/protocols/AimOscar/src/client.cpp b/protocols/AimOscar/src/client.cpp index 69577e8cc2..a766db7187 100644 --- a/protocols/AimOscar/src/client.cpp +++ b/protocols/AimOscar/src/client.cpp @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "aim.h" +#include "stdafx.h" int CAimProto::aim_send_connection_packet(HANDLE hServerConn,unsigned short &seqno,char *buf) { @@ -414,8 +414,8 @@ int CAimProto::aim_add_contact(HANDLE hServerConn, unsigned short &seqno, const { unsigned short offset=0; unsigned short sn_length=(unsigned short)strlen(sn); - unsigned short nick_length = (unsigned short)_strlens(nick); - unsigned short note_length = (unsigned short)_strlens(note); + unsigned short nick_length = (unsigned short)mir_strlen(nick); + unsigned short note_length = (unsigned short)mir_strlen(note); unsigned short tlv_len = nick || note ? TLV_HEADER_SIZE * 2 + nick_length + note_length : 0; char* buf=(char*)alloca(SNAC_SIZE + sn_length + 10 + tlv_len); @@ -458,8 +458,8 @@ int CAimProto::aim_mod_buddy(HANDLE hServerConn, unsigned short &seqno, const ch { unsigned short offset=0; unsigned short sn_length = (unsigned short)strlen(sn); - unsigned short nick_length = (unsigned short)_strlens(nick); - unsigned short note_length = (unsigned short)_strlens(note); + unsigned short nick_length = (unsigned short)mir_strlen(nick); + unsigned short note_length = (unsigned short)mir_strlen(note); unsigned short tlv_len = TLV_HEADER_SIZE * 2 + nick_length + note_length; char* buf=(char*)alloca(SNAC_SIZE+sn_length+10+tlv_len); @@ -625,7 +625,7 @@ int CAimProto::aim_send_file(HANDLE hServerConn, unsigned short &seqno, } -int CAimProto::aim_file_ad(HANDLE hServerConn,unsigned short &seqno,char* sn, char* icbm_cookie, bool deny, unsigned short max_ver) +int CAimProto::aim_file_ad(HANDLE hServerConn,unsigned short &seqno,char* sn, char* icbm_cookie, bool deny, unsigned short) { unsigned short frag_offset=0; char msg_frag[10+AIM_CAPS_LENGTH+TLV_HEADER_SIZE*2+6]; @@ -742,7 +742,7 @@ int CAimProto::aim_set_avatar_hash(HANDLE hServerConn, unsigned short &seqno, ch return aim_sendflap(hServerConn,0x02,offset,buf,seqno); } -int CAimProto::aim_delete_avatar_hash(HANDLE hServerConn, unsigned short &seqno, char flags, unsigned short bart_type, unsigned short & id) +int CAimProto::aim_delete_avatar_hash(HANDLE hServerConn, unsigned short &seqno, char /*flags*/, unsigned short bart_type, unsigned short & id) { unsigned short offset=0; diff --git a/protocols/AimOscar/src/connection.cpp b/protocols/AimOscar/src/connection.cpp index d9acb8d542..d813cb5646 100644 --- a/protocols/AimOscar/src/connection.cpp +++ b/protocols/AimOscar/src/connection.cpp @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "aim.h" +#include "stdafx.h" HANDLE CAimProto::aim_connect(const char* server, unsigned short port, bool use_ssl, const char* host) { diff --git a/protocols/AimOscar/src/conv.cpp b/protocols/AimOscar/src/conv.cpp index 96aff9e2e5..faa4bdc01c 100644 --- a/protocols/AimOscar/src/conv.cpp +++ b/protocols/AimOscar/src/conv.cpp @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "aim.h" +#include "stdafx.h" #pragma warning( disable: 4706 ) @@ -610,8 +610,8 @@ char* rtf_to_html(HWND hwndDlg,int DlgItem) BOOL Italic=false; BOOL Underline=false; char Face[32]=""; - COLORREF Color; - COLORREF BackColor; + COLORREF Color=0; + COLORREF BackColor=0; int Size=0; GETTEXTLENGTHEX tl; tl.flags=GTL_DEFAULT; @@ -703,7 +703,7 @@ char* rtf_to_html(HWND hwndDlg,int DlgItem) } } } - if ( Size != isSize || Color != isColor || BackColor != isBackColor || mir_strcmp( Face, cfOld.szFaceName )) + if (Size != isSize || Color != isColor || BackColor != isBackColor || mir_strcmp(Face, cfOld.szFaceName)) { Size=isSize; Color=isColor; diff --git a/protocols/AimOscar/src/direct_connect.cpp b/protocols/AimOscar/src/direct_connect.cpp index 982d56fe7d..0ed07c535c 100644 --- a/protocols/AimOscar/src/direct_connect.cpp +++ b/protocols/AimOscar/src/direct_connect.cpp @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "aim.h" +#include "stdafx.h" void __cdecl CAimProto::aim_dc_helper(void* param) //only called when we are initiating a direct connection with someone else { diff --git a/protocols/AimOscar/src/error.cpp b/protocols/AimOscar/src/error.cpp index cfd5f3e26d..f9ecf33108 100644 --- a/protocols/AimOscar/src/error.cpp +++ b/protocols/AimOscar/src/error.cpp @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "aim.h" +#include "stdafx.h" void CAimProto::login_error(unsigned short error) { diff --git a/protocols/AimOscar/src/file.cpp b/protocols/AimOscar/src/file.cpp index 03871937f8..300561e408 100644 --- a/protocols/AimOscar/src/file.cpp +++ b/protocols/AimOscar/src/file.cpp @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "aim.h" +#include "stdafx.h" #pragma pack(push, 1) struct oft2//oscar file transfer 2 class- See On_Sending_Files_via_OSCAR.pdf diff --git a/protocols/AimOscar/src/flap.cpp b/protocols/AimOscar/src/flap.cpp index 9d5186da47..96b164fa9c 100644 --- a/protocols/AimOscar/src/flap.cpp +++ b/protocols/AimOscar/src/flap.cpp @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "aim.h" +#include "stdafx.h" FLAP::FLAP(char* buf,int num_bytes) { diff --git a/protocols/AimOscar/src/links.cpp b/protocols/AimOscar/src/links.cpp index 12f69bd9fc..ee4709ac0c 100644 --- a/protocols/AimOscar/src/links.cpp +++ b/protocols/AimOscar/src/links.cpp @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "aim.h" +#include "stdafx.h" static HANDLE hServiceParseLink; diff --git a/protocols/AimOscar/src/packets.cpp b/protocols/AimOscar/src/packets.cpp index f4f44ab8bf..4c5964d293 100644 --- a/protocols/AimOscar/src/packets.cpp +++ b/protocols/AimOscar/src/packets.cpp @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "aim.h" +#include "stdafx.h" int aim_writesnac(unsigned short service, unsigned short subgroup,unsigned short &offset, char* out, unsigned short id) { diff --git a/protocols/AimOscar/src/popup.cpp b/protocols/AimOscar/src/popup.cpp index c561994451..82ded8680c 100644 --- a/protocols/AimOscar/src/popup.cpp +++ b/protocols/AimOscar/src/popup.cpp @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "aim.h" +#include "stdafx.h" struct CAimPopupData { diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp index 0b468f1dba..fcf9c2e86b 100644 --- a/protocols/AimOscar/src/proto.cpp +++ b/protocols/AimOscar/src/proto.cpp @@ -15,7 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "aim.h" +#include "stdafx.h" CAimProto::CAimProto(const char* aProtoName, const TCHAR* aUserName) : PROTO(aProtoName, aUserName), @@ -105,11 +105,11 @@ CAimProto::~CAimProto() //////////////////////////////////////////////////////////////////////////////////////// // OnModulesLoadedEx - performs hook registration -int CAimProto::OnModulesLoaded(WPARAM wParam, LPARAM lParam) +int CAimProto::OnModulesLoaded(WPARAM, LPARAM) { - HookProtoEvent(ME_USERINFO_INITIALISE, &CAimProto::OnUserInfoInit); - HookProtoEvent(ME_IDLE_CHANGED, &CAimProto::OnIdleChanged); - HookProtoEvent(ME_MSG_WINDOWEVENT, &CAimProto::OnWindowEvent); + HookProtoEvent(ME_IDLE_CHANGED, &CAimProto::OnIdleChanged); + HookProtoEvent(ME_MSG_WINDOWEVENT, &CAimProto::OnWindowEvent); + HookProtoEvent(ME_USERINFO_INITIALISE, &CAimProto::OnUserInfoInit); chat_register(); InitContactMenus(); @@ -130,26 +130,10 @@ MCONTACT CAimProto::AddToList(int flags, PROTOSEARCHRESULT* psr) return hContact; //See authrequest for serverside addition } -//////////////////////////////////////////////////////////////////////////////////////// -// AuthAllow - processes the successful authorization - -int CAimProto::Authorize(MEVENT hDbEvent) -{ - return 0; -} - -//////////////////////////////////////////////////////////////////////////////////////// -// AuthDeny - handles the unsuccessful authorization - -int CAimProto::AuthDeny(MEVENT hDbEvent, const TCHAR* szReason) -{ - return 0; -} - //////////////////////////////////////////////////////////////////////////////////////// // PSS_AUTHREQUEST -int __cdecl CAimProto::AuthRequest(MCONTACT hContact, const TCHAR* szMessage) +int __cdecl CAimProto::AuthRequest(MCONTACT hContact, const TCHAR*) { //Not a real authrequest- only used b/c we don't know the group until now. if (state != 1) @@ -169,7 +153,7 @@ int __cdecl CAimProto::AuthRequest(MCONTACT hContact, const TCHAR* szMessage) //////////////////////////////////////////////////////////////////////////////////////// // FileAllow - starts a file transfer -HANDLE __cdecl CAimProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath) +HANDLE __cdecl CAimProto::FileAllow(MCONTACT, HANDLE hTransfer, const PROTOCHAR* szPath) { file_transfer *ft = (file_transfer*)hTransfer; if (ft && ft_list.find_by_ft(ft)) @@ -197,7 +181,7 @@ HANDLE __cdecl CAimProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const P //////////////////////////////////////////////////////////////////////////////////////// // FileCancel - cancels a file transfer -int __cdecl CAimProto::FileCancel(MCONTACT hContact, HANDLE hTransfer) +int __cdecl CAimProto::FileCancel(MCONTACT, HANDLE hTransfer) { file_transfer *ft = (file_transfer*)hTransfer; if (!ft_list.find_by_ft(ft)) return 0; @@ -220,7 +204,7 @@ int __cdecl CAimProto::FileCancel(MCONTACT hContact, HANDLE hTransfer) //////////////////////////////////////////////////////////////////////////////////////// // FileDeny - denies a file transfer -int __cdecl CAimProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* /*szReason*/) +int __cdecl CAimProto::FileDeny(MCONTACT, HANDLE hTransfer, const PROTOCHAR* /*szReason*/) { file_transfer *ft = (file_transfer*)hTransfer; if (!ft_list.find_by_ft(ft)) return 0; @@ -239,8 +223,7 @@ int __cdecl CAimProto::FileResume(HANDLE hTransfer, int* action, const PROTOCHAR file_transfer *ft = (file_transfer*)hTransfer; if (!ft_list.find_by_ft(ft)) return 0; - switch (*action) - { + switch (*action) { case FILERESUME_RESUME: { struct _stati64 statbuf; @@ -275,10 +258,9 @@ int __cdecl CAimProto::FileResume(HANDLE hTransfer, int* action, const PROTOCHAR //////////////////////////////////////////////////////////////////////////////////////// // GetCaps - return protocol capabilities bits -DWORD_PTR __cdecl CAimProto::GetCaps(int type, MCONTACT hContact) +DWORD_PTR __cdecl CAimProto::GetCaps(int type, MCONTACT) { - switch (type) - { + switch (type) { case PFLAGNUM_1: return PF1_IM | PF1_MODEMSG | PF1_BASICSEARCH | PF1_SEARCHBYEMAIL | PF1_FILE; @@ -645,7 +627,7 @@ HANDLE __cdecl CAimProto::GetAwayMsg(MCONTACT hContact) //////////////////////////////////////////////////////////////////////////////////////// // PSR_AWAYMSG -int __cdecl CAimProto::RecvAwayMsg(MCONTACT hContact, int statusMode, PROTORECVEVENT* pre) +int __cdecl CAimProto::RecvAwayMsg(MCONTACT hContact, int, PROTORECVEVENT* pre) { ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)pre->szMessage); return 0; @@ -684,7 +666,7 @@ int __cdecl CAimProto::SetAwayMsg(int status, const TCHAR* msg) if (state == 1 && status == m_iStatus) { - if (!_strcmps(last_status_msg, nmsg)) + if (!mir_strcmp(last_status_msg, nmsg)) return 0; mir_free(last_status_msg); diff --git a/protocols/AimOscar/src/proto.h b/protocols/AimOscar/src/proto.h index e92f9f34e1..b5e77ed9bc 100644 --- a/protocols/AimOscar/src/proto.h +++ b/protocols/AimOscar/src/proto.h @@ -30,8 +30,6 @@ struct CAimProto : public PROTO virtual MCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr ); - virtual int __cdecl Authorize( MEVENT hDbEvent ); - virtual int __cdecl AuthDeny( MEVENT hDbEvent, const TCHAR* szReason ); virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR* szMessage ); virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath ); diff --git a/protocols/AimOscar/src/proxy.cpp b/protocols/AimOscar/src/proxy.cpp index d24f34f8f2..7cfaa76e19 100644 --- a/protocols/AimOscar/src/proxy.cpp +++ b/protocols/AimOscar/src/proxy.cpp @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "aim.h" +#include "stdafx.h" void __cdecl CAimProto::aim_proxy_helper(void* param) { diff --git a/protocols/AimOscar/src/server.cpp b/protocols/AimOscar/src/server.cpp index 743966c18a..9256800a9d 100644 --- a/protocols/AimOscar/src/server.cpp +++ b/protocols/AimOscar/src/server.cpp @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "aim.h" +#include "stdafx.h" void CAimProto::snac_md5_authkey(SNAC &snac,HANDLE hServerConn,unsigned short &seqno, const char* username, const char* password)//family 0x0017 { @@ -758,7 +758,7 @@ void CAimProto::process_ssi_list(SNAC &snac, int &offset) break; case 0x0014: //avatar record - if (!_strcmps(name, "1") || !_strcmps(name, "12")) { + if (!mir_strcmp(name, "1") || !mir_strcmp(name, "12")) { if (name_length == 1) avatar_id_sm = item_id; else @@ -768,7 +768,6 @@ void CAimProto::process_ssi_list(SNAC &snac, int &offset) TLV tlv(snac.val(tlv_base + tlv_offset)); if (tlv.cmp(0x00d5) && tlv.len() > 2) { - unsigned char type = tlv.ubyte(0); if (name_length == 1) { mir_free(hash_sm); hash_sm = bytes_to_string(tlv.val() + 2, tlv.ubyte(1)); @@ -899,7 +898,7 @@ void CAimProto::modify_ssi_list(SNAC &snac, int &offset) break; case 0x0014: //avatar record - if (!_strcmps(name, "1") || !_strcmps(name, "12")) + if (!mir_strcmp(name, "1") || !mir_strcmp(name, "12")) { if (name_length == 1) avatar_id_sm = item_id; @@ -969,13 +968,13 @@ void CAimProto::delete_ssi_list(SNAC &snac, int &offset) break; case 0x0014: //avatar record - if (_strcmps(name, "1")) + if (mir_strcmp(name, "1")) { avatar_id_sm = 0; mir_free(hash_sm); hash_sm = NULL; } - else if (!_strcmps(name, "12")) + else if (!mir_strcmp(name, "12")) { avatar_id_lg = 0; mir_free(hash_lg); diff --git a/protocols/AimOscar/src/services.cpp b/protocols/AimOscar/src/services.cpp index e21396f34c..8e7c2c75db 100644 --- a/protocols/AimOscar/src/services.cpp +++ b/protocols/AimOscar/src/services.cpp @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "aim.h" +#include "stdafx.h" INT_PTR CAimProto::GetMyAwayMsg(WPARAM wParam,LPARAM lParam) { diff --git a/protocols/AimOscar/src/snac.cpp b/protocols/AimOscar/src/snac.cpp index 8c893b58e0..0dd1c12d3f 100644 --- a/protocols/AimOscar/src/snac.cpp +++ b/protocols/AimOscar/src/snac.cpp @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "aim.h" +#include "stdafx.h" SNAC::SNAC(char* buf,unsigned short length) { diff --git a/protocols/AimOscar/src/stdafx.cpp b/protocols/AimOscar/src/stdafx.cpp deleted file mode 100644 index a53e8c03ae..0000000000 --- a/protocols/AimOscar/src/stdafx.cpp +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright (C) 2012-15 Miranda NG project (http://miranda-ng.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation version 2 -of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "aim.h" \ No newline at end of file diff --git a/protocols/AimOscar/src/stdafx.cxx b/protocols/AimOscar/src/stdafx.cxx new file mode 100644 index 0000000000..6fb37564b7 --- /dev/null +++ b/protocols/AimOscar/src/stdafx.cxx @@ -0,0 +1,18 @@ +/* +Copyright (C) 2012-15 Miranda NG project (http://miranda-ng.org) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation version 2 +of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "stdafx.h" \ No newline at end of file diff --git a/protocols/AimOscar/src/stdafx.h b/protocols/AimOscar/src/stdafx.h new file mode 100644 index 0000000000..371dffa66f --- /dev/null +++ b/protocols/AimOscar/src/stdafx.h @@ -0,0 +1,320 @@ +/* +Plugin of Miranda IM for communicating with users of the AIM protocol. +Copyright (c) 2008-2012 Boris Krasnovskiy +Copyright (C) 2005-2006 Aaron Myles Landwehr + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#ifndef AIM_H +#define AIM_H + +//System includes +#include +#include +#include +#include +#include +#include +#include +#include + +//Miranda NG includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +//rest of includes +#include "avatars.h" +#include "utility.h" +#include "chat.h" +#include "direct_connect.h" +#include "conv.h" +#include "file.h" +#include "flap.h" +#include "links.h" +#include "snac.h" +#include "tlv.h" +#include "packets.h" +#include "proxy.h" +#include "resource.h" +#include "proto.h" +#include "theme.h" +#include "ui.h" +#include "version.h" + +// Protocol limits +#define MAX_SCREEN_NAME_LENGTH 97 +#define MAX_GROUP_NAME_LENGTH 48 +#define MAX_NICKNAME_LENGTH 64 +#define MAX_MESSAGE_LENGTH 3978 +#define MAX_STATUS_MESSAGE_LENGTH 251 +#define MAX_AWAY_MESSAGE_LENGTH 4096 +#define MAX_ICON_SIZE 7168 + +// ICBM parameter flags +#define ICBM_CHANNEL_MSGS_ALLOWED 0x00000001 +#define ICBM_MISSED_CALLS_ENABLED 0x00000002 +#define ICBM_EVENTS_ALLOWED 0x00000008 +#define ICBM_SMS_SUPPORTED 0x00000010 +#define ICBM_OFFLINE_MSGS_ALLOWED 0x00000100 + +// SSI preferences +#define SHOW_IDLE 0x00000400 +#define SHOW_RECENT_BUDDIES 0x00020000 +#define SHOW_TYPING 0x00400000 + +//Extended Status Icon Numbers +#define ACCOUNT_TYPE_UNCONFIRMED 1 +#define ACCOUNT_TYPE_CONFIRMED 2 +#define ACCOUNT_TYPE_ICQ 3 +#define ACCOUNT_TYPE_AOL 4 +#define ACCOUNT_TYPE_ADMIN 5 +#define EXTENDED_STATUS_BOT 1 +#define EXTENDED_STATUS_HIPTOP 2 + +//Popup flags +#define MAIL_POPUP 0x04 +#define ERROR_POPUP 0x08 +#define TCHAR_POPUP 0x10 + +//Main Option Window Keys +#define AIM_KEY_SN "SN" +#define AIM_KEY_NK "Nick" +#define AIM_KEY_PW "Password" +#define AIM_KEY_HN "loginhost" +#define AIM_KEY_PN "loginport" +#define AIM_KEY_DC "DelConf"//delivery confirmation +#define AIM_KEY_FP "ForceProxyTransfer" +#define AIM_KEY_HF "HiptopFake" +#define AIM_KEY_AT "DisableATIcons" +#define AIM_KEY_ES "DisableESIcons" +#define AIM_KEY_DM "DisableModeMsg" +#define AIM_KEY_FI "FormatIncoming"//html->bbcodes +#define AIM_KEY_FO "FormatOutgoing"//bbcodes->html +#define AIM_KEY_II "InstantIdle" +#define AIM_KEY_IIT "InstantIdleTS" +#define AIM_KEY_CM "CheckMail" +#define AIM_KEY_MG "ManageGroups" +#define AIM_KEY_DA "DisableAvatars" +#define AIM_KEY_DSSL "DisableSSL" +#define AIM_KEY_FSC "ForceSingleClient" + +#define OTH_KEY_SM "StatusMsg" +#define OTH_KEY_GP "Group" +//Module Name Key +#define MOD_KEY_CL "CList" +//Settings Keys +#define AIM_KEY_PR "Profile" +#define AIM_KEY_LA "LastAwayChange" +//Contact Keys +#define AIM_KEY_BI "BuddyId" +#define AIM_KEY_GI "GroupId" +#define AIM_KEY_ST "Status" +#define AIM_KEY_IT "IdleTS" +#define AIM_KEY_OT "LogonTS" +#define AIM_KEY_MS "MemberTS" +#define AIM_KEY_AC "AccType"//account type +#define AIM_KEY_ET "ESType"//Extended Status type +#define AIM_KEY_MV "MirVer" +#define AIM_KEY_US "Utf8Support" +#define AIM_KEY_NL "NotOnList" +#define AIM_KEY_LM "LastMessage" +#define AIM_KEY_AH "AvatarHash" +#define AIM_KEY_AHT "AvatarType" +#define AIM_KEY_EM "e-mail" +#define AIM_KEY_LV "LastVer" +#define AIM_KEY_TIS "TotalIMsSent" +#define AIM_KEY_TIR "TotalIMsReceived" +#define AIM_KEY_TAM "TotalAwayMessages" +#define AIM_KEY_TTO "TotalTimeOnline" +#define AIM_KEY_BLS "IsBlast" +#define AIM_KEY_NIL "IsNotInList" + +#define AIM_DEFAULT_SERVER "slogin.oscar.aol.com" +#define AIM_DEFAULT_SERVER_NS "login.oscar.aol.com" +#define AIM_PROXY_SERVER "ars.oscar.aol.com" +#define AIM_DEFAULT_PORT 5190 +#define AIM_DEFAULT_SSL_PORT 443 + +//Some Defaults for various things +#define DEFAULT_KEEPALIVE_TIMER 39 // secs +#define DEFAULT_GRACE_PERIOD 60 +#define AIM_DEFAULT_GROUP "miranda merged" +#define SYSTEM_BUDDY "aolsystemmsg" +#define DEFAULT_AWAY_MSG "I am away from my computer right now." +//Md5 Roasting stuff +#define AIM_MD5_STRING "AOL Instant Messenger (SM)" +#define MD5_HASH_LENGTH 16 + +//Aim Version Stuff +#define AIM_CLIENT_MAJOR_VERSION 5 +#define AIM_CLIENT_MINOR_VERSION 9 +#define AIM_CLIENT_LESSER_VERSION 0 +#define AIM_CLIENT_BUILD_NUMBER 0x1772 +#define AIM_CLIENT_ID_NUMBER 0x0109 +#define AIM_CLIENT_DISTRIBUTION_NUMBER 0x0150 + +#define AIM_LANGUAGE "en" +#define AIM_COUNTRY "us" +#define AIM_MSG_TYPE "text/x-aolrtf; charset=\"us-ascii\"" +#define AIM_MSG_TYPE_UNICODE "text/x-aolrtf; charset=\"unicode-2-0\"" +#define AIM_TOOL_VERSION "\x01\x10\x18\xf1" + +//Supported Clients +#define CLIENT_UNKNOWN "?" +#define CLIENT_AIM5 "AIM 5.x" +#define CLIENT_AIM4 "AIM 4.x" +#define CLIENT_AIMEXPRESS5 "AIM Express 5" +#define CLIENT_AIMEXPRESS6 "AIM Express 6" +#define CLIENT_AIMEXPRESS7 "AIM Express 7" +#define CLIENT_ICQ "ICQ" +#define CLIENT_AIM_TRITON "AIM Triton" +#define CLIENT_AIM6_1 "AIM 6.1" +#define CLIENT_AIM6_5 "AIM 6.5" +#define CLIENT_AIM6_8 "AIM 6.8" +#define CLIENT_AIM6_9 "AIM 6.9" +#define CLIENT_AIM7_0 "AIM 7.0" +#define CLIENT_AIMTOC "AIM TOC" +#define CLIENT_BOT "AIM Bot" +#define CLIENT_GAIM "Gaim" +#define CLIENT_PURPLE "Purple" +#define CLIENT_ADIUM "Adium X" +#define CLIENT_GPRS "GPRS" +#define CLIENT_ICHAT "iChat" +#define CLIENT_IM2 "IM2" +#define CLIENT_KOPETE "Kopete" +#define CLIENT_MEEBO "Meebo" +#define CLIENT_DIGSBY "Digsby" +#define CLIENT_BEEJIVE "beejive" +#define CLIENT_MICQ "mICQ" +#define CLIENT_AIMOSCAR "Miranda IM %d.%d.%d.%d (AIM v%d.%d.%d.%d)" +#define CLIENT_OSCARJ "Miranda IM %d.%d.%d.%d%s (ICQ v%d.%d.%d.%d%s)" +#define CLIENT_OSCARSN "Miranda IM %d.%d.%d.%d%s (ICQ S!N v%d.%d.%d.%d%s)%s" +#define CLIENT_OSCARPL "Miranda IM %d.%d.%d.%d%s (ICQ Plus v%d.%d.%d.%d%s)%s" +#define CLIENT_NAIM "naim" +#define CLIENT_QIP "qip" +#define CLIENT_SIM "SIM" +#define CLIENT_SMS "SMS" +#define CLIENT_TERRAIM "TerraIM" +#define CLIENT_TRILLIAN_PRO "Trillian Pro" +#define CLIENT_TRILLIAN "Trillian" +#define CLIENT_TRILLIAN_ASTRA "Trillian Astra" +#define CLIENT_BLAST "Blast Group" + +//Aim Caps +#define AIM_CAPS_LENGTH 16 + +// Official +#define AIM_CAP_SHORT_CAPS "\x09\x46\x00\x00\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_SECURE_IM "\x09\x46\x00\x01\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_XHTML_IM "\x09\x46\x00\x02\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_RTCVIDEO "\x09\x46\x01\x01\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_HAS_MICROPHONE "\x09\x46\x01\x02\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_HAS_CAMERA "\x09\x46\x01\x03\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_RTCAUDIO "\x09\x46\x01\x04\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_HOST_STATUS_TEXT_AWARE "\x09\x46\x01\x0a\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_RT_IM "\x09\x46\x01\x0b\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_SMART_CAPS "\x09\x46\x01\xff\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_FILE_TRANSFER "\x09\x46\x13\x43\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_DIRECT_IM "\x09\x46\x13\x45\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_FILE_SHARING "\x09\x46\x13\x48\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_SUPPORT_ICQ "\x09\x46\x13\x4D\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" + +#define AIM_CAP_AVAILABLE_FOR_CALL "\x09\x46\x01\x05\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_ACA "\x09\x46\x01\x06\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_MULTI_AUDIO "\x09\x46\x01\x07\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_MULTI_VIDEO "\x09\x46\x01\x08\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_VICEROY "\x09\x46\xf0\x04\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_BUDDY_ICON "\x09\x46\x13\x46\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_VOICE_CHAT "\x09\x46\x13\x41\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_DIRECT_PLAY "\x09\x46\x13\x42\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_ICQ_DIRECT_CONNECT "\x09\x46\x13\x44\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_GAMES "\x09\x46\x13\x47\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_ICQ_SERVER_RELAY "\x09\x46\x13\x49\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0"//icq? channel 2 extended, TLV(0x2711) based messages +#define AIM_CAP_CHAT_ROBOTS "\x09\x46\x13\x4A\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_SHARE_BUDDIES "\x09\x46\x13\x4B\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_CHAT "\x74\x8F\x24\x20\x62\x87\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_AMO "\x09\x46\x01\x0c\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" + +// Extensions +#define AIM_CAP_HIPTOP "\x09\x46\x13\x23\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_UTF8 "\x09\x46\x13\x4E\x4C\x7F\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_UNKNOWN4 "\x09\x46\xf0\x03\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_UNKNOWNC "\x09\x46\xf0\x05\x4c\x7f\x11\xD1\x82\x22\x44\x45\x53\x54\0\0" +#define AIM_CAP_IM2 "\x74\xed\xc3\x36\x44\xdf\x48\x5b\x8b\x1c\x67\x1a\x1f\x86\x09\x9f" +#define AIM_CAP_TRILLIAN "\xF2\xE7\xC7\xF4\xFE\xAD\x4D\xFB\xB2\x35\x36\x79\x8B\xDF\0\0" +extern char AIM_CAP_MIRANDA[]; //Miranda cap EXTERN + +//Aim Services +#define AIM_SERVICE_GENERIC "\0\x01\0\x04"//version 4 +#define AIM_SERVICE_SSI "\0\x13\0\x03"//version 3 +#define AIM_SERVICE_LOCATION "\0\x02\0\x01"//version 1 +#define AIM_SERVICE_BUDDYLIST "\0\x03\0\x01"//version 1 +#define AIM_SERVICE_MESSAGING "\0\x04\0\x01"//version 1 +#define AIM_SERVICE_INVITATION "\0\x06\0\x01"//version 1 +#define AIM_SERVICE_ADMIN "\0\x07\0\x01"//version 1 +#define AIM_SERVICE_POPUP "\0\x08\0\x01"//version 1 +#define AIM_SERVICE_BOS "\0\x09\0\x01"//version 1 +#define AIM_SERVICE_AVATAR "\0\x10\0\x01"//version 1 +#define AIM_SERVICE_USERLOOKUP "\0\x0A\0\x01"//version 1 +#define AIM_SERVICE_STATS "\0\x0B\0\x01"//version 1 +#define AIM_SERVICE_CHATNAV "\0\x0D\0\x01"//version 1 +#define AIM_SERVICE_DIRSEARCH "\0\x0F\0\x01"//version 1 +#define AIM_SERVICE_CHAT "\0\x0E\0\x01"//version 1 +#define AIM_SERVICE_ICQ "\0\x15\0\x01"//version 1 +#define AIM_SERVICE_MAIL "\0\x18\0\x01"//version 1 +#define AIM_SERVICE_UNKNOWN "\0\x22\0\x01"//version 1 +#define AIM_SERVICE_RATES "\0\x01\0\x02\0\x03\0\x04\0\x05" + +//Aim Statuses +#define AIM_STATUS_WEBAWARE "\0\x01" +#define AIM_STATUS_SHOWIP "\0\x02" +#define AIM_STATUS_BIRTHDAY "\0\x08" +#define AIM_STATUS_WEBFRONT "\0\x20" +#define AIM_STATUS_DCAUTH "\x10\0" +#define AIM_STATUS_DCCONT "\x20\0" +#define AIM_STATUS_NULL "\0\0" + +#define AIM_STATUS_ONLINE 0x00000000 +#define AIM_STATUS_AWAY 0x00000001 +#define AIM_STATUS_DND 0x00000002 +#define AIM_STATUS_OUT 0x00000004 +#define AIM_STATUS_BUSY 0x00000010 +#define AIM_STATUS_CHAT 0x00000020 // Broken. If set, you cannot unset. +#define AIM_STATUS_INVISIBLE 0x00000100 + +extern HINSTANCE hInstance; //plugin dll instance + +#endif diff --git a/protocols/AimOscar/src/theme.cpp b/protocols/AimOscar/src/theme.cpp index 0e4b6b69b5..36acbcef17 100644 --- a/protocols/AimOscar/src/theme.cpp +++ b/protocols/AimOscar/src/theme.cpp @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "aim.h" +#include "stdafx.h" ///////////////////////////////////////////////////////////////////////////////////////// // Icons init diff --git a/protocols/AimOscar/src/thread.cpp b/protocols/AimOscar/src/thread.cpp index 04b0991333..8c03fab0a0 100644 --- a/protocols/AimOscar/src/thread.cpp +++ b/protocols/AimOscar/src/thread.cpp @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "aim.h" +#include "stdafx.h" void __cdecl CAimProto::accept_file_thread(void* param)//buddy sending file { diff --git a/protocols/AimOscar/src/tlv.cpp b/protocols/AimOscar/src/tlv.cpp index f35fbac50e..717ef5d4b5 100644 --- a/protocols/AimOscar/src/tlv.cpp +++ b/protocols/AimOscar/src/tlv.cpp @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "aim.h" +#include "stdafx.h" TLV::TLV(char* buf) { diff --git a/protocols/AimOscar/src/ui.cpp b/protocols/AimOscar/src/ui.cpp index 02294d8587..c846ab9574 100644 --- a/protocols/AimOscar/src/ui.cpp +++ b/protocols/AimOscar/src/ui.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "aim.h" +#include "stdafx.h" HANDLE hThemeButton = NULL; COLORREF foreground=0; diff --git a/protocols/AimOscar/src/utility.cpp b/protocols/AimOscar/src/utility.cpp index dfd9677ca3..7480917b4c 100644 --- a/protocols/AimOscar/src/utility.cpp +++ b/protocols/AimOscar/src/utility.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "aim.h" +#include "stdafx.h" void CAimProto::broadcast_status(int status) { -- cgit v1.2.3