You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
RnQ/RnQ/ICQ/ICQConsts.pas

602 lines
27 KiB
Plaintext

{
This file is part of R&Q.
Under same license
}
unit ICQConsts;
{$I RnQConfig.inc}
interface
uses
RDGlobal, RnQPics, ICQCommon;
{$I NoRTTI.inc}
type
TICQStatus = (SC_ONLINE = 0, SC_OFFLINE, SC_UNK, SC_OCCUPIED, SC_DND, SC_NA, SC_AWAY, SC_F4C, SC_EVIL, SC_DEPRESSION);
TICQContactType = (CT_UNK = 0, CT_ICQ, CT_OLDICQ, CT_SMS, CT_PHONE, CT_CHAT, CT_INTEROP);
TProtoEvent = (
IE_error,
IE_online,
IE_offline,
IE_incoming,
IE_outgoing,
IE_msg
);
TRefKind = (
REF_null,
REF_wp,
REF_query,
REF_simplequery,
REF_savemyinfo,
REF_file,
REF_status,
REF_msg,
REF_contacts,
REF_auth,
REF_sms,
REF_login
);
TLIST_TYPES = (LT_ROSTER, LT_SPAM);
const
SC_LAST = SC_DEPRESSION;
StatusPriority: array [TICQStatus] of Byte = (0, 8, 9, 1, 2, 3, 4, 5, 6, 7);
type
TOldVisibility = (OVI_normal, OVI_invisible, OVI_privacy, OVI_all, OVI_CL);
TVisibility = (VI_normal, VI_invisible);
const
SupportedPresenceFields: array [1 .. 39] of String = ('aimId', 'displayId', 'friendly', 'moodIcon', 'moodTitle',
'offlineMsg', 'state', 'statusMsg', 'userType', 'phoneNumber', 'cellNumber', 'smsNumber', 'workNumber', 'otherNumber',
'capabilities', 'ssl', 'abPhoneNumber', 'lastName', 'abPhones', 'abContactName', 'lastseen', 'mute', 'livechat', 'official',
'public', 'autoAddition', 'readonly', 'profile', 'statusTime', 'onlineTime', 'awayTime', 'awayMsg', 'profileMsg',
'presenceIcon', 'location', 'memberSince', 'iconId', 'nick', 'bot');
// buddyIcon,bigBuddyIcon,bigIconId,largeIconId
Visibility2ShowStr: array [Tvisibility] of String = ('Normal (all but server ignore list)', 'Invisible');
Visibility2ImgName: array [Tvisibility] of TPicName = (PIC_VISIBILITY_NORMAL, PIC_VISIBILITY_NONE);
Visib2Str: array [Tvisibility] of TPicName = ('normal', 'invisible');
Status2ShowStr: array [TICQStatus] of String =
('Online', 'Offline', 'Unknown', 'Occupied', 'Don''t disturb', 'N/A', 'Away', 'Free for chat', 'Evil', 'Depression');
Status2Img: array [0 .. Byte(SC_DEPRESSION)] of TPicName =
('online', 'offline', 'unk', 'occupied', 'dnd', 'na', 'away', 'f4c', 'evil', 'depression');
Status2Srv: array [0 .. Byte(SC_DEPRESSION)] of TPicName =
('online', 'offline', 'offline', 'occupied', 'occupied', 'occupied', 'away', 'online', 'online', 'online');
const
MaxRefs = 65535;
MaxPwdLength = 16;
API_VERSION = 'v92';
API_VERSION_FALLBACK = 'v17'; // v15+ is missing 'state' in presence event; v18+ is missing presence/get request
AIM_MD5_STRING: AnsiString = 'AOL Instant Messenger (SM)';
ICQ_DEV_ID: AnsiString = 'ic1nmMjqg7Yu-0hL'; // ic1nmMjqg7Yu-0hL - ICQ Windows, ic1rtwz1s1Hj1O0r - Web
ICQ_FAKE_VERSION_MAJOR = '23';
ICQ_FAKE_VERSION_MINOR = '2';
ICQ_FAKE_VERSION_POINT = '0';
ICQ_FAKE_VERSION = ICQ_FAKE_VERSION_MAJOR + '.' + ICQ_FAKE_VERSION_MINOR + '.' + ICQ_FAKE_VERSION_POINT;
ICQ_FAKE_BUILD = '48119';
API_HOST_BASE = 'https://u.icq.net/api/';
API_HOST = API_HOST_BASE + API_VERSION;
SMS_REG: AnsiString = API_HOST + '/smsreg/';
WIM_HOST: AnsiString = API_HOST + '/wim/';
WIM_HOST_FALLBACK: AnsiString = API_HOST_BASE + API_VERSION_FALLBACK + '/wim/';
RAPI_HOST: AnsiString = API_HOST + '/rapi/';
STORE_HOST: AnsiString = API_HOST + '/store/';
STORE_HOST_FALLBACK: AnsiString = API_HOST_BASE + API_VERSION_FALLBACK + '/store/';
FILES_HOST: AnsiString = API_HOST + '/files/';
BIN_FILES_HOST: AnsiString = 'https://ub.icq.net/api/' + API_VERSION + '/files/';
BIN_PREVIEW_HOST: AnsiString = 'https://ub.icq.net/files/preview/max/';
LOTTIE_PREVIEW_HOST: AnsiString = 'https://cicq.org/lottie_preview/';
LOTTIE_ORIGINAL_HOST: AnsiString = 'https://cicq.org/lottie_original/';
GET_FILES_HOST: AnsiString = 'https://files.icq.net/get/';
//STICKERS_HOST: AnsiString = 'https://c.icq.com/store/stickers/';
ICQErrorReconnectDelay = 5000; // Default attempt delay after error
BALLOON_NEVER = 0;
BALLOON_ALWAYS = 1;
BALLOON_BDAY = 2;
BALLOON_DATE = 3;
// By Rapid D
IF_Simple = 1 shl 5; // msg is simple
// IF_MSG_OK = 1 shl 8; // msg was delivered!
// IF_MSG_ERROR= 1 shl 9; // msg was NOT delivered!
IF_no_matter = 1 shl 10;
last_IF = 1 shl 10; // useful for external additional flags
dword_Zero = AnsiString(#00#00#00#00);
BigCapability: array [1 .. 35] of record
v: String[16];
s: AnsiString;
end = (
(v: #$97#$B1#$27#$51#$24#$3C#$43#$34#$AD#$22#$D6#$AB#$F7#$3F#$14#$92; s: 'RTF messages'), // RTF
(v: #$2E#$7A#$64#$75#$FA#$DF#$4D#$C8#$88#$6F#$EA#$35#$95#$FD#$B6#$DF; s: 'ICQ 2001'),
// AIM_CAPS_2001 or OLD_UTF
(v: #$56#$3F#$C8#$09#$0B#$6F#$41#$BD#$9F#$79#$42#$26#$09#$DF#$A2#$F3; s: 'Typing notifications'),
// mini typing notification (MTN) (for 2003b, ..., lite4)
(v: #$97#$B1#$27#$51#$24#$3C#$43#$34#$AD#$22#$D6#$AB#$F7#$3F#$14#$09; s: 'Secure IM Trillian'),
// Is Trillian
(v: #$74#$8F#$24#$20#$62#$87#$11#$D1#$82#$22#$44#$45#$53#$54#$00#$00; s: 'Chat'),
// Can participate in centralized text conferences
(v: #$1A#$09#$3C#$6C#$D7#$FD#$4E#$C5#$9D#$51#$A6#$47#$4E#$34#$F5#$A0; s: 'Xtraz'),
(v: #$D3#$D4#$53#$19#$8B#$32#$40#$3B#$AC#$C7#$D1#$A9#$E2#$B5#$81#$3E; s: 'QIP-ProtectMsg'),
// (V: #$17#$8C#$2D#$9B#$DA#$A5#$45#$BB#$8D#$DB#$F3#$BD#$BD#$53#$A1#$0A; s: 'Lite-AIM Cap1'),
(v: #$17#$8C#$2D#$9B#$DA#$A5#$45#$BB#$8D#$DB#$F3#$BD#$BD#$53#$A1#$0A; s: 'IM is ICQLite'),
// );
// ExtCapability:array [1..6] of record v : string[16]; s : String end=(
(v: #$F2#$E7#$C7#$F4#$FE#$AD#$4D#$FB#$B2#$35#$36#$79#$8B#$DF#$00#$00; s: 'Trillian'), // Trillian
(v: #$09#$49#$13#$44#$4C#$7F#$11#$D1#$82#$22#$44#$45#$53#$54#$00#$00; s: 'kxICQ2'), // Is kxICQ2
(v: #$DD#$16#$F2#$02#$84#$E6#$11#$D4#$90#$DB#$00#$10#$4B#$9B#$4B#$7D; s: 'MacICQ'), // MacICQ
(v: #$09#$49#$13#$49#$4C#$7F#$11#$D1#$82#$22#$44#$45#$53#$54#$00#$00; s: 'LICQ'), // LICQ
(v: #$56#$3F#$C8#$09#$0B#$6F#$41#$51#$49#$50#$20#$32#$30#$30#$35#$61; s: 'QIP 2005'), // QIP 2005
(v: #$74#$ED#$C3#$36#$44#$DF#$48#$5B#$8B#$1C#$67#$1A#$1F#$86#$09#$9F; s: 'IM2'),
(v: #$E3#$62#$C1#$E9#$12#$1A#$4B#$94#$A6#$26#$7A#$74#$DE#$24#$27#$0D; s: 'Push2Talk'),
(v: #$B9#$97#$08#$B5#$3A#$92#$42#$02#$B0#$69#$F1#$E7#$57#$BB#$2E#$17; s: 'ICQ Voice Chat'),
(v: #$67#$36#$15#$15#$61#$2D#$4C#$07#$8F#$3D#$BD#$E6#$40#$8E#$A0#$41; s: 'Xtraz MultiUser Chat'),
(v: #$7E#$11#$B7#$78#$A3#$53#$49#$26#$A8#$02#$44#$73#$52#$08#$C4#$2A; s: 'Lsp-RU-Rambler'),
(v: #$B6#$07#$43#$78#$F5#$0C#$4A#$C7#$90#$92#$59#$38#$50#$2D#$05#$91; s: 'ICQ-XVideo'),
(v: #$01#$00#$11#$00#$00#$00#$00#$00#$11#$00#$00#$00#$00#$2a#$02#$b5; s: 'AIM'),
(v: #$B2#$EC#$8F#$16#$7C#$6F#$45#$1B#$BD#$79#$DC#$58#$49#$78#$88#$B9; s: 'tZers'), // 21
(v: #$01#$38#$CA#$7B#$76#$9A#$49#$15#$88#$F2#$13#$FC#$00#$97#$9E#$A8; s: 'ICQ6'),
(v: #$D6#$68#$7F#$4F#$3D#$C3#$4b#$db#$8A#$8C#$4C#$1A#$57#$27#$63#$CD; s: 'R&Q-ProtectMsg'), // 23
(v: #$7C#$73#$75#$02#$C3#$BE#$4F#$3E#$A6#$9F#$01#$53#$13#$43#$1E#$1A; s: 'QIP Infium'),
(v: #$56#$6D#$49#$43#$51#$20#$76#$30#$2E#$31#$2E#$34#$62#$00#$00#$00; s: 'vmICQ'),
(v: #$7C#$53#$3F#$FA#$68#$00#$4F#$21#$BC#$FB#$C7#$D2#$43#$9A#$AD#$31; s: 'QIP Plugins'),
(v: #$56#$3F#$C8#$09#$0B#$6F#$41#$51#$49#$50#$20#$20#$20#$20#$20#$21; s: 'QIP PDA WM'),
(v: #$51#$AD#$D1#$90#$72#$04#$47#$3D#$A1#$A1#$49#$F4#$A3#$97#$A4#$1F; s: 'QIP PDA Symbian'),
(v: #$7A#$7B#$7C#$7D#$7E#$7F#$0A#$03#$0B#$04#$01#$53#$13#$43#$1E#$1A; s: 'QIP 2010'),
(v: #$35#$CA#$0A#$C9#$E4#$67#$48#$AB#$9D#$FA#$1D#$23#$41#$F0#$08#$32; s: 'tZers [Mults]'),
(v: #$4D#$6F#$64#$20#$62#$79#$20#$4D#$69#$6B#$61#$6E#$6F#$73#$68#$69; s: 'R&Q build by Mikanoshi'),
(v: #$F2#$3D#$D3#$84#$7B#$52#$40#$EC#$B5#$CE#$10#$64#$59#$A4#$C9#$7D; s: 'Buzz support'),
(v: #$09#$46#$13#$50#$3c#$7f#$11#$d1#$82#$22#$44#$45#$53#$54#$00#$00; s: 'Group calls'),
(v: #$1f#$99#$49#$4e#$76#$cb#$c8#$80#$21#$5d#$6a#$ea#$b8#$e4#$22#$68; s: 'Group subscription'),
(v: #$a2#$0c#$36#$2c#$d4#$94#$4b#$6e#$a3#$d1#$e7#$76#$42#$20#$1f#$d8; s: 'Reactions')
// (V: #$B7#$07#$43#$78#$F5#$0C#$77#$77#$97#$77#$57#$78#$50#$2D#$05#$70; s: 'Status [Sad]'),
// (V: #$B7#$07#$43#$78#$F5#$0C#$77#$77#$97#$77#$57#$78#$50#$2D#$05#$75; s: 'Status [Free for chat]'),
// (V: #$B7#$07#$43#$78#$F5#$0C#$77#$77#$97#$77#$57#$78#$50#$2D#$05#$76; s: 'Status [At home]'),
// (V: #$B7#$07#$43#$78#$F5#$0C#$77#$77#$97#$77#$57#$78#$50#$2D#$05#$77; s: 'Status [At work]'),
// (V: #$B7#$07#$43#$78#$F5#$0C#$77#$77#$97#$77#$57#$78#$50#$2D#$05#$78; s: 'Status [At Lunch]'),
// (V: #$B7#$07#$43#$78#$F5#$0C#$77#$77#$97#$77#$57#$78#$50#$2D#$05#$79; s: 'Status [Angry]')
// 8C543DFC69024D25BFFAC0D3419CAF30 -- ????
);
CapsMakeBig1 = AnsiString(#$09#$46);
CapsMakeBig2 = AnsiString(#$4C#$7F#$11#$D1#$82#$22#$44#$45#$53#$54#$00#$00);
CapsCustomBuild = AnsiString(#$4D#$69#$6B#$61#$6E#$6F#$73#$68#$69);
CapsInvalidPublicKey = AnsiString(#$49#$6e#$76#$61#$6c#$69#$64#$50#$75#$62#$6c#$69#$63#$4b#$65#$79);
CapsSmall: array [1 .. 40] of record
v: RawByteString;
s: AnsiString;
Desc: AnsiString;
end =
((v: #$01#$00; s: 'Video'; Desc: ''), // = Video
(v: #$01#$01; s: 'SIP/RTP video'; Desc: 'Can do live video streaming, using SIP/RTP'),
// 2 = RtpVideo
(v: #$01#$02; s: 'Has camera'; Desc: 'Has a video camera connected'), // = HasCamera
(v: #$01#$03; s: 'Has microphone'; Desc: 'Has a microphone connected (may not be set for non-USB mics)'), // 4 = HasMicrophone
(v: #$01#$04; s: 'RTP audio'; Desc: 'Can do live audio streaming, using SIP/RTP'), // = RtpAudio
(v: #$01#$05; s: 'Available for call'; Desc: 'Can receive an a/v call at this time'),
// 6 = AvailableForCall
(v: #$01#$06; s: 'Aca'), // = Aca
(v: #$01#$07; s: 'Audio conferences'; Desc: 'Can participate in centralized audio conferences'),
// 8 = MultiAudio
(v: #$01#$08; s: 'Video conferences'; Desc: 'Can participate in centralized video conferences'),
// = MultiVideo
(v: #$01#$FF; s: 'Smart caps'; Desc: 'Whether caps reflect opt-in features vs. features the software supports'),
// 10 = SmartCaps
(v: #$F0#$04; s: 'Viceroy'), // = Viceroy
(v: #$13#$49; s: 'ICQ Server Relay'), // 12 AIM_CAPS_ICQSERVERRELAY
(v: #$13#$44; s: 'IM is ICQ'), // AIM_CAPS_ICQ
(v: #$13#$4E; s: 'UTF-8 Messages'), // 14 UTF-8
(v: #$13#$4C; s: 'Avatar support'), // CAP_AVATAR
// (V: #$13#$4c; s: 'Lite-AIM Cap1'), // CAP_AVATAR
(v: #$13#$45; s: 'Direct IM'; Desc: 'Can participate in direct IM sessions'), // 16
(v: #$13#$46; s: 'Buddy icon'; Desc: 'Can receive non-BART buddy icons'),
(v: #$13#$48; s: 'File sharing'; Desc: 'Offering files for download'), // 18 CAP_FILE_SHARING
(v: #$14#$49; s: 'ICQ 2001a'), // CAP_ICQ_SERVER_RELAY
(v: #$13#$43; s: 'File transfer'; Desc: 'Can receive files'), // 20 CAP_FILE_TRANSFER
(v: #$13#$41; s: 'Old audio'; Desc: 'Can do live audio streaming, using JGTK'), // CAP_AOL_TALK
(v: #$13#$42; s: 'Direct Play'), // 22 CAP_DIRECT_PLAY
(v: #$13#$4B; s: 'Share buddies'; Desc: 'Can receive sent buddy lists'), // CAP_SHARE_BUDDIES
// (V: #$13#$42; s: 'Preakness') //24 CAP_PREAKNESS
(v: #$13#$4D; s: 'Talk with ICQ'), // 24
(v: #$00#$00; s: 'Short caps'), // 25
(v: #$00#$01; s: 'Secure IM'; Desc: 'Can receive "application/pkcs7-mime" encoded IMs'), // 26
(v: #$00#$02; s: 'XHTML IM'; Desc: 'Can receive "application/xhtml+xml" encoded IMs'), // 27
(v: #$01#$0A; s: 'New status message features'), // 28 = HOST_STATUS_TEXT_AWARE
(v: #$01#$0B; s: '"See as I type" IMs'), // 29 RTIM
(v: #$13#$50; s: 'VoIP Audio'; Desc: 'Supports voice over VoIP'), // 30
(v: #$13#$51; s: 'VoIP Video'; Desc: 'Supports video over VoIP'), // 31
(v: #$13#$53; s: 'Unique request ID'), // 32
(v: #$13#$54; s: 'Emoji support'), // 33
(v: #$13#$56; s: 'VoIP Ringing'), // 34
(v: #$13#$59; s: 'Mail notifications'), // 35
(v: #$13#$5A; s: 'Dialog messages position support'; desc: 'Receive intro/tail messages'), // 36
(v: #$13#$5B; s: 'Mentions support'), // 37
(v: #$13#$5C; s: 'Chat heads support'), // 38
(v: #$13#$5D; s: 'Recent calls'), // 39
(v: #$13#$5E; s: 'Gallery notify support') // 40
);
// #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00 // Anti-invischeck
// MsgCapabilities: array [1 .. 1] of RawByteString = (#$3B#$60#$B3#$EF#$D8#$2A#$6C#$45#$A4#$E0#$9C#$5A#$5E#$67#$E8#$65
// XStatus
// #$09#$46#$13#$43#$4C#$7F#$11#$D1#$82#$22#$44#$45#$53#$54#$00#$00 // file transfer (Send)
// D9122DF0-9130-11D3-8DD7-00104B06462E //File transfer plugin.
// #$09#$46#$13#$48#$4C#$7F#$11#$D1#$82#$22#$44#$45#$53#$54#$00#$00 // file transfer (Recieve)
// #$09#$46#$13#$49#$4C#$7F#$11#$D1#$82#$22#$44#$45#$53#$54#$00#$00, // Plugin MSG
// #$f0#$2d#$12#$d9#$30#$91#$d3#$11#$8d#$d7#$00#$10#$4b#$06#$46#$2e,
// );
CAPS_CustomStatuses = '2381B328-7AA4-4979-A9A2-573EA646B5DE';
// msgUTF : TGUID = '{0946134E-4C7F-11D1-8222-444553540000}';
// msgUTFstr = '{0946134E-4C7F-11D1-8222-444553540000}';
// msgRTF: TGUID = '{97B12751-243C-4334-AD22-D6ABF73F1492}';
// msgRnQpass: TGUID = '{e92a62a2-e32a-49dc-acc6-22066bd4f316}';
// msgQIPpass : TGUID = '{d3d45319-8b32-403b-acc7-d1a9e2b5813e}';
// msgQIPpassStr = AnsiString('{D3D45319-8B32-403B-ACC7-D1A9E2B5813E}');
CAPS_sm_SmartCaps = 10;
CAPS_sm_ICQServerRelay = 12;
CAPS_sm_ICQ = 13;
CAPS_sm_UTF8 = 14;
CAPS_sm_Avatar = 15;
CAPS_sm_BuddyIcon = 17;
CAPS_sm_File = 18;
CAPS_sm_FileTransfer = 20;
CAPS_sm_ShareBuddies = 23;
CAPS_sm_AIM = 24;
CAPS_sm_ShortCaps = 25;
CAPS_sm_SecIM = 26;
CAPS_sm_NewStat = 28;
CAPS_sm_VOIPAudio = 30;
CAPS_sm_VOIPVideo = 31;
CAPS_sm_UniqueID = 32;
CAPS_sm_Emoji = 33;
CAPS_sm_VOIPRing = 34;
CAPS_sm_MailNotify = 35;
CAPS_sm_IntroDlgStates = 36;
CAPS_sm_Mentions = 37;
CAPS_sm_ChatHeads = 38;
CAPS_sm_RecentCalls = 39;
CAPS_sm_GalleryNotify = 40;
CAPS_big_RTF = 1;
CAPS_big_2001 = 2;
CAPS_big_MTN = 3;
CAPS_big_SecIM = 4;
CAPS_big_Chat = 5;
CAPS_big_Xtraz = 6;
CAPS_big_QIP_Secure = 7;
CAPS_big_Lite = 8;
CAPS_big_Tril = 9;
CAPS_big_macICQ = 11;
CAPS_big_LICQ = 12;
CAPS_big_QIP = 13;
CAPS_big_MultiUserChat = 17;
CAPS_big_RMBLR = 18;
CAPS_BIG_Xtraz5 = 20;
CAPS_big_tZers = 21;
CAPS_big_ICQ6 = 22;
CAPS_big_CryptMsg = 23;
CAPS_big_qipInf = 24;
CAPS_big_qipWM = 27;
CAPS_big_qipSym = 28;
CAPS_big_qip2010 = 29;
CAPS_big_tZers_Mults = 30;
CAPS_big_Build = 31;
CAPS_big_Buzz = 32;
CAPS_big_GroupCalls = 33;
CAPS_big_GroupSubs = 34;
CAPS_big_Reactions = 35;
CAPS_Ext_CLI_Last = 14;
CAPS_Ext_CLI_First = 9;
// Message types
MTYPE_PLAIN = $01; // Plain text (simple) message
MTYPE_CHAT = $02; // Chat request message
MTYPE_FILEREQ = $03; // File request / file ok message
MTYPE_URL = $04; // URL message (0xFE formatted)
MTYPE_AUTHREQ = $06; // Authorization request message (0xFE formatted)
MTYPE_AUTHDENY = $07; // Authorization denied message (0xFE formatted)
MTYPE_AUTHOK = $08; // Authorization given message (empty)
MTYPE_SERVER = $09; // Message from OSCAR server (0xFE formatted)
MTYPE_ADDED = $0C; // "You-were-added" message (0xFE formatted)
MTYPE_WWP = $0D; // Web pager message (0xFE formatted)
MTYPE_EEXPRESS = $0E; // Email express message (0xFE formatted)
MTYPE_CONTACTS = $13; // Contact list message
MTYPE_PLUGIN = $1A; // Plugin message described by text string
MTYPE_AUTOAWAY = $E8; // Auto away message
MTYPE_AUTOBUSY = $E9; // Auto occupied message
MTYPE_AUTONA = $EA; // Auto not available message
MTYPE_AUTOFFC = $EC; // Auto free for chat message
MTYPE_XSTATUS = $61;
MTYPE_GCARD = $62;
MTYPE_UNKNOWN = $00; // Unknown message, only used internally by this plugin
// MTYPE_AUTOMSGS = [MTYPE_AUTOAWAY, MTYPE_AUTOBUSY, MTYPE_AUTONA, MTYPE_AUTOFFC];
PLUGIN_SCRIPT = AnsiString('Script Plug-in: Remote Notification Arrive');
MTN_FINISHED = $0000; // typing finished sign
MTN_TYPED = $0001; // text typed sign
MTN_BEGUN = $0002; // typing begun sign
MTN_CLOSED = $000F; // Closed chat
type
TICQError = (EC_rateExceeded, EC_cantConnect, EC_socket, EC_other, EC_badUIN,
// at login-time, referred to my own uin
EC_missingLogin, EC_anotherLogin, EC_serverDisconnected, EC_badPwd, EC_cantChangePwd,
EC_loginDelay, EC_cantCreateUIN, EC_invalidFlap, EC_badContact, EC_cantConnect_dc,
EC_proxy_error, EC_proxy_badPwd, EC_proxy_unk, // unknown reply
EC_MalformedMsg, EC_AddContact_Error, EC_Login_Seq_Failed, EC_FailedDecrypt, EC_FailedDecryptNotif, EC_StoreProblem);
TICQAuthError = (
EAC_Not_Enough_Data = -1,
EAC_Unknown = 0,
EAC_OK = 200,
EAC_Wrong_Login = 330,
EAC_Invalid_Request = 400,
EAC_Auth_Required = 401,
EAC_Req_Timeout = 408,
EAC_Send_Rate_Limit = 430,
EAC_Wrong_DevKey = 440,
EAC_Session_Not_Found = 451,
EAC_Missing_Req_Param = 460,
EAC_Param_Error = 462,
EAC_SMS_Rate_Limit = 465,
EAC_Server_Error = 500,
EAC_Invalid_Target = 600,
EAC_Target_Doesnt_Exist = 601,
EAC_Target_Not_Available = 602,
EAC_CAPTCA = 603,
EAC_Message_Too_Big = 604,
EAC_Rate_Limit = 607
);
TICQRAPIError = (
ERAPI_Unknown = 0,
ERAPI_OK = 20000,
ERAPI_Token_Expired = 40201,
ERAPI_Rate_Limit = 40500
);
const
ICQError2Str: array [TICQError] of String =
('Server says you''re reconnecting too often, try later or change user.', // 'rate exceeded',
'Cannot connect\n[%d] %s', // 'can''t connect',
'Disconnected\n[%d] %s', // 'disconnected',
'Unknown error', // 'unknown',
'Your uin is not correct', // 'incorrect uin',
'Missing password', // 'missing pwd',
'Your current UIN is used by someone else right now, server disconnected you',
// 'another login',
'Server disconnected', // 'server disconnected',
'Wrong password, correct it and try again', // 'wrong pwd',
'Cannot change password', // 'can''t change pwd',
'Server is sick, wait 2 seconds and try again', // 'delay',
'Can''t create UIN', // 'can''t create uin',
'FLAP level error', // 'invalid flap',
'Queried contact is invalid', // 'bad contact',
'can''t directly connect\n[%d] %s', 'proxy: error', 'PROXY: Invalid user/password',
// 'proxy: wrong user/pwd',
'PROXY: Unknown reply\n[%d] %s', // 'proxy: unk'
'Couldn''t parse incoming event\nRaw input:\n%s',
'Failed to add contact\n%s',
'Login sequence cannot be completed due to error on one of the stages\n%s',
'Could''t decrypt message\n%s',
'Contact could''t decrypt your message, update contact info to fetch current public key and try again',
'Failed to process store purchase\n%s');
(*
ICQAuthErrors: array [330, 408] of String = (
'Invalid nick or password', 'Service temporarily unavailable', 'All other errors',
'Wrong password, correct it and try again', // 'AUTH_ERR_INCORR_NICK_OR_PASSWORD',
'Mismatch nick or password, re-enter', 'Internal client error (bad input to authorizer)',
'Invalid account', 'Deleted account', 'Expired account', 'No access to database', // $0A
'No access to resolver', 'Invalid database fields', // $0C
'Bad database status', 'Bad resolver status', 'Internal error', 'Service temporarily offline',
// $10
'Suspended account', 'DB send error', 'DB link error', 'Reservation map error',
'Reservation link error', // $15
'Too many clients from the same ip address',
'Too many clients from the same ip address (reservation)',
'Server says you''re reconnecting too often, try later or change user.',
// 'AUTH_ERR_RESERVATION_RATE', // $18
'User too heavily warned', 'Reservation timeout', // $1A
'You are using an older version of ICQ. Upgrade required', // $1B
'You are using an older version of ICQ. Upgrade recommended',
'Rate limit exceeded. Please try to reconnect in a few minutes', // $1D
'Can ''t register on the ICQ network. Reconnect in a few minutes', // $1E
'AUTH_ERR_SECURID_TIMEOUT', // upd, 2006: AUTH_ERR_TOKEN_SERVER_TIMEOUT
'Invalid SecurID', // upd, 2006: AUTH_ERR_INVALID_TOKEN_KEY
'AUTH_ERR_MC_ERROR', 'AUTH_ERR_CREDIT_CARD_VALIDATION', // upd 2006 // ...
'AUTH_ERR_REQUIRE_REVALIDATION', // upd 2006
'AUTH_ERR_LINK_RULE_REJECT', // upd 2006
'AUTH_ERR_MISS_INFO_OR_INVALID_SNAC', // upd 2006
'AUTH_ERR_LINK_BROKEN', // upd 2006
'AUTH_ERR_INVALID_CLIENT_IP', // upd 2006
'AUTH_ERR_PARTNER_REJECT', // upd 2006
'AUTH_ERR_SECUREID_MISSING', // upd 2006
'AUTH_ERR_BUMP_USER',
'Failed to get all the data required for starting a new session'); // upd 2019
*)
type
XStatusFlags = (xsf_Old, xsf_6);
XStatusFlagsSet = set of XStatusFlags;
const
XStatusArray: array [0..103] of record
Status, Text: String;
Unofficial: Boolean;
end = (
(Status: ''; Text: 'None'),
(Status: '😊'; Text: 'Glad'),
(Status: '🤪'; Text: 'Silly'; Unofficial: True),
(Status: '😞'; Text: 'Tired'),
(Status: '😐'; Text: 'HA HA HA, No'),
(Status: '🙄'; Text: 'For how long?'),
(Status: '😴'; Text: 'Sleeping'),
(Status: '🤔'; Text: 'Thinking'),
(Status: '😩'; Text: 'Depressed'; Unofficial: True),
(Status: '😢'; Text: 'Feeling down'; Unofficial: True),
(Status: '😱'; Text: 'Scared'),
(Status: '😎'; Text: 'Live as I want'),
(Status: '🤑'; Text: 'Waiting for a salary'),
(Status: '😡'; Text: 'Angry, outraged'),
(Status: '😈'; Text: 'Malevolent'; Unofficial: True),
(Status: '👶'; Text: 'Babysitting'),
(Status: '🍼'; Text: 'Feeding the baby'),
(Status: '💼'; Text: 'At the meeting'),
(Status: '🌭'; Text: 'Eating'),
(Status: '🍔'; Text: 'Eating'; Unofficial: True),
(Status: '🥗'; Text: 'Eating'; Unofficial: True),
(Status: '🎸'; Text: 'At rehearsal' ),
(Status: '🎹'; Text: 'Playing on nerves'),
(Status: '🎧'; Text: 'Listening to music'),
(Status: '🤘'; Text: 'At the concert'),
(Status: '💪'; Text: 'Working out'),
(Status: '🛴'; Text: 'Skating'),
(Status: '🚲'; Text: 'Riding bike'),
(Status: '🐶'; Text: 'Walking with dog'),
(Status: '🐈'; Text: 'Pet cat'),
(Status: '🎂'; Text: 'Birthday'),
(Status: '🍕'; Text: 'Party'),
(Status: '🎉'; Text: 'Holiday'),
(Status: '🎨'; Text: 'Drawing'),
(Status: '👾'; Text: 'Hack internet'),
(Status: '✂️'; Text: 'Getting a haircut'),
(Status: '🚽'; Text: 'WC'),
(Status: '🧻'; Text: 'WC'; Unofficial: True),
(Status: '📺'; Text: 'Watching TV'),
(Status: '🐥'; Text: 'In the bathroom'),
(Status: '🚿'; Text: 'Taking a shower'),
(Status: '🌎'; Text: 'In the Internet'),
(Status: '🍿'; Text: 'At the cinema'),
(Status: '🔍'; Text: 'In active search'),
(Status: '📲'; Text: 'Waiting for you call'),
(Status: '💚'; Text: 'I love ICQ'),
(Status: '❤️'; Text: 'In love'),
(Status: '💔'; Text: 'Broken heart'),
(Status: '👰'; Text: 'Bride'),
(Status: '🤵'; Text: 'Groom'),
(Status: '⛅'; Text: 'Soaring in the clouds'),
(Status: '🥇'; Text: 'Life winner'),
(Status: '🌜'; Text: 'Insomnia'),
(Status: '🏝'; Text: 'Want to be alone'),
(Status: '🐼'; Text: 'Being lazy'),
(Status: '🙅‍♀️'; Text: 'Socially distancing myself'),
(Status: '💆‍♂️'; Text: 'Keep calm'),
(Status: '🍀'; Text: 'Lucky'),
(Status: '🔋'; Text: 'Full of strength'),
(Status: '🌀'; Text: 'Changing reality'),
(Status: '👻'; Text: 'Booo'),
(Status: '⛄'; Text: 'Freezing at home'),
(Status: '💬'; Text: 'Ready to chat'),
(Status: '⛔'; Text: 'Busy'),
(Status: '🏆'; Text: 'Became successful'),
(Status: '🤝'; Text: 'With friends'),
(Status: '👊'; Text: 'Fist'; Unofficial: True),
(Status: '🖕'; Text: 'Fuck you'; Unofficial: True),
(Status: '💩'; Text: 'Pile of poo'),
(Status: '🌡️'; Text: 'Fallen sick'),
(Status: '🌈'; Text: 'Rainbow'),
(Status: '✍️'; Text: 'Writing a graduate work'),
(Status: '🤹‍♂️'; Text: 'Effective manager'),
(Status: '🕳'; Text: 'Mastering the budget'),
(Status: '📚'; Text: 'Exam...'),
(Status: '🐌'; Text: 'Late for a meeting'),
(Status: '🕵️‍♀️'; Text: 'Researching the market'),
(Status: '📟'; Text: 'Compiling'),
(Status: '🔧'; Text: 'Writing crutches'),
(Status: '🐞'; Text: 'Searching for bugs'),
(Status: '💅'; Text: 'Call me for nails'),
(Status: '🎓'; Text: 'Studying'),
(Status: '📖'; Text: 'Reading'),
(Status: '📸'; Text: 'Taking pictures'),
(Status: '⏳'; Text: 'Waiting'),
(Status: '🥒'; Text: 'Healthy food'),
(Status: '🐽'; Text: 'Night food'),
(Status: '☕'; Text: 'Drinking coffee or tea'),
(Status: '🍺'; Text: 'Drinking beer'),
(Status: '🚘'; Text: 'Driving'),
(Status: '🏡'; Text: 'Going to the countryside'),
(Status: '🌊'; Text: 'Want to go to the sea'),
(Status: '🔩'; Text: 'Tighten the nuts'),
(Status: '🎲'; Text: 'Playing board games'),
(Status: '🎮'; Text: 'Playing'),
(Status: '👟'; Text: 'Waiting for new clothes'),
(Status: '🛒'; Text: 'Shopping'),
(Status: '🐙'; Text: 'Cthulhu fhtagn'),
(Status: '💵'; Text: 'Donate me'),
(Status: '🏗️'; Text: 'Build more ziggurats'),
(Status: '👨‍💻'; Text: 'Working'),
(Status: '👩‍🚒'; Text: 'Girl Power'),
(Status: '👨‍🎨'; Text: 'Finishing the design'),
(Status: '👨‍🚀'; Text: 'We are flying to Mars')
);
ReactionOptions: array [0..5] of String = ('👍', '❤️', '🤣', '😳', '😢', '😡');
icq_missed_msgs:
array [0 .. 4] of string = ('Message was invalid', 'Message was too large', 'Message rate exceeded',
'Sender too evil (sender warn level > your max_msgs_evil)',
'You are too evil (sender max_msg_revil < your warn level)');
function CAPS_sm2big(i: byte): RawByteString; inline;
var
// ExtStsStrings : array[low(aXStatus)..High(aXStatus),0..1] of string;
// ExtStsStrings : array[low(XStatus6)..High(XStatus6)] of string;
// ExtStsStrings : array[low(XStatusArray)..High(XStatusArray)] of string;
ExtStsStrings: array [Low(XStatusArray) .. High(XStatusArray)] of TXStatStr;
StatusesArray: TStatusArray;
type
TFileAbout = class(TObject)
fPath: String;
fName: String;
Size: Int64;
Processed: Int64;
CheckSum: Cardinal;
end;
function AllFieldsAsQuery(Enabled: Boolean = True): String;
function AllFieldsAsParam: String;
implementation
uses
System.SysUtils, System.StrUtils;
function CAPS_sm2big(i: byte): RawByteString; inline;
begin
result := CapsMakeBig1 + CapsSmall[i].v + CapsMakeBig2;
end;
function AllFieldsAsQuery(Enabled: Boolean = True): String;
var
Val: String;
begin
Val := IfThen(Enabled, '1', '0');
Result := '&' + String.Join('=' + Val + '&', SupportedPresenceFields) + '=' + Val;
end;
function AllFieldsAsParam: String;
begin
Result := String.Join(',', SupportedPresenceFields)
end;
end.