summaryrefslogtreecommitdiff
path: root/protocols/MRA
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-05-15 10:38:20 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-05-15 10:38:20 +0000
commit48540940b6c28bb4378abfeb500ec45a625b37b6 (patch)
tree2ef294c0763e802f91d868bdef4229b6868527de /protocols/MRA
parent5c350913f011e119127baeb32a6aedeb4f0d33bc (diff)
initial commit
git-svn-id: http://svn.miranda-ng.org/main/trunk@2 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MRA')
-rw-r--r--protocols/MRA/Docs/Mail_ru Агент.files/0.gifbin0 -> 103 bytes
-rw-r--r--protocols/MRA/Docs/Mail_ru Агент.files/1.gifbin0 -> 35 bytes
-rw-r--r--protocols/MRA/Docs/Mail_ru Агент.files/WindowOpen.js44
-rw-r--r--protocols/MRA/Docs/Mail_ru Агент.files/_mail.gifbin0 -> 929 bytes
-rw-r--r--protocols/MRA/Docs/Mail_ru Агент.files/agentlogo.gifbin0 -> 1866 bytes
-rw-r--r--protocols/MRA/Docs/Mail_ru Агент.files/cards-all.gifbin0 -> 240 bytes
-rw-r--r--protocols/MRA/Docs/Mail_ru Агент.files/cars-all.gifbin0 -> 249 bytes
-rw-r--r--protocols/MRA/Docs/Mail_ru Агент.files/chat-all.gifbin0 -> 1039 bytes
-rw-r--r--protocols/MRA/Docs/Mail_ru Агент.files/content-all.gifbin0 -> 599 bytes
-rw-r--r--protocols/MRA/Docs/Mail_ru Агент.files/go-all.gifbin0 -> 1019 bytes
-rw-r--r--protocols/MRA/Docs/Mail_ru Агент.files/index.css501
-rw-r--r--protocols/MRA/Docs/Mail_ru Агент.files/love-all.gifbin0 -> 558 bytes
-rw-r--r--protocols/MRA/Docs/Mail_ru Агент.files/molotok-all.gifbin0 -> 362 bytes
-rw-r--r--protocols/MRA/Docs/Mail_ru Агент.files/proto.css39
-rw-r--r--protocols/MRA/Docs/Mail_ru Агент.files/tour-all.gifbin0 -> 256 bytes
-rw-r--r--protocols/MRA/Docs/Mail_ru Агент.htm635
-rw-r--r--protocols/MRA/Docs/MraPlaces.h3174
-rw-r--r--protocols/MRA/Docs/docs.rarbin0 -> 32163 bytes
-rw-r--r--protocols/MRA/Docs/proto.htm103
-rw-r--r--protocols/MRA/Docs/region.txt3353
-rw-r--r--protocols/MRA/Docs/region_m.txt3150
-rw-r--r--protocols/MRA/Icons/Alarm.icobin0 -> 1406 bytes
-rw-r--r--protocols/MRA/Icons/AuthGrant.icobin0 -> 2550 bytes
-rw-r--r--protocols/MRA/Icons/AuthReguest.icobin0 -> 2550 bytes
-rw-r--r--protocols/MRA/Icons/Bagz.icobin0 -> 2550 bytes
-rw-r--r--protocols/MRA/Icons/BlogStatus.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/Icons/Blogs.icobin0 -> 2550 bytes
-rw-r--r--protocols/MRA/Icons/Chat.icobin0 -> 2550 bytes
-rw-r--r--protocols/MRA/Icons/Info.icobin0 -> 2550 bytes
-rw-r--r--protocols/MRA/Icons/Magent.icobin0 -> 2550 bytes
-rw-r--r--protocols/MRA/Icons/Mail.icobin0 -> 2550 bytes
-rw-r--r--protocols/MRA/Icons/MailNotify.icobin0 -> 2550 bytes
-rw-r--r--protocols/MRA/Icons/Phone.icobin0 -> 2550 bytes
-rw-r--r--protocols/MRA/Icons/Photo.icobin0 -> 2550 bytes
-rw-r--r--protocols/MRA/Icons/PostCards.icobin0 -> 2550 bytes
-rw-r--r--protocols/MRA/Icons/WebSearch.icobin0 -> 2550 bytes
-rw-r--r--protocols/MRA/Icons/answers.icobin0 -> 1406 bytes
-rw-r--r--protocols/MRA/Icons/my world.icobin0 -> 1406 bytes
-rw-r--r--protocols/MRA/Icons/video.icobin0 -> 1406 bytes
-rw-r--r--protocols/MRA/Mra.cpp912
-rw-r--r--protocols/MRA/Mra.h432
-rw-r--r--protocols/MRA/Mra.sln25
-rw-r--r--protocols/MRA/Mra.vcproj1209
-rw-r--r--protocols/MRA/Mra.vcxproj434
-rw-r--r--protocols/MRA/Mra.vcxproj.filters400
-rw-r--r--protocols/MRA/MraAdvancedSearch.cpp361
-rw-r--r--protocols/MRA/MraAntiSpam.cpp540
-rw-r--r--protocols/MRA/MraAntiSpam.h24
-rw-r--r--protocols/MRA/MraAvatars.cpp912
-rw-r--r--protocols/MRA/MraAvatars.h35
-rw-r--r--protocols/MRA/MraChat.cpp389
-rw-r--r--protocols/MRA/MraChat.h30
-rw-r--r--protocols/MRA/MraConstans.h667
-rw-r--r--protocols/MRA/MraFilesQueue.cpp1443
-rw-r--r--protocols/MRA/MraFilesQueue.h26
-rw-r--r--protocols/MRA/MraFilesQueue_mod.cpp1298
-rw-r--r--protocols/MRA/MraIcons.cpp151
-rw-r--r--protocols/MRA/MraIcons.h20
-rw-r--r--protocols/MRA/MraMPop.cpp241
-rw-r--r--protocols/MRA/MraMPop.h26
-rw-r--r--protocols/MRA/MraMRIMProxy.cpp239
-rw-r--r--protocols/MRA/MraMRIMProxy.h21
-rw-r--r--protocols/MRA/MraOfflineMsg.cpp432
-rw-r--r--protocols/MRA/MraOfflineMsg.h19
-rw-r--r--protocols/MRA/MraPlaces.h5959
-rw-r--r--protocols/MRA/MraPopUp.cpp308
-rw-r--r--protocols/MRA/MraPopUp.h34
-rw-r--r--protocols/MRA/MraRTFMsg.cpp341
-rw-r--r--protocols/MRA/MraRTFMsg.h19
-rw-r--r--protocols/MRA/MraSelectEMail.cpp187
-rw-r--r--protocols/MRA/MraSelectEMail.h25
-rw-r--r--protocols/MRA/MraSendCommand.cpp878
-rw-r--r--protocols/MRA/MraSendCommand.h36
-rw-r--r--protocols/MRA/MraSendQueue.cpp225
-rw-r--r--protocols/MRA/MraSendQueue.h23
-rw-r--r--protocols/MRA/Mra_functions.cpp2417
-rw-r--r--protocols/MRA/Mra_options.cpp239
-rw-r--r--protocols/MRA/Mra_proto.cpp2581
-rw-r--r--protocols/MRA/Mra_svcs.cpp2302
-rw-r--r--protocols/MRA/Readme_MRA.txt502
-rw-r--r--protocols/MRA/Sdk/Base64.h380
-rw-r--r--protocols/MRA/Sdk/BuffToLowerCase.h98
-rw-r--r--protocols/MRA/Sdk/DebugFunctions.h148
-rw-r--r--protocols/MRA/Sdk/FIFOMT.h133
-rw-r--r--protocols/MRA/Sdk/InterlockedFunctions.h156
-rw-r--r--protocols/MRA/Sdk/InternetTime.h473
-rw-r--r--protocols/MRA/Sdk/ListMT.h358
-rw-r--r--protocols/MRA/Sdk/MemoryCompare.h101
-rw-r--r--protocols/MRA/Sdk/MemoryFind.h80
-rw-r--r--protocols/MRA/Sdk/MemoryFindByte.h97
-rw-r--r--protocols/MRA/Sdk/MemoryReplace.h150
-rw-r--r--protocols/MRA/Sdk/RC4.h103
-rw-r--r--protocols/MRA/Sdk/SHA1.h596
-rw-r--r--protocols/MRA/Sdk/SocketFunctions.h485
-rw-r--r--protocols/MRA/Sdk/StrHexToNum.h634
-rw-r--r--protocols/MRA/Sdk/StrToNum.h447
-rw-r--r--protocols/MRA/Sdk/timefuncs.h131
-rw-r--r--protocols/MRA/Sdk/zconf.h428
-rw-r--r--protocols/MRA/Sdk/zlib.h1357
-rw-r--r--protocols/MRA/TODO.txt28
-rw-r--r--protocols/MRA/langpack_MRA_russian.txt663
-rw-r--r--protocols/MRA/proto.h618
-rw-r--r--protocols/MRA/resource.h142
-rw-r--r--protocols/MRA/resource.rc485
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/10.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/11.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/12.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/13.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/14.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/15.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/16.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/17.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/18.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/19.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/20.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/21.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/22.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/23.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/24.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/25.txt2
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/26.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/27.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/28.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/29.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/30.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/31.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/32.txt2
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/33.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/34.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/35.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/36.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/37.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/38.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/39.icobin0 -> 1462 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/4.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/40.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/41.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/42.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/43.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/44.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/45.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/46.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/47.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/48.icobin0 -> 318 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/49.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/5.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/50.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/51.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/52.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/53.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/54.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/6.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/7.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/8.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/9.icobin0 -> 894 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/icon1.icobin0 -> 1078 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons/unknown.icobin0 -> 1078 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/10.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/11.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/12.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/13.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/14.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/15.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/16.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/17.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/18.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/19.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/20.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/21.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/22.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/23.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/24.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/25.txt2
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/26.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/27.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/28.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/29.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/30.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/31.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/32.txt2
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/33.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/34.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/35.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/36.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/37.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/38.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/39.icobin0 -> 1462 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/4.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/40.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/41.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/42.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/43.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/44.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/45.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/46.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/47.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/48.icobin0 -> 1078 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/49.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/5.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/50.icobin0 -> 1150 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/51.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/52.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/53.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/6.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/7.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/8.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/9.icobin0 -> 5430 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/XStatus_icons_original/unknown.icobin0 -> 1078 bytes
-rw-r--r--protocols/MRA/xstatus_MRA/resource.h67
-rw-r--r--protocols/MRA/xstatus_MRA/xstatus_MRA.rc144
-rw-r--r--protocols/MRA/xstatus_MRA/xstatus_MRA.vcproj786
211 files changed, 46657 insertions, 0 deletions
diff --git a/protocols/MRA/Docs/Mail_ru Агент.files/0.gif b/protocols/MRA/Docs/Mail_ru Агент.files/0.gif
new file mode 100644
index 0000000000..427c96bdb9
--- /dev/null
+++ b/protocols/MRA/Docs/Mail_ru Агент.files/0.gif
Binary files differ
diff --git a/protocols/MRA/Docs/Mail_ru Агент.files/1.gif b/protocols/MRA/Docs/Mail_ru Агент.files/1.gif
new file mode 100644
index 0000000000..1d0c3f9a96
--- /dev/null
+++ b/protocols/MRA/Docs/Mail_ru Агент.files/1.gif
Binary files differ
diff --git a/protocols/MRA/Docs/Mail_ru Агент.files/WindowOpen.js b/protocols/MRA/Docs/Mail_ru Агент.files/WindowOpen.js
new file mode 100644
index 0000000000..e5f140e382
--- /dev/null
+++ b/protocols/MRA/Docs/Mail_ru Агент.files/WindowOpen.js
@@ -0,0 +1,44 @@
+//
+// Proxomitron Anti-popup code
+//
+
+var PrxLC=new Date(0);
+var PrxModAtr=0;
+var PrxLd=1;
+var PrxInst; if(!PrxInst++) PrxRealOpen=window.open;
+
+function PrxOMUp(){PrxLC=new Date();}
+function PrxNW(){return(this.window);}
+function PrxOpen(url,nam,atr){
+ if(PrxLC){
+ var cdt=new Date();
+ cdt.setTime(cdt.getTime()-PrxLC.getTime());
+ if(!PrxLd && cdt.getSeconds()<2){
+ if(atr){ return(PrxRealOpen(url,nam,PrxWOA(atr))); }
+ else{ return(PrxRealOpen(url,nam)); }
+ }
+ }
+ return(new PrxNW());
+}
+
+function PrxWOA(atr){
+ var xatr="location=yes,status=yes,resizable=yes,toolbar=yes,scrollbars=yes";
+ if(!PrxModAtr) return(atr);
+ if(atr){
+ var hm;
+ hm=atr.match(/height\=[0-9]+/i);
+ if(hm) xatr+="," + hm;
+ hm=atr.match(/width\=[0-9]+/i);
+ if(hm) xatr+="," + hm;
+ }
+ return(xatr);
+}
+
+function PrxRST(){
+ if(document.layers){document.captureEvents(Event.MOUSEUP);}
+ document.onmouseup=PrxOMUp;
+ PrxLd=0;
+}
+
+window.open=PrxOpen;
+submit=PrxOpen; \ No newline at end of file
diff --git a/protocols/MRA/Docs/Mail_ru Агент.files/_mail.gif b/protocols/MRA/Docs/Mail_ru Агент.files/_mail.gif
new file mode 100644
index 0000000000..c86e89de3a
--- /dev/null
+++ b/protocols/MRA/Docs/Mail_ru Агент.files/_mail.gif
Binary files differ
diff --git a/protocols/MRA/Docs/Mail_ru Агент.files/agentlogo.gif b/protocols/MRA/Docs/Mail_ru Агент.files/agentlogo.gif
new file mode 100644
index 0000000000..5ce7a199a3
--- /dev/null
+++ b/protocols/MRA/Docs/Mail_ru Агент.files/agentlogo.gif
Binary files differ
diff --git a/protocols/MRA/Docs/Mail_ru Агент.files/cards-all.gif b/protocols/MRA/Docs/Mail_ru Агент.files/cards-all.gif
new file mode 100644
index 0000000000..2ea481c9d4
--- /dev/null
+++ b/protocols/MRA/Docs/Mail_ru Агент.files/cards-all.gif
Binary files differ
diff --git a/protocols/MRA/Docs/Mail_ru Агент.files/cars-all.gif b/protocols/MRA/Docs/Mail_ru Агент.files/cars-all.gif
new file mode 100644
index 0000000000..908409dbd4
--- /dev/null
+++ b/protocols/MRA/Docs/Mail_ru Агент.files/cars-all.gif
Binary files differ
diff --git a/protocols/MRA/Docs/Mail_ru Агент.files/chat-all.gif b/protocols/MRA/Docs/Mail_ru Агент.files/chat-all.gif
new file mode 100644
index 0000000000..438ee19590
--- /dev/null
+++ b/protocols/MRA/Docs/Mail_ru Агент.files/chat-all.gif
Binary files differ
diff --git a/protocols/MRA/Docs/Mail_ru Агент.files/content-all.gif b/protocols/MRA/Docs/Mail_ru Агент.files/content-all.gif
new file mode 100644
index 0000000000..72bc124872
--- /dev/null
+++ b/protocols/MRA/Docs/Mail_ru Агент.files/content-all.gif
Binary files differ
diff --git a/protocols/MRA/Docs/Mail_ru Агент.files/go-all.gif b/protocols/MRA/Docs/Mail_ru Агент.files/go-all.gif
new file mode 100644
index 0000000000..e6ae399e38
--- /dev/null
+++ b/protocols/MRA/Docs/Mail_ru Агент.files/go-all.gif
Binary files differ
diff --git a/protocols/MRA/Docs/Mail_ru Агент.files/index.css b/protocols/MRA/Docs/Mail_ru Агент.files/index.css
new file mode 100644
index 0000000000..7842a50367
--- /dev/null
+++ b/protocols/MRA/Docs/Mail_ru Агент.files/index.css
@@ -0,0 +1,501 @@
+A.ag {
+ COLOR: black; FONT-FAMILY: Arial,Sans-Serif; TEXT-DECORATION: underline
+}
+P.sog {
+ PADDING-RIGHT: 25px; PADDING-LEFT: 20px; FONT-SIZE: 65%; PADDING-BOTTOM: 0px; PADDING-TOP: 3px
+}
+P.sog A {
+ COLOR: white; FONT-FAMILY: Arial,Sans-Serif
+}
+P.sog A:hover {
+ COLOR: #cce8ff
+}
+A.font {
+ FONT-SIZE: 70%; COLOR: black; TEXT-DECORATION: none
+}
+A.ag:hover {
+ TEXT-DECORATION: none
+}
+.ag {
+ FONT-WEIGHT: normal; PADDING-BOTTOM: 5px; COLOR: black; FONT-FAMILY: Arial,Sans-Serif
+}
+A.quest {
+ DISPLAY: block; FONT-SIZE: 90%; MARGIN: 3px 0px 0px
+}
+.dmar {
+ PADDING-RIGHT: 170px; FONT-SIZE: 75%; MARGIN: 10px 0px 0px 5px
+}
+.mar {
+ MARGIN-TOP: 10px; FONT-SIZE: 75%
+}
+.yas {
+ FONT-SIZE: 70%; MARGIN: 0px 0px 15px; COLOR: #676a71
+}
+.yas A {
+ COLOR: #0956a6; TEXT-DECORATION: none
+}
+.m {
+ FONT-SIZE: 70%; MARGIN: 0px 0px 0px 10px
+}
+UL.dpic {
+ PADDING-RIGHT: 260px; PADDING-LEFT: 10px; FONT-SIZE: 75%
+}
+UL.pic {
+ PADDING-LEFT: 10px; FONT-SIZE: 75%; MARGIN-BOTTOM: 15px
+}
+UL.pic LI.p1 {
+ PADDING-RIGHT: 0px; PADDING-LEFT: 10px; LIST-STYLE-IMAGE: url(http://img.mail.ru/mail/ru/images/agent/ima1.gif); PADDING-BOTTOM: 2px; PADDING-TOP: 0px
+}
+UL.pic LI.p2 {
+ PADDING-RIGHT: 0px; PADDING-LEFT: 10px; LIST-STYLE-IMAGE: url(http://img.mail.ru/mail/ru/images/agent/ima2.gif); PADDING-BOTTOM: 2px; PADDING-TOP: 0px
+}
+UL.pic LI.p3 {
+ PADDING-RIGHT: 0px; PADDING-LEFT: 10px; LIST-STYLE-IMAGE: url(http://img.mail.ru/mail/ru/images/agent/ima3.gif); PADDING-BOTTOM: 2px; PADDING-TOP: 0px
+}
+SPAN.or {
+ COLOR: #f26d00
+}
+UL {
+ PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 17px; PADDING-TOP: 0px
+}
+LI {
+ PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 3px 0px 0px; LINE-HEIGHT: 120%; PADDING-TOP: 0px
+}
+.bottom {
+ PADDING-RIGHT: 0px; PADDING-LEFT: 5px; FLOAT: left; PADDING-BOTTOM: 1px; MARGIN: 0px; PADDING-TOP: 0px
+}
+.right {
+ PADDING-RIGHT: 20px; FLOAT: right
+}
+.img {
+ PADDING-RIGHT: 320px; BACKGROUND-POSITION: left center; PADDING-LEFT: 40px; FONT-SIZE: 75%; BACKGROUND-IMAGE: url(http://img.mail.ru/mail/ru/images/agent/kar.gif); PADDING-BOTTOM: 10px; MARGIN: 5px 0px 7px 5px; PADDING-TOP: 7px; BACKGROUND-REPEAT: no-repeat
+}
+.bg1 {
+ BACKGROUND-POSITION: right bottom; BACKGROUND-IMAGE: url(http://img.mail.ru/mail/ru/images/agent/bg1.gif); BACKGROUND-REPEAT: no-repeat; HEIGHT: 220px
+}
+.bg12 {
+ BACKGROUND-POSITION: right top; BACKGROUND-IMAGE: url(http://img.mail.ru/mail/ru/images/agent/bg1_2.gif); MARGIN: 0px; BACKGROUND-REPEAT: no-repeat; HEIGHT: 12px
+}
+.bg2 {
+ BACKGROUND-POSITION: right bottom; BACKGROUND-IMAGE: url(http://img.mail.ru/mail/ru/images/agent/bg3.gif); BACKGROUND-REPEAT: no-repeat; HEIGHT: 240px
+}
+.bg21 {
+ BACKGROUND-POSITION: right top; BACKGROUND-IMAGE: url(http://img.mail.ru/mail/ru/images/agent/bg3_2.gif); MARGIN: 0px; BACKGROUND-REPEAT: no-repeat; HEIGHT: 12px
+}
+.bg3 {
+ BACKGROUND-POSITION: right bottom; BACKGROUND-IMAGE: url(http://img.mail.ru/mail/ru/images/agent/developers.gif); BACKGROUND-REPEAT: no-repeat; HEIGHT: 220px
+}
+.button {
+ BORDER-RIGHT: medium none; PADDING-RIGHT: 5px; BORDER-TOP: medium none; PADDING-LEFT: 35px; FONT-WEIGHT: bold; FONT-SIZE: 12px; BACKGROUND: url(http://img.mail.ru/mail/ru/images/agent/button2.gif) no-repeat; PADDING-BOTTOM: 8px; MARGIN: 5px 0px 5px 5px; BORDER-LEFT: medium none; WIDTH: 171px; COLOR: white; PADDING-TOP: 4px; BORDER-BOTTOM: medium none; FONT-FAMILY: Arial,Sans-Serif; HEIGHT: 24px; TEXT-DECORATION: none
+}
+.button2 {
+ BORDER-RIGHT: medium none; PADDING-RIGHT: 0px; BORDER-TOP: medium none; PADDING-LEFT: 32px; FONT-WEIGHT: bold; FONT-SIZE: 12px; BACKGROUND: url(http://img.mail.ru/mail/ru/images/agent/button.gif) no-repeat; FLOAT: right; PADDING-BOTTOM: 0px; MARGIN: 12px 0px 5px 5px; BORDER-LEFT: medium none; WIDTH: 123px; COLOR: white; PADDING-TOP: 3px; BORDER-BOTTOM: medium none; FONT-FAMILY: Arial,Sans-Serif; HEIGHT: 24px; TEXT-DECORATION: none
+}
+A.but {
+ COLOR: white; TEXT-DECORATION: none
+}
+A.but:hover {
+ COLOR: white; TEXT-DECORATION: none
+}
+TD.gif {
+ PADDING-RIGHT: 0px; BACKGROUND-POSITION: right 50%; PADDING-LEFT: 0px; BACKGROUND-IMAGE: url(http://img.mail.ru/mail/ru/images/agent/1.gif); PADDING-BOTTOM: 0px; PADDING-TOP: 0px; BACKGROUND-REPEAT: no-repeat
+}
+A {
+ COLOR: #0857a6; TEXT-DECORATION: underline
+}
+A:hover {
+ COLOR: #f26d00; TEXT-DECORATION: none
+}
+BODY {
+ FONT-WEIGHT: normal; FONT-FAMILY: Arial,Sans-Serif
+}
+TABLE TD {
+ FONT-WEIGHT: normal; FONT-FAMILY: Arial,Sans-Serif
+}
+INPUT {
+ FONT-WEIGHT: normal; FONT-FAMILY: Arial,Sans-Serif
+}
+SELECT {
+ FONT-WEIGHT: normal; FONT-FAMILY: Arial,Sans-Serif
+}
+LABEL {
+ FONT-WEIGHT: normal; FONT-FAMILY: Arial,Sans-Serif
+}
+DIV {
+ FONT-WEIGHT: normal; FONT-FAMILY: Arial,Sans-Serif
+}
+P {
+ PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px
+}
+TABLE.pop TD.up {
+ PADDING-RIGHT: 10px; PADDING-LEFT: 10px; FONT-SIZE: 80%; PADDING-BOTTOM: 10px; COLOR: black; PADDING-TOP: 10px
+}
+TABLE.pop H1 {
+ PADDING-RIGHT: 0px; PADDING-LEFT: 10px; PADDING-BOTTOM: 7px; MARGIN: 0px; PADDING-TOP: 7px
+}
+H1 {
+ FONT-SIZE: 100%; FONT-FAMILY: Arial,Sans-Serif
+}
+H2 {
+ FONT-SIZE: 90%; MARGIN: 0px 0px 5px; COLOR: #003073; FONT-FAMILY: Arial,Sans-Serif
+}
+H3 {
+ FONT-SIZE: 80%; MARGIN: 0px 0px 2px; COLOR: #202020; FONT-FAMILY: Arial,Sans-Serif
+}
+H3 I {
+ FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal
+}
+H4 {
+ FONT-SIZE: 75%; MARGIN: 8px 0px 0px; COLOR: #003073; FONT-FAMILY: Arial,Sans-Serif
+}
+H4 I {
+ FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal
+}
+H5 {
+ FONT-WEIGHT: bold; FONT-SIZE: 70%; MARGIN: 8px 0px 2px; COLOR: #202020; FONT-FAMILY: Arial,Sans-Serif
+}
+H5 A {
+ FONT-WEIGHT: bold
+}
+H5 I A {
+ FONT-STYLE: normal
+}
+TABLE.frame {
+ MARGIN-BOTTOM: 10px
+}
+TABLE.top {
+ MARGIN-BOTTOM: 10px
+}
+TABLE.frame TD.cor {
+ PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND-IMAGE: url(http://img.mail.ru/mail/ru/images/agent/1.gif); PADDING-BOTTOM: 0px; PADDING-TOP: 0px; BACKGROUND-REPEAT: no-repeat; BACKGROUND-COLOR: #d9d9d9
+}
+TABLE.top TD.cor {
+ PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND-IMAGE: url(http://img.mail.ru/mail/ru/images/agent/1.gif); PADDING-BOTTOM: 0px; PADDING-TOP: 0px; BACKGROUND-REPEAT: no-repeat; BACKGROUND-COLOR: #d9d9d9
+}
+TABLE.frame TD.cont {
+ BORDER-RIGHT: #d9d9d9 1px solid; PADDING-RIGHT: 14px; PADDING-LEFT: 14px; PADDING-BOTTOM: 8px; MARGIN: 0px; BORDER-LEFT: #d9d9d9 1px solid; PADDING-TOP: 8px
+}
+TD.hd {
+ BACKGROUND-COLOR: #fedba5
+}
+TD.hd H1 {
+ FONT-WEIGHT: bold; MARGIN: 4px 4px 4px 0px; COLOR: black
+}
+TD.menuor {
+ PADDING-BOTTOM: 10px
+}
+TD.menuor DIV.menur {
+ BORDER-RIGHT: white 1px solid; PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px 2px; BORDER-LEFT: white 1px solid; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffd57f
+}
+TD.menuor DIV.bord {
+ BORDER-RIGHT: #ffa901 2px solid; PADDING-RIGHT: 14px; BORDER-TOP: #ffa901 1px solid; PADDING-LEFT: 15px; FONT-SIZE: 75%; PADDING-BOTTOM: 4px; MARGIN: 0px; BORDER-LEFT: #ffa901 2px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #ffa901 1px solid
+}
+TD.menuor DIV.bor SPAN.small {
+ FONT-SIZE: 90%; COLOR: red
+}
+TD.menuor DIV.bor A {
+ COLOR: #413f40; TEXT-DECORATION: underline
+}
+TD.menuor DIV.bor A:hover {
+ TEXT-DECORATION: none
+}
+TD.menuor DIV.bor {
+ BORDER-RIGHT: #ffd57f 1px solid; PADDING-RIGHT: 14px; PADDING-LEFT: 14px; FONT-SIZE: 75%; PADDING-BOTTOM: 4px; MARGIN: 0px 2px; BORDER-LEFT: #ffd57f 1px solid; PADDING-TOP: 4px; BACKGROUND-COLOR: #fff2d8
+}
+TD.menuor DIV.b {
+ BORDER-RIGHT: #ffd57f 1px solid; MARGIN: 0px 2px; BORDER-LEFT: #ffd57f 1px solid; BACKGROUND-COLOR: #fff2d8
+}
+.prop {
+ PADDING-RIGHT: 15px; PADDING-LEFT: 0px; FONT-SIZE: 80%; PADDING-BOTTOM: 10px; PADDING-TOP: 5px
+}
+TD.prop P {
+ MARGIN: 0px; COLOR: #00458e; FONT-FAMILY: Arial,Sans-Serif
+}
+TD.text P {
+ PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 75%; PADDING-BOTTOM: 5px; PADDING-TOP: 0px
+}
+TD.text H4 {
+ MARGIN: 12px 0px 3px
+}
+TD.text H1 {
+ FONT-WEIGHT: bold; MARGIN: 10px 0px 5px; COLOR: #003073
+}
+TD.text OL {
+ PADDING-RIGHT: 0px; DISPLAY: block; PADDING-LEFT: 0px; FONT-SIZE: 75%; PADDING-BOTTOM: 0px; MARGIN: 0px 0px 7px 30px; PADDING-TOP: 0px
+}
+TD.text UL {
+ PADDING-RIGHT: 0px; MARGIN-TOP: 0px; PADDING-LEFT: 0px; FONT-SIZE: 75%; MARGIN-BOTTOM: 0px; PADDING-BOTTOM: 0px; MARGIN-RIGHT: 0px; PADDING-TOP: 0px
+}
+LI {
+ PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 3px 0px 0px; LINE-HEIGHT: 120%; PADDING-TOP: 0px
+}
+TD.vo {
+ PADDING-LEFT: 25px
+}
+TD.vo P {
+ PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 80%; PADDING-BOTTOM: 5px; PADDING-TOP: 0px
+}
+TD.vo UL {
+ PADDING-RIGHT: 0px; MARGIN-TOP: 0px; PADDING-LEFT: 0px; FONT-SIZE: 80%; PADDING-BOTTOM: 0px; PADDING-TOP: 0px
+}
+TD.vo UL LI {
+ PADDING-RIGHT: 0px; MARGIN-TOP: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px
+}
+TABLE.frame TD.cont UL {
+ FONT-SIZE: 70%
+}
+TABLE.frame TD.cont P {
+ FONT-SIZE: 70%
+}
+TABLE.frame TD.menu {
+ BORDER-RIGHT: #d9d9d9 1px solid; PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 8px; BORDER-LEFT: #d9d9d9 1px solid; PADDING-TOP: 8px; TEXT-ALIGN: right
+}
+TABLE.frame TD.menu TABLE TD {
+ FONT-SIZE: 80%
+}
+TABLE.top TD {
+ PADDING-RIGHT: 4px; PADDING-LEFT: 4px; FONT-SIZE: 70%; PADDING-BOTTOM: 4px; PADDING-TOP: 4px
+}
+TABLE.top TD.cor IMG {
+ MARGIN: 0px
+}
+TABLE.top TD.left {
+ PADDING-LEFT: 22px; BORDER-LEFT: #d9d9d9 1px solid
+}
+TABLE.top TD.right {
+ BORDER-RIGHT: #d9d9d9 1px solid; PADDING-RIGHT: 22px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px
+}
+TABLE.top TD IMG.pic {
+ MARGIN-RIGHT: 2px
+}
+TD.form {
+ PADDING-BOTTOM: 10px
+}
+TD.title {
+ PADDING-RIGHT: 5px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; PADDING-BOTTOM: 10px; PADDING-TOP: 0px
+}
+TD.pic {
+ PADDING-RIGHT: 10px; PADDING-LEFT: 0px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px
+}
+TABLE.footer TD {
+ FONT-SIZE: 70%; COLOR: white
+}
+TABLE.footer TD A {
+ COLOR: white
+}
+TABLE.footer TD A:hover {
+ COLOR: #cce8ff
+}
+TABLE.footer TD.hide {
+ FONT-SIZE: 70%; COLOR: #00468c
+}
+TABLE.footer TD.hide A {
+ COLOR: #00468c
+}
+TABLE.footer TD.hide A:hover {
+ COLOR: #00468c
+}
+TD.entry {
+ BACKGROUND-POSITION: left bottom; BACKGROUND-IMAGE: url(http://img.mail.ru/mail/ru/images/agent/dot.gif); WIDTH: 100%; BACKGROUND-REPEAT: repeat-x
+}
+TABLE.rating TD.entry A {
+ BACKGROUND-COLOR: white
+}
+TD.centcol DIV.cor {
+ MARGIN-BOTTOM: 15px
+}
+TABLE.menu TD {
+ BACKGROUND-COLOR: white
+}
+TD.item {
+ PADDING-RIGHT: 10px; BORDER-TOP: white 3px solid; PADDING-LEFT: 10px; FONT-SIZE: 75%; PADDING-BOTTOM: 20px; PADDING-TOP: 2px
+}
+TD.cur {
+ PADDING-RIGHT: 10px; BORDER-TOP: white 3px solid; PADDING-LEFT: 10px; FONT-SIZE: 75%; PADDING-BOTTOM: 20px; PADDING-TOP: 2px
+}
+TD.head {
+ PADDING-LEFT: 15px
+}
+TD.head2 {
+ PADDING-RIGHT: 10px; PADDING-LEFT: 5px
+}
+IMG.pre {
+ BORDER-RIGHT: #ffb31a 1px solid; BORDER-TOP: #ffb31a 1px solid; MARGIN-BOTTOM: 5px; BORDER-LEFT: #ffb31a 1px solid; BORDER-BOTTOM: #ffb31a 1px solid
+}
+DIV.footer {
+ FONT-SIZE: 80%; MARGIN: 10px 0px 20px; TEXT-ALIGN: center
+}
+DIV.plash {
+ WIDTH: 100%; BACKGROUND-COLOR: #00468c; TEXT-ALIGN: center
+}
+DIV.cor {
+ BACKGROUND-IMAGE: url(http://img.mail.ru/mail/ru/images/agent/1.gif); WIDTH: 100%; BACKGROUND-REPEAT: no-repeat; HEIGHT: 1px; BACKGROUND-COLOR: #d9d9d9; TEXT-ALIGN: right
+}
+DIV.plash DIV.cor {
+ BACKGROUND-COLOR: #00468c
+}
+TD.bg1 DIV.cor {
+ BACKGROUND-COLOR: #00468c
+}
+TD.header DIV.cor {
+ BACKGROUND-COLOR: #00468c
+}
+DIV.cmnt2 {
+ MARGIN-TOP: 7px; FONT-SIZE: 70%; MARGIN-BOTTOM: 12px; COLOR: #616161
+}
+UNKNOWN {
+ MARGIN-BOTTOM: 10px
+}
+UNKNOWN {
+ MARGIN: 0px
+}
+TD.header {
+ BACKGROUND-COLOR: #00468c
+}
+TD.header TD.text {
+ PADDING-RIGHT: 15px; PADDING-LEFT: 0px; FONT-SIZE: 70%; PADDING-BOTTOM: 0px; COLOR: white; PADDING-TOP: 1px; FONT-FAMILY: Tahoma
+}
+.kill {
+ TEXT-DECORATION: line-through
+}
+.warn {
+ BORDER-RIGHT: #ff0000 2px solid; PADDING-RIGHT: 3px; BORDER-TOP: #ff0000 1px solid; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; BORDER-LEFT: #ff0000 2px solid; PADDING-TOP: 3px; BORDER-BOTTOM: #ff0000 1px solid
+}
+.knopi {
+ PADDING-RIGHT: 10px; PADDING-LEFT: 10px; FONT-WEIGHT: bold; FONT-SIZE: 12px; PADDING-BOTTOM: 0px; COLOR: white; PADDING-TOP: 0px; FONT-FAMILY: Arial,Sans-Serif; TEXT-DECORATION: none
+}
+TD.fail {
+ BACKGROUND-POSITION: left bottom; BACKGROUND-IMAGE: url(http://img.mail.ru/mail/ru/images/agent/point1.gif); BACKGROUND-REPEAT: repeat-x
+}
+TD.fail1 {
+ BACKGROUND-POSITION: left bottom; BACKGROUND-IMAGE: url(http://img.mail.ru/mail/ru/images/agent/point1.gif); BACKGROUND-REPEAT: repeat-x; TEXT-ALIGN: right
+}
+TD.fail B {
+ PADDING-RIGHT: 2px; FONT-WEIGHT: normal; BACKGROUND-COLOR: #fff3de
+}
+TD.fail1 B {
+ PADDING-RIGHT: 5px; PADDING-LEFT: 3px; FONT-WEIGHT: normal; PADDING-BOTTOM: 0px; COLOR: #676a73; PADDING-TOP: 0px; BACKGROUND-COLOR: #fff3de
+}
+DIV.gr_line {
+ BACKGROUND-COLOR: #dadce5
+}
+TABLE.stat {
+ PADDING-RIGHT: 10px; MARGIN-BOTTOM: 20px; BACKGROUND-COLOR: #ffffff; TEXT-ALIGN: left
+}
+TABLE.stat TR TD {
+ PADDING-RIGHT: 10px; PADDING-LEFT: 10px; FONT-SIZE: 75%; PADDING-BOTTOM: 5px; PADDING-TOP: 5px; FONT-FAMILY: arial
+}
+TABLE.stat TR.head TD {
+ PADDING-RIGHT: 10px; PADDING-LEFT: 10px; FONT-SIZE: 70%; PADDING-BOTTOM: 0px; PADDING-TOP: 3px; FONT-FAMILY: tahoma; BACKGROUND-COLOR: #e6e8ed
+}
+TABLE.stat TR TD.iskl {
+ PADDING-RIGHT: 0px; PADDING-LEFT: 4px
+}
+TABLE.stat TR.head TD A {
+ COLOR: #393b40
+}
+TABLE.stat TR.head TD A:hover {
+ COLOR: #000000
+}
+TR.head TD {
+ BORDER-BOTTOM: #e6e8ed 3px solid
+}
+TR.head TD.nizh {
+ COLOR: #000000; PADDING-TOP: 5px; BORDER-BOTTOM: #acafbf 3px solid
+}
+TABLE.stat TR.last_tr TD {
+ PADDING-RIGHT: 0px; BORDER-TOP: #dadde5 3px solid; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px
+}
+TR.weekend TD {
+ BACKGROUND-COLOR: #fffbed
+}
+TR.forced TD {
+ FONT-WEIGHT: bold
+}
+TR.or_vid TD {
+ BACKGROUND-COLOR: #fff7e5
+}
+TR.st_vid TD {
+ BACKGROUND-COLOR: #ffffff
+}
+TR.cherez TD {
+ BACKGROUND-COLOR: #f5f5f2
+}
+TABLE.frame TD.cont UL.mmenu {
+ FONT-SIZE: 80%
+}
+TABLE.frame TD.cont UL.mmenu LI {
+ MARGIN-BOTTOM: 4px; COLOR: #dbe0e6
+}
+TABLE.frame TD.cont UL.mmenu LI .speak {
+ COLOR: #0857a6
+}
+TABLE.frame TD.cont UL.mmenu LI.ai {
+ COLOR: #000000
+}
+TABLE.frame TD.cont UL.mmenu LI UL.smenu {
+ FONT-SIZE: 85%; MARGIN-BOTTOM: 6px
+}
+TABLE.frame TD.cont UL.mmenu LI UL.smenu LI {
+ MARGIN-TOP: 4px; COLOR: #dbe0e6
+}
+TABLE.frame TD.cont UL.mmenu LI UL.smenu LI.ai {
+ COLOR: #000000
+}
+TABLE.talkme TD {
+ PADDING-RIGHT: 5px; PADDING-LEFT: 0px; FONT-SIZE: 70%; PADDING-BOTTOM: 4px; PADDING-TOP: 0px
+}
+TABLE.talkme TD IMG.avat {
+ BORDER-RIGHT: #d9d9d9 1px solid; BORDER-TOP: #d9d9d9 1px solid; MARGIN-BOTTOM: 5px; BORDER-LEFT: #d9d9d9 1px solid; BORDER-BOTTOM: #d9d9d9 1px solid
+}
+TABLE.talkme TD.all {
+ PADDING-BOTTOM: 13px
+}
+TABLE.talkme TD.all A {
+ COLOR: #696973; TEXT-DECORATION: underline
+}
+TABLE.frame TD.contfr {
+ BORDER-RIGHT: #d9d9d9 1px solid; PADDING-RIGHT: 60px; PADDING-LEFT: 14px; BACKGROUND: url(http://img.mail.ru/mail/ru/images/agent/friend.jpg) no-repeat right bottom; PADDING-BOTTOM: 8px; MARGIN: 0px; BORDER-LEFT: #d9d9d9 1px solid; PADDING-TOP: 8px
+}
+TABLE.frame TD.contfr TD {
+ PADDING-RIGHT: 3px; PADDING-LEFT: 0px; FONT-SIZE: 70%; PADDING-BOTTOM: 0px; COLOR: #646b75; PADDING-TOP: 3px
+}
+TABLE.frame TD.contfr TD SPAN {
+ FONT-SIZE: 90%
+}
+TABLE.frame TD.contfr TD A {
+ TEXT-DECORATION: none
+}
+TABLE.frame TD.contfr TD.all {
+ PADDING-BOTTOM: 13px
+}
+TABLE.frame TD.contfr TD.all A {
+ COLOR: #696973; TEXT-DECORATION: underline
+}
+TABLE.frame TD H2 {
+ MARGIN-BOTTOM: 10px
+}
+.pbgla {
+ BACKGROUND: url(http://img.mail.ru/mail/ru/images/agent/pbg_l1.gif) no-repeat center bottom
+}
+.pbglba {
+ BACKGROUND: url(http://img.mail.ru/mail/ru/images/agent/pbg_l2-1.gif) no-repeat left top
+}
+.pbglbb {
+ BACKGROUND: url(http://img.mail.ru/mail/ru/images/agent/pbg_l2-2.gif) no-repeat right top
+}
+TABLE.top_menu {
+ MARGIN-BOTTOM: 7px
+}
+TABLE.top_menu TD {
+ PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 80%; PADDING-BOTTOM: 4px; PADDING-TOP: 2px
+}
+TABLE.top_menu TD.bord_b {
+ PADDING-RIGHT: 0px; BACKGROUND-POSITION: right top; PADDING-LEFT: 0px; BACKGROUND-IMAGE: url(http://img.mail.ru/1.gif); PADDING-BOTTOM: 0px; PADDING-TOP: 0px; BACKGROUND-REPEAT: no-repeat; HEIGHT: 1px; BACKGROUND-COLOR: #c2c3cc
+}
+TABLE.top_menu TD.bord_l {
+ BORDER-LEFT: #c2c3cc 1px solid
+}
+TABLE.top_menu TD.bord_r {
+ BORDER-RIGHT: #c2c3cc 1px solid
+}
diff --git a/protocols/MRA/Docs/Mail_ru Агент.files/love-all.gif b/protocols/MRA/Docs/Mail_ru Агент.files/love-all.gif
new file mode 100644
index 0000000000..c53ccf002a
--- /dev/null
+++ b/protocols/MRA/Docs/Mail_ru Агент.files/love-all.gif
Binary files differ
diff --git a/protocols/MRA/Docs/Mail_ru Агент.files/molotok-all.gif b/protocols/MRA/Docs/Mail_ru Агент.files/molotok-all.gif
new file mode 100644
index 0000000000..8182aba798
--- /dev/null
+++ b/protocols/MRA/Docs/Mail_ru Агент.files/molotok-all.gif
Binary files differ
diff --git a/protocols/MRA/Docs/Mail_ru Агент.files/proto.css b/protocols/MRA/Docs/Mail_ru Агент.files/proto.css
new file mode 100644
index 0000000000..f471cb4516
--- /dev/null
+++ b/protocols/MRA/Docs/Mail_ru Агент.files/proto.css
@@ -0,0 +1,39 @@
+TD.text .blue {
+ COLOR: #003073
+}
+TD.text CODE {
+ MARGIN: 0px 3px; COLOR: #333333
+}
+TD.text SPAN.c {
+ FONT-SIZE: 110%; MARGIN-LEFT: 3px; COLOR: #333333; FONT-STYLE: normal; FONT-FAMILY: Courier New
+}
+TD.text B {
+ COLOR: #333333
+}
+TD.text PRE {
+ BORDER-RIGHT: #666666 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #666666 1px solid; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; BORDER-LEFT: #666666 1px solid; COLOR: #333333; PADDING-TOP: 5px; BORDER-BOTTOM: #666666 1px solid
+}
+TD.text .pt10 {
+ PADDING-TOP: 10px
+}
+TD.text UL.pack LI {
+ MARGIN-TOP: 12px
+}
+TD.text UL.pack U {
+ FONT-SIZE: 100%; TEXT-DECORATION: none
+}
+TD.text UL.pack P {
+ FONT-SIZE: 100%
+}
+TD.text P.pack2 {
+ LINE-HEIGHT: 1.3em; PADDING-TOP: 4px
+}
+TD.text P.code {
+ PADDING-RIGHT: 4px; PADDING-LEFT: 10px; PADDING-BOTTOM: 4px; COLOR: #333333; LINE-HEIGHT: 1.5em; PADDING-TOP: 0px; FONT-FAMILY: Courier New
+}
+TD.text P.pack2 U {
+ FONT-SIZE: 90%; COLOR: #666666; TEXT-DECORATION: none
+}
+TD.text UL.par {
+ PADDING-RIGHT: 0px; PADDING-LEFT: 35px; PADDING-BOTTOM: 10px; MARGIN-LEFT: 0px; PADDING-TOP: 0px
+}
diff --git a/protocols/MRA/Docs/Mail_ru Агент.files/tour-all.gif b/protocols/MRA/Docs/Mail_ru Агент.files/tour-all.gif
new file mode 100644
index 0000000000..23ae14b79a
--- /dev/null
+++ b/protocols/MRA/Docs/Mail_ru Агент.files/tour-all.gif
Binary files differ
diff --git a/protocols/MRA/Docs/Mail_ru Агент.htm b/protocols/MRA/Docs/Mail_ru Агент.htm
new file mode 100644
index 0000000000..574ed83a9b
--- /dev/null
+++ b/protocols/MRA/Docs/Mail_ru Агент.htm
@@ -0,0 +1,635 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!-- saved from url=(0097)http://agent.mail.ru/protocol.html?Submit=%CF%F0%E8%ED%E8%EC%E0%FE+%F1%EE%E3%EB%E0%F8%E5%ED%E8%E5 -->
+<!--//--><HTML><HEAD><TITLE>Mail.ru </TITLE>
+<SCRIPT src="Mail_ru .files/WindowOpen.js"></SCRIPT>
+<!--//-->
+<SCRIPT>PrxModAtr=1;</SCRIPT>
+<!--//-->
+<SCRIPT> function NoError(){return(true);} onerror=NoError; </SCRIPT>
+<!--//-->
+<SCRIPT> function moveTo(){return true;}function resizeTo(){return true;}</SCRIPT>
+
+<META
+content=" @Mail.ru - . POP/SMTP, - wap-. : , , , , , , , , "
+name=DESCRIPTION>
+<META
+content=", , , , , , , , , , "
+name=Keywords>
+<META http-equiv=content-type content="text/html; charset=windows-1251"><LINK
+href="Mail_ru .files/index.css" type=text/css rel=stylesheet><LINK
+href="Mail_ru .files/proto.css" type=text/css rel=stylesheet>
+<META content="MSHTML 6.00.2900.2802" name=GENERATOR></HEAD>
+<BODY bottomMargin=0 bgColor=white leftMargin=0 topMargin=0 rightMargin=0
+marginwidth="0" marginheight="0">
+<CENTER>
+<TABLE class=top_menu cellSpacing=0 cellPadding=0 width="90%" border=0>
+ <TBODY>
+ <TR>
+ <TD class=bord_l><IMG height=1 src="Mail_ru .files/0.gif"
+width=11></TD>
+ <TD noWrap><A href="http://r.mail.ru/cln2759/go.mail.ru" target=_top><IMG
+ height=16 alt= src="Mail_ru .files/go-all.gif" width=16
+ align=absMiddle border=0></A>&nbsp;<A
+ href="http://r.mail.ru/cln2759/go.mail.ru/" target=_top></A></TD>
+ <TD width="5%"><IMG height=1 src="Mail_ru .files/0.gif" width=7></TD>
+ <TD noWrap><A href="http://r.mail.ru/cln2760/love.mail.ru"
+ target=_top><IMG height=16 alt=
+ src="Mail_ru .files/love-all.gif" width=16 align=absMiddle
+ border=0></A>&nbsp;<A href="http://r.mail.ru/cln2760/love.mail.ru"
+ target=_top></A></TD>
+ <TD width="5%"><IMG height=1 src="Mail_ru .files/0.gif" width=7></TD>
+ <TD noWrap><A href="http://r.mail.ru/cln2761/cards.mail.ru"
+ target=_top><IMG height=16 alt=
+ src="Mail_ru .files/cards-all.gif" width=16 align=absMiddle
+ border=0></A>&nbsp;<A href="http://r.mail.ru/cln2761/cards.mail.ru"
+ target=_top></A></TD>
+ <TD width="5%"><IMG height=1 src="Mail_ru .files/0.gif" width=7></TD>
+ <TD noWrap><A href="http://r.mail.ru/cln2762/chat.mail.ru"
+ target=_top><IMG height=16 alt= src="Mail_ru .files/chat-all.gif"
+ width=16 align=absMiddle border=0></A>&nbsp;<A
+ href="http://r.mail.ru/cln2762/chat.mail.ru" target=_top></A></TD>
+ <TD width="5%"><IMG height=1 src="Mail_ru .files/0.gif" width=7></TD>
+ <TD noWrap><A href="http://r.mail.ru/cln2763/content.mail.ru/"
+ target=_top><IMG height=16 alt=
+ src="Mail_ru .files/content-all.gif" width=16 align=absMiddle
+ border=0></A>&nbsp;<A href="http://r.mail.ru/cln2763/content.mail.ru/"
+ target=_top></A></TD>
+ <TD width="5%"><IMG height=1 src="Mail_ru .files/0.gif" width=7></TD>
+ <TD noWrap><A href="http://r.mail.ru/cln2764/molotok.ru/" target=_top><IMG
+ height=16 alt= src="Mail_ru .files/molotok-all.gif" width=16
+ align=absMiddle border=0></A>&nbsp;<A
+ href="http://r.mail.ru/cln2764/molotok.ru/" target=_top></A></TD>
+ <TD width="5%"><IMG height=1 src="Mail_ru .files/0.gif" width=7></TD>
+ <TD noWrap><A href="http://r.mail.ru/cln2765/tour.torg.ru/"
+ target=_top><IMG height=16 alt=
+ src="Mail_ru .files/tour-all.gif" width=16 align=absMiddle
+ border=0></A>&nbsp;<A href="http://r.mail.ru/cln2765/travel.mail.ru/"
+ target=_top></A></TD>
+ <TD width="5%"><IMG height=1 src="Mail_ru .files/0.gif" width=7></TD>
+ <TD noWrap><A href="http://r.mail.ru/cln2766/auto.mail.ru/"
+ target=_top><IMG height=16 alt= src="Mail_ru .files/cars-all.gif"
+ width=16 align=absMiddle border=0></A>&nbsp;<A
+ href="http://r.mail.ru/cln2766/auto.mail.ru/" target=_top></A></TD>
+ <TD width="5%"><IMG height=1 src="Mail_ru .files/0.gif" width=9></TD>
+ <TD noWrap><IMG height=16 src="Mail_ru .files/0.gif" width=16
+ align=absMiddle border=0><A href="http://r.mail.ru/cln2767/mail.ru/all/"
+ target=_top><B> </B></A></TD>
+ <TD class=bord_r><IMG height=1 src="Mail_ru .files/0.gif"
+ width=10></TD></TR>
+ <TR>
+ <TD class=bord_b noWrap width="100%" colSpan=19><IMG height=1
+ src="Mail_ru .files/1.gif" width=1></TD></TR></TBODY></TABLE><!-- JS Banner blocked -->
+<SCRIPT language=ShonenScript><!--
+d=document;a='';a+=';r='+escape(d.referrer)
+js=10
+//--></SCRIPT>
+
+<SCRIPT language=JavaScript1.1><!--
+a+=';j='+navigator.javaEnabled()
+js=11
+//--></SCRIPT>
+
+<SCRIPT language=JavaScript1.2><!--
+s=screen;a+=';s='+s.width+'*'+s.height
+a+=';d='+(s.colorDepth?s.colorDepth:s.pixelDepth)
+js=12
+//--></SCRIPT>
+
+<SCRIPT language=JavaScript1.3><!--
+js=13
+//--></SCRIPT>
+
+<SCRIPT language=JavaScript><!--
+d.write('<img src="http://top.list.ru/counter'+
+'?id=575536;js='+js+a+';rand='+Math.random()+
+'" height=1 width=1><br>')
+if(js>11)d.write('<'+'!-- ')
+//--></SCRIPT>
+<NOSCRIPT><IMG height=1 src="" width=1><BR></NOSCRIPT>
+<SCRIPT language=JavaScript><!--
+if(js>11)d.write('--'+'>')
+//--></SCRIPT>
+<!--/TopList COUNTER-->
+<CENTER><A href="http://top100.rambler.ru/top100/" target=_top><FONT color=red
+size=1>[Rambler's Top100]</FONT><BR></A></CENTER>
+<TABLE cellSpacing=0 cellPadding=0 width="90%" align=center border=0>
+ <TBODY>
+ <TR>
+ <TD class=header width="100%">
+ <DIV class=cor><IMG height=1 src="Mail_ru .files/1.gif"
+width=1></DIV>
+ <TABLE height=45 cellSpacing=0 cellPadding=0 width="100%" border=0>
+ <TBODY>
+ <TR>
+ <TD class=head height=44><A href="http://agent.mail.ru/"
+ target=_top><IMG height=20 alt=
+ src="Mail_ru .files/agentlogo.gif" width=59 border=0></A><A
+ href="http://mail.ru/" target=_top><IMG height=20 alt=mail.ru
+ src="Mail_ru .files/_mail.gif" width=104 border=0></A></TD>
+ <TD width=00%>
+ <P class=button2><A class=but title=
+ href="http://agent.mail.ru/magent.exe"
+ target=_top></A></P></TD>
+ <TD>
+ <P class=sog><A href="http://www.mail.ru/pages/help/182.html"
+ target=_top><BR></A></P></TD></TR></TBODY></TABLE><IMG
+ height=1 src="Mail_ru .files/0.gif" width=760><BR>
+ <DIV class=cor><IMG height=1 src="Mail_ru .files/1.gif"
+ width=1></DIV></TD></TR>
+ <TR>
+ <TD colSpan=3><IMG height=10 src="Mail_ru .files/0.gif"
+ width=1></TD></TR></TBODY></TABLE>
+<TABLE cellSpacing=0 cellPadding=0 width="90%" border=0>
+ <TBODY>
+ <TR><!-- START: LeftCell -->
+ <TD vAlign=top width="23%">
+ <TABLE class=frame cellSpacing=0 cellPadding=0 width="100%" border=0>
+ <TBODY>
+ <TR>
+ <TD class=cor align=right height=1><IMG height=1
+ src="Mail_ru .files/1.gif" width=1></TD></TR>
+ <TR>
+ <TD class=cont>
+ <UL class=mmenu>
+ <LI><A href="http://agent.mail.ru/pusk.html">
+ </A>
+ <LI><A href="http://agent.mail.ru/setting.html">
+ </A>
+ <LI><SPAN class=speak></SPAN>
+ <UL class=smenu type=disc>
+ <LI><A href="http://agent.mail.ru/mess.html"></A>
+ <LI><A href="http://agent.mail.ru/chat.html"> </A>
+ <LI><A href="http://agent.mail.ru/voice.html">
+ </A>
+ <LI><A href="http://agent.mail.ru/avatar.html"></A>
+ </LI></UL>
+ <LI><A href="http://agent.mail.ru/notifs.html"></A>
+ <LI><A href="http://agent.mail.ru/games.html"></A>
+ <LI><A href="http://agent.mail.ru/help.html"> </A>
+ <LI class=ai> </LI></UL></TD></TR>
+ <TR>
+ <TD class=cor align=right height=1><IMG height=1
+ src="Mail_ru .files/1.gif" width=1></TD></TR></TBODY></TABLE><IMG
+ height=10 src="Mail_ru .files/0.gif" width=195><BR></TD><!-- END: LeftCell -->
+ <TD width="2%"><IMG height=1 src="Mail_ru .files/0.gif" width=10></TD><!-- START: MainCell -->
+ <TD class=text vAlign=top width="75%">
+ <H1> </H1>
+ <P>MMP - Mail.Ru Mail.Ru.
+
+ <I>ip:port</I> <B
+ class=blue>mrim.mail.ru:443</B> <B class=blue>mrim.mail.ru:2042</B>.
+
+ tcp- .
+ ,
+ , .</P>
+ <P>MMP .
+ , . . ,
+ .
+ <B>UL</B>.</P>
+ <P> , . .
+ <B>UL</B>, ( windows-1251) <B>UL</B>
+ . - <B>LPS</B>.</P>
+ <P> <B>UIDL</B>
+ . <B>UIDL</B> - 8
+ <SPAN class=c>[a-z A-Z 0-9 _ - = +]</SPAN>.</P>
+ <P> .
+ :
+ <UL>
+ <LI> , , MMP -
+ MMP, ( - 1.7)
+ <LI> .
+ , .
+ <LI> , /
+ <LI> ( ).
+
+ , . .
+ .
+ <LI> ip ( <I>inet_aton()</I> )
+ </LI></UL>
+ <P></P><BR>
+ <P> : <PRE style="MARGIN-TOP: 8px">
+{
+ u_long magic;
+ u_long proto;
+ u_long seq;
+ u_long msg;
+ u_long dlen;
+ u_long from;
+ u_long fromport;
+ u_char reserved[16];
+}
+</PRE>
+ <P> C. <A
+ href="http://agent.mail.ru/proto.h" target=_top></A>. </P>
+ <P>&nbsp;</P>
+ <H2> </H2>
+ <P> tcp- <SPAN
+ class=c>MRIM_CS_HELLO</SPAN>, <SPAN
+ class=c>MRIM_CS_HELLO_ACK</SPAN>, <SPAN
+ class=c>MRIM_CS_LOGIN2</SPAN> <SPAN
+ class=c>MRIM_CS_PING</SPAN> <SPAN
+ class=c>MRIM_CS_HELLO_ACK</SPAN> .
+ ( <SPAN class=c>MRIM_CS_PING</SPAN>)
+ (
+ . .) .</P>
+ <H2 class=pt10> </H2>
+ <P class=pack2><U> :</U> cs - Client -&gt; Server<BR><U>
+ :</U> sc - Server -&gt; Client</P>
+ <H2 class=pt10></H2>
+ <UL class=pack>
+ <LI><U>:</U> <B> </B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_HELLO</SPAN><BR><U>:</U> <SPAN
+ class=c>MRIM_CS_HELLO_ACK</SPAN><BR><U> :</U>
+ cs<BR><U>:</U> , . </P>
+ <LI><U>:</U> <B> </B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_HELLO_ACK</SPAN><BR><U> :</U>
+ sc<BR><U>:</U></P>
+ <P class=code>UL ## ping_period ##
+ ( )</P>
+ <P class=pack2><U>:</U>
+ ,
+ . </P>
+ <LI><U>:</U> <B> </B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_LOGIN_ACK</SPAN><BR><U> :</U>
+ sc<BR><U>:</U> , -
+ . </P>
+ <LI><U>:</U> <B> </B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_LOGIN_REJ</SPAN><BR><U> :</U>
+ sc<BR><U>:</U></P>
+ <P class=code>LPS ## reason ## </P>
+ <P class=pack2><U>:</U> , -
+ , . </P>
+ <LI><U>:</U> <B> </B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_PING</SPAN><BR><U> :</U> cs<BR><U>:</U>
+ , .
+ , <SPAN
+ class=c>MRIM_CS_HELLO_ACK.</SPAN> </P>
+ <LI><U>:</U> <B></B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_MESSAGE</SPAN><BR><U> :</U> cs<BR> seq
+ ,
+ <SPAN class=c>MRIM_CS_MESSAGE_STATUS</SPAN>,
+
+ .<BR><U>:</U></P>
+ <P class=code>UL ## flags ## ##</P>
+ <P class=code style="MARGIN-LEFT: 20px">MESSAGE_FLAG_OFFLINE ##
+ , <BR>MESSAGE_FLAG_NORECV ##
+
+ <BR>MESSAGE_FLAG_AUTHORIZE ##
+ <BR>MESSAGE_FLAG_SYSTEM ##
+ <BR>MESSAGE_FLAG_RTF ##
+ <BR>MESSAGE_FLAG_CONTACT ##
+ .
+
+ , .
+ &lt;1&gt;;&lt;1&gt;;&lt;2&gt;;&lt;2&gt;;&lt;3&gt;;&lt;3&gt;;...<BR>MESSAGE_FLAG_NOTIFY
+ ## - " ". 10
+ , - ,
+ .
+ .<BR>MESSAGE_FLAG_MULTICAST ##
+ , . to
+ , .
+ - 50 .</P>
+ <P class=code>LPS ## to ## email <BR>LPS ## message ##
+ <BR>LPS ## rtf-message ##
+ ,
+ rtf-.
+ rtf- gzip base64 . : <PRE style="MARGIN: 0px 0px 0px 10px">BASE64(
+ GZIP(
+ UL LPS ( 2)
+ LPS rtf_text_with_all_rtf_headers_and_tags
+ LPS UL
+ )
+ )
+ </PRE>
+ <P></P>
+ <P class=pack2><U>:</U>
+ .
+ . , rtf ,
+ .</P>
+ <LI><U>:</U> <B> </B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_MESSAGE_ACK</SPAN><BR><U> :</U>
+ sc<BR><U>:</U></P>
+ <P class=code>UL ## msg_id ## (Sequence)
+ <BR>UL ## flags ##
+ MRIM_CS_MESSAGE<BR>LPS ## from ## <BR>LPS ## message ##
+ <BR>LPS ## rtf-message ##
+ </P>
+ <P class=pack2><U>:</U> </P>
+ <LI><U>:</U> <B> </B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_MESSAGE_RECV</SPAN><BR><U> :</U>
+ cs<BR><U>:</U></P>
+ <P class=code>LPS ## from ##<BR>UL ## msg_id ##</P>
+ <P class=pack2><U>:</U>
+ <SPAN class=c>MRIM_CS_MESSAGE_ACK</SPAN>, <SPAN
+ class=c>MRIM_CS_MESSAGE_ACK</SPAN> <SPAN
+ class=c>MESSAGE_FLAG_NORECV</SPAN>. <SPAN class=c>from</SPAN> <SPAN
+ class=c>msg_id</SPAN> <SPAN
+ class=c>MRIM_CS_MESSAGE_ACK</SPAN> . </P>
+ <LI><U>:</U> <B> </B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_MESSAGE_STATUS</SPAN><BR><U> :</U> sc<BR>
+ seq seq <SPAN
+ class=c>MRIM_CS_MESSAGE</SPAN><BR><U>:</U></P>
+ <P class=code>UL ## status ## ##</P>
+ <P class=code style="MARGIN-LEFT: 20px">MESSAGE_DELIVERED ##
+ <BR>MESSAGE_REJECTED_INTERR ##
+ <BR>MESSAGE_REJECTED_NOUSER ##
+ - <BR>MESSAGE_REJECTED_LIMIT_EXCEEDED ##
+ - ,
+ <BR>MESSAGE_REJECTED_TOO_LARGE ##
+
+ <BR>MESSAGE_REJECTED_DENY_OFFMSG ## -
+ ,
+ </P>
+ <P class=pack2><U>:</U>
+ .
+ . <SPAN
+ class=c>MRIM_CS_MESSAGE_STATUS</SPAN>
+ ,
+ -
+ . </P>
+ <LI><U>:</U> <B> </B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_USER_STATUS</SPAN><BR><U> :</U>
+ sc<BR><U>:</U></P>
+ <P class=code>UL ## status ## ##</P>
+ <P class=code style="MARGIN-LEFT: 20px">STATUS_OFFLINE ##
+ <BR>STATUS_ONLINE ##
+ <BR>STATUS_AWAY ## ,
+ <BR>STATUS_UNDETERMINATED ##
+ <BR>STATUS_FLAG_INVISIBLE ##
+ , ,
+ .</P>LPS ## user ## email
+
+ <P></P>
+ <P class=pack2><U>:</U>
+ ,
+ - ( " " ,
+ ).
+ -.
+ . </P>
+ <LI><U>:</U> <B> </B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_LOGOUT</SPAN><BR><U> :</U>
+ sc<BR><U>:</U></P>
+ <P class=code>UL ## reason ## ##</P>
+ <P class=code style="MARGIN-LEFT: 20px">LOGOUT_NO_RELOGIN_FLAG ##
+ - .
+ .</P>
+ <LI><U>:</U> <B> </B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_CONNECTION_PARAM</SPAN><BR><U> :</U>
+ sc<BR><U>:</U></P>
+ <P class=code>UL ## ping_period ##
+ </P>
+ <P class=pack2><U>:</U> <SPAN
+ class=c>MRIM_CS_PING</SPAN>
+ . </P>
+ <LI><U>:</U> <B> </B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_ADD_CONTACT</SPAN><BR><U> :</U>
+ cs<BR><U>:</U></P>
+ <P class=code>UL ## flags ## ##</P>
+ <P class=code style="MARGIN-LEFT: 20px">CONTACT_FLAG_GROUP ##
+ , ( ).
+
+ -<BR>CONTACT_FLAG_INVISIBLE ##
+ " "<BR>CONTACT_FLAG_VISIBLE ##
+ " "<BR>CONTACT_FLAG_IGNORE ##
+ <BR>CONTACT_FLAG_SHADOW ##
+ - (
+ )<BR>CONTACT_FLAG_REMOVED ## </P>
+ <P class=code>UL ## group_id ## ,
+ ( CONTACT_FLAG_GROUP 0)<BR>LPS ## email ##
+ ( CONTACT_FLAG_GROUP)<BR>LPS ## name ##
+ ( -,
+ CONTACT_FLAG_GROUP) LPS ## unused ##
+ </P>
+ <LI><U>:</U> <B> </B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_ADD_CONTACT_ACK</SPAN><BR><U> :</U>
+ sc<BR><U>:</U></P>
+ <P class=code>UL ## status ## ##</P>
+ <P class=code style="MARGIN-LEFT: 20px">CONTACT_OPER_SUCCESS ##
+ <BR>CONTACT_OPER_ERROR ##
+ <BR>CONTACT_OPER_INTERR ##
+ <BR>CONTACT_OPER_NO_SUCH_USER ##
+ <BR>CONTACT_OPER_INVALID_INFO ##
+ <BR>CONTACT_OPER_USER_EXISTS ##
+ -<BR>CONTACT_OPER_GROUP_LIMIT ##
+ (20)</P>
+ <P class=code>## UL ## contact_id ##
+ </P>
+ <P class=pack2><U>:</U> <SPAN
+ class=c>MRIM_CS_ADD_CONTACT</SPAN>. -1 <SPAN class=c>status</SPAN>
+ <SPAN class=c>CONTACT_OPER_SUCCESS</SPAN>. </P>
+ <LI><U>:</U> <B> </B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_MODIFY_CONTACT</SPAN><BR><U> :</U>
+ cs<BR><U>:</U></P>
+ <P class=code>UL ## id ## <BR>UL ## flags
+ ##<BR>UL ## group_id ## 0 <BR>LPS ## contact ##
+ , <BR>LPS ## name ## , </P>
+ <P class=pack2><U>:</U> , <SPAN
+ class=c>MRIM_CS_ADD_CONTACT</SPAN>. <SPAN class=c>contact</SPAN>
+ . </P>
+ <LI><U>:</U> <B> </B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_MODIFY_CONTACT_ACK</SPAN><BR><U> :</U>
+ sc<BR><U>:</U></P>
+ <P class=code>UL ## status ## .
+ , MRIM_CS_ADD_CONTACT_ACK</P>
+ <LI><U>:</U> <B> ,
+ </B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_OFFLINE_MESSAGE_ACK</SPAN><BR><U> :</U>
+ sc<BR><U>:</U></P>
+ <P class=code>UIDL ## uidl ## id <BR>LPS ## message ##
+ . RFC/822 .
+ From, Date,
+ X-MRIM-FLAGS,
+
+ Boundary.</P>
+ <P class=pack2><U>:</U>
+ ,
+ . </P>
+ <LI><U>:</U> <B> </B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_OFFLINE_MESSAGE_DEL</SPAN><BR><U> :</U>
+ cs<BR><U>:</U></P>
+ <P class=code>UIDL ## uidl</P>
+ <P class=pack2><U>:</U> <SPAN
+ class=c>MRIM_CS_OFFLINE_MESSAGE_ACK</SPAN> <SPAN
+ class=c>MRIM_CS_OFFLINE_MESSAGE_DEL</SPAN> <SPAN
+ class=c>uidl</SPAN>, .
+ .</P>
+ <LI><U>:</U> <B>
+ -</B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_AUTHORIZE</SPAN><BR><U> :</U>
+ cs<BR><U>:</U></P>
+ <P class=code>LPS ## user ## email </P>
+ <P class=pack2><U>:</U> , <SPAN
+ class=c>user</SPAN> -
+ . </P>
+ <LI><U>:</U> <B> </B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_AUTHORIZE_ACK</SPAN><BR><U> :</U>
+ sc<BR><U>:</U></P>
+ <P class=code>LPS ## user ## email </P>
+ <P class=pack2><U>:</U>
+ <SPAN class=c>MRIM_CS_AUTHORIZE</SPAN> <SPAN class=c>user</SPAN>
+ , <SPAN class=c>user</SPAN> . </P>
+ <LI><U>:</U> <B> </B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_CHANGE_STATUS</SPAN><BR><U> :</U>
+ cs<BR><U>:</U></P>
+ <P class=code>UL ## status ##
+ MRIM_CS_USER_STATUS,
+ STATUS_UNDETERMINATED STATUS_OFFLINE</P>
+ <LI><U>:</U> <B> web-</B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_GET_MPOP_SESSION</SPAN><BR><U> :</U>
+ cs<BR><U>:</U>
+ Mail.Ru
+ GET-, . </P>
+ <LI><U>:</U> <B> web-</B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_GET_MPOP_SESSION_ACK</SPAN><BR><U> :</U>
+ sc<BR><U>:</U></P>
+ <P class=code>UL ## status ## (1 - , 0 -
+ )<BR>LPS ## session ## </P>
+ <P class=pack2><U>:</U> URL
+ win.mail.ru/cgi-bin/auth?Login=email&amp;agent=. </P>
+ <LI><U>:</U> <B> </B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_WP_REQUEST</SPAN><BR><U> :</U>
+ cs<BR><U>:</U></P>
+ <P class=code>UL ## field ## ##</P>
+ <P class=code style="MARGIN-LEFT: 20px">MRIM_CS_WP_REQUEST_PARAM_USER ##
+ ( ),
+ <BR>MRIM_CS_WP_REQUEST_PARAM_DOMAIN ##
+ <BR>MRIM_CS_WP_REQUEST_PARAM_NICKNAME ##
+ <BR>MRIM_CS_WP_REQUEST_PARAM_FIRSTNAME ##
+ <BR>MRIM_CS_WP_REQUEST_PARAM_LASTNAME ## , *
+ //
+ <BR>MRIM_CS_WP_REQUEST_PARAM_SEX ## . 1 - , 2 -
+ <BR>MRIM_CS_WP_REQUEST_PARAM_DATE1 ## (
+ )<BR>MRIM_CS_WP_REQUEST_PARAM_DATE2 ## (
+ )<BR>MRIM_CS_WP_REQUEST_PARAM_CITY_ID ## ID
+ <BR>MRIM_CS_WP_REQUEST_PARAM_ZODIAC ## ( - 1, ...,
+ - 12)<BR>MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_MONTH ##
+ ( - 1, ..., - 12)<BR>MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_DAY
+ ## (
+ )<BR>MRIM_CS_WP_REQUEST_PARAM_COUNTRY_ID ## ID
+ <BR>MRIM_CS_WP_REQUEST_PARAM_ONLINE ##
+ (1)</P>
+ <P class=code>LPS ## value ,
+ </P>
+ <P class=pack2><U>:</U> .
+ -.
+ "", . .
+ .
+ (
+ )
+ ( <SPAN
+ class=c>MRIM_CS_WP_REQUEST_PARAM_ONLINE</SPAN> ).
+ </P>
+ <LI><U>:</U> <B> </B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_ANKETA_INFO</SPAN><BR><U> :</U>
+ cs<BR><U>:</U></P>
+ <P class=code>UL ## status ## ##</P>
+ <P class=code style="MARGIN-LEFT: 20px">MRIM_ANKETA_INFO_STATUS_OK ##
+ <BR>MRIM_ANKETA_INFO_STATUS_NOUSER ##
+ <BR>MRIM_ANKETA_INFO_STATUS_RATELIMERR ##
+ , </P>
+ <P class=code>UL ## fields_num ##
+ <BR>UL ## max_rows ##
+ ( ,
+ )<BR>UL ## server_time ## (
+ ). :
+ 00:00:00 1 1970 .<BR>LPS, LPS, ... ## fields ##
+ ( fields_num )<BR>LPS, LPS, ...
+ ## values ##
+ , , fields_num
+ </P>
+ <P class=pack2><U>:</U> .
+ ( ). </P>
+ <LI><U>:</U> <B> </B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_MAILBOX_STATUS</SPAN><BR><U> :</U>
+ sc<BR><U>:</U></P>
+ <P class=code>UL ## status ## </P>
+ <P class=pack2><U>:</U>
+ . </P>
+ <LI><U>:</U> <B>-</B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_CONTACT_LIST2</SPAN><BR><U> :</U>
+ sc<BR><U>:</U></P>
+ <P class=code>UL ## status ## -</P>
+ <P class=code style="MARGIN-LEFT: 20px">GET_CONTACTS_OK ##
+ <BR>GET_CONTACTS_ERROR ## -
+ <BR>GET_CONTACTS_INTERR ## </P>
+ <P class=code>UL ## groups_number ##
+ -<BR>LPS ## group_mask ## - ,
+ 's' (LPS),'u' (UL),'z' ( ,
+ ), "us" - ,
+ <BR>LPS ##
+ contacts_mask ## - (
+ group_mask), uussuu (, , , , ,
+ )<BR>## groups ## ( groups_number
+ )<BR>## contacts ## </P>
+ <P class=pack2><U>:</U> -
+ . -,
+ . ,
+ <SPAN class=c>MRIM_CS_ADD_CONTACT</SPAN>, - ,
+ <SPAN class=c>MRIM_CS_USER_STATUS</SPAN>.
+ - <SPAN class=c>CONTACT_INTFLAG_NOT_AUTHORIZED</SPAN>
+ ,
+ " ".
+ , ,
+ . </P>
+ <LI><U>:</U> <B></B>
+ <P class=pack2><U> :</U> <SPAN
+ class=c>MRIM_CS_LOGIN2</SPAN><BR><U> :</U>
+ cs<BR><U>:</U></P>
+ <P class=code>LPS ## login ## email <BR>LPS
+ ## password ## <BR>UL ## status ## (.
+ MRIM_CS_CHANGE_STATUS)<BR>LPS ## user_agent ##
+ , "Mail.Ru Miranda Plugin v
+ 1.0"</P></LI></UL><IMG height=10 src="Mail_ru .files/0.gif"
+ width=555><BR></TD><!-- END: MainCell --></TR></TBODY></TABLE>
+<TABLE cellSpacing=0 cellPadding=0 width="90%" align=center border=0>
+ <TBODY>
+ <TR>
+ <TD align=middle width="100%">
+ <DIV class=plash>
+ <DIV class=cor><IMG height=1 src="Mail_ru .files/1.gif"
+width=1></DIV>
+ <TABLE class=footer cellSpacing=0 cellPadding=0 width="96%" border=0>
+ <TBODY>
+ <TR>
+ <TD width="27%" height=20> 1999-2004, <A href="http://www.mail.ru/"
+ target=_blank>Mail.Ru</A></TD>
+ <TD align=middle width="37%"><A
+ href="http://win.mail.ru/cgi-bin/support_mra?version=www"
+ target=_blank> </A></TD>
+ <TD align=right width="30%" height=20><A
+ href="http://sales.mail.ru/" target=_top> Mail.ru</A>
+ <B></B> <A href="http://corp.mail.ru/" target=_top>
+ </A></TD></TR></TBODY></TABLE><IMG height=1
+ src="Mail_ru .files/0.gif" width=760><BR>
+ <DIV class=cor><IMG height=1 src="Mail_ru .files/1.gif"
+ width=1></DIV></DIV></TD></TR></TBODY></TABLE><BR
+style="LINE-HEIGHT: 30px"></CENTER><!--//-->
+<SCRIPT>PrxRST();</SCRIPT>
+</BODY></HTML>
diff --git a/protocols/MRA/Docs/MraPlaces.h b/protocols/MRA/Docs/MraPlaces.h
new file mode 100644
index 0000000000..b51e4151b9
--- /dev/null
+++ b/protocols/MRA/Docs/MraPlaces.h
@@ -0,0 +1,3174 @@
+#if !defined(AFX_MRA_PLACES_H__INCLUDED_)
+#define AFX_MRA_PLACES_H__INCLUDED_
+
+
+
+typedef struct
+{
+ DWORD dwCountryID;
+ DWORD dwCityID;
+ DWORD dwPlaceID;
+ LPWSTR lpszData;
+} MRA_PLACE;
+
+
+
+MRA_PLACE mrapPlaces[]=
+{
+ {24, 0, 0, L""},
+ {81, 0, 0, L""},
+ {82, 0, 0, L""},
+ {97, 0, 0, L""},
+ {96, 0, 0, L""},
+ {99, 0, 0, L""},
+ {100, 0, 0, L"-"},
+ {101, 0, 0, L""},
+ {102, 0, 0, L""},
+ {83, 0, 0, L""},
+ {86, 0, 0, L""},
+ {95, 0, 0, L""},
+ {103, 0, 0, L""},
+ {79, 0, 0, L""},
+ {85, 0, 0, L""},
+ {87, 0, 0, L""},
+ {104, 0, 0, L""},
+ {84, 0, 0, L""},
+ {105, 0, 0, L""},
+ {106, 0, 0, L""},
+ {107, 0, 0, L""},
+ {92, 0, 0, L" ()"},
+ {76, 0, 0, L""},
+ {3215, 0, 0, L" (.)"},
+ {29, 0, 0, L" ()"},
+ {108, 0, 0, L""},
+ {88, 0, 0, L""},
+ {109, 0, 0, L""},
+ {110, 0, 0, L""},
+ {111, 0, 0, L""},
+ {112, 0, 0, L""},
+ {113, 0, 0, L""},
+ {114, 0, 0, L""},
+ {115, 0, 0, L""},
+ {116, 0, 0, L" "},
+ {117, 0, 0, L""},
+ {3216, 0, 0, L" (.)"},
+ {122, 0, 0, L""},
+ {89, 0, 0, L""},
+ {94, 0, 0, L" "},
+ {118, 0, 0, L""},
+ {78, 0, 0, L""},
+ {91, 0, 0, L""},
+ {119, 0, 0, L""},
+ {120, 0, 0, L""},
+ {132, 0, 0, L""},
+ {90, 0, 0, L""},
+ {77, 0, 0, L""},
+ {93, 0, 0, L""},
+ {121, 0, 0, L""},
+ {98, 0, 0, L" "},
+ {75, 0, 0, L""},
+ {123, 0, 0, L""},
+ {454, 0, 0, L" "},
+ {124, 0, 0, L""},
+ {453, 0, 0, L" ()"},
+ {126, 0, 0, L""},
+ {127, 0, 0, L" "},
+ {128, 0, 0, L" ( )"},
+ {129, 0, 0, L""},
+ {3220, 0, 0, L" (..)"},
+ {130, 0, 0, L" "},
+ {3218, 0, 0, L" (.)"},
+ {3221, 0, 0, L" (..)"},
+ {3230, 0, 0, L" (.)"},
+ {131, 0, 0, L""},
+ {133, 0, 0, L" - "},
+ {3222, 0, 0, L" (.)"},
+ {125, 0, 0, L""},
+ {3219, 0, 0, L". ()"},
+ {134, 0, 0, L" "},
+ {3223, 0, 0, L" (..)"},
+ {135, 0, 0, L""},
+ {136, 0, 0, L""},
+ {3224, 0, 0, L" (.)"},
+ {137, 0, 0, L""},
+ {3226, 0, 0, L" "},
+ {3225, 0, 0, L" "},
+ {138, 0, 0, L""},
+ {139, 0, 0, L""},
+ {3200, 0, 0, L" (.)"},
+ {140, 0, 0, L" "},
+ {141, 0, 0, L""},
+ {3202, 0, 0, L" (.)"},
+ {142, 0, 0, L""},
+ {143, 0, 0, L""},
+ {146, 0, 0, L""},
+ {3203, 0, 0, L" (.)"},
+ {144, 0, 0, L""},
+ {145, 0, 0, L""},
+ {147, 0, 0, L""},
+ {3204, 0, 0, L" (.)"},
+ {452, 0, 0, L" ()"},
+ {149, 0, 0, L""},
+ {148, 0, 0, L""},
+ {3205, 0, 0, L" (.)"},
+ {173, 0, 0, L""},
+ {150, 0, 0, L""},
+ {151, 0, 0, L""},
+ {152, 0, 0, L" (.)"},
+ {153, 0, 0, L""},
+ {154, 0, 0, L" "},
+ {155, 0, 0, L""},
+ {156, 0, 0, L"-"},
+ {157, 0, 0, L""},
+ {3208, 0, 0, L" (.)"},
+ {158, 0, 0, L""},
+ {3209, 0, 0, L" ()"},
+ {3201, 0, 0, L" "},
+ {159, 0, 0, L""},
+ {3207, 0, 0, L" (.)"},
+ {3211, 0, 0, L" (.)"},
+ {160, 0, 0, L""},
+ {161, 0, 0, L""},
+ {162, 0, 0, L""},
+ {163, 0, 0, L""},
+ {164, 0, 0, L"- "},
+ {165, 0, 0, L"- "},
+ {166, 0, 0, L"-"},
+ {3210, 0, 0, L"- (.)"},
+ {167, 0, 0, L""},
+ {168, 0, 0, L" "},
+ {169, 0, 0, L""},
+ {3212, 0, 0, L" (.)"},
+ {3206, 0, 0, L" "},
+ {170, 0, 0, L""},
+ {171, 0, 0, L""},
+ {3213, 0, 0, L". . - (.)"},
+ {172, 0, 0, L""},
+ {174, 0, 0, L""},
+ {175, 0, 0, L""},
+ {176, 0, 0, L""},
+ {177, 0, 0, L""},
+ {3228, 0, 0, L" "},
+ {178, 0, 0, L"-"},
+ {179, 0, 0, L""},
+ {180, 0, 0, L""},
+ {181, 0, 0, L""},
+ {182, 0, 0, L""},
+ {183, 0, 0, L""},
+ {184, 0, 0, L"-"},
+ {185, 0, 0, L""},
+ {186, 0, 0, L""},
+ {187, 0, 0, L""},
+ {3198, 0, 0, L". "},
+ {23, 0, 0, L""},
+ {188, 0, 0, L"-"},
+ {189, 0, 0, L""},
+ {190, 0, 0, L""},
+ {191, 0, 0, L""},
+ {193, 0, 0, L" ()"},
+ {192, 0, 0, L""},
+ {194, 0, 0, L"-`"},
+ {195, 0, 0, L""},
+ {196, 0, 0, L""},
+ {197, 0, 0, L""},
+ {198, 0, 0, L""},
+ {199, 0, 0, L""},
+ {200, 0, 0, L""},
+ {3229, 0, 0, L" (.)"},
+ {201, 0, 0, L""},
+ {202, 0, 0, L""},
+ {203, 0, 0, L""},
+ {204, 0, 0, L""},
+ {205, 0, 0, L""},
+ {206, 0, 0, L""},
+ {207, 0, 0, L""},
+ {3227, 0, 0, L" (.)"},
+ {3197, 0, 0, L" (.)"},
+ {208, 0, 0, L""},
+ {209, 0, 0, L"- "},
+ {210, 0, 0, L""},
+ {3199, 0, 0, L" (.)"},
+ {211, 0, 0, L""},
+ {212, 0, 0, L""},
+ {213, 0, 0, L""},
+ {214, 0, 0, L""},
+ {215, 0, 0, L"-"},
+ {216, 0, 0, L""},
+ {217, 0, 0, L""},
+ {218, 0, 0, L""},
+ {219, 0, 0, L""},
+ {220, 0, 0, L" "},
+ {222, 0, 0, L""},
+ {223, 0, 0, L" "},
+ {221, 0, 0, L""},
+ {224, 0, 0, L""},
+ {225, 0, 0, L"- ()"},
+ {39, 0, 0, L""},
+ {40, 0, 0, L""},
+ {32, 0, 0, L""},
+ {33, 0, 0, L""},
+ {340, 0, 0, L""},
+ {38, 0, 0, L""},
+ {41, 0, 0, L""},
+ {42, 0, 0, L" "},
+ {43, 0, 0, L""},
+ {45, 0, 0, L""},
+ {44, 0, 0, L""},
+ {46, 0, 0, L""},
+ {3193, 0, 0, L" (.)"},
+ {47, 0, 0, L" (.)"},
+ {48, 0, 0, L""},
+ {49, 0, 0, L""},
+ {3194, 0, 0, L" (.)"},
+ {50, 0, 0, L""},
+ {51, 0, 0, L""},
+ {34, 0, 0, L""},
+ {52, 0, 0, L""},
+ {53, 0, 0, L""},
+ {54, 0, 0, L""},
+ {55, 0, 0, L""},
+ {56, 0, 0, L""},
+ {57, 0, 0, L""},
+ {58, 0, 0, L""},
+ {59, 0, 0, L""},
+ {36, 0, 0, L""},
+ {60, 0, 0, L""},
+ {61, 0, 0, L""},
+ {3195, 0, 0, L" (.)"},
+ {62, 0, 0, L""},
+ {35, 0, 0, L""},
+ {63, 0, 0, L""},
+ {64, 0, 0, L"-"},
+ {74, 0, 0, L" "},
+ {65, 0, 0, L""},
+ {66, 0, 0, L""},
+ {67, 0, 0, L" - ()"},
+ {68, 0, 0, L""},
+ {37, 0, 0, L""},
+ {69, 0, 0, L""},
+ {70, 0, 0, L""},
+ {71, 0, 0, L""},
+ {72, 0, 0, L""},
+ {3196, 0, 0, L" (.)"},
+ {73, 0, 0, L""},
+ {24, 25, 0, L""},
+ {24, 226, 0, L"-"},
+ {24, 233, 0, L" ()"},
+ {24, 232, 0, L" "},
+ {24, 235, 0, L" "},
+ {24, 227, 0, L" ."},
+ {24, 229, 0, L" ."},
+ {24, 231, 0, L" ."},
+ {24, 234, 0, L" ."},
+ {24, 228, 0, L" "},
+ {24, 230, 0, L" "},
+ {24, 236, 0, L" "},
+ {24, 237, 0, L""},
+ {24, 240, 0, L"-"},
+ {24, 241, 0, L""},
+ {24, 248, 0, L""},
+ {24, 249, 0, L""},
+ {24, 251, 0, L""},
+ {24, 238, 0, L" ."},
+ {24, 242, 0, L" ."},
+ {24, 243, 0, L" ."},
+ {24, 244, 0, L" ."},
+ {24, 245, 0, L" ."},
+ {24, 246, 0, L" ."},
+ {24, 247, 0, L" ."},
+ {24, 250, 0, L" ."},
+ {24, 239, 0, L"- "},
+ {24, 255, 0, L""},
+ {24, 256, 0, L""},
+ {24, 252, 0, L" ."},
+ {24, 253, 0, L" ."},
+ {24, 254, 0, L" ."},
+ {24, 257, 0, L" ."},
+ {24, 258, 0, L" ."},
+ {24, 260, 0, L" ."},
+ {24, 261, 0, L" ."},
+ {24, 259, 0, L" "},
+ {24, 265, 0, L""},
+ {24, 263, 0, L" "},
+ {24, 273, 0, L""},
+ {24, 275, 0, L""},
+ {24, 264, 0, L" "},
+ {24, 268, 0, L" "},
+ {24, 266, 0, L" ."},
+ {24, 267, 0, L" ."},
+ {24, 269, 0, L" ."},
+ {24, 270, 0, L" ."},
+ {24, 272, 0, L" ."},
+ {24, 276, 0, L" ."},
+ {24, 262, 0, L" "},
+ {24, 271, 0, L" "},
+ {24, 274, 0, L"- "},
+ {24, 277, 0, L" "},
+ {24, 278, 0, L" ."},
+ {24, 279, 0, L" ."},
+ {24, 280, 0, L" ."},
+ {24, 282, 0, L" ."},
+ {24, 281, 0, L"- - "},
+ {24, 283, 0, L"- "},
+ {24, 284, 0, L" ."},
+ {24, 285, 0, L" ."},
+ {24, 286, 0, L" ."},
+ {24, 287, 0, L" ."},
+ {24, 288, 0, L" ."},
+ {24, 289, 0, L" ."},
+ {24, 290, 0, L" ."},
+ {24, 291, 0, L" ."},
+ {24, 292, 0, L" ."},
+ {24, 293, 0, L" ."},
+ {24, 294, 0, L" ."},
+ {24, 295, 0, L" ."},
+ {24, 296, 0, L" ."},
+ {24, 297, 0, L" ."},
+ {24, 298, 0, L" ."},
+ {24, 299, 0, L" ."},
+ {24, 300, 0, L" ."},
+ {24, 301, 0, L""},
+ {24, 304, 0, L""},
+ {24, 305, 0, L""},
+ {24, 306, 0, L"-"},
+ {24, 307, 0, L""},
+ {24, 308, 0, L"-"},
+ {24, 311, 0, L" - "},
+ {24, 313, 0, L""},
+ {24, 309, 0, L" "},
+ {24, 312, 0, L" "},
+ {24, 302, 0, L" ."},
+ {24, 303, 0, L" ."},
+ {24, 310, 0, L" ."},
+ {81, 1055, 0, L""},
+ {81, 1058, 0, L""},
+ {81, 1056, 0, L""},
+ {81, 1057, 0, L""},
+ {81, 3153, 0, L""},
+ {81, 2291, 0, L""},
+ {82, 2932, 0, L""},
+ {82, 1060, 0, L""},
+ {82, 3084, 0, L""},
+ {82, 3011, 0, L""},
+ {82, 3306, 0, L""},
+ {82, 1059, 0, L""},
+ {82, 3145, 0, L""},
+ {82, 2292, 0, L""},
+ {97, 1061, 0, L""},
+ {97, 2293, 0, L""},
+ {96, 1062, 0, L""},
+ {96, 2294, 0, L""},
+ {99, 1063, 0, L""},
+ {99, 2295, 0, L""},
+ {100, 1064, 0, L"--"},
+ {100, 2296, 0, L""},
+ {101, 1065, 0, L""},
+ {101, 2297, 0, L""},
+ {102, 1066, 0, L""},
+ {102, 2298, 0, L""},
+ {83, 1067, 0, L""},
+ {83, 3158, 0, L""},
+ {83, 1068, 0, L""},
+ {83, 3129, 0, L""},
+ {83, 1069, 0, L""},
+ {83, 1070, 0, L""},
+ {83, 2299, 0, L""},
+ {86, 3345, 0, L""},
+ {86, 1071, 0, L""},
+ {86, 2992, 0, L""},
+ {86, 3175, 0, L""},
+ {86, 3363, 0, L"-"},
+ {86, 2884, 0, L"-"},
+ {86, 3243, 0, L"-"},
+ {86, 1074, 0, L"-"},
+ {86, 3348, 0, L""},
+ {86, 3241, 0, L""},
+ {86, 1075, 0, L""},
+ {86, 3350, 0, L"-"},
+ {86, 2982, 0, L""},
+ {86, 2971, 0, L"-"},
+ {86, 3136, 0, L""},
+ {86, 1080, 0, L""},
+ {86, 3303, 0, L""},
+ {86, 3050, 0, L""},
+ {86, 3151, 0, L" "},
+ {86, 3141, 0, L""},
+ {86, 3012, 0, L" "},
+ {86, 1081, 0, L""},
+ {86, 1077, 0, L"-"},
+ {86, 1079, 0, L""},
+ {86, 1078, 0, L""},
+ {86, 1076, 0, L""},
+ {86, 2929, 0, L""},
+ {86, 2928, 0, L""},
+ {86, 2300, 0, L""},
+ {95, 3315, 0, L""},
+ {95, 1082, 0, L""},
+ {95, 1083, 0, L""},
+ {95, 3144, 0, L""},
+ {95, 3025, 0, L""},
+ {95, 3277, 0, L""},
+ {95, 1084, 0, L""},
+ {95, 2301, 0, L""},
+ {103, 1085, 0, L""},
+ {103, 2302, 0, L""},
+ {79, 1086, 0, L""},
+ {79, 2303, 0, L""},
+ {85, 1087, 0, L""},
+ {85, 2304, 0, L""},
+ {87, 1088, 0, L""},
+ {87, 2305, 0, L""},
+ {104, 1089, 0, L""},
+ {104, 2306, 0, L""},
+ {84, 1090, 0, L""},
+ {84, 1091, 0, L""},
+ {84, 1092, 0, L"-"},
+ {84, 3242, 0, L""},
+ {84, 1093, 0, L""},
+ {84, 1094, 0, L" ()"},
+ {84, 1095, 0, L""},
+ {84, 3245, 0, L""},
+ {84, 3083, 0, L""},
+ {84, 1096, 0, L""},
+ {84, 1097, 0, L""},
+ {84, 1098, 0, L""},
+ {84, 1099, 0, L""},
+ {84, 2868, 0, L""},
+ {84, 1100, 0, L""},
+ {84, 1101, 0, L" (.-. .)"},
+ {84, 1102, 0, L""},
+ {84, 1103, 0, L""},
+ {84, 1104, 0, L""},
+ {84, 3166, 0, L""},
+ {84, 1105, 0, L"-"},
+ {84, 2927, 0, L""},
+ {84, 1106, 0, L""},
+ {84, 1107, 0, L""},
+ {84, 1108, 0, L"-"},
+ {84, 1109, 0, L""},
+ {84, 1110, 0, L""},
+ {84, 2307, 0, L""},
+ {105, 1111, 0, L""},
+ {105, 2308, 0, L""},
+ {106, 1112, 0, L""},
+ {106, 2309, 0, L""},
+ {107, 1113, 0, L""},
+ {107, 1114, 0, L""},
+ {107, 1115, 0, L""},
+ {107, 2954, 0, L""},
+ {107, 2310, 0, L""},
+ {92, 1116, 0, L""},
+ {92, 1117, 0, L"-"},
+ {92, 3027, 0, L"-"},
+ {92, 1118, 0, L""},
+ {92, 1119, 0, L""},
+ {92, 1120, 0, L""},
+ {92, 2933, 0, L""},
+ {92, 2311, 0, L""},
+ {76, 3214, 0, L" ()"},
+ {76, 1121, 0, L""},
+ {76, 2869, 0, L""},
+ {76, 3262, 0, L""},
+ {76, 1122, 0, L""},
+ {76, 1123, 0, L""},
+ {76, 1124, 0, L""},
+ {76, 3043, 0, L""},
+ {76, 2312, 0, L""},
+ {29, 1125, 0, L""},
+ {29, 2313, 0, L""},
+ {108, 1126, 0, L""},
+ {108, 3240, 0, L""},
+ {108, 2314, 0, L""},
+ {88, 1127, 0, L"-"},
+ {88, 2315, 0, L""},
+ {109, 1128, 0, L""},
+ {109, 2316, 0, L""},
+ {110, 1129, 0, L""},
+ {110, 2317, 0, L""},
+ {111, 1130, 0, L"-"},
+ {111, 1131, 0, L"-"},
+ {111, 2318, 0, L""},
+ {112, 1132, 0, L""},
+ {112, 2319, 0, L""},
+ {113, 1133, 0, L"-"},
+ {113, 1134, 0, L""},
+ {113, 2320, 0, L""},
+ {114, 1135, 0, L""},
+ {114, 2321, 0, L""},
+ {115, 1136, 0, L""},
+ {115, 2322, 0, L""},
+ {116, 1137, 0, L"-"},
+ {116, 1138, 0, L""},
+ {116, 1139, 0, L""},
+ {116, 2323, 0, L""},
+ {117, 1140, 0, L""},
+ {117, 2324, 0, L""},
+ {122, 1141, 0, L""},
+ {122, 2325, 0, L""},
+ {89, 1072, 0, L""},
+ {89, 1073, 0, L""},
+ {89, 1142, 0, L""},
+ {89, 2326, 0, L""},
+ {94, 3250, 0, L""},
+ {94, 1143, 0, L"-"},
+ {94, 2327, 0, L""},
+ {78, 1144, 0, L""},
+ {78, 2328, 0, L""},
+ {91, 1145, 0, L""},
+ {91, 3307, 0, L""},
+ {91, 3308, 0, L""},
+ {91, 2329, 0, L""},
+ {119, 1146, 0, L""},
+ {119, 1147, 0, L""},
+ {119, 2330, 0, L""},
+ {120, 1148, 0, L""},
+ {120, 2331, 0, L""},
+ {132, 1149, 0, L""},
+ {132, 2332, 0, L""},
+ {90, 1150, 0, L""},
+ {90, 3079, 0, L""},
+ {90, 2333, 0, L""},
+ {77, 1152, 0, L""},
+ {77, 1153, 0, L""},
+ {77, 3080, 0, L""},
+ {77, 1151, 0, L""},
+ {77, 1154, 0, L""},
+ {77, 1155, 0, L""},
+ {77, 2334, 0, L""},
+ {93, 3362, 0, L""},
+ {93, 3137, 0, L""},
+ {93, 3273, 0, L""},
+ {93, 1156, 0, L""},
+ {93, 1157, 0, L""},
+ {93, 3167, 0, L""},
+ {93, 3347, 0, L""},
+ {93, 1158, 0, L""},
+ {93, 1159, 0, L""},
+ {93, 1160, 0, L""},
+ {93, 1161, 0, L""},
+ {93, 1162, 0, L""},
+ {93, 1163, 0, L""},
+ {93, 1164, 0, L""},
+ {93, 2335, 0, L""},
+ {121, 1165, 0, L""},
+ {121, 3319, 0, L""},
+ {121, 2336, 0, L""},
+ {98, 1166, 0, L""},
+ {98, 2337, 0, L""},
+ {75, 3176, 0, L""},
+ {75, 3339, 0, L""},
+ {75, 1167, 0, L""},
+ {75, 1168, 0, L""},
+ {75, 2338, 0, L""},
+ {123, 1914, 0, L""},
+ {123, 2957, 0, L" "},
+ {123, 1915, 0, L""},
+ {123, 3331, 0, L""},
+ {123, 1916, 0, L""},
+ {123, 3001, 0, L""},
+ {123, 1917, 0, L""},
+ {123, 3217, 0, L""},
+ {123, 3064, 0, L""},
+ {123, 3020, 0, L" "},
+ {123, 1918, 0, L""},
+ {123, 3238, 0, L""},
+ {123, 2339, 0, L""},
+ {454, 1192, 0, L"-"},
+ {454, 2366, 0, L""},
+ {124, 1919, 0, L"-"},
+ {124, 2340, 0, L""},
+ {453, 1193, 0, L""},
+ {453, 2368, 0, L""},
+ {126, 1921, 0, L""},
+ {126, 2342, 0, L""},
+ {127, 1922, 0, L""},
+ {127, 2343, 0, L""},
+ {128, 1923, 0, L""},
+ {128, 2344, 0, L""},
+ {129, 1924, 0, L""},
+ {129, 2345, 0, L""},
+ {130, 1925, 0, L""},
+ {130, 1926, 0, L""},
+ {130, 1928, 0, L""},
+ {130, 1929, 0, L""},
+ {130, 3235, 0, L""},
+ {130, 1927, 0, L""},
+ {130, 3323, 0, L""},
+ {130, 2346, 0, L""},
+ {131, 1930, 0, L""},
+ {131, 2347, 0, L""},
+ {133, 1931, 0, L"-"},
+ {133, 2348, 0, L""},
+ {125, 1920, 0, L""},
+ {125, 2341, 0, L""},
+ {134, 1932, 0, L""},
+ {134, 2349, 0, L""},
+ {135, 1933, 0, L""},
+ {135, 2350, 0, L""},
+ {136, 1934, 0, L""},
+ {136, 2351, 0, L""},
+ {137, 1935, 0, L""},
+ {137, 2352, 0, L""},
+ {138, 3055, 0, L""},
+ {138, 3049, 0, L""},
+ {138, 3330, 0, L""},
+ {138, 1169, 0, L""},
+ {138, 3106, 0, L""},
+ {138, 1170, 0, L""},
+ {138, 1171, 0, L""},
+ {138, 1172, 0, L""},
+ {138, 3365, 0, L""},
+ {138, 1173, 0, L""},
+ {138, 3104, 0, L""},
+ {138, 3366, 0, L""},
+ {138, 1174, 0, L""},
+ {138, 2964, 0, L""},
+ {138, 3113, 0, L""},
+ {138, 1175, 0, L""},
+ {138, 2920, 0, L"-"},
+ {138, 2889, 0, L"-"},
+ {138, 1176, 0, L""},
+ {138, 2903, 0, L" "},
+ {138, 1177, 0, L""},
+ {138, 1178, 0, L""},
+ {138, 2946, 0, L""},
+ {138, 1179, 0, L""},
+ {138, 1180, 0, L""},
+ {138, 2353, 0, L""},
+ {139, 407, 0, L""},
+ {139, 426, 0, L""},
+ {139, 378, 0, L""},
+ {139, 412, 0, L""},
+ {139, 446, 0, L""},
+ {139, 434, 0, L""},
+ {139, 416, 0, L""},
+ {139, 428, 0, L""},
+ {139, 440, 0, L""},
+ {139, 352, 0, L""},
+ {139, 394, 0, L""},
+ {139, 374, 0, L""},
+ {139, 448, 0, L""},
+ {139, 390, 0, L""},
+ {139, 402, 0, L""},
+ {139, 396, 0, L" "},
+ {139, 370, 0, L""},
+ {139, 368, 0, L""},
+ {139, 444, 0, L""},
+ {139, 388, 0, L""},
+ {139, 408, 0, L""},
+ {139, 430, 0, L""},
+ {139, 358, 0, L""},
+ {139, 418, 0, L""},
+ {139, 354, 0, L""},
+ {139, 376, 0, L""},
+ {139, 414, 0, L""},
+ {139, 380, 0, L""},
+ {139, 372, 0, L""},
+ {139, 424, 0, L""},
+ {139, 348, 0, L""},
+ {139, 392, 0, L""},
+ {139, 386, 0, L""},
+ {139, 438, 0, L""},
+ {139, 362, 0, L"-"},
+ {139, 360, 0, L"-"},
+ {139, 432, 0, L"-"},
+ {139, 350, 0, L"-"},
+ {139, 366, 0, L""},
+ {139, 420, 0, L""},
+ {139, 442, 0, L""},
+ {139, 364, 0, L""},
+ {139, 450, 0, L"-"},
+ {139, 356, 0, L"-"},
+ {139, 382, 0, L" "},
+ {139, 398, 0, L" "},
+ {139, 410, 0, L""},
+ {139, 422, 0, L""},
+ {139, 406, 0, L" "},
+ {139, 404, 0, L""},
+ {139, 384, 0, L" "},
+ {139, 400, 0, L" "},
+ {139, 436, 0, L""},
+ {140, 1238, 0, L"-"},
+ {140, 2442, 0, L""},
+ {141, 1239, 0, L"-"},
+ {141, 2441, 0, L""},
+ {142, 1240, 0, L""},
+ {142, 2440, 0, L""},
+ {143, 1241, 0, L""},
+ {143, 2439, 0, L""},
+ {146, 1242, 0, L""},
+ {146, 2438, 0, L""},
+ {144, 1243, 0, L"-"},
+ {144, 2437, 0, L""},
+ {145, 1244, 0, L""},
+ {145, 3094, 0, L" "},
+ {145, 1245, 0, L"--"},
+ {145, 1246, 0, L"-"},
+ {145, 2436, 0, L""},
+ {147, 1247, 0, L""},
+ {147, 2435, 0, L""},
+ {452, 1190, 0, L"-"},
+ {452, 2364, 0, L""},
+ {149, 1248, 0, L"--"},
+ {149, 2434, 0, L""},
+ {148, 1249, 0, L""},
+ {148, 2433, 0, L""},
+ {173, 1250, 0, L""},
+ {173, 2432, 0, L""},
+ {150, 1251, 0, L""},
+ {150, 2431, 0, L""},
+ {151, 1252, 0, L"-"},
+ {151, 2430, 0, L""},
+ {152, 1253, 0, L""},
+ {152, 2429, 0, L""},
+ {153, 1254, 0, L""},
+ {153, 2428, 0, L""},
+ {154, 1255, 0, L"-"},
+ {154, 2427, 0, L""},
+ {155, 1256, 0, L""},
+ {155, 2426, 0, L""},
+ {156, 1257, 0, L"-"},
+ {156, 2425, 0, L""},
+ {157, 1258, 0, L""},
+ {157, 2424, 0, L""},
+ {158, 1259, 0, L""},
+ {158, 1260, 0, L""},
+ {158, 2423, 0, L""},
+ {159, 1261, 0, L""},
+ {159, 2422, 0, L""},
+ {160, 1262, 0, L""},
+ {160, 2421, 0, L""},
+ {161, 1263, 0, L""},
+ {161, 2420, 0, L""},
+ {162, 1264, 0, L""},
+ {162, 2419, 0, L""},
+ {163, 1265, 0, L"-"},
+ {163, 2418, 0, L""},
+ {164, 1266, 0, L""},
+ {164, 2417, 0, L""},
+ {165, 1267, 0, L""},
+ {165, 2416, 0, L""},
+ {166, 1268, 0, L""},
+ {166, 2415, 0, L""},
+ {167, 1269, 0, L""},
+ {167, 2414, 0, L""},
+ {168, 1270, 0, L"--"},
+ {168, 2413, 0, L""},
+ {169, 1271, 0, L""},
+ {169, 2412, 0, L""},
+ {170, 1272, 0, L""},
+ {170, 2411, 0, L""},
+ {171, 1273, 0, L""},
+ {171, 1274, 0, L""},
+ {171, 2410, 0, L""},
+ {172, 1275, 0, L""},
+ {172, 2409, 0, L""},
+ {174, 1854, 0, L""},
+ {174, 2495, 0, L""},
+ {175, 1855, 0, L""},
+ {175, 2494, 0, L""},
+ {176, 1856, 0, L""},
+ {176, 1857, 0, L"-"},
+ {176, 2493, 0, L""},
+ {177, 1858, 0, L""},
+ {177, 2492, 0, L""},
+ {178, 1859, 0, L""},
+ {178, 2491, 0, L""},
+ {179, 1860, 0, L""},
+ {179, 2490, 0, L""},
+ {180, 1861, 0, L""},
+ {180, 2489, 0, L""},
+ {181, 1862, 0, L""},
+ {181, 2488, 0, L""},
+ {182, 1863, 0, L""},
+ {182, 2487, 0, L""},
+ {183, 1864, 0, L""},
+ {183, 2486, 0, L""},
+ {184, 1865, 0, L""},
+ {184, 2485, 0, L""},
+ {185, 1866, 0, L""},
+ {185, 2484, 0, L""},
+ {186, 3312, 0, L""},
+ {186, 1867, 0, L""},
+ {186, 1868, 0, L""},
+ {186, 2483, 0, L""},
+ {187, 1869, 0, L""},
+ {187, 2482, 0, L""},
+ {23, 1870, 0, L""},
+ {23, 2481, 0, L""},
+ {188, 1871, 0, L""},
+ {188, 2480, 0, L""},
+ {189, 1872, 0, L""},
+ {189, 2479, 0, L""},
+ {190, 1873, 0, L""},
+ {190, 2478, 0, L""},
+ {191, 1874, 0, L""},
+ {191, 2477, 0, L""},
+ {193, 1875, 0, L""},
+ {193, 2476, 0, L""},
+ {192, 1876, 0, L""},
+ {192, 2475, 0, L""},
+ {194, 1877, 0, L""},
+ {194, 2474, 0, L""},
+ {195, 1878, 0, L""},
+ {195, 2473, 0, L""},
+ {196, 1879, 0, L""},
+ {196, 2472, 0, L""},
+ {197, 1880, 0, L""},
+ {197, 2471, 0, L""},
+ {198, 1881, 0, L"-"},
+ {198, 2470, 0, L""},
+ {199, 1882, 0, L""},
+ {199, 2469, 0, L""},
+ {200, 1883, 0, L""},
+ {200, 2468, 0, L""},
+ {201, 1884, 0, L""},
+ {201, 2467, 0, L""},
+ {202, 1885, 0, L""},
+ {202, 2466, 0, L""},
+ {203, 1886, 0, L""},
+ {203, 1887, 0, L""},
+ {203, 2465, 0, L""},
+ {204, 1888, 0, L""},
+ {204, 2464, 0, L""},
+ {205, 1889, 0, L""},
+ {205, 2463, 0, L""},
+ {206, 1890, 0, L""},
+ {206, 2462, 0, L""},
+ {207, 1891, 0, L""},
+ {207, 2461, 0, L""},
+ {208, 1892, 0, L""},
+ {208, 2460, 0, L""},
+ {209, 1893, 0, L"-"},
+ {209, 2459, 0, L""},
+ {210, 1894, 0, L""},
+ {210, 2458, 0, L""},
+ {211, 1895, 0, L""},
+ {211, 2457, 0, L""},
+ {212, 1896, 0, L""},
+ {212, 2456, 0, L""},
+ {213, 1897, 0, L""},
+ {213, 2455, 0, L""},
+ {214, 1898, 0, L""},
+ {214, 2454, 0, L""},
+ {215, 1899, 0, L""},
+ {215, 2453, 0, L""},
+ {216, 1900, 0, L"--"},
+ {216, 1901, 0, L""},
+ {216, 2452, 0, L""},
+ {217, 1902, 0, L""},
+ {217, 2451, 0, L""},
+ {218, 1903, 0, L""},
+ {218, 2450, 0, L""},
+ {219, 1904, 0, L""},
+ {219, 2449, 0, L""},
+ {220, 1905, 0, L""},
+ {220, 2448, 0, L""},
+ {222, 1906, 0, L""},
+ {222, 2447, 0, L""},
+ {223, 1907, 0, L""},
+ {223, 2446, 0, L""},
+ {221, 1908, 0, L""},
+ {221, 2445, 0, L""},
+ {224, 1909, 0, L"-"},
+ {224, 2444, 0, L""},
+ {225, 1910, 0, L""},
+ {225, 1913, 0, L""},
+ {225, 1912, 0, L""},
+ {225, 3033, 0, L""},
+ {225, 1911, 0, L""},
+ {225, 2443, 0, L""},
+ {39, 314, 0, L""},
+ {39, 315, 0, L" ."},
+ {39, 316, 0, L" ."},
+ {39, 317, 0, L" ."},
+ {39, 318, 0, L" ."},
+ {39, 319, 0, L" ."},
+ {39, 320, 0, L" ."},
+ {39, 321, 0, L" ."},
+ {39, 322, 0, L"- ."},
+ {39, 323, 0, L" ."},
+ {39, 324, 0, L" ."},
+ {39, 325, 0, L""},
+ {39, 326, 0, L" ."},
+ {39, 327, 0, L" ."},
+ {39, 328, 0, L" ."},
+ {39, 329, 0, L" ."},
+ {39, 330, 0, L" ."},
+ {39, 331, 0, L" ."},
+ {39, 332, 0, L" ."},
+ {39, 333, 0, L" ."},
+ {39, 334, 0, L" ."},
+ {39, 335, 0, L" ."},
+ {39, 336, 0, L" ."},
+ {39, 337, 0, L" ."},
+ {39, 338, 0, L" ."},
+ {39, 339, 0, L" ."},
+ {40, 602, 0, L" "},
+ {40, 604, 0, L""},
+ {40, 603, 0, L""},
+ {40, 608, 0, L""},
+ {40, 606, 0, L""},
+ {40, 3099, 0, L"--"},
+ {40, 605, 0, L""},
+ {40, 3174, 0, L""},
+ {40, 609, 0, L""},
+ {40, 607, 0, L""},
+ {40, 610, 0, L""},
+ {40, 611, 0, L""},
+ {40, 2541, 0, L""},
+ {32, 612, 0, L""},
+ {32, 2540, 0, L""},
+ {33, 613, 0, L"--"},
+ {33, 2539, 0, L""},
+ {340, 341, 0, L""},
+ {340, 342, 0, L" ."},
+ {340, 343, 0, L" ."},
+ {340, 344, 0, L" ."},
+ {340, 345, 0, L" ."},
+ {340, 346, 0, L" ."},
+ {340, 347, 0, L" ."},
+ {38, 760, 0, L""},
+ {38, 767, 0, L""},
+ {38, 762, 0, L""},
+ {38, 761, 0, L""},
+ {38, 763, 0, L""},
+ {38, 769, 0, L""},
+ {38, 765, 0, L""},
+ {38, 764, 0, L""},
+ {38, 3117, 0, L""},
+ {38, 766, 0, L""},
+ {38, 768, 0, L""},
+ {38, 2532, 0, L""},
+ {41, 3098, 0, L""},
+ {41, 792, 0, L""},
+ {41, 770, 0, L""},
+ {41, 771, 0, L""},
+ {41, 773, 0, L""},
+ {41, 776, 0, L"-"},
+ {41, 788, 0, L""},
+ {41, 789, 0, L""},
+ {41, 796, 0, L""},
+ {41, 777, 0, L""},
+ {41, 781, 0, L""},
+ {41, 786, 0, L""},
+ {41, 791, 0, L""},
+ {41, 793, 0, L""},
+ {41, 795, 0, L""},
+ {41, 787, 0, L""},
+ {41, 790, 0, L""},
+ {41, 3133, 0, L""},
+ {41, 794, 0, L""},
+ {41, 782, 0, L""},
+ {41, 780, 0, L""},
+ {41, 779, 0, L""},
+ {41, 774, 0, L""},
+ {41, 784, 0, L""},
+ {41, 772, 0, L""},
+ {41, 775, 0, L""},
+ {41, 3116, 0, L""},
+ {41, 785, 0, L""},
+ {41, 778, 0, L""},
+ {41, 783, 0, L""},
+ {41, 2531, 0, L""},
+ {42, 797, 0, L"-"},
+ {42, 799, 0, L""},
+ {42, 798, 0, L""},
+ {42, 800, 0, L""},
+ {42, 2530, 0, L""},
+ {45, 802, 0, L""},
+ {45, 3075, 0, L""},
+ {45, 801, 0, L""},
+ {45, 804, 0, L""},
+ {45, 803, 0, L""},
+ {45, 805, 0, L""},
+ {45, 3168, 0, L""},
+ {45, 806, 0, L""},
+ {45, 807, 0, L""},
+ {45, 808, 0, L""},
+ {45, 809, 0, L""},
+ {45, 3131, 0, L""},
+ {45, 810, 0, L""},
+ {45, 3342, 0, L""},
+ {45, 811, 0, L""},
+ {45, 812, 0, L""},
+ {45, 813, 0, L""},
+ {45, 814, 0, L""},
+ {45, 3089, 0, L""},
+ {45, 815, 0, L""},
+ {45, 816, 0, L""},
+ {45, 817, 0, L""},
+ {45, 818, 0, L""},
+ {45, 819, 0, L""},
+ {45, 820, 0, L""},
+ {45, 2976, 0, L""},
+ {45, 2988, 0, L""},
+ {45, 821, 0, L""},
+ {45, 3088, 0, L""},
+ {45, 822, 0, L""},
+ {45, 823, 0, L""},
+ {45, 824, 0, L""},
+ {45, 825, 0, L""},
+ {45, 3343, 0, L""},
+ {45, 2867, 0, L""},
+ {45, 2986, 0, L"-"},
+ {45, 826, 0, L""},
+ {45, 3063, 0, L""},
+ {45, 827, 0, L""},
+ {45, 3140, 0, L""},
+ {45, 828, 0, L""},
+ {45, 829, 0, L""},
+ {45, 830, 0, L""},
+ {45, 2529, 0, L""},
+ {44, 831, 0, L""},
+ {44, 832, 0, L""},
+ {44, 836, 0, L""},
+ {44, 835, 0, L""},
+ {44, 834, 0, L""},
+ {44, 833, 0, L""},
+ {44, 2528, 0, L""},
+ {46, 3007, 0, L""},
+ {46, 837, 0, L""},
+ {46, 838, 0, L"-"},
+ {46, 3371, 0, L""},
+ {46, 839, 0, L"-"},
+ {46, 840, 0, L""},
+ {46, 841, 0, L""},
+ {46, 3163, 0, L""},
+ {46, 842, 0, L""},
+ {46, 843, 0, L""},
+ {46, 3015, 0, L""},
+ {46, 844, 0, L""},
+ {46, 2921, 0, L""},
+ {46, 845, 0, L""},
+ {46, 846, 0, L""},
+ {46, 847, 0, L""},
+ {46, 848, 0, L""},
+ {46, 849, 0, L""},
+ {46, 3010, 0, L""},
+ {46, 850, 0, L""},
+ {46, 851, 0, L""},
+ {46, 3072, 0, L""},
+ {46, 852, 0, L""},
+ {46, 853, 0, L""},
+ {46, 854, 0, L""},
+ {46, 855, 0, L""},
+ {46, 3082, 0, L""},
+ {46, 3309, 0, L""},
+ {46, 856, 0, L""},
+ {46, 857, 0, L""},
+ {46, 3138, 0, L""},
+ {46, 858, 0, L""},
+ {46, 859, 0, L""},
+ {46, 2872, 0, L""},
+ {46, 2965, 0, L""},
+ {46, 3135, 0, L""},
+ {46, 3156, 0, L""},
+ {46, 3192, 0, L""},
+ {46, 860, 0, L""},
+ {46, 861, 0, L""},
+ {46, 2864, 0, L""},
+ {46, 862, 0, L""},
+ {46, 3009, 0, L""},
+ {46, 2993, 0, L""},
+ {46, 863, 0, L""},
+ {46, 864, 0, L""},
+ {46, 865, 0, L""},
+ {46, 866, 0, L""},
+ {46, 3191, 0, L""},
+ {46, 2974, 0, L"-"},
+ {46, 3127, 0, L""},
+ {46, 867, 0, L""},
+ {46, 868, 0, L""},
+ {46, 869, 0, L"--"},
+ {46, 3373, 0, L""},
+ {46, 3313, 0, L""},
+ {46, 870, 0, L""},
+ {46, 3045, 0, L""},
+ {46, 2906, 0, L""},
+ {46, 2527, 0, L""},
+ {48, 871, 0, L""},
+ {48, 873, 0, L""},
+ {48, 3147, 0, L""},
+ {48, 872, 0, L""},
+ {48, 3178, 0, L""},
+ {48, 2526, 0, L""},
+ {49, 3006, 0, L""},
+ {49, 874, 0, L""},
+ {49, 875, 0, L""},
+ {49, 3285, 0, L""},
+ {49, 876, 0, L""},
+ {49, 3126, 0, L""},
+ {49, 2525, 0, L""},
+ {50, 3377, 0, L""},
+ {50, 3067, 0, L""},
+ {50, 877, 0, L""},
+ {50, 3065, 0, L""},
+ {50, 3066, 0, L""},
+ {50, 878, 0, L""},
+ {50, 3069, 0, L""},
+ {50, 3068, 0, L""},
+ {50, 2524, 0, L""},
+ {51, 879, 0, L""},
+ {51, 2523, 0, L""},
+ {34, 880, 0, L""},
+ {34, 3125, 0, L""},
+ {34, 881, 0, L""},
+ {34, 890, 0, L""},
+ {34, 3076, 0, L""},
+ {34, 882, 0, L""},
+ {34, 3070, 0, L""},
+ {34, 888, 0, L""},
+ {34, 886, 0, L""},
+ {34, 891, 0, L"-"},
+ {34, 3310, 0, L" "},
+ {34, 883, 0, L""},
+ {34, 884, 0, L""},
+ {34, 885, 0, L""},
+ {34, 892, 0, L""},
+ {34, 3179, 0, L" "},
+ {34, 3177, 0, L"-"},
+ {34, 3289, 0, L"---"},
+ {34, 889, 0, L""},
+ {34, 887, 0, L""},
+ {34, 893, 0, L""},
+ {34, 2522, 0, L""},
+ {52, 3318, 0, L""},
+ {52, 3278, 0, L""},
+ {52, 906, 0, L""},
+ {52, 894, 0, L""},
+ {52, 895, 0, L""},
+ {52, 905, 0, L""},
+ {52, 896, 0, L""},
+ {52, 897, 0, L""},
+ {52, 3369, 0, L""},
+ {52, 3327, 0, L""},
+ {52, 898, 0, L""},
+ {52, 899, 0, L""},
+ {52, 907, 0, L""},
+ {52, 908, 0, L""},
+ {52, 900, 0, L""},
+ {52, 901, 0, L""},
+ {52, 3368, 0, L"-"},
+ {52, 3384, 0, L""},
+ {52, 3252, 0, L""},
+ {52, 902, 0, L""},
+ {52, 903, 0, L""},
+ {52, 3130, 0, L""},
+ {52, 904, 0, L""},
+ {52, 2521, 0, L""},
+ {53, 2939, 0, L""},
+ {53, 3054, 0, L""},
+ {53, 909, 0, L""},
+ {53, 2934, 0, L""},
+ {53, 913, 0, L""},
+ {53, 2935, 0, L""},
+ {53, 912, 0, L""},
+ {53, 2905, 0, L""},
+ {53, 911, 0, L""},
+ {53, 2936, 0, L""},
+ {53, 2937, 0, L""},
+ {53, 910, 0, L""},
+ {53, 2520, 0, L""},
+ {54, 914, 0, L""},
+ {54, 915, 0, L""},
+ {54, 916, 0, L""},
+ {54, 918, 0, L""},
+ {54, 919, 0, L""},
+ {54, 3173, 0, L""},
+ {54, 917, 0, L""},
+ {54, 2519, 0, L""},
+ {55, 920, 0, L""},
+ {55, 2518, 0, L""},
+ {56, 3376, 0, L""},
+ {56, 921, 0, L""},
+ {56, 2517, 0, L""},
+ {57, 3142, 0, L""},
+ {57, 922, 0, L""},
+ {57, 2516, 0, L""},
+ {58, 923, 0, L""},
+ {58, 3154, 0, L""},
+ {58, 924, 0, L""},
+ {58, 2515, 0, L""},
+ {59, 925, 0, L""},
+ {59, 926, 0, L""},
+ {59, 3234, 0, L""},
+ {59, 3275, 0, L""},
+ {59, 927, 0, L""},
+ {59, 3321, 0, L""},
+ {59, 928, 0, L""},
+ {59, 929, 0, L""},
+ {59, 3281, 0, L"-"},
+ {59, 2514, 0, L""},
+ {36, 930, 0, L"-"},
+ {36, 2513, 0, L""},
+ {60, 931, 0, L""},
+ {60, 933, 0, L""},
+ {60, 932, 0, L""},
+ {60, 934, 0, L""},
+ {60, 935, 0, L""},
+ {60, 2977, 0, L""},
+ {60, 3030, 0, L""},
+ {60, 3091, 0, L""},
+ {60, 936, 0, L""},
+ {60, 937, 0, L""},
+ {60, 3044, 0, L""},
+ {60, 3380, 0, L""},
+ {60, 2512, 0, L""},
+ {61, 3190, 0, L""},
+ {61, 2857, 0, L""},
+ {61, 938, 0, L""},
+ {61, 3355, 0, L""},
+ {61, 939, 0, L""},
+ {61, 2511, 0, L""},
+ {62, 940, 0, L""},
+ {62, 941, 0, L""},
+ {62, 3164, 0, L""},
+ {62, 942, 0, L""},
+ {62, 943, 0, L""},
+ {62, 3237, 0, L""},
+ {62, 3165, 0, L" "},
+ {62, 944, 0, L""},
+ {62, 945, 0, L""},
+ {62, 3008, 0, L""},
+ {62, 3150, 0, L""},
+ {62, 946, 0, L""},
+ {62, 947, 0, L""},
+ {62, 948, 0, L""},
+ {62, 2958, 0, L""},
+ {62, 2510, 0, L""},
+ {35, 949, 0, L""},
+ {35, 950, 0, L""},
+ {35, 2509, 0, L""},
+ {63, 952, 0, L""},
+ {63, 951, 0, L""},
+ {63, 954, 0, L""},
+ {63, 955, 0, L""},
+ {63, 953, 0, L""},
+ {63, 2508, 0, L""},
+ {64, 956, 0, L"-"},
+ {64, 2507, 0, L""},
+ {74, 957, 0, L""},
+ {74, 960, 0, L""},
+ {74, 958, 0, L"-"},
+ {74, 959, 0, L""},
+ {74, 2506, 0, L""},
+ {65, 961, 0, L""},
+ {65, 962, 0, L""},
+ {65, 3101, 0, L""},
+ {65, 963, 0, L""},
+ {65, 964, 0, L""},
+ {65, 965, 0, L""},
+ {65, 966, 0, L""},
+ {65, 2505, 0, L""},
+ {66, 968, 0, L""},
+ {66, 967, 0, L""},
+ {66, 969, 0, L""},
+ {66, 2504, 0, L""},
+ {67, 970, 0, L""},
+ {67, 2503, 0, L""},
+ {68, 2888, 0, L""},
+ {68, 971, 0, L""},
+ {68, 979, 0, L""},
+ {68, 972, 0, L""},
+ {68, 980, 0, L""},
+ {68, 973, 0, L""},
+ {68, 3375, 0, L""},
+ {68, 3159, 0, L""},
+ {68, 974, 0, L""},
+ {68, 975, 0, L""},
+ {68, 976, 0, L""},
+ {68, 977, 0, L""},
+ {68, 978, 0, L""},
+ {68, 2502, 0, L""},
+ {37, 996, 0, L""},
+ {37, 983, 0, L""},
+ {37, 997, 0, L""},
+ {37, 984, 0, L""},
+ {37, 998, 0, L""},
+ {37, 987, 0, L""},
+ {37, 988, 0, L""},
+ {37, 993, 0, L"-"},
+ {37, 3037, 0, L""},
+ {37, 989, 0, L""},
+ {37, 985, 0, L""},
+ {37, 991, 0, L""},
+ {37, 3161, 0, L""},
+ {37, 990, 0, L""},
+ {37, 994, 0, L""},
+ {37, 995, 0, L""},
+ {37, 999, 0, L""},
+ {37, 981, 0, L""},
+ {37, 3374, 0, L""},
+ {37, 992, 0, L""},
+ {37, 982, 0, L""},
+ {37, 986, 0, L""},
+ {37, 3314, 0, L""},
+ {37, 2501, 0, L""},
+ {69, 1003, 0, L""},
+ {69, 1000, 0, L""},
+ {69, 1001, 0, L""},
+ {69, 1004, 0, L""},
+ {69, 1002, 0, L""},
+ {69, 2500, 0, L""},
+ {70, 1005, 0, L""},
+ {70, 3291, 0, L"-"},
+ {70, 1007, 0, L"-"},
+ {70, 1008, 0, L"-"},
+ {70, 3019, 0, L""},
+ {70, 1010, 0, L""},
+ {70, 1009, 0, L""},
+ {70, 1015, 0, L""},
+ {70, 3105, 0, L" "},
+ {70, 1006, 0, L""},
+ {70, 3246, 0, L""},
+ {70, 1011, 0, L""},
+ {70, 1012, 0, L"--"},
+ {70, 1014, 0, L"-"},
+ {70, 1013, 0, L"--"},
+ {70, 2499, 0, L""},
+ {71, 1016, 0, L""},
+ {71, 1019, 0, L""},
+ {71, 1017, 0, L""},
+ {71, 1018, 0, L""},
+ {71, 1020, 0, L""},
+ {71, 1021, 0, L""},
+ {71, 1022, 0, L""},
+ {71, 3189, 0, L""},
+ {71, 1023, 0, L""},
+ {71, 1024, 0, L""},
+ {71, 1025, 0, L""},
+ {71, 1026, 0, L""},
+ {71, 1027, 0, L""},
+ {71, 1028, 0, L""},
+ {71, 1029, 0, L""},
+ {71, 1030, 0, L""},
+ {71, 2498, 0, L""},
+ {72, 2883, 0, L""},
+ {72, 1031, 0, L""},
+ {72, 1032, 0, L""},
+ {72, 1037, 0, L""},
+ {72, 1036, 0, L""},
+ {72, 1042, 0, L""},
+ {72, 1033, 0, L""},
+ {72, 1034, 0, L""},
+ {72, 1041, 0, L""},
+ {72, 1039, 0, L""},
+ {72, 1043, 0, L""},
+ {72, 1040, 0, L""},
+ {72, 1038, 0, L""},
+ {72, 2497, 0, L""},
+ {73, 3013, 0, L""},
+ {73, 1044, 0, L""},
+ {73, 1045, 0, L"-"},
+ {73, 1046, 0, L""},
+ {73, 1047, 0, L""},
+ {73, 1048, 0, L""},
+ {73, 1049, 0, L""},
+ {73, 1050, 0, L""},
+ {73, 1051, 0, L""},
+ {73, 1052, 0, L""},
+ {73, 1053, 0, L""},
+ {73, 1054, 0, L""},
+ {24, 233, 474, L""},
+ {24, 233, 2809, L""},
+ {24, 233, 2804, L""},
+ {24, 233, 475, L""},
+ {24, 233, 477, L""},
+ {24, 233, 476, L""},
+ {24, 233, 2806, L""},
+ {24, 233, 3115, L""},
+ {24, 233, 2808, L""},
+ {24, 233, 2807, L""},
+ {24, 233, 2805, L""},
+ {24, 233, 478, L"-"},
+ {24, 233, 479, L""},
+ {24, 233, 2263, L""},
+ {24, 232, 2819, L""},
+ {24, 232, 464, L""},
+ {24, 232, 465, L" "},
+ {24, 232, 466, L""},
+ {24, 232, 2817, L""},
+ {24, 232, 2818, L""},
+ {24, 232, 3359, L""},
+ {24, 232, 467, L"-"},
+ {24, 232, 468, L""},
+ {24, 232, 469, L""},
+ {24, 232, 470, L""},
+ {24, 232, 471, L""},
+ {24, 232, 472, L""},
+ {24, 232, 2816, L"-"},
+ {24, 232, 473, L""},
+ {24, 232, 2258, L""},
+ {24, 235, 487, L""},
+ {24, 235, 2821, L""},
+ {24, 235, 488, L""},
+ {24, 235, 2820, L""},
+ {24, 235, 489, L"--"},
+ {24, 235, 490, L"--"},
+ {24, 235, 491, L" "},
+ {24, 235, 3353, L""},
+ {24, 235, 492, L""},
+ {24, 235, 2280, L""},
+ {24, 227, 455, L""},
+ {24, 227, 456, L""},
+ {24, 227, 2814, L""},
+ {24, 227, 2813, L""},
+ {24, 227, 2815, L""},
+ {24, 227, 2812, L""},
+ {24, 227, 2811, L""},
+ {24, 227, 457, L""},
+ {24, 227, 2217, L""},
+ {24, 227, 2218, L""},
+ {24, 229, 460, L""},
+ {24, 229, 2822, L""},
+ {24, 229, 459, L"-."},
+ {24, 229, 2234, L""},
+ {24, 231, 462, L""},
+ {24, 231, 2823, L""},
+ {24, 231, 463, L""},
+ {24, 231, 2246, L""},
+ {24, 234, 480, L"-"},
+ {24, 234, 2829, L""},
+ {24, 234, 2833, L""},
+ {24, 234, 2825, L""},
+ {24, 234, 481, L""},
+ {24, 234, 482, L""},
+ {24, 234, 2826, L""},
+ {24, 234, 2832, L""},
+ {24, 234, 2836, L""},
+ {24, 234, 2830, L""},
+ {24, 234, 483, L""},
+ {24, 234, 2828, L""},
+ {24, 234, 2824, L"-"},
+ {24, 234, 2827, L""},
+ {24, 234, 2831, L""},
+ {24, 234, 484, L""},
+ {24, 234, 2834, L""},
+ {24, 234, 2835, L""},
+ {24, 234, 485, L"-"},
+ {24, 234, 486, L"-"},
+ {24, 234, 2264, L""},
+ {24, 228, 458, L""},
+ {24, 228, 2810, L""},
+ {24, 228, 2226, L""},
+ {24, 230, 461, L""},
+ {24, 230, 2239, L""},
+ {24, 236, 493, L""},
+ {24, 236, 2287, L""},
+ {24, 237, 2850, L""},
+ {24, 237, 2851, L""},
+ {24, 237, 2657, L""},
+ {24, 237, 2662, L""},
+ {24, 237, 494, L""},
+ {24, 237, 2658, L""},
+ {24, 237, 2660, L""},
+ {24, 237, 2659, L""},
+ {24, 237, 2663, L""},
+ {24, 237, 495, L""},
+ {24, 237, 496, L""},
+ {24, 237, 2655, L""},
+ {24, 237, 497, L""},
+ {24, 237, 2654, L""},
+ {24, 237, 499, L""},
+ {24, 237, 2656, L""},
+ {24, 237, 498, L""},
+ {24, 237, 500, L""},
+ {24, 237, 2661, L""},
+ {24, 237, 501, L""},
+ {24, 237, 502, L""},
+ {24, 237, 2664, L""},
+ {24, 237, 2220, L""},
+ {24, 240, 509, L""},
+ {24, 240, 510, L""},
+ {24, 240, 511, L"-"},
+ {24, 240, 512, L""},
+ {24, 240, 2247, L""},
+ {24, 241, 513, L" "},
+ {24, 241, 2147, L""},
+ {24, 241, 2150, L""},
+ {24, 241, 2148, L""},
+ {24, 241, 2910, L""},
+ {24, 241, 515, L""},
+ {24, 241, 514, L""},
+ {24, 241, 2149, L""},
+ {24, 241, 2923, L""},
+ {24, 241, 2248, L""},
+ {24, 248, 2569, L""},
+ {24, 248, 2575, L""},
+ {24, 248, 569, L""},
+ {24, 248, 570, L""},
+ {24, 248, 2571, L""},
+ {24, 248, 571, L""},
+ {24, 248, 2570, L""},
+ {24, 248, 572, L""},
+ {24, 248, 573, L""},
+ {24, 248, 2576, L""},
+ {24, 248, 574, L""},
+ {24, 248, 575, L""},
+ {24, 248, 2577, L""},
+ {24, 248, 2572, L""},
+ {24, 248, 576, L""},
+ {24, 248, 2573, L""},
+ {24, 248, 577, L" "},
+ {24, 248, 578, L""},
+ {24, 248, 579, L""},
+ {24, 248, 2574, L""},
+ {24, 248, 580, L""},
+ {24, 248, 2271, L""},
+ {24, 249, 3311, L""},
+ {24, 249, 581, L""},
+ {24, 249, 582, L""},
+ {24, 249, 583, L""},
+ {24, 249, 584, L""},
+ {24, 249, 2665, L""},
+ {24, 249, 585, L""},
+ {24, 249, 586, L""},
+ {24, 249, 587, L""},
+ {24, 249, 2277, L""},
+ {24, 251, 2158, L""},
+ {24, 251, 2156, L""},
+ {24, 251, 2151, L""},
+ {24, 251, 2152, L" "},
+ {24, 251, 2155, L""},
+ {24, 251, 2153, L""},
+ {24, 251, 592, L""},
+ {24, 251, 2157, L""},
+ {24, 251, 2154, L""},
+ {24, 251, 2286, L""},
+ {24, 238, 2168, L" "},
+ {24, 238, 503, L" "},
+ {24, 238, 2164, L""},
+ {24, 238, 504, L""},
+ {24, 238, 505, L"-"},
+ {24, 238, 2160, L""},
+ {24, 238, 506, L""},
+ {24, 238, 2167, L""},
+ {24, 238, 2159, L""},
+ {24, 238, 2169, L""},
+ {24, 238, 2163, L""},
+ {24, 238, 2170, L""},
+ {24, 238, 2166, L""},
+ {24, 238, 2165, L""},
+ {24, 238, 2162, L""},
+ {24, 238, 2171, L""},
+ {24, 238, 2161, L""},
+ {24, 238, 507, L""},
+ {24, 238, 2237, L""},
+ {24, 242, 516, L""},
+ {24, 242, 517, L""},
+ {24, 242, 2139, L""},
+ {24, 242, 518, L""},
+ {24, 242, 519, L""},
+ {24, 242, 520, L""},
+ {24, 242, 2140, L""},
+ {24, 242, 2138, L""},
+ {24, 242, 521, L""},
+ {24, 242, 2137, L""},
+ {24, 242, 522, L""},
+ {24, 242, 523, L""},
+ {24, 242, 524, L""},
+ {24, 242, 2891, L""},
+ {24, 242, 525, L""},
+ {24, 242, 2145, L""},
+ {24, 242, 2143, L""},
+ {24, 242, 2144, L""},
+ {24, 242, 2146, L""},
+ {24, 242, 526, L" "},
+ {24, 242, 527, L""},
+ {24, 242, 2135, L""},
+ {24, 242, 528, L""},
+ {24, 242, 529, L""},
+ {24, 242, 530, L""},
+ {24, 242, 2141, L""},
+ {24, 242, 2136, L""},
+ {24, 242, 2897, L""},
+ {24, 242, 2142, L""},
+ {24, 242, 2251, L""},
+ {24, 243, 2678, L""},
+ {24, 243, 2673, L""},
+ {24, 243, 531, L""},
+ {24, 243, 532, L""},
+ {24, 243, 2674, L""},
+ {24, 243, 2675, L""},
+ {24, 243, 533, L""},
+ {24, 243, 535, L""},
+ {24, 243, 536, L""},
+ {24, 243, 3360, L""},
+ {24, 243, 2677, L"-"},
+ {24, 243, 2676, L""},
+ {24, 243, 537, L""},
+ {24, 243, 538, L""},
+ {24, 243, 2254, L""},
+ {24, 244, 539, L""},
+ {24, 244, 2597, L""},
+ {24, 244, 2595, L""},
+ {24, 244, 2593, L""},
+ {24, 244, 540, L""},
+ {24, 244, 2598, L" "},
+ {24, 244, 2592, L""},
+ {24, 244, 541, L""},
+ {24, 244, 3304, L" "},
+ {24, 244, 2596, L""},
+ {24, 244, 2594, L""},
+ {24, 244, 2256, L""},
+ {24, 245, 2690, L""},
+ {24, 245, 542, L""},
+ {24, 245, 2679, L""},
+ {24, 245, 2680, L""},
+ {24, 245, 2687, L""},
+ {24, 245, 2686, L""},
+ {24, 245, 543, L""},
+ {24, 245, 544, L""},
+ {24, 245, 2681, L""},
+ {24, 245, 545, L""},
+ {24, 245, 546, L""},
+ {24, 245, 547, L""},
+ {24, 245, 548, L""},
+ {24, 245, 2683, L""},
+ {24, 245, 2684, L""},
+ {24, 245, 2682, L""},
+ {24, 245, 549, L""},
+ {24, 245, 550, L""},
+ {24, 245, 2685, L""},
+ {24, 245, 551, L""},
+ {24, 245, 2689, L""},
+ {24, 245, 2688, L""},
+ {24, 245, 552, L""},
+ {24, 245, 553, L""},
+ {24, 245, 2257, L""},
+ {24, 246, 554, L""},
+ {24, 246, 555, L""},
+ {24, 246, 2599, L""},
+ {24, 246, 3293, L" "},
+ {24, 246, 2602, L""},
+ {24, 246, 556, L""},
+ {24, 246, 2600, L""},
+ {24, 246, 557, L""},
+ {24, 246, 558, L""},
+ {24, 246, 559, L""},
+ {24, 246, 560, L""},
+ {24, 246, 561, L""},
+ {24, 246, 2601, L""},
+ {24, 246, 562, L""},
+ {24, 246, 2261, L""},
+ {24, 247, 2613, L""},
+ {24, 247, 2606, L""},
+ {24, 247, 563, L""},
+ {24, 247, 564, L""},
+ {24, 247, 565, L""},
+ {24, 247, 2608, L""},
+ {24, 247, 2607, L""},
+ {24, 247, 2609, L""},
+ {24, 247, 2610, L" "},
+ {24, 247, 2605, L""},
+ {24, 247, 566, L""},
+ {24, 247, 2603, L""},
+ {24, 247, 2604, L""},
+ {24, 247, 2612, L""},
+ {24, 247, 567, L""},
+ {24, 247, 2611, L""},
+ {24, 247, 568, L""},
+ {24, 247, 3267, L"-12"},
+ {24, 247, 2262, L""},
+ {24, 250, 2614, L""},
+ {24, 250, 588, L""},
+ {24, 250, 2615, L""},
+ {24, 250, 589, L""},
+ {24, 250, 2616, L""},
+ {24, 250, 590, L""},
+ {24, 250, 591, L""},
+ {24, 250, 2278, L""},
+ {24, 239, 508, L""},
+ {24, 239, 2238, L""},
+ {24, 255, 1355, L""},
+ {24, 255, 1356, L""},
+ {24, 255, 1357, L""},
+ {24, 255, 1358, L""},
+ {24, 255, 1359, L""},
+ {24, 255, 1360, L""},
+ {24, 255, 1362, L""},
+ {24, 255, 1361, L""},
+ {24, 255, 3286, L""},
+ {24, 255, 1937, L""},
+ {24, 255, 1363, L""},
+ {24, 255, 1938, L""},
+ {24, 255, 3287, L""},
+ {24, 255, 1936, L""},
+ {24, 255, 1364, L""},
+ {24, 255, 1365, L""},
+ {24, 255, 1939, L""},
+ {24, 255, 2201, L""},
+ {24, 256, 1366, L""},
+ {24, 256, 1367, L""},
+ {24, 256, 2202, L""},
+ {24, 256, 1368, L""},
+ {24, 256, 1940, L""},
+ {24, 256, 1369, L""},
+ {24, 256, 1941, L""},
+ {24, 256, 1370, L""},
+ {24, 256, 1371, L""},
+ {24, 256, 1372, L""},
+ {24, 256, 2203, L""},
+ {24, 252, 593, L""},
+ {24, 252, 594, L""},
+ {24, 252, 1945, L""},
+ {24, 252, 595, L""},
+ {24, 252, 596, L""},
+ {24, 252, 1944, L""},
+ {24, 252, 597, L""},
+ {24, 252, 598, L""},
+ {24, 252, 1946, L""},
+ {24, 252, 599, L""},
+ {24, 252, 600, L""},
+ {24, 252, 601, L""},
+ {24, 252, 1942, L""},
+ {24, 252, 3239, L""},
+ {24, 252, 1943, L""},
+ {24, 252, 2204, L""},
+ {24, 253, 1950, L""},
+ {24, 253, 1949, L""},
+ {24, 253, 1338, L" "},
+ {24, 253, 1339, L""},
+ {24, 253, 1951, L""},
+ {24, 253, 1340, L""},
+ {24, 253, 1952, L""},
+ {24, 253, 2871, L""},
+ {24, 253, 1341, L""},
+ {24, 253, 1955, L""},
+ {24, 253, 1342, L""},
+ {24, 253, 1947, L""},
+ {24, 253, 1343, L""},
+ {24, 253, 1953, L""},
+ {24, 253, 1954, L""},
+ {24, 253, 1948, L""},
+ {24, 253, 1344, L""},
+ {24, 253, 2205, L""},
+ {24, 254, 2838, L""},
+ {24, 254, 1345, L""},
+ {24, 254, 2846, L""},
+ {24, 254, 2843, L""},
+ {24, 254, 1346, L""},
+ {24, 254, 1347, L""},
+ {24, 254, 1348, L""},
+ {24, 254, 2842, L""},
+ {24, 254, 2845, L""},
+ {24, 254, 2848, L""},
+ {24, 254, 2837, L""},
+ {24, 254, 2844, L""},
+ {24, 254, 1349, L""},
+ {24, 254, 2841, L""},
+ {24, 254, 2839, L""},
+ {24, 254, 1350, L""},
+ {24, 254, 1351, L""},
+ {24, 254, 1352, L""},
+ {24, 254, 2840, L""},
+ {24, 254, 1353, L""},
+ {24, 254, 1354, L""},
+ {24, 254, 2231, L""},
+ {24, 257, 1985, L""},
+ {24, 257, 1374, L""},
+ {24, 257, 1373, L""},
+ {24, 257, 1375, L""},
+ {24, 257, 1995, L""},
+ {24, 257, 1376, L""},
+ {24, 257, 1378, L""},
+ {24, 257, 1993, L""},
+ {24, 257, 1379, L""},
+ {24, 257, 1380, L""},
+ {24, 257, 1381, L""},
+ {24, 257, 1384, L""},
+ {24, 257, 1984, L" "},
+ {24, 257, 1990, L""},
+ {24, 257, 1994, L""},
+ {24, 257, 1386, L""},
+ {24, 257, 1987, L" "},
+ {24, 257, 1996, L""},
+ {24, 257, 1986, L""},
+ {24, 257, 1983, L""},
+ {24, 257, 1992, L""},
+ {24, 257, 1988, L""},
+ {24, 257, 3071, L""},
+ {24, 257, 1989, L""},
+ {24, 257, 1389, L""},
+ {24, 257, 1991, L""},
+ {24, 257, 1391, L" "},
+ {24, 257, 1392, L""},
+ {24, 257, 1393, L""},
+ {24, 257, 1394, L""},
+ {24, 257, 2207, L""},
+ {24, 258, 1395, L""},
+ {24, 258, 1959, L""},
+ {24, 258, 1396, L""},
+ {24, 258, 1397, L""},
+ {24, 258, 1398, L""},
+ {24, 258, 1399, L""},
+ {24, 258, 1958, L""},
+ {24, 258, 1400, L""},
+ {24, 258, 1401, L""},
+ {24, 258, 1402, L""},
+ {24, 258, 1403, L""},
+ {24, 258, 1404, L" "},
+ {24, 258, 1956, L""},
+ {24, 258, 1957, L""},
+ {24, 258, 3288, L""},
+ {24, 258, 2206, L""},
+ {24, 260, 1406, L""},
+ {24, 260, 2001, L""},
+ {24, 260, 2003, L""},
+ {24, 260, 1407, L" "},
+ {24, 260, 1408, L""},
+ {24, 260, 2002, L" "},
+ {24, 260, 1409, L""},
+ {24, 260, 2000, L""},
+ {24, 260, 1997, L""},
+ {24, 260, 1410, L" "},
+ {24, 260, 1998, L""},
+ {24, 260, 1999, L""},
+ {24, 260, 2208, L""},
+ {24, 261, 1412, L" "},
+ {24, 261, 2004, L""},
+ {24, 261, 2009, L""},
+ {24, 261, 2005, L""},
+ {24, 261, 1413, L""},
+ {24, 261, 2006, L""},
+ {24, 261, 2008, L""},
+ {24, 261, 1414, L""},
+ {24, 261, 1415, L""},
+ {24, 261, 1411, L""},
+ {24, 261, 1416, L""},
+ {24, 261, 2007, L""},
+ {24, 261, 1417, L""},
+ {24, 261, 2209, L""},
+ {24, 259, 1405, L"-"},
+ {24, 259, 2250, L""},
+ {24, 265, 2764, L""},
+ {24, 265, 2760, L""},
+ {24, 265, 2762, L""},
+ {24, 265, 2763, L""},
+ {24, 265, 2761, L""},
+ {24, 265, 1446, L"-"},
+ {24, 265, 2222, L""},
+ {24, 263, 1439, L"-"},
+ {24, 263, 2215, L""},
+ {24, 273, 2766, L"-"},
+ {24, 273, 1494, L""},
+ {24, 273, 2768, L" "},
+ {24, 273, 2767, L""},
+ {24, 273, 2765, L""},
+ {24, 273, 2275, L""},
+ {24, 275, 2769, L""},
+ {24, 275, 1496, L""},
+ {24, 275, 1497, L""},
+ {24, 275, 2770, L""},
+ {24, 275, 2771, L""},
+ {24, 275, 2281, L""},
+ {24, 264, 1440, L""},
+ {24, 264, 1441, L""},
+ {24, 264, 1442, L""},
+ {24, 264, 1443, L""},
+ {24, 264, 2728, L""},
+ {24, 264, 2731, L""},
+ {24, 264, 2729, L""},
+ {24, 264, 2732, L"--"},
+ {24, 264, 3292, L""},
+ {24, 264, 2730, L""},
+ {24, 264, 1444, L""},
+ {24, 264, 1445, L""},
+ {24, 264, 3231, L""},
+ {24, 264, 2216, L""},
+ {24, 268, 2781, L""},
+ {24, 268, 1469, L""},
+ {24, 268, 2784, L""},
+ {24, 268, 2773, L""},
+ {24, 268, 2774, L""},
+ {24, 268, 3122, L""},
+ {24, 268, 2772, L""},
+ {24, 268, 3294, L""},
+ {24, 268, 2777, L""},
+ {24, 268, 1470, L""},
+ {24, 268, 2778, L""},
+ {24, 268, 2782, L""},
+ {24, 268, 2783, L""},
+ {24, 268, 1471, L""},
+ {24, 268, 1472, L""},
+ {24, 268, 1473, L""},
+ {24, 268, 2775, L""},
+ {24, 268, 2776, L""},
+ {24, 268, 2780, L""},
+ {24, 268, 2779, L""},
+ {24, 268, 2785, L""},
+ {24, 268, 1474, L""},
+ {24, 268, 2242, L""},
+ {24, 266, 2792, L""},
+ {24, 266, 1447, L""},
+ {24, 266, 1448, L""},
+ {24, 266, 2791, L""},
+ {24, 266, 1450, L""},
+ {24, 266, 1451, L""},
+ {24, 266, 2793, L""},
+ {24, 266, 2789, L"-"},
+ {24, 266, 2786, L""},
+ {24, 266, 1452, L""},
+ {24, 266, 2794, L""},
+ {24, 266, 2787, L""},
+ {24, 266, 1449, L""},
+ {24, 266, 2790, L""},
+ {24, 266, 1453, L""},
+ {24, 266, 2788, L""},
+ {24, 266, 1454, L""},
+ {24, 266, 1455, L"-"},
+ {24, 266, 2908, L""},
+ {24, 266, 1456, L"-"},
+ {24, 266, 1457, L"-"},
+ {24, 266, 1458, L""},
+ {24, 266, 1459, L""},
+ {24, 266, 2795, L""},
+ {24, 266, 2229, L""},
+ {24, 267, 2737, L"-"},
+ {24, 267, 2740, L""},
+ {24, 267, 2746, L""},
+ {24, 267, 2739, L""},
+ {24, 267, 2742, L""},
+ {24, 267, 1460, L""},
+ {24, 267, 1461, L""},
+ {24, 267, 2738, L"-"},
+ {24, 267, 2745, L""},
+ {24, 267, 1462, L""},
+ {24, 267, 1463, L""},
+ {24, 267, 1464, L""},
+ {24, 267, 2744, L""},
+ {24, 267, 3358, L""},
+ {24, 267, 1465, L""},
+ {24, 267, 1466, L""},
+ {24, 267, 2743, L""},
+ {24, 267, 2741, L""},
+ {24, 267, 1467, L""},
+ {24, 267, 1468, L""},
+ {24, 267, 2236, L""},
+ {24, 269, 1475, L""},
+ {24, 269, 1476, L""},
+ {24, 269, 1477, L""},
+ {24, 269, 2750, L""},
+ {24, 269, 1478, L""},
+ {24, 269, 2752, L""},
+ {24, 269, 2751, L""},
+ {24, 269, 3107, L""},
+ {24, 269, 2753, L""},
+ {24, 269, 2755, L""},
+ {24, 269, 1479, L""},
+ {24, 269, 2759, L""},
+ {24, 269, 2756, L""},
+ {24, 269, 2758, L""},
+ {24, 269, 2757, L""},
+ {24, 269, 2754, L""},
+ {24, 269, 2252, L""},
+ {24, 270, 2733, L""},
+ {24, 270, 1480, L""},
+ {24, 270, 1481, L""},
+ {24, 270, 2735, L""},
+ {24, 270, 1482, L""},
+ {24, 270, 2734, L""},
+ {24, 270, 2736, L""},
+ {24, 270, 2253, L""},
+ {24, 272, 1488, L""},
+ {24, 272, 1489, L" "},
+ {24, 272, 3295, L""},
+ {24, 272, 1491, L""},
+ {24, 272, 1492, L""},
+ {24, 272, 1493, L""},
+ {24, 272, 1490, L""},
+ {24, 272, 2273, L""},
+ {24, 276, 2803, L""},
+ {24, 276, 2799, L""},
+ {24, 276, 1499, L""},
+ {24, 276, 2801, L""},
+ {24, 276, 2800, L""},
+ {24, 276, 2802, L"-"},
+ {24, 276, 2798, L""},
+ {24, 276, 2796, L""},
+ {24, 276, 1498, L""},
+ {24, 276, 2797, L""},
+ {24, 276, 2285, L""},
+ {24, 262, 1438, L""},
+ {24, 262, 2213, L""},
+ {24, 271, 3233, L""},
+ {24, 271, 1485, L""},
+ {24, 271, 1487, L""},
+ {24, 271, 1483, L""},
+ {24, 271, 1484, L""},
+ {24, 271, 1486, L""},
+ {24, 271, 2269, L""},
+ {24, 274, 1495, L"-"},
+ {24, 274, 2279, L""},
+ {24, 277, 1500, L""},
+ {24, 277, 2288, L""},
+ {24, 278, 2668, L""},
+ {24, 278, 2667, L""},
+ {24, 278, 1524, L""},
+ {24, 278, 2669, L""},
+ {24, 278, 2666, L""},
+ {24, 278, 2671, L""},
+ {24, 278, 1525, L""},
+ {24, 278, 2670, L""},
+ {24, 278, 2672, L""},
+ {24, 278, 2243, L""},
+ {24, 279, 1526, L""},
+ {24, 279, 1527, L""},
+ {24, 279, 2691, L""},
+ {24, 279, 1528, L""},
+ {24, 279, 2924, L""},
+ {24, 279, 2707, L""},
+ {24, 279, 1529, L""},
+ {24, 279, 2698, L" "},
+ {24, 279, 1530, L" "},
+ {24, 279, 1531, L" "},
+ {24, 279, 1532, L" "},
+ {24, 279, 2696, L" "},
+ {24, 279, 2692, L""},
+ {24, 279, 2706, L""},
+ {24, 279, 2709, L""},
+ {24, 279, 1533, L""},
+ {24, 279, 1534, L""},
+ {24, 279, 1535, L""},
+ {24, 279, 1536, L""},
+ {24, 279, 1537, L"-"},
+ {24, 279, 1538, L""},
+ {24, 279, 2708, L""},
+ {24, 279, 1539, L""},
+ {24, 279, 2712, L""},
+ {24, 279, 1540, L""},
+ {24, 279, 2694, L""},
+ {24, 279, 2693, L""},
+ {24, 279, 1541, L""},
+ {24, 279, 2711, L""},
+ {24, 279, 2713, L""},
+ {24, 279, 1542, L""},
+ {24, 279, 2702, L" "},
+ {24, 279, 1543, L" "},
+ {24, 279, 2695, L" "},
+ {24, 279, 2697, L" "},
+ {24, 279, 2699, L" "},
+ {24, 279, 2909, L""},
+ {24, 279, 1544, L""},
+ {24, 279, 1545, L""},
+ {24, 279, 1546, L""},
+ {24, 279, 1547, L""},
+ {24, 279, 3296, L""},
+ {24, 279, 2700, L""},
+ {24, 279, 1548, L""},
+ {24, 279, 2710, L""},
+ {24, 279, 2701, L" "},
+ {24, 279, 2703, L""},
+ {24, 279, 1549, L""},
+ {24, 279, 2704, L""},
+ {24, 279, 2705, L""},
+ {24, 279, 2265, L""},
+ {24, 280, 1550, L""},
+ {24, 280, 1551, L""},
+ {24, 280, 3326, L""},
+ {24, 280, 1552, L""},
+ {24, 280, 1553, L""},
+ {24, 280, 2748, L""},
+ {24, 280, 2276, L""},
+ {24, 282, 1564, L""},
+ {24, 282, 2723, L""},
+ {24, 282, 2724, L""},
+ {24, 282, 2716, L" "},
+ {24, 282, 3297, L""},
+ {24, 282, 2725, L""},
+ {24, 282, 1565, L""},
+ {24, 282, 2722, L""},
+ {24, 282, 1566, L""},
+ {24, 282, 2718, L""},
+ {24, 282, 2720, L"-"},
+ {24, 282, 1567, L""},
+ {24, 282, 2721, L""},
+ {24, 282, 2715, L""},
+ {24, 282, 1568, L""},
+ {24, 282, 1569, L""},
+ {24, 282, 1570, L""},
+ {24, 282, 2726, L""},
+ {24, 282, 2717, L""},
+ {24, 282, 3100, L""},
+ {24, 282, 1571, L""},
+ {24, 282, 2719, L""},
+ {24, 282, 2727, L""},
+ {24, 282, 1572, L""},
+ {24, 282, 3332, L""},
+ {24, 282, 1573, L""},
+ {24, 282, 1574, L"-"},
+ {24, 282, 1575, L""},
+ {24, 282, 1576, L""},
+ {24, 282, 1577, L""},
+ {24, 282, 2714, L""},
+ {24, 282, 2283, L""},
+ {24, 281, 2749, L""},
+ {24, 281, 1554, L""},
+ {24, 281, 1555, L""},
+ {24, 281, 1556, L""},
+ {24, 281, 1561, L""},
+ {24, 281, 1562, L""},
+ {24, 281, 1559, L""},
+ {24, 281, 2852, L""},
+ {24, 281, 2853, L""},
+ {24, 281, 2854, L"-"},
+ {24, 281, 1560, L""},
+ {24, 281, 1563, L""},
+ {24, 281, 2747, L""},
+ {24, 281, 1557, L""},
+ {24, 281, 1558, L"-"},
+ {24, 281, 3344, L""},
+ {24, 281, 2282, L""},
+ {24, 283, 3298, L""},
+ {24, 283, 1578, L""},
+ {24, 283, 2856, L""},
+ {24, 283, 1579, L""},
+ {24, 283, 1580, L" "},
+ {24, 283, 1581, L""},
+ {24, 283, 1582, L""},
+ {24, 283, 1583, L""},
+ {24, 283, 2289, L""},
+ {24, 284, 1625, L""},
+ {24, 284, 1626, L""},
+ {24, 284, 2172, L""},
+ {24, 284, 2173, L""},
+ {24, 284, 1627, L""},
+ {24, 284, 2174, L""},
+ {24, 284, 2175, L" "},
+ {24, 284, 1628, L" "},
+ {24, 284, 1629, L""},
+ {24, 284, 2221, L""},
+ {24, 285, 1630, L""},
+ {24, 285, 3283, L""},
+ {24, 285, 1631, L""},
+ {24, 285, 2013, L""},
+ {24, 285, 2015, L""},
+ {24, 285, 1632, L""},
+ {24, 285, 1633, L""},
+ {24, 285, 1634, L""},
+ {24, 285, 2016, L""},
+ {24, 285, 2018, L""},
+ {24, 285, 2017, L""},
+ {24, 285, 2020, L""},
+ {24, 285, 2014, L""},
+ {24, 285, 2010, L""},
+ {24, 285, 2012, L""},
+ {24, 285, 2011, L""},
+ {24, 285, 2019, L""},
+ {24, 285, 2210, L""},
+ {24, 286, 1635, L""},
+ {24, 286, 1636, L""},
+ {24, 286, 2021, L""},
+ {24, 286, 1637, L""},
+ {24, 286, 2022, L""},
+ {24, 286, 1638, L"-"},
+ {24, 286, 2023, L""},
+ {24, 286, 2031, L""},
+ {24, 286, 2024, L""},
+ {24, 286, 1639, L""},
+ {24, 286, 1640, L""},
+ {24, 286, 2026, L""},
+ {24, 286, 3299, L" "},
+ {24, 286, 2033, L""},
+ {24, 286, 2025, L""},
+ {24, 286, 1641, L""},
+ {24, 286, 1642, L""},
+ {24, 286, 2027, L""},
+ {24, 286, 2211, L""},
+ {24, 286, 2028, L""},
+ {24, 286, 2032, L""},
+ {24, 286, 2029, L""},
+ {24, 286, 1643, L""},
+ {24, 286, 2030, L"-"},
+ {24, 286, 2212, L""},
+ {24, 287, 1644, L""},
+ {24, 287, 1645, L""},
+ {24, 287, 1646, L""},
+ {24, 287, 1647, L""},
+ {24, 287, 1648, L""},
+ {24, 287, 2178, L""},
+ {24, 287, 2176, L""},
+ {24, 287, 1649, L""},
+ {24, 287, 2177, L""},
+ {24, 287, 2180, L""},
+ {24, 287, 1650, L""},
+ {24, 287, 2181, L""},
+ {24, 287, 1651, L""},
+ {24, 287, 2179, L""},
+ {24, 287, 2182, L""},
+ {24, 287, 2224, L""},
+ {24, 288, 1652, L""},
+ {24, 288, 2036, L" "},
+ {24, 288, 1657, L""},
+ {24, 288, 1653, L""},
+ {24, 288, 1656, L""},
+ {24, 288, 2040, L""},
+ {24, 288, 2037, L""},
+ {24, 288, 2043, L""},
+ {24, 288, 3300, L""},
+ {24, 288, 2039, L""},
+ {24, 288, 2038, L""},
+ {24, 288, 2042, L""},
+ {24, 288, 2044, L""},
+ {24, 288, 1655, L""},
+ {24, 288, 2034, L""},
+ {24, 288, 1654, L""},
+ {24, 288, 2041, L""},
+ {24, 288, 2035, L""},
+ {24, 288, 2227, L""},
+ {24, 289, 2050, L""},
+ {24, 289, 2051, L""},
+ {24, 289, 3301, L""},
+ {24, 289, 2052, L""},
+ {24, 289, 1660, L""},
+ {24, 289, 1658, L""},
+ {24, 289, 2046, L""},
+ {24, 289, 1661, L""},
+ {24, 289, 2053, L""},
+ {24, 289, 2049, L""},
+ {24, 289, 1659, L""},
+ {24, 289, 2054, L""},
+ {24, 289, 2055, L""},
+ {24, 289, 2047, L""},
+ {24, 289, 1662, L""},
+ {24, 289, 2057, L""},
+ {24, 289, 2056, L"-"},
+ {24, 289, 2045, L""},
+ {24, 289, 1663, L""},
+ {24, 289, 2131, L""},
+ {24, 289, 2048, L""},
+ {24, 289, 2233, L""},
+ {24, 290, 1664, L""},
+ {24, 290, 1665, L""},
+ {24, 290, 1666, L""},
+ {24, 290, 2059, L""},
+ {24, 290, 1667, L""},
+ {24, 290, 3302, L"--"},
+ {24, 290, 1668, L""},
+ {24, 290, 2060, L""},
+ {24, 290, 1669, L""},
+ {24, 290, 2061, L""},
+ {24, 290, 2062, L""},
+ {24, 290, 2058, L""},
+ {24, 290, 1670, L""},
+ {24, 290, 2240, L""},
+ {24, 291, 1671, L"-"},
+ {24, 291, 1673, L""},
+ {24, 291, 3279, L""},
+ {24, 291, 1672, L""},
+ {24, 291, 2187, L""},
+ {24, 291, 2188, L""},
+ {24, 291, 2184, L""},
+ {24, 291, 2185, L""},
+ {24, 291, 2183, L""},
+ {24, 291, 2189, L""},
+ {24, 291, 2186, L""},
+ {24, 291, 2244, L""},
+ {24, 292, 2194, L""},
+ {24, 292, 2193, L""},
+ {24, 292, 1674, L""},
+ {24, 292, 2190, L""},
+ {24, 292, 2195, L""},
+ {24, 292, 1675, L""},
+ {24, 292, 2192, L""},
+ {24, 292, 2191, L""},
+ {24, 292, 2245, L""},
+ {24, 293, 1733, L""},
+ {24, 293, 1732, L""},
+ {24, 293, 1731, L""},
+ {24, 293, 1730, L""},
+ {24, 293, 2063, L""},
+ {24, 293, 2064, L""},
+ {24, 293, 1729, L""},
+ {24, 293, 1728, L""},
+ {24, 293, 1727, L""},
+ {24, 293, 2065, L""},
+ {24, 293, 1726, L""},
+ {24, 293, 1725, L""},
+ {24, 293, 1724, L""},
+ {24, 293, 1723, L""},
+ {24, 293, 2066, L""},
+ {24, 293, 1722, L""},
+ {24, 293, 1721, L""},
+ {24, 293, 1720, L""},
+ {24, 293, 1719, L""},
+ {24, 293, 2067, L""},
+ {24, 293, 1718, L""},
+ {24, 293, 1715, L""},
+ {24, 293, 1717, L""},
+ {24, 293, 2068, L""},
+ {24, 293, 2069, L""},
+ {24, 293, 1716, L""},
+ {24, 293, 1714, L""},
+ {24, 293, 1713, L""},
+ {24, 293, 1712, L""},
+ {24, 293, 1711, L""},
+ {24, 293, 1710, L""},
+ {24, 293, 2070, L""},
+ {24, 293, 2071, L""},
+ {24, 293, 1709, L"-"},
+ {24, 293, 1708, L""},
+ {24, 293, 2072, L"-"},
+ {24, 293, 1707, L""},
+ {24, 293, 1706, L""},
+ {24, 293, 1705, L""},
+ {24, 293, 1704, L""},
+ {24, 293, 1703, L""},
+ {24, 293, 1702, L""},
+ {24, 293, 1701, L"-"},
+ {24, 293, 1700, L""},
+ {24, 293, 1698, L""},
+ {24, 293, 2073, L""},
+ {24, 293, 2074, L""},
+ {24, 293, 1699, L"-"},
+ {24, 293, 1697, L" "},
+ {24, 293, 1696, L""},
+ {24, 293, 1695, L""},
+ {24, 293, 1694, L""},
+ {24, 293, 1693, L""},
+ {24, 293, 1692, L""},
+ {24, 293, 1691, L""},
+ {24, 293, 1690, L""},
+ {24, 293, 2075, L""},
+ {24, 293, 2076, L""},
+ {24, 293, 1689, L" "},
+ {24, 293, 1688, L""},
+ {24, 293, 1687, L""},
+ {24, 293, 1686, L""},
+ {24, 293, 2077, L""},
+ {24, 293, 2078, L""},
+ {24, 293, 1685, L""},
+ {24, 293, 1684, L""},
+ {24, 293, 1683, L""},
+ {24, 293, 1682, L""},
+ {24, 293, 1681, L""},
+ {24, 293, 1680, L""},
+ {24, 293, 1679, L""},
+ {24, 293, 1678, L""},
+ {24, 293, 2080, L""},
+ {24, 293, 1677, L""},
+ {24, 293, 1676, L""},
+ {24, 293, 2079, L""},
+ {24, 293, 3031, L""},
+ {24, 293, 2081, L""},
+ {24, 293, 2249, L""},
+ {24, 294, 2083, L""},
+ {24, 294, 2082, L"-"},
+ {24, 294, 3160, L""},
+ {24, 294, 1736, L""},
+ {24, 294, 2084, L""},
+ {24, 294, 1737, L""},
+ {24, 294, 2085, L""},
+ {24, 294, 1735, L""},
+ {24, 294, 2255, L""},
+ {24, 295, 1740, L"-"},
+ {24, 295, 1741, L""},
+ {24, 295, 2086, L""},
+ {24, 295, 2087, L""},
+ {24, 295, 2089, L""},
+ {24, 295, 2091, L""},
+ {24, 295, 2093, L""},
+ {24, 295, 1738, L""},
+ {24, 295, 3305, L""},
+ {24, 295, 1739, L""},
+ {24, 295, 2090, L""},
+ {24, 295, 2088, L"-"},
+ {24, 295, 2092, L"-"},
+ {24, 295, 2094, L""},
+ {24, 295, 3320, L""},
+ {24, 295, 2260, L""},
+ {24, 296, 2095, L""},
+ {24, 296, 1743, L""},
+ {24, 296, 1744, L""},
+ {24, 296, 2096, L""},
+ {24, 296, 1745, L""},
+ {24, 296, 1746, L""},
+ {24, 296, 2097, L""},
+ {24, 296, 2098, L""},
+ {24, 296, 2099, L""},
+ {24, 296, 2100, L""},
+ {24, 296, 2101, L""},
+ {24, 296, 1747, L""},
+ {24, 296, 1742, L""},
+ {24, 296, 2102, L""},
+ {24, 296, 1748, L""},
+ {24, 296, 2267, L""},
+ {24, 297, 2198, L""},
+ {24, 297, 2199, L""},
+ {24, 297, 1752, L""},
+ {24, 297, 1751, L""},
+ {24, 297, 2196, L""},
+ {24, 297, 1750, L""},
+ {24, 297, 3271, L""},
+ {24, 297, 1749, L""},
+ {24, 297, 3272, L""},
+ {24, 297, 2197, L""},
+ {24, 297, 2270, L""},
+ {24, 298, 2103, L""},
+ {24, 298, 2104, L""},
+ {24, 298, 2105, L""},
+ {24, 298, 2106, L""},
+ {24, 298, 2107, L""},
+ {24, 298, 1753, L" "},
+ {24, 298, 2108, L" "},
+ {24, 298, 2109, L""},
+ {24, 298, 2110, L""},
+ {24, 298, 2111, L""},
+ {24, 298, 1758, L""},
+ {24, 298, 1756, L""},
+ {24, 298, 2112, L" "},
+ {24, 298, 1759, L""},
+ {24, 298, 1760, L""},
+ {24, 298, 1761, L""},
+ {24, 298, 2113, L""},
+ {24, 298, 1757, L""},
+ {24, 298, 2114, L""},
+ {24, 298, 1754, L""},
+ {24, 298, 2115, L""},
+ {24, 298, 2116, L""},
+ {24, 298, 1755, L""},
+ {24, 298, 2272, L""},
+ {24, 299, 2127, L""},
+ {24, 299, 2126, L""},
+ {24, 299, 2118, L""},
+ {24, 299, 2122, L""},
+ {24, 299, 2129, L""},
+ {24, 299, 1762, L""},
+ {24, 299, 2128, L""},
+ {24, 299, 3354, L""},
+ {24, 299, 2124, L""},
+ {24, 299, 1763, L""},
+ {24, 299, 2123, L""},
+ {24, 299, 1764, L""},
+ {24, 299, 2117, L""},
+ {24, 299, 2130, L"-"},
+ {24, 299, 2120, L""},
+ {24, 299, 2119, L""},
+ {24, 299, 2125, L""},
+ {24, 299, 1765, L""},
+ {24, 299, 1766, L""},
+ {24, 299, 2121, L""},
+ {24, 299, 1767, L""},
+ {24, 299, 2274, L""},
+ {24, 300, 3053, L" "},
+ {24, 300, 3268, L""},
+ {24, 300, 1773, L"-"},
+ {24, 300, 2132, L""},
+ {24, 300, 3269, L" "},
+ {24, 300, 2133, L""},
+ {24, 300, 3270, L""},
+ {24, 300, 1774, L""},
+ {24, 300, 2994, L""},
+ {24, 300, 1775, L"-"},
+ {24, 300, 2134, L""},
+ {24, 300, 1769, L""},
+ {24, 300, 1771, L""},
+ {24, 300, 1772, L""},
+ {24, 300, 1770, L""},
+ {24, 300, 1768, L""},
+ {24, 300, 2290, L""},
+ {24, 301, 2849, L""},
+ {24, 301, 1776, L""},
+ {24, 301, 2214, L""},
+ {24, 304, 2617, L""},
+ {24, 304, 1791, L""},
+ {24, 304, 1788, L""},
+ {24, 304, 2619, L""},
+ {24, 304, 1789, L""},
+ {24, 304, 2618, L""},
+ {24, 304, 1790, L""},
+ {24, 304, 1792, L""},
+ {24, 304, 2620, L""},
+ {24, 304, 2225, L""},
+ {24, 305, 3052, L""},
+ {24, 305, 1787, L""},
+ {24, 305, 2228, L""},
+ {24, 306, 2621, L""},
+ {24, 306, 1794, L""},
+ {24, 306, 1793, L""},
+ {24, 306, 2622, L""},
+ {24, 306, 1795, L""},
+ {24, 306, 2623, L""},
+ {24, 306, 2624, L""},
+ {24, 306, 3274, L""},
+ {24, 306, 2230, L""},
+ {24, 307, 2567, L""},
+ {24, 307, 2568, L""},
+ {24, 307, 3324, L""},
+ {24, 307, 1796, L""},
+ {24, 307, 2232, L""},
+ {24, 308, 1799, L""},
+ {24, 308, 1798, L""},
+ {24, 308, 2626, L""},
+ {24, 308, 2625, L"-"},
+ {24, 308, 1797, L""},
+ {24, 308, 2235, L""},
+ {24, 311, 2630, L""},
+ {24, 311, 2631, L""},
+ {24, 311, 2628, L""},
+ {24, 311, 1839, L""},
+ {24, 311, 2629, L""},
+ {24, 311, 2627, L""},
+ {24, 311, 2266, L""},
+ {24, 313, 2632, L""},
+ {24, 313, 1853, L""},
+ {24, 313, 2633, L""},
+ {24, 313, 2284, L""},
+ {24, 309, 2636, L""},
+ {24, 309, 1800, L""},
+ {24, 309, 1801, L""},
+ {24, 309, 1802, L""},
+ {24, 309, 1803, L""},
+ {24, 309, 1804, L""},
+ {24, 309, 1805, L" "},
+ {24, 309, 2637, L""},
+ {24, 309, 1806, L""},
+ {24, 309, 1807, L""},
+ {24, 309, 2638, L""},
+ {24, 309, 1808, L""},
+ {24, 309, 1809, L""},
+ {24, 309, 1810, L""},
+ {24, 309, 1811, L""},
+ {24, 309, 3232, L""},
+ {24, 309, 2639, L""},
+ {24, 309, 1812, L""},
+ {24, 309, 1813, L""},
+ {24, 309, 1814, L"-"},
+ {24, 309, 3102, L""},
+ {24, 309, 1815, L"--"},
+ {24, 309, 1816, L""},
+ {24, 309, 3266, L""},
+ {24, 309, 3039, L""},
+ {24, 309, 1817, L""},
+ {24, 309, 2635, L""},
+ {24, 309, 1818, L""},
+ {24, 309, 1819, L""},
+ {24, 309, 1820, L"-"},
+ {24, 309, 2634, L""},
+ {24, 309, 2241, L""},
+ {24, 312, 1840, L""},
+ {24, 312, 2644, L""},
+ {24, 312, 1841, L""},
+ {24, 312, 1842, L""},
+ {24, 312, 1843, L""},
+ {24, 312, 1844, L""},
+ {24, 312, 2647, L""},
+ {24, 312, 2641, L""},
+ {24, 312, 2642, L""},
+ {24, 312, 1845, L""},
+ {24, 312, 1846, L""},
+ {24, 312, 3367, L""},
+ {24, 312, 3265, L""},
+ {24, 312, 1847, L""},
+ {24, 312, 1848, L" "},
+ {24, 312, 1849, L""},
+ {24, 312, 2645, L""},
+ {24, 312, 2643, L""},
+ {24, 312, 1850, L""},
+ {24, 312, 1851, L""},
+ {24, 312, 1852, L""},
+ {24, 312, 2646, L""},
+ {24, 312, 2640, L""},
+ {24, 312, 2268, L""},
+ {24, 302, 1777, L""},
+ {24, 302, 1778, L""},
+ {24, 302, 3383, L""},
+ {24, 302, 2578, L""},
+ {24, 302, 2579, L""},
+ {24, 302, 1786, L""},
+ {24, 302, 2219, L""},
+ {24, 303, 1779, L""},
+ {24, 303, 1780, L""},
+ {24, 303, 2584, L""},
+ {24, 303, 1781, L""},
+ {24, 303, 1782, L"--"},
+ {24, 303, 1783, L""},
+ {24, 303, 2588, L""},
+ {24, 303, 2591, L""},
+ {24, 303, 2587, L""},
+ {24, 303, 2582, L""},
+ {24, 303, 2590, L""},
+ {24, 303, 1784, L""},
+ {24, 303, 2581, L""},
+ {24, 303, 2583, L""},
+ {24, 303, 2580, L" "},
+ {24, 303, 2589, L""},
+ {24, 303, 2585, L""},
+ {24, 303, 1785, L""},
+ {24, 303, 2586, L""},
+ {24, 303, 2223, L""},
+ {24, 310, 1821, L""},
+ {24, 310, 1822, L""},
+ {24, 310, 1823, L""},
+ {24, 310, 1824, L""},
+ {24, 310, 1825, L" "},
+ {24, 310, 1826, L""},
+ {24, 310, 1827, L""},
+ {24, 310, 2651, L""},
+ {24, 310, 1828, L""},
+ {24, 310, 3264, L""},
+ {24, 310, 2652, L"-"},
+ {24, 310, 2649, L""},
+ {24, 310, 2648, L" "},
+ {24, 310, 1829, L""},
+ {24, 310, 2653, L""},
+ {24, 310, 1830, L""},
+ {24, 310, 1831, L""},
+ {24, 310, 1832, L""},
+ {24, 310, 1833, L"--"},
+ {24, 310, 1834, L""},
+ {24, 310, 1835, L""},
+ {24, 310, 1836, L""},
+ {24, 310, 1837, L"-"},
+ {24, 310, 3263, L""},
+ {24, 310, 2650, L""},
+ {24, 310, 1838, L""},
+ {24, 310, 2259, L""},
+ {139, 407, 407, L" "},
+ {139, 426, 427, L""},
+ {139, 426, 2354, L""},
+ {139, 378, 3109, L" "},
+ {139, 378, 379, L"-"},
+ {139, 378, 2963, L""},
+ {139, 378, 2355, L""},
+ {139, 412, 3236, L""},
+ {139, 412, 413, L""},
+ {139, 412, 1181, L""},
+ {139, 412, 2356, L""},
+ {139, 446, 1182, L""},
+ {139, 446, 447, L""},
+ {139, 446, 1183, L""},
+ {139, 446, 2357, L""},
+ {139, 434, 2917, L""},
+ {139, 434, 1184, L""},
+ {139, 434, 435, L""},
+ {139, 434, 3061, L""},
+ {139, 434, 2358, L""},
+ {139, 416, 417, L"-"},
+ {139, 416, 2359, L""},
+ {139, 428, 3017, L""},
+ {139, 428, 429, L""},
+ {139, 428, 2360, L""},
+ {139, 440, 2956, L""},
+ {139, 440, 2967, L""},
+ {139, 440, 3385, L""},
+ {139, 440, 2865, L""},
+ {139, 440, 441, L""},
+ {139, 440, 3352, L" "},
+ {139, 440, 2876, L""},
+ {139, 440, 3003, L""},
+ {139, 440, 1185, L""},
+ {139, 440, 2983, L""},
+ {139, 440, 1186, L""},
+ {139, 440, 3152, L" "},
+ {139, 440, 2886, L""},
+ {139, 440, 2361, L""},
+ {139, 352, 353, L""},
+ {139, 352, 2861, L""},
+ {139, 352, 2362, L""},
+ {139, 394, 1188, L""},
+ {139, 394, 1187, L""},
+ {139, 394, 2969, L""},
+ {139, 394, 1189, L""},
+ {139, 394, 3114, L""},
+ {139, 394, 2885, L"-"},
+ {139, 394, 2979, L" "},
+ {139, 394, 3338, L""},
+ {139, 394, 395, L""},
+ {139, 394, 3005, L""},
+ {139, 394, 2991, L""},
+ {139, 394, 2996, L""},
+ {139, 394, 3097, L""},
+ {139, 394, 2981, L""},
+ {139, 394, 2363, L""},
+ {139, 374, 2995, L"-"},
+ {139, 374, 375, L""},
+ {139, 374, 2365, L""},
+ {139, 448, 449, L""},
+ {139, 448, 1191, L""},
+ {139, 448, 2367, L""},
+ {139, 390, 3021, L""},
+ {139, 390, 391, L""},
+ {139, 390, 2973, L""},
+ {139, 390, 2369, L""},
+ {139, 402, 403, L""},
+ {139, 402, 2370, L""},
+ {139, 396, 397, L""},
+ {139, 396, 2371, L""},
+ {139, 370, 2911, L""},
+ {139, 370, 3074, L""},
+ {139, 370, 371, L""},
+ {139, 370, 2930, L""},
+ {139, 370, 1194, L""},
+ {139, 370, 2372, L""},
+ {139, 368, 369, L""},
+ {139, 368, 1195, L""},
+ {139, 368, 2373, L""},
+ {139, 444, 2959, L""},
+ {139, 444, 2961, L""},
+ {139, 444, 2912, L""},
+ {139, 444, 2899, L" "},
+ {139, 444, 1196, L""},
+ {139, 444, 3249, L""},
+ {139, 444, 3014, L""},
+ {139, 444, 3048, L""},
+ {139, 444, 2901, L"-"},
+ {139, 444, 2926, L" "},
+ {139, 444, 2922, L""},
+ {139, 444, 1203, L""},
+ {139, 444, 2978, L""},
+ {139, 444, 2990, L""},
+ {139, 444, 3077, L""},
+ {139, 444, 2918, L""},
+ {139, 444, 2881, L""},
+ {139, 444, 3247, L""},
+ {139, 444, 3092, L" "},
+ {139, 444, 2948, L""},
+ {139, 444, 1197, L"-"},
+ {139, 444, 1198, L"-"},
+ {139, 444, 3058, L"-"},
+ {139, 444, 3328, L"--"},
+ {139, 444, 2874, L"-"},
+ {139, 444, 2998, L""},
+ {139, 444, 3087, L""},
+ {139, 444, 2947, L""},
+ {139, 444, 2900, L" "},
+ {139, 444, 1199, L""},
+ {139, 444, 3335, L""},
+ {139, 444, 2966, L""},
+ {139, 444, 445, L""},
+ {139, 444, 1200, L"-"},
+ {139, 444, 3317, L"-"},
+ {139, 444, 1201, L"-"},
+ {139, 444, 1202, L"-"},
+ {139, 444, 2878, L""},
+ {139, 444, 2925, L"-"},
+ {139, 444, 2875, L"-"},
+ {139, 444, 1204, L"-"},
+ {139, 444, 2859, L"-"},
+ {139, 444, 3157, L" "},
+ {139, 444, 3146, L""},
+ {139, 444, 2970, L" "},
+ {139, 444, 2949, L"-"},
+ {139, 444, 3057, L" "},
+ {139, 444, 3032, L"-"},
+ {139, 444, 3381, L""},
+ {139, 444, 3028, L""},
+ {139, 444, 2858, L""},
+ {139, 444, 3040, L""},
+ {139, 444, 2374, L""},
+ {139, 388, 3041, L""},
+ {139, 388, 389, L""},
+ {139, 388, 2375, L""},
+ {139, 408, 3004, L""},
+ {139, 408, 1205, L""},
+ {139, 408, 409, L""},
+ {139, 408, 2376, L""},
+ {139, 430, 1206, L""},
+ {139, 430, 3095, L""},
+ {139, 430, 431, L""},
+ {139, 430, 1207, L"-"},
+ {139, 430, 3046, L""},
+ {139, 430, 2377, L""},
+ {139, 358, 2968, L""},
+ {139, 358, 3018, L""},
+ {139, 358, 2882, L""},
+ {139, 358, 359, L""},
+ {139, 358, 3047, L""},
+ {139, 358, 2378, L""},
+ {139, 418, 419, L"-"},
+ {139, 418, 1208, L" "},
+ {139, 418, 2408, L""},
+ {139, 354, 2931, L""},
+ {139, 354, 3334, L""},
+ {139, 354, 355, L""},
+ {139, 354, 3059, L""},
+ {139, 354, 2919, L""},
+ {139, 354, 2902, L""},
+ {139, 354, 1209, L""},
+ {139, 354, 3336, L""},
+ {139, 354, 2985, L""},
+ {139, 354, 3022, L""},
+ {139, 354, 2407, L""},
+ {139, 376, 1210, L""},
+ {139, 376, 2980, L""},
+ {139, 376, 377, L"-"},
+ {139, 376, 3035, L" "},
+ {139, 376, 2406, L""},
+ {139, 414, 415, L""},
+ {139, 414, 2405, L""},
+ {139, 380, 381, L"-"},
+ {139, 380, 3062, L" "},
+ {139, 380, 3038, L" "},
+ {139, 380, 1211, L"-"},
+ {139, 380, 2895, L""},
+ {139, 380, 2404, L""},
+ {139, 372, 3357, L" "},
+ {139, 372, 1212, L"-"},
+ {139, 372, 1213, L""},
+ {139, 372, 3103, L""},
+ {139, 372, 373, L""},
+ {139, 372, 2987, L""},
+ {139, 372, 2887, L""},
+ {139, 372, 2403, L""},
+ {139, 424, 1214, L"-"},
+ {139, 424, 425, L""},
+ {139, 424, 2402, L""},
+ {139, 348, 349, L""},
+ {139, 348, 3000, L""},
+ {139, 348, 2401, L""},
+ {139, 392, 393, L""},
+ {139, 392, 1215, L""},
+ {139, 392, 3143, L""},
+ {139, 392, 3337, L" "},
+ {139, 392, 2904, L" "},
+ {139, 392, 3329, L""},
+ {139, 392, 2400, L""},
+ {139, 386, 387, L""},
+ {139, 386, 1216, L""},
+ {139, 386, 2399, L""},
+ {139, 438, 439, L"-"},
+ {139, 438, 1217, L"-"},
+ {139, 438, 2890, L""},
+ {139, 438, 2398, L""},
+ {139, 362, 1219, L"-"},
+ {139, 362, 1218, L""},
+ {139, 362, 3276, L""},
+ {139, 362, 3073, L""},
+ {139, 362, 2955, L""},
+ {139, 362, 3349, L""},
+ {139, 362, 363, L""},
+ {139, 362, 3078, L""},
+ {139, 362, 3248, L" "},
+ {139, 362, 2397, L""},
+ {139, 360, 3134, L""},
+ {139, 360, 3081, L""},
+ {139, 360, 2997, L""},
+ {139, 360, 2999, L""},
+ {139, 360, 3139, L""},
+ {139, 360, 3060, L""},
+ {139, 360, 1220, L"-"},
+ {139, 360, 361, L""},
+ {139, 360, 2914, L""},
+ {139, 360, 3056, L" "},
+ {139, 360, 2396, L""},
+ {139, 432, 1222, L""},
+ {139, 432, 433, L"-"},
+ {139, 432, 2395, L""},
+ {139, 350, 2989, L""},
+ {139, 350, 351, L""},
+ {139, 350, 2950, L""},
+ {139, 350, 1221, L""},
+ {139, 350, 3111, L""},
+ {139, 350, 2898, L""},
+ {139, 350, 2938, L""},
+ {139, 350, 2394, L""},
+ {139, 366, 2953, L""},
+ {139, 366, 3112, L" "},
+ {139, 366, 1223, L""},
+ {139, 366, 367, L""},
+ {139, 366, 2951, L""},
+ {139, 366, 2862, L""},
+ {139, 366, 3034, L""},
+ {139, 366, 2860, L""},
+ {139, 366, 2393, L""},
+ {139, 420, 421, L"-"},
+ {139, 420, 1224, L""},
+ {139, 420, 2392, L""},
+ {139, 442, 2877, L"-"},
+ {139, 442, 2945, L"-"},
+ {139, 442, 1225, L""},
+ {139, 442, 443, L""},
+ {139, 442, 1226, L""},
+ {139, 442, 2391, L""},
+ {139, 364, 3316, L""},
+ {139, 364, 3282, L""},
+ {139, 364, 2972, L" "},
+ {139, 364, 1227, L""},
+ {139, 364, 2893, L""},
+ {139, 364, 3110, L" "},
+ {139, 364, 1228, L""},
+ {139, 364, 365, L""},
+ {139, 364, 2390, L""},
+ {139, 450, 451, L""},
+ {139, 450, 3093, L"-"},
+ {139, 450, 2389, L""},
+ {139, 356, 357, L""},
+ {139, 356, 2388, L""},
+ {139, 382, 383, L""},
+ {139, 382, 2387, L""},
+ {139, 398, 2960, L""},
+ {139, 398, 2915, L""},
+ {139, 398, 399, L""},
+ {139, 398, 2386, L""},
+ {139, 410, 2863, L""},
+ {139, 410, 411, L""},
+ {139, 410, 1229, L""},
+ {139, 410, 2385, L""},
+ {139, 422, 3085, L""},
+ {139, 422, 2913, L""},
+ {139, 422, 1233, L""},
+ {139, 422, 2916, L""},
+ {139, 422, 3123, L""},
+ {139, 422, 2873, L""},
+ {139, 422, 3096, L" "},
+ {139, 422, 423, L""},
+ {139, 422, 1232, L"-"},
+ {139, 422, 3023, L""},
+ {139, 422, 1231, L""},
+ {139, 422, 1230, L"-"},
+ {139, 422, 2384, L""},
+ {139, 406, 2383, L""},
+ {139, 404, 2879, L"-"},
+ {139, 404, 2880, L""},
+ {139, 404, 3086, L""},
+ {139, 404, 3002, L""},
+ {139, 404, 3124, L" "},
+ {139, 404, 2894, L"-"},
+ {139, 404, 3290, L"-"},
+ {139, 404, 1234, L""},
+ {139, 404, 1236, L""},
+ {139, 404, 3372, L" "},
+ {139, 404, 2952, L"-"},
+ {139, 404, 3340, L""},
+ {139, 404, 1235, L"-"},
+ {139, 404, 405, L""},
+ {139, 404, 2962, L" "},
+ {139, 404, 2382, L""},
+ {139, 384, 385, L""},
+ {139, 384, 2381, L""},
+ {139, 400, 401, L""},
+ {139, 400, 3090, L""},
+ {139, 400, 1237, L""},
+ {139, 400, 2380, L""},
+ {139, 436, 3036, L""},
+ {139, 436, 3024, L""},
+ {139, 436, 3108, L""},
+ {139, 436, 2866, L"-"},
+ {139, 436, 437, L"--"},
+ {139, 436, 2379, L""},
+ {39, 315, 614, L""},
+ {39, 315, 615, L""},
+ {39, 315, 2566, L""},
+ {39, 316, 2940, L""},
+ {39, 316, 616, L""},
+ {39, 316, 2565, L""},
+ {39, 317, 617, L""},
+ {39, 317, 618, L""},
+ {39, 317, 619, L" "},
+ {39, 317, 620, L""},
+ {39, 317, 621, L""},
+ {39, 317, 622, L""},
+ {39, 317, 623, L""},
+ {39, 317, 2564, L""},
+ {39, 318, 624, L""},
+ {39, 318, 625, L""},
+ {39, 318, 626, L""},
+ {39, 318, 627, L""},
+ {39, 318, 628, L""},
+ {39, 318, 629, L""},
+ {39, 318, 630, L""},
+ {39, 318, 2944, L""},
+ {39, 318, 631, L""},
+ {39, 318, 632, L""},
+ {39, 318, 633, L""},
+ {39, 318, 634, L""},
+ {39, 318, 635, L""},
+ {39, 318, 2563, L""},
+ {39, 319, 636, L""},
+ {39, 319, 637, L""},
+ {39, 319, 2942, L""},
+ {39, 319, 638, L""},
+ {39, 319, 2907, L""},
+ {39, 319, 639, L"-"},
+ {39, 319, 2562, L""},
+ {39, 320, 640, L""},
+ {39, 320, 641, L""},
+ {39, 320, 3119, L""},
+ {39, 320, 3162, L""},
+ {39, 320, 642, L""},
+ {39, 320, 643, L""},
+ {39, 320, 2561, L""},
+ {39, 321, 644, L""},
+ {39, 321, 3128, L""},
+ {39, 321, 645, L""},
+ {39, 321, 646, L""},
+ {39, 321, 3121, L""},
+ {39, 321, 3378, L""},
+ {39, 321, 2560, L""},
+ {39, 322, 3379, L""},
+ {39, 322, 647, L"-"},
+ {39, 322, 3170, L""},
+ {39, 322, 2559, L""},
+ {39, 323, 648, L" "},
+ {39, 323, 649, L""},
+ {39, 323, 651, L""},
+ {39, 323, 650, L""},
+ {39, 323, 652, L""},
+ {39, 323, 3341, L"-"},
+ {39, 323, 653, L""},
+ {39, 323, 654, L""},
+ {39, 323, 655, L""},
+ {39, 323, 2558, L""},
+ {39, 324, 656, L""},
+ {39, 324, 657, L""},
+ {39, 324, 658, L""},
+ {39, 324, 2557, L""},
+ {39, 325, 659, L""},
+ {39, 325, 2984, L""},
+ {39, 325, 3042, L""},
+ {39, 325, 660, L""},
+ {39, 325, 662, L""},
+ {39, 325, 3382, L""},
+ {39, 325, 663, L""},
+ {39, 325, 667, L""},
+ {39, 325, 666, L""},
+ {39, 325, 668, L""},
+ {39, 325, 669, L""},
+ {39, 325, 665, L""},
+ {39, 325, 661, L""},
+ {39, 325, 3370, L" "},
+ {39, 325, 670, L""},
+ {39, 325, 664, L""},
+ {39, 325, 3148, L""},
+ {39, 325, 671, L""},
+ {39, 325, 2556, L""},
+ {39, 326, 672, L""},
+ {39, 326, 673, L""},
+ {39, 326, 674, L""},
+ {39, 326, 675, L""},
+ {39, 326, 3364, L""},
+ {39, 326, 676, L""},
+ {39, 326, 677, L""},
+ {39, 326, 678, L""},
+ {39, 326, 679, L""},
+ {39, 326, 680, L""},
+ {39, 326, 2555, L""},
+ {39, 327, 3284, L""},
+ {39, 327, 681, L""},
+ {39, 327, 682, L""},
+ {39, 327, 2554, L""},
+ {39, 328, 3322, L""},
+ {39, 328, 2870, L""},
+ {39, 328, 683, L""},
+ {39, 328, 3118, L""},
+ {39, 328, 3325, L""},
+ {39, 328, 2553, L""},
+ {39, 329, 684, L"-"},
+ {39, 329, 685, L""},
+ {39, 329, 689, L""},
+ {39, 329, 686, L""},
+ {39, 329, 688, L""},
+ {39, 329, 687, L""},
+ {39, 329, 2552, L""},
+ {39, 330, 690, L""},
+ {39, 330, 691, L""},
+ {39, 330, 693, L""},
+ {39, 330, 694, L""},
+ {39, 330, 695, L""},
+ {39, 330, 692, L""},
+ {39, 330, 2551, L""},
+ {39, 331, 696, L""},
+ {39, 331, 697, L""},
+ {39, 331, 3361, L""},
+ {39, 331, 2550, L""},
+ {39, 332, 3356, L""},
+ {39, 332, 698, L""},
+ {39, 332, 700, L""},
+ {39, 332, 699, L""},
+ {39, 332, 701, L""},
+ {39, 332, 2549, L""},
+ {39, 333, 702, L""},
+ {39, 333, 3171, L""},
+ {39, 333, 703, L""},
+ {39, 333, 704, L""},
+ {39, 333, 2548, L""},
+ {39, 334, 705, L""},
+ {39, 334, 3346, L""},
+ {39, 334, 3351, L""},
+ {39, 334, 706, L""},
+ {39, 334, 708, L""},
+ {39, 334, 707, L""},
+ {39, 334, 709, L""},
+ {39, 334, 2547, L""},
+ {39, 335, 710, L""},
+ {39, 335, 711, L""},
+ {39, 335, 712, L" "},
+ {39, 335, 3280, L""},
+ {39, 335, 713, L""},
+ {39, 335, 2546, L""},
+ {39, 336, 714, L"-"},
+ {39, 336, 715, L""},
+ {39, 336, 2941, L""},
+ {39, 336, 716, L""},
+ {39, 336, 3120, L""},
+ {39, 336, 2943, L""},
+ {39, 336, 717, L""},
+ {39, 336, 3155, L""},
+ {39, 336, 2542, L""},
+ {39, 337, 3169, L""},
+ {39, 337, 3016, L""},
+ {39, 337, 3333, L""},
+ {39, 337, 718, L""},
+ {39, 337, 719, L""},
+ {39, 337, 720, L""},
+ {39, 337, 2545, L""},
+ {39, 338, 721, L""},
+ {39, 338, 722, L""},
+ {39, 338, 723, L""},
+ {39, 338, 2544, L""},
+ {39, 339, 724, L""},
+ {39, 339, 2543, L""},
+ {340, 342, 725, L""},
+ {340, 342, 726, L""},
+ {340, 342, 727, L""},
+ {340, 342, 728, L""},
+ {340, 342, 3172, L""},
+ {340, 342, 729, L""},
+ {340, 342, 730, L""},
+ {340, 342, 731, L""},
+ {340, 342, 732, L""},
+ {340, 342, 2538, L""},
+ {340, 343, 733, L""},
+ {340, 343, 735, L""},
+ {340, 343, 734, L""},
+ {340, 343, 736, L""},
+ {340, 343, 737, L""},
+ {340, 343, 738, L""},
+ {340, 343, 2537, L""},
+ {340, 344, 739, L""},
+ {340, 344, 740, L""},
+ {340, 344, 741, L""},
+ {340, 344, 742, L""},
+ {340, 344, 743, L""},
+ {340, 344, 744, L""},
+ {340, 344, 2536, L""},
+ {340, 345, 745, L""},
+ {340, 345, 746, L""},
+ {340, 345, 747, L""},
+ {340, 345, 3244, L""},
+ {340, 345, 748, L""},
+ {340, 345, 2535, L""},
+ {340, 346, 3149, L""},
+ {340, 346, 749, L""},
+ {340, 346, 750, L""},
+ {340, 346, 751, L""},
+ {340, 346, 752, L" "},
+ {340, 346, 753, L""},
+ {340, 346, 2896, L""},
+ {340, 346, 754, L""},
+ {340, 346, 755, L""},
+ {340, 346, 756, L""},
+ {340, 346, 2534, L""},
+ {340, 347, 757, L""},
+ {340, 347, 758, L""},
+ {340, 347, 759, L""},
+ {340, 347, 2533, L""},
+ {0, 0, 0, NULL}
+};
+
+
+
+
+#endif // !defined(AFX_MRA_PLACES_H__INCLUDED_) \ No newline at end of file
diff --git a/protocols/MRA/Docs/docs.rar b/protocols/MRA/Docs/docs.rar
new file mode 100644
index 0000000000..0542097afa
--- /dev/null
+++ b/protocols/MRA/Docs/docs.rar
Binary files differ
diff --git a/protocols/MRA/Docs/proto.htm b/protocols/MRA/Docs/proto.htm
new file mode 100644
index 0000000000..ec334ffb30
--- /dev/null
+++ b/protocols/MRA/Docs/proto.htm
@@ -0,0 +1,103 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!-- saved from url=(0028)http://agent.mail.ru/proto.h -->
+<HTML><HEAD>
+<META http-equiv=Content-Type content="text/html; charset=windows-1251">
+<META content="MSHTML 6.00.2900.2722" name=GENERATOR></HEAD>
+<BODY>//***************************************************************************
+// $Id: proto.h,v 1.141 2005/10/24 15:32:33 shingrus Exp $
+//***************************************************************************
+#ifndef MRIM_PROTO_H #define MRIM_PROTO_H #include <SYS types.h>#define
+PROTO_VERSION_MAJOR 1 #define PROTO_VERSION_MINOR 10 #define PROTO_VERSION
+((((u_long)(PROTO_VERSION_MAJOR))&lt;&lt;16)|(u_long)(PROTO_VERSION_MINOR))
+#define PROTO_MAJOR(p) (((p)&amp;0xFFFF0000)&gt;&gt;16) #define PROTO_MINOR(p)
+((p)&amp;0x0000FFFF) typedef struct mrim_packet_header_t { u_long magic; //
+Magic u_long proto; // u_long seq; // Sequence u_long msg; //
+ u_long dlen; // u_long from; // u_long
+fromport; // u_char reserved[16]; // }
+mrim_packet_header_t; #define CS_MAGIC 0xDEADBEEF // Magic ( C
+&lt;-&gt; S )
+/***************************************************************************
+ -
+***************************************************************************/
+#define MRIM_CS_HELLO 0x1001 // C -&gt; S // empty #define MRIM_CS_HELLO_ACK
+0x1002 // S -&gt; C // mrim_connection_params_t #define MRIM_CS_LOGIN_ACK 0x1004
+// S -&gt; C // empty #define MRIM_CS_LOGIN_REJ 0x1005 // S -&gt; C // LPS
+reason #define MRIM_CS_PING 0x1006 // C -&gt; S // empty #define MRIM_CS_MESSAGE
+0x1008 // C -&gt; S // UL flags // LPS to // LPS message // LPS rtf-formatted
+message (&gt;=1.1) #define MESSAGE_FLAG_OFFLINE 0x00000001 #define
+MESSAGE_FLAG_NORECV 0x00000004 #define MESSAGE_FLAG_AUTHORIZE 0x00000008 //
+X-MRIM-Flags: 00000008 #define MESSAGE_FLAG_SYSTEM 0x00000040 #define
+MESSAGE_FLAG_RTF 0x00000080 #define MESSAGE_FLAG_CONTACT 0x00000200 #define
+MESSAGE_FLAG_NOTIFY 0x00000400 #define MESSAGE_FLAG_MULTICAST 0x00001000 #define
+MAX_MULTICAST_RECIPIENTS 50 #define MESSAGE_USERFLAGS_MASK 0x000036A8 // Flags
+that user is allowed to set himself #define MRIM_CS_MESSAGE_ACK 0x1009 // S
+-&gt; C // UL msg_id // UL flags // LPS from // LPS message // LPS rtf-formatted
+message (&gt;=1.1) #define MRIM_CS_MESSAGE_RECV 0x1011 // C -&gt; S // LPS from
+// UL msg_id #define MRIM_CS_MESSAGE_STATUS 0x1012 // S -&gt; C // UL status
+#define MESSAGE_DELIVERED 0x0000 // Message delivered directly to user #define
+MESSAGE_REJECTED_NOUSER 0x8001 // Message rejected - no such user #define
+MESSAGE_REJECTED_INTERR 0x8003 // Internal server error #define
+MESSAGE_REJECTED_LIMIT_EXCEEDED 0x8004 // Offline messages limit exceeded
+#define MESSAGE_REJECTED_TOO_LARGE 0x8005 // Message is too large #define
+MESSAGE_REJECTED_DENY_OFFMSG 0x8006 // User does not accept offline messages
+#define MRIM_CS_USER_STATUS 0x100F // S -&gt; C // UL status #define
+STATUS_OFFLINE 0x00000000 #define STATUS_ONLINE 0x00000001 #define STATUS_AWAY
+0x00000002 #define STATUS_UNDETERMINATED 0x00000003 #define
+STATUS_FLAG_INVISIBLE 0x80000000 // LPS user #define MRIM_CS_LOGOUT 0x1013 // S
+-&gt; C // UL reason #define LOGOUT_NO_RELOGIN_FLAG 0x0010 // Logout due to
+double login #define MRIM_CS_CONNECTION_PARAMS 0x1014 // S -&gt; C //
+mrim_connection_params_t #define MRIM_CS_USER_INFO 0x1015 // S -&gt; C // (LPS
+key, LPS value)* X #define MRIM_CS_ADD_CONTACT 0x1019 // C -&gt; S // UL flags
+(group(2) or usual(0) // UL group id (unused if contact is group) // LPS contact
+// LPS name #define CONTACT_FLAG_REMOVED 0x00000001 #define CONTACT_FLAG_GROUP
+0x00000002 #define CONTACT_FLAG_INVISIBLE 0x00000004 #define
+CONTACT_FLAG_VISIBLE 0x00000008 #define CONTACT_FLAG_IGNORE 0x00000010 #define
+CONTACT_FLAG_SHADOW 0x00000020 #define MRIM_CS_ADD_CONTACT_ACK 0x101A // S -&gt;
+C // UL status // UL contact_id or (u_long)-1 if status is not OK #define
+CONTACT_OPER_SUCCESS 0x0000 #define CONTACT_OPER_ERROR 0x0001 #define
+CONTACT_OPER_INTERR 0x0002 #define CONTACT_OPER_NO_SUCH_USER 0x0003 #define
+CONTACT_OPER_INVALID_INFO 0x0004 #define CONTACT_OPER_USER_EXISTS 0x0005 #define
+CONTACT_OPER_GROUP_LIMIT 0x6 #define MRIM_CS_MODIFY_CONTACT 0x101B // C -&gt; S
+// UL id // UL flags - same as for MRIM_CS_ADD_CONTACT // UL group id (unused if
+contact is group) // LPS contact // LPS name #define MRIM_CS_MODIFY_CONTACT_ACK
+0x101C // S -&gt; C // UL status, same as for MRIM_CS_ADD_CONTACT_ACK #define
+MRIM_CS_OFFLINE_MESSAGE_ACK 0x101D // S -&gt; C // UIDL // LPS offline message
+#define MRIM_CS_DELETE_OFFLINE_MESSAGE 0x101E // C -&gt; S // UIDL #define
+MRIM_CS_AUTHORIZE 0x1020 // C -&gt; S // LPS user #define MRIM_CS_AUTHORIZE_ACK
+0x1021 // S -&gt; C // LPS user #define MRIM_CS_CHANGE_STATUS 0x1022 // C -&gt;
+S // UL new status #define MRIM_CS_GET_MPOP_SESSION 0x1024 // C -&gt; S #define
+MRIM_CS_MPOP_SESSION 0x1025 // S -&gt; C #define MRIM_GET_SESSION_FAIL 0 #define
+MRIM_GET_SESSION_SUCCESS 1 //UL status // LPS mpop session //white pages!
+#define MRIM_CS_WP_REQUEST 0x1029 //C-&gt;S //DWORD field, LPS value #define
+PARAMS_NUMBER_LIMIT 50 #define PARAM_VALUE_LENGTH_LIMIT 64 //if last symbol in
+value eq '*' it will be replaced by LIKE '%' // params define // must be in
+consecutive order (0..N) to quick check in check_anketa_info_request enum {
+MRIM_CS_WP_REQUEST_PARAM_USER = 0, MRIM_CS_WP_REQUEST_PARAM_DOMAIN,
+MRIM_CS_WP_REQUEST_PARAM_NICKNAME, MRIM_CS_WP_REQUEST_PARAM_FIRSTNAME,
+MRIM_CS_WP_REQUEST_PARAM_LASTNAME, MRIM_CS_WP_REQUEST_PARAM_SEX ,
+MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY, MRIM_CS_WP_REQUEST_PARAM_DATE1 ,
+MRIM_CS_WP_REQUEST_PARAM_DATE2 , //!!!!!!!!!!!!!!!!!!!online request param must
+be at end of request!!!!!!!!!!!!!!! MRIM_CS_WP_REQUEST_PARAM_ONLINE ,
+MRIM_CS_WP_REQUEST_PARAM_STATUS , // we do not used it, yet
+MRIM_CS_WP_REQUEST_PARAM_CITY_ID, MRIM_CS_WP_REQUEST_PARAM_ZODIAC,
+MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_MONTH, MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_DAY,
+MRIM_CS_WP_REQUEST_PARAM_COUNTRY_ID, MRIM_CS_WP_REQUEST_PARAM_MAX }; #define
+MRIM_CS_ANKETA_INFO 0x1028 //S-&gt;C //DWORD status #define
+MRIM_ANKETA_INFO_STATUS_OK 1 #define MRIM_ANKETA_INFO_STATUS_NOUSER 0 #define
+MRIM_ANKETA_INFO_STATUS_DBERR 2 #define MRIM_ANKETA_INFO_STATUS_RATELIMERR 3
+//DWORD fields_num //DWORD max_rows //DWORD server_time sec since 1970
+(unixtime) // fields set //%fields_num == 0 //values set //%fields_num == 0
+//LPS value (numbers too) #define MRIM_CS_MAILBOX_STATUS 0x1033 //DWORD new
+messages in mailbox #define MRIM_CS_CONTACT_LIST2 0x1037 //S-&gt;C // UL status
+#define GET_CONTACTS_OK 0x0000 #define GET_CONTACTS_ERROR 0x0001 #define
+GET_CONTACTS_INTERR 0x0002 //DWORD status - if ...OK than this staff: //DWORD
+groups number //mask symbols table: //'s' - lps //'u' - unsigned long //'z' -
+zero terminated string //LPS groups fields mask //LPS contacts fields mask
+//group fields //contacts fields //groups mask 'us' == flags, name //contact
+mask 'uussuu' flags, flags, internal flags, status #define
+CONTACT_INTFLAG_NOT_AUTHORIZED 0x0001 //old packet cs_login with cs_statistic
+#define MRIM_CS_LOGIN2 0x1038 // C -&gt; S #define MAX_CLIENT_DESCRIPTION 256 //
+LPS login // LPS password // DWORD status //+ statistic packet data: // LPS
+client description //max 256 typedef struct mrim_connection_params_t { unsigned
+long ping_period; } mrim_connection_params_t; #endif // MRIM_PROTO_H
+</BODY></HTML>
diff --git a/protocols/MRA/Docs/region.txt b/protocols/MRA/Docs/region.txt
new file mode 100644
index 0000000000..9beac5540a
--- /dev/null
+++ b/protocols/MRA/Docs/region.txt
@@ -0,0 +1,3353 @@
+id city_id country_id name
+24 0 24
+25 25 24 ,
+1734 25 24 ,,.
+3256 25 24 ,,
+1503 25 24 ,, ,.
+1507 25 24 ,, ,.
+1435 25 24 ,, ,.
+1434 25 24 ,, ,.
+1506 25 24 ,, ,.
+1436 25 24 ,, ,.
+1505 25 24 ,, ,.
+1324 25 24 ,, ,.
+1433 25 24 ,, ,.
+1325 25 24 ,, ,.
+534 25 24 ,, ,.
+1323 25 24 ,, ,.
+1504 25 24 ,, ,.
+1437 25 24 ,, ,.
+1432 25 24 ,, ,.
+3260 25 24 ,,
+1422 25 24 ,, ,.
+1616 25 24 ,, ,.
+1418 25 24 ,, ,.
+1420 25 24 ,, ,.
+1425 25 24 ,, ,.
+1419 25 24 ,, ,.
+3187 25 24 ,, ,.
+1421 25 24 ,, ,.
+1336 25 24 ,, ,.
+1426 25 24 ,, ,.
+1423 25 24 ,, ,.
+1424 25 24 ,, ,.
+1337 25 24 ,, ,. -
+3254 25 24 ,,
+1517 25 24 ,, ,.
+1614 25 24 ,, ,.
+1609 25 24 ,, ,.
+1612 25 24 ,, ,.
+1611 25 24 ,, ,.
+1608 25 24 ,, ,.
+1282 25 24 ,, ,.
+1280 25 24 ,, ,. -
+1518 25 24 ,, ,.
+1613 25 24 ,, ,.
+1283 25 24 ,, ,.
+1610 25 24 ,, ,.
+1281 25 24 ,, ,.
+3255 25 24 ,,-
+1316 25 24 ,,- ,.
+1276 25 24 ,,- ,.
+1317 25 24 ,,- ,.
+1321 25 24 ,,- ,.
+1277 25 24 ,,- ,.
+1319 25 24 ,,- ,.
+1318 25 24 ,,- ,.
+1279 25 24 ,,- ,.
+1322 25 24 ,,- ,.
+1278 25 24 ,,- ,.
+1320 25 24 ,,- ,.
+3261 25 24 ,,-
+1519 25 24 ,,- ,.
+1523 25 24 ,,- ,.
+1522 25 24 ,,- ,.
+1521 25 24 ,,- ,.
+1520 25 24 ,,- ,.
+3251 25 24 ,,
+1429 25 24 ,, ,.
+1428 25 24 ,, ,.
+1515 25 24 ,, ,.
+1431 25 24 ,, ,.
+1331 25 24 ,, ,. .
+1287 25 24 ,, ,.
+1618 25 24 ,, ,.
+1313 25 24 ,, ,. -
+1622 25 24 ,, ,.
+1615 25 24 ,, ,.
+1326 25 24 ,, ,.
+1327 25 24 ,, ,.
+1586 25 24 ,, ,.
+3132 25 24 ,, ,.
+1513 25 24 ,, ,.
+1621 25 24 ,, ,.
+1329 25 24 ,, ,.
+1501 25 24 ,, ,.
+1607 25 24 ,, ,.
+1284 25 24 ,, ,.
+1604 25 24 ,, ,.
+1624 25 24 ,, ,.
+1311 25 24 ,, ,.
+1330 25 24 ,, ,.
+1619 25 24 ,, ,.
+1617 25 24 ,, ,.
+1502 25 24 ,, ,.
+1430 25 24 ,, ,.
+1288 25 24 ,, ,.
+1512 25 24 ,, ,.
+1623 25 24 ,, ,.
+1514 25 24 ,, ,.
+1584 25 24 ,, ,.
+1289 25 24 ,, ,.
+1427 25 24 ,, ,.
+1333 25 24 ,, ,.
+1315 25 24 ,, ,.
+1620 25 24 ,, ,.
+1606 25 24 ,, ,.
+1605 25 24 ,, ,.
+1312 25 24 ,, ,.
+3253 25 24 ,, ,.
+1516 25 24 ,, ,. 1905
+1332 25 24 ,, ,.
+1285 25 24 ,, ,.
+1286 25 24 ,, ,.
+1328 25 24 ,, ,.
+1585 25 24 ,, ,.
+3257 25 24 ,,-
+1592 25 24 ,,- ,.
+1511 25 24 ,,- ,.
+1590 25 24 ,,- ,.
+1587 25 24 ,,- ,.
+1588 25 24 ,,- ,.
+1509 25 24 ,,- ,.
+1591 25 24 ,,- ,.
+1593 25 24 ,,- ,.
+1589 25 24 ,,- ,.
+1508 25 24 ,,- ,.
+1510 25 24 ,,- ,.
+3259 25 24 ,,-
+1309 25 24 ,,- ,.
+1295 25 24 ,,- ,.
+1308 25 24 ,,- ,.
+1304 25 24 ,,- ,.
+1300 25 24 ,,- ,.
+3188 25 24 ,,- ,.
+1305 25 24 ,,- ,.
+1595 25 24 ,,- ,.
+1303 25 24 ,,- ,.
+1334 25 24 ,,- ,.
+1293 25 24 ,,- ,.
+1306 25 24 ,,- ,.
+1307 25 24 ,,- ,.
+1294 25 24 ,,- ,.
+1302 25 24 ,,- ,.
+1335 25 24 ,,- ,.
+1301 25 24 ,,- ,.
+3258 25 24 ,,
+1603 25 24 ,, ,.
+1298 25 24 ,, ,.
+1594 25 24 ,, ,.
+1597 25 24 ,, ,.
+1600 25 24 ,, ,.
+1601 25 24 ,, ,.
+1602 25 24 ,, ,.
+1596 25 24 ,, ,.
+1291 25 24 ,, ,.
+1292 25 24 ,, ,.
+1598 25 24 ,, ,.
+1297 25 24 ,, ,.
+1290 25 24 ,, ,.
+1299 25 24 ,, ,.
+1599 25 24 ,, ,.
+1310 25 24 ,, ,.
+1296 25 24 ,, ,.
+226 226 24 ,-
+1970 226 24 ,-, -
+1968 226 24 ,-, -
+1964 226 24 ,-, -
+1377 226 24 ,-,
+1965 226 24 ,-, -
+1971 226 24 ,-, -
+1961 226 24 ,-,
+1975 226 24 ,-, -
+1966 226 24 ,-, -
+1383 226 24 ,-,
+1978 226 24 ,-, -
+1981 226 24 ,-, -
+1382 226 24 ,-,
+1962 226 24 ,-, -
+1385 226 24 ,-,
+1980 226 24 ,-, -
+1972 226 24 ,-, -
+1974 226 24 ,-, -
+1387 226 24 ,-,
+1977 226 24 ,-, -
+1982 226 24 ,-,
+1967 226 24 ,-, -
+1960 226 24 ,-,
+1979 226 24 ,-, -
+1963 226 24 ,-, -
+1388 226 24 ,-,
+1976 226 24 ,-, -
+1390 226 24 ,-,
+1973 226 24 ,-, -
+1969 226 24 ,-, -
+3186 0 24 ,
+233 233 24 , , ()
+474 233 24 , , (),
+2809 233 24 , , (),
+2804 233 24 , , (),
+475 233 24 , , (),
+477 233 24 , , (),
+476 233 24 , , (),
+2806 233 24 , , (),
+3115 233 24 , , (),
+2808 233 24 , , (),
+2807 233 24 , , (),
+2805 233 24 , , (),
+478 233 24 , , (),-
+479 233 24 , , (),
+2263 233 24 , , (),
+232 232 24 , ,
+2819 232 24 , , ,
+464 232 24 , , ,
+465 232 24 , , ,
+466 232 24 , , ,
+2817 232 24 , , ,
+2818 232 24 , , ,
+3359 232 24 , , ,
+467 232 24 , , ,-
+468 232 24 , , ,
+469 232 24 , , ,
+470 232 24 , , ,
+471 232 24 , , ,
+472 232 24 , , ,
+2816 232 24 , , ,-
+473 232 24 , , ,
+2258 232 24 , , ,
+235 235 24 , ,
+487 235 24 , , ,
+2821 235 24 , , ,
+488 235 24 , , ,
+2820 235 24 , , ,
+489 235 24 , , ,--
+490 235 24 , , ,--
+491 235 24 , , ,
+3353 235 24 , , ,
+492 235 24 , , ,
+2280 235 24 , , ,
+227 227 24 , , .
+455 227 24 , , .,
+456 227 24 , , .,
+2814 227 24 , , .,
+2813 227 24 , , .,
+2815 227 24 , , .,
+2812 227 24 , , .,
+2811 227 24 , , .,
+457 227 24 , , .,
+2217 227 24 , , .,
+2218 227 24 , , .,
+229 229 24 , , .
+460 229 24 , , .,
+2822 229 24 , , .,
+459 229 24 , , .,-.
+2234 229 24 , , .,
+231 231 24 , , .
+462 231 24 , , .,
+2823 231 24 , , .,
+463 231 24 , , .,
+2246 231 24 , , .,
+234 234 24 , , .
+480 234 24 , , .,-
+2829 234 24 , , .,
+2833 234 24 , , .,
+2825 234 24 , , .,
+481 234 24 , , .,
+482 234 24 , , .,
+2826 234 24 , , .,
+2832 234 24 , , .,
+2836 234 24 , , .,
+2830 234 24 , , .,
+483 234 24 , , .,
+2828 234 24 , , .,
+2824 234 24 , , .,-
+2827 234 24 , , .,
+2831 234 24 , , .,
+484 234 24 , , .,
+2834 234 24 , , .,
+2835 234 24 , , .,
+485 234 24 , , .,-
+486 234 24 , , .,-
+2264 234 24 , , .,
+228 228 24 , ,
+458 228 24 , , ,
+2810 228 24 , , ,
+2226 228 24 , , ,
+230 230 24 , ,
+461 230 24 , , ,
+2239 230 24 , , ,
+236 236 24 , ,
+493 236 24 , , ,
+2287 236 24 , , ,
+3183 236 24 ,
+237 237 24 , ,
+2850 237 24 , ,,
+2851 237 24 , ,,
+2657 237 24 , ,,
+2662 237 24 , ,,
+494 237 24 , ,,
+2658 237 24 , ,,
+2660 237 24 , ,,
+2659 237 24 , ,,
+2663 237 24 , ,,
+495 237 24 , ,,
+496 237 24 , ,,
+2655 237 24 , ,,
+497 237 24 , ,,
+2654 237 24 , ,,
+499 237 24 , ,,
+2656 237 24 , ,,
+498 237 24 , ,,
+500 237 24 , ,,
+2661 237 24 , ,,
+501 237 24 , ,,
+502 237 24 , ,,
+2664 237 24 , ,,
+2220 237 24 , ,,
+240 240 24 , ,-
+509 240 24 , ,-,
+510 240 24 , ,-,
+511 240 24 , ,-,-
+512 240 24 , ,-,
+2247 240 24 , ,-,
+241 241 24 , ,
+513 241 24 , ,,
+2147 241 24 , ,,
+2150 241 24 , ,,
+2148 241 24 , ,,
+2910 241 24 , ,,
+515 241 24 , ,,
+514 241 24 , ,,
+2149 241 24 , ,,
+2923 241 24 , ,,
+2248 241 24 , ,,
+248 248 24 , ,
+2569 248 24 , ,,
+2575 248 24 , ,,
+569 248 24 , ,,
+570 248 24 , ,,
+2571 248 24 , ,,
+571 248 24 , ,,
+2570 248 24 , ,,
+572 248 24 , ,,
+573 248 24 , ,,
+2576 248 24 , ,,
+574 248 24 , ,,
+575 248 24 , ,,
+2577 248 24 , ,,
+2572 248 24 , ,,
+576 248 24 , ,,
+2573 248 24 , ,,
+577 248 24 , ,,
+578 248 24 , ,,
+579 248 24 , ,,
+2574 248 24 , ,,
+580 248 24 , ,,
+2271 248 24 , ,,
+249 249 24 , ,
+3311 249 24 , ,,
+581 249 24 , ,,
+582 249 24 , ,,
+583 249 24 , ,,
+584 249 24 , ,,
+2665 249 24 , ,,
+585 249 24 , ,,
+586 249 24 , ,,
+587 249 24 , ,,
+2277 249 24 , ,,
+251 251 24 , ,
+2158 251 24 , ,,
+2156 251 24 , ,,
+2151 251 24 , ,,
+2152 251 24 , ,,
+2155 251 24 , ,,
+2153 251 24 , ,,
+592 251 24 , ,,
+2157 251 24 , ,,
+2154 251 24 , ,,
+2286 251 24 , ,,
+238 238 24 , , .
+2168 238 24 , , .,
+503 238 24 , , .,
+2164 238 24 , , .,
+504 238 24 , , .,
+505 238 24 , , .,-
+2160 238 24 , , .,
+506 238 24 , , .,
+2167 238 24 , , .,
+2159 238 24 , , .,
+2169 238 24 , , .,
+2163 238 24 , , .,
+2170 238 24 , , .,
+2166 238 24 , , .,
+2165 238 24 , , .,
+2162 238 24 , , .,
+2171 238 24 , , .,
+2161 238 24 , , .,
+507 238 24 , , .,
+2237 238 24 , , .,
+242 242 24 , , .
+516 242 24 , , .,
+517 242 24 , , .,
+2139 242 24 , , .,
+518 242 24 , , .,
+519 242 24 , , .,
+520 242 24 , , .,
+2140 242 24 , , .,
+2138 242 24 , , .,
+521 242 24 , , .,
+2137 242 24 , , .,
+522 242 24 , , .,
+523 242 24 , , .,
+524 242 24 , , .,
+2891 242 24 , , .,
+525 242 24 , , .,
+2145 242 24 , , .,
+2143 242 24 , , .,
+2144 242 24 , , .,
+2146 242 24 , , .,
+526 242 24 , , .,
+527 242 24 , , .,
+2135 242 24 , , .,
+528 242 24 , , .,
+529 242 24 , , .,
+530 242 24 , , .,
+2141 242 24 , , .,
+2136 242 24 , , .,
+2897 242 24 , , .,
+2142 242 24 , , .,
+2251 242 24 , , .,
+243 243 24 , , .
+2678 243 24 , , .,
+2673 243 24 , , .,
+531 243 24 , , .,
+532 243 24 , , .,
+2674 243 24 , , .,
+2675 243 24 , , .,
+533 243 24 , , .,
+535 243 24 , , .,
+536 243 24 , , .,
+3360 243 24 , , .,
+2677 243 24 , , .,-
+2676 243 24 , , .,
+537 243 24 , , .,
+538 243 24 , , .,
+2254 243 24 , , .,
+244 244 24 , , .
+539 244 24 , , .,
+2597 244 24 , , .,
+2595 244 24 , , .,
+2593 244 24 , , .,
+540 244 24 , , .,
+2598 244 24 , , .,
+2592 244 24 , , .,
+541 244 24 , , .,
+3304 244 24 , , .,
+2596 244 24 , , .,
+2594 244 24 , , .,
+2256 244 24 , , .,
+245 245 24 , , .
+2690 245 24 , , .,
+542 245 24 , , .,
+2679 245 24 , , .,
+2680 245 24 , , .,
+2687 245 24 , , .,
+2686 245 24 , , .,
+543 245 24 , , .,
+544 245 24 , , .,
+2681 245 24 , , .,
+545 245 24 , , .,
+546 245 24 , , .,
+547 245 24 , , .,
+548 245 24 , , .,
+2683 245 24 , , .,
+2684 245 24 , , .,
+2682 245 24 , , .,
+549 245 24 , , .,
+550 245 24 , , .,
+2685 245 24 , , .,
+551 245 24 , , .,
+2689 245 24 , , .,
+2688 245 24 , , .,
+552 245 24 , , .,
+553 245 24 , , .,
+2257 245 24 , , .,
+246 246 24 , , .
+554 246 24 , , .,
+555 246 24 , , .,
+2599 246 24 , , .,
+3293 246 24 , , .,
+2602 246 24 , , .,
+556 246 24 , , .,
+2600 246 24 , , .,
+557 246 24 , , .,
+558 246 24 , , .,
+559 246 24 , , .,
+560 246 24 , , .,
+561 246 24 , , .,
+2601 246 24 , , .,
+562 246 24 , , .,
+2261 246 24 , , .,
+247 247 24 , , .
+2613 247 24 , , .,
+2606 247 24 , , .,
+563 247 24 , , .,
+564 247 24 , , .,
+565 247 24 , , .,
+2608 247 24 , , .,
+2607 247 24 , , .,
+2609 247 24 , , .,
+2610 247 24 , , .,
+2605 247 24 , , .,
+566 247 24 , , .,
+2603 247 24 , , .,
+2604 247 24 , , .,
+2612 247 24 , , .,
+567 247 24 , , .,
+2611 247 24 , , .,
+568 247 24 , , .,
+3267 247 24 , , .,-12
+2262 247 24 , , .,
+250 250 24 , , .
+2614 250 24 , , .,
+588 250 24 , , .,
+2615 250 24 , , .,
+589 250 24 , , .,
+2616 250 24 , , .,
+590 250 24 , , .,
+591 250 24 , , .,
+2278 250 24 , , .,
+239 239 24 , ,-
+508 239 24 , ,- ,
+2238 239 24 , ,- ,
+3181 239 24 ,-
+255 255 24 ,- ,
+1355 255 24 ,- ,,
+1356 255 24 ,- ,,
+1357 255 24 ,- ,,
+1358 255 24 ,- ,,
+1359 255 24 ,- ,,
+1360 255 24 ,- ,,
+1362 255 24 ,- ,,
+1361 255 24 ,- ,,
+3286 255 24 ,- ,,
+1937 255 24 ,- ,,
+1363 255 24 ,- ,,
+1938 255 24 ,- ,,
+3287 255 24 ,- ,,
+1936 255 24 ,- ,,
+1364 255 24 ,- ,,
+1365 255 24 ,- ,,
+1939 255 24 ,- ,,
+2201 255 24 ,- ,,
+256 256 24 ,- ,
+1366 256 24 ,- ,,
+1367 256 24 ,- ,,
+2202 256 24 ,- ,,
+1368 256 24 ,- ,,
+1940 256 24 ,- ,,
+1369 256 24 ,- ,,
+1941 256 24 ,- ,,
+1370 256 24 ,- ,,
+1371 256 24 ,- ,,
+1372 256 24 ,- ,,
+2203 256 24 ,- ,,
+252 252 24 ,- , .
+593 252 24 ,- , .,
+594 252 24 ,- , .,
+1945 252 24 ,- , .,
+595 252 24 ,- , .,
+596 252 24 ,- , .,
+1944 252 24 ,- , .,
+597 252 24 ,- , .,
+598 252 24 ,- , .,
+1946 252 24 ,- , .,
+599 252 24 ,- , .,
+600 252 24 ,- , .,
+601 252 24 ,- , .,
+1942 252 24 ,- , .,
+3239 252 24 ,- , .,
+1943 252 24 ,- , .,
+2204 252 24 ,- , .,
+253 253 24 ,- , .
+1950 253 24 ,- , .,
+1949 253 24 ,- , .,
+1338 253 24 ,- , .,
+1339 253 24 ,- , .,
+1951 253 24 ,- , .,
+1340 253 24 ,- , .,
+1952 253 24 ,- , .,
+2871 253 24 ,- , .,
+1341 253 24 ,- , .,
+1955 253 24 ,- , .,
+1342 253 24 ,- , .,
+1947 253 24 ,- , .,
+1343 253 24 ,- , .,
+1953 253 24 ,- , .,
+1954 253 24 ,- , .,
+1948 253 24 ,- , .,
+1344 253 24 ,- , .,
+2205 253 24 ,- , .,
+254 254 24 ,- , .
+2838 254 24 ,- , .,
+1345 254 24 ,- , .,
+2846 254 24 ,- , .,
+2843 254 24 ,- , .,
+1346 254 24 ,- , .,
+1347 254 24 ,- , .,
+1348 254 24 ,- , .,
+2842 254 24 ,- , .,
+2845 254 24 ,- , .,
+2848 254 24 ,- , .,
+2837 254 24 ,- , .,
+2844 254 24 ,- , .,
+1349 254 24 ,- , .,
+2841 254 24 ,- , .,
+2839 254 24 ,- , .,
+1350 254 24 ,- , .,
+1351 254 24 ,- , .,
+1352 254 24 ,- , .,
+2840 254 24 ,- , .,
+1353 254 24 ,- , .,
+1354 254 24 ,- , .,
+2231 254 24 ,- , .,
+257 257 24 ,- , .
+1985 257 24 ,- , .,
+1374 257 24 ,- , .,
+1373 257 24 ,- , .,
+1375 257 24 ,- , .,
+1995 257 24 ,- , .,
+1376 257 24 ,- , .,
+1378 257 24 ,- , .,
+1993 257 24 ,- , .,
+1379 257 24 ,- , .,
+1380 257 24 ,- , .,
+1381 257 24 ,- , .,
+1384 257 24 ,- , .,
+1984 257 24 ,- , .,
+1990 257 24 ,- , .,
+1994 257 24 ,- , .,
+1386 257 24 ,- , .,
+1987 257 24 ,- , .,
+1996 257 24 ,- , .,
+1986 257 24 ,- , .,
+1983 257 24 ,- , .,
+1992 257 24 ,- , .,
+1988 257 24 ,- , .,
+3071 257 24 ,- , .,
+1989 257 24 ,- , .,
+1389 257 24 ,- , .,
+1991 257 24 ,- , .,
+1391 257 24 ,- , .,
+1392 257 24 ,- , .,
+1393 257 24 ,- , .,
+1394 257 24 ,- , .,
+2207 257 24 ,- , .,
+258 258 24 ,- , .
+1395 258 24 ,- , .,
+1959 258 24 ,- , .,
+1396 258 24 ,- , .,
+1397 258 24 ,- , .,
+1398 258 24 ,- , .,
+1399 258 24 ,- , .,
+1958 258 24 ,- , .,
+1400 258 24 ,- , .,
+1401 258 24 ,- , .,
+1402 258 24 ,- , .,
+1403 258 24 ,- , .,
+1404 258 24 ,- , .,
+1956 258 24 ,- , .,
+1957 258 24 ,- , .,
+3288 258 24 ,- , .,
+2206 258 24 ,- , .,
+260 260 24 ,- , .
+1406 260 24 ,- , .,
+2001 260 24 ,- , .,
+2003 260 24 ,- , .,
+1407 260 24 ,- , .,
+1408 260 24 ,- , .,
+2002 260 24 ,- , .,
+1409 260 24 ,- , .,
+2000 260 24 ,- , .,
+1997 260 24 ,- , .,
+1410 260 24 ,- , .,
+1998 260 24 ,- , .,
+1999 260 24 ,- , .,
+2208 260 24 ,- , .,
+261 261 24 ,- , .
+1412 261 24 ,- , .,
+2004 261 24 ,- , .,
+2009 261 24 ,- , .,
+2005 261 24 ,- , .,
+1413 261 24 ,- , .,
+2006 261 24 ,- , .,
+2008 261 24 ,- , .,
+1414 261 24 ,- , .,
+1415 261 24 ,- , .,
+1411 261 24 ,- , .,
+1416 261 24 ,- , .,
+2007 261 24 ,- , .,
+1417 261 24 ,- , .,
+2209 261 24 ,- , .,
+259 259 24 ,- ,
+1405 259 24 ,- , ,-
+2250 259 24 ,- , ,
+3185 259 24 ,
+265 265 24 , ,
+2764 265 24 , ,,
+2760 265 24 , ,,
+2762 265 24 , ,,
+2763 265 24 , ,,
+2761 265 24 , ,,
+1446 265 24 , ,,-
+2222 265 24 , ,,
+263 263 24 , ,
+1439 263 24 , , ,-
+2215 263 24 , , ,
+273 273 24 , ,
+2766 273 24 , ,,-
+1494 273 24 , ,,
+2768 273 24 , ,,
+2767 273 24 , ,,
+2765 273 24 , ,,
+2275 273 24 , ,,
+275 275 24 , ,
+2769 275 24 , ,,
+1496 275 24 , ,,
+1497 275 24 , ,,
+2770 275 24 , ,,
+2771 275 24 , ,,
+2281 275 24 , ,,
+264 264 24 , ,
+1440 264 24 , , ,
+1441 264 24 , , ,
+1442 264 24 , , ,
+1443 264 24 , , ,
+2728 264 24 , , ,
+2731 264 24 , , ,
+2729 264 24 , , ,
+2732 264 24 , , ,--
+3292 264 24 , , ,
+2730 264 24 , , ,
+1444 264 24 , , ,
+1445 264 24 , , ,
+3231 264 24 , , ,
+2216 264 24 , , ,
+268 268 24 , ,
+2781 268 24 , , ,
+1469 268 24 , , ,
+2784 268 24 , , ,
+2773 268 24 , , ,
+2774 268 24 , , ,
+3122 268 24 , , ,
+2772 268 24 , , ,
+3294 268 24 , , ,
+2777 268 24 , , ,
+1470 268 24 , , ,
+2778 268 24 , , ,
+2782 268 24 , , ,
+2783 268 24 , , ,
+1471 268 24 , , ,
+1472 268 24 , , ,
+1473 268 24 , , ,
+2775 268 24 , , ,
+2776 268 24 , , ,
+2780 268 24 , , ,
+2779 268 24 , , ,
+2785 268 24 , , ,
+1474 268 24 , , ,
+2242 268 24 , , ,
+266 266 24 , , .
+2792 266 24 , , .,
+1447 266 24 , , .,
+1448 266 24 , , .,
+2791 266 24 , , .,
+1450 266 24 , , .,
+1451 266 24 , , .,
+2793 266 24 , , .,
+2789 266 24 , , .,-
+2786 266 24 , , .,
+1452 266 24 , , .,
+2794 266 24 , , .,
+2787 266 24 , , .,
+1449 266 24 , , .,
+2790 266 24 , , .,
+1453 266 24 , , .,
+2788 266 24 , , .,
+1454 266 24 , , .,
+1455 266 24 , , .,-
+2908 266 24 , , .,
+1456 266 24 , , .,-
+1457 266 24 , , .,-
+1458 266 24 , , .,
+1459 266 24 , , .,
+2795 266 24 , , .,
+2229 266 24 , , .,
+267 267 24 , , .
+2737 267 24 , , .,-
+2740 267 24 , , .,
+2746 267 24 , , .,
+2739 267 24 , , .,
+2742 267 24 , , .,
+1460 267 24 , , .,
+1461 267 24 , , .,
+2738 267 24 , , .,-
+2745 267 24 , , .,
+1462 267 24 , , .,
+1463 267 24 , , .,
+1464 267 24 , , .,
+2744 267 24 , , .,
+3358 267 24 , , .,
+1465 267 24 , , .,
+1466 267 24 , , .,
+2743 267 24 , , .,
+2741 267 24 , , .,
+1467 267 24 , , .,
+1468 267 24 , , .,
+2236 267 24 , , .,
+269 269 24 , , .
+1475 269 24 , , .,
+1476 269 24 , , .,
+1477 269 24 , , .,
+2750 269 24 , , .,
+1478 269 24 , , .,
+2752 269 24 , , .,
+2751 269 24 , , .,
+3107 269 24 , , .,
+2753 269 24 , , .,
+2755 269 24 , , .,
+1479 269 24 , , .,
+2759 269 24 , , .,
+2756 269 24 , , .,
+2758 269 24 , , .,
+2757 269 24 , , .,
+2754 269 24 , , .,
+2252 269 24 , , .,
+270 270 24 , , .
+2733 270 24 , , .,
+1480 270 24 , , .,
+1481 270 24 , , .,
+2735 270 24 , , .,
+1482 270 24 , , .,
+2734 270 24 , , .,
+2736 270 24 , , .,
+2253 270 24 , , .,
+272 272 24 , , .
+1488 272 24 , , .,
+1489 272 24 , , .,
+3295 272 24 , , .,
+1491 272 24 , , .,
+1492 272 24 , , .,
+1493 272 24 , , .,
+1490 272 24 , , .,
+2273 272 24 , , .,
+276 276 24 , , .
+2803 276 24 , , .,
+2799 276 24 , , .,
+1499 276 24 , , .,
+2801 276 24 , , .,
+2800 276 24 , , .,
+2802 276 24 , , .,-
+2798 276 24 , , .,
+2796 276 24 , , .,
+1498 276 24 , , .,
+2797 276 24 , , .,
+2285 276 24 , , .,
+262 262 24 , ,
+1438 262 24 , , ,
+2213 262 24 , , ,
+271 271 24 , ,
+3233 271 24 , , ,
+1485 271 24 , , ,
+1487 271 24 , , ,
+1483 271 24 , , ,
+1484 271 24 , , ,
+1486 271 24 , , ,
+2269 271 24 , , ,
+274 274 24 , ,-
+1495 274 24 , ,- ,-
+2279 274 24 , ,- ,
+277 277 24 , ,
+1500 277 24 , , ,
+2288 277 24 , , ,
+3184 277 24 ,
+278 278 24 , , .
+2668 278 24 , , .,
+2667 278 24 , , .,
+1524 278 24 , , .,
+2669 278 24 , , .,
+2666 278 24 , , .,
+2671 278 24 , , .,
+1525 278 24 , , .,
+2670 278 24 , , .,
+2672 278 24 , , .,
+2243 278 24 , , .,
+279 279 24 , , .
+1526 279 24 , , .,
+1527 279 24 , , .,
+2691 279 24 , , .,
+1528 279 24 , , .,
+2924 279 24 , , .,
+2707 279 24 , , .,
+1529 279 24 , , .,
+2698 279 24 , , .,
+1530 279 24 , , .,
+1531 279 24 , , .,
+1532 279 24 , , .,
+2696 279 24 , , .,
+2692 279 24 , , .,
+2706 279 24 , , .,
+2709 279 24 , , .,
+1533 279 24 , , .,
+1534 279 24 , , .,
+1535 279 24 , , .,
+1536 279 24 , , .,
+1537 279 24 , , .,-
+1538 279 24 , , .,
+2708 279 24 , , .,
+1539 279 24 , , .,
+2712 279 24 , , .,
+1540 279 24 , , .,
+2694 279 24 , , .,
+2693 279 24 , , .,
+1541 279 24 , , .,
+2711 279 24 , , .,
+2713 279 24 , , .,
+1542 279 24 , , .,
+2702 279 24 , , .,
+1543 279 24 , , .,
+2695 279 24 , , .,
+2697 279 24 , , .,
+2699 279 24 , , .,
+2909 279 24 , , .,
+1544 279 24 , , .,
+1545 279 24 , , .,
+1546 279 24 , , .,
+1547 279 24 , , .,
+3296 279 24 , , .,
+2700 279 24 , , .,
+1548 279 24 , , .,
+2710 279 24 , , .,
+2701 279 24 , , .,
+2703 279 24 , , .,
+1549 279 24 , , .,
+2704 279 24 , , .,
+2705 279 24 , , .,
+2265 279 24 , , .,
+280 280 24 , , .
+1550 280 24 , , .,
+1551 280 24 , , .,
+3326 280 24 , , .,
+1552 280 24 , , .,
+1553 280 24 , , .,
+2748 280 24 , , .,
+2276 280 24 , , .,
+282 282 24 , , .
+1564 282 24 , , .,
+2723 282 24 , , .,
+2724 282 24 , , .,
+2716 282 24 , , .,
+3297 282 24 , , .,
+2725 282 24 , , .,
+1565 282 24 , , .,
+2722 282 24 , , .,
+1566 282 24 , , .,
+2718 282 24 , , .,
+2720 282 24 , , .,-
+1567 282 24 , , .,
+2721 282 24 , , .,
+2715 282 24 , , .,
+1568 282 24 , , .,
+1569 282 24 , , .,
+1570 282 24 , , .,
+2726 282 24 , , .,
+2717 282 24 , , .,
+3100 282 24 , , .,
+1571 282 24 , , .,
+2719 282 24 , , .,
+2727 282 24 , , .,
+1572 282 24 , , .,
+3332 282 24 , , .,
+1573 282 24 , , .,
+1574 282 24 , , .,-
+1575 282 24 , , .,
+1576 282 24 , , .,
+1577 282 24 , , .,
+2714 282 24 , , .,
+2283 282 24 , , .,
+281 281 24 , ,- -
+2749 281 24 , ,- - ,
+1554 281 24 , ,- - ,
+1555 281 24 , ,- - ,
+1556 281 24 , ,- - ,
+1561 281 24 , ,- - ,
+1562 281 24 , ,- - ,
+1559 281 24 , ,- - ,
+2852 281 24 , ,- - ,
+2853 281 24 , ,- - ,
+2854 281 24 , ,- - ,-
+1560 281 24 , ,- - ,
+1563 281 24 , ,- - ,
+2747 281 24 , ,- - ,
+1557 281 24 , ,- - ,
+1558 281 24 , ,- - ,-
+3344 281 24 , ,- - ,
+2282 281 24 , ,- - ,
+283 283 24 , ,-
+3298 283 24 , ,- ,
+1578 283 24 , ,- ,
+2856 283 24 , ,- ,
+1579 283 24 , ,- ,
+1580 283 24 , ,- ,
+1581 283 24 , ,- ,
+1582 283 24 , ,- ,
+1583 283 24 , ,- ,
+2289 283 24 , ,- ,
+3180 283 24 ,
+284 284 24 , , .
+1625 284 24 , , .,
+1626 284 24 , , .,
+2172 284 24 , , .,
+2173 284 24 , , .,
+1627 284 24 , , .,
+2174 284 24 , , .,
+2175 284 24 , , .,
+1628 284 24 , , .,
+1629 284 24 , , .,
+2221 284 24 , , .,
+285 285 24 , , .
+1630 285 24 , , .,
+3283 285 24 , , .,
+1631 285 24 , , .,
+2013 285 24 , , .,
+2015 285 24 , , .,
+1632 285 24 , , .,
+1633 285 24 , , .,
+1634 285 24 , , .,
+2016 285 24 , , .,
+2018 285 24 , , .,
+2017 285 24 , , .,
+2020 285 24 , , .,
+2014 285 24 , , .,
+2010 285 24 , , .,
+2012 285 24 , , .,
+2011 285 24 , , .,
+2019 285 24 , , .,
+2210 285 24 , , .,
+286 286 24 , , .
+1635 286 24 , , .,
+1636 286 24 , , .,
+2021 286 24 , , .,
+1637 286 24 , , .,
+2022 286 24 , , .,
+1638 286 24 , , .,-
+2023 286 24 , , .,
+2031 286 24 , , .,
+2024 286 24 , , .,
+1639 286 24 , , .,
+1640 286 24 , , .,
+2026 286 24 , , .,
+3299 286 24 , , .,
+2033 286 24 , , .,
+2025 286 24 , , .,
+1641 286 24 , , .,
+1642 286 24 , , .,
+2027 286 24 , , .,
+2211 286 24 , , .,
+2028 286 24 , , .,
+2032 286 24 , , .,
+2029 286 24 , , .,
+1643 286 24 , , .,
+2030 286 24 , , .,-
+2212 286 24 , , .,
+287 287 24 , , .
+1644 287 24 , , .,
+1645 287 24 , , .,
+1646 287 24 , , .,
+1647 287 24 , , .,
+1648 287 24 , , .,
+2178 287 24 , , .,
+2176 287 24 , , .,
+1649 287 24 , , .,
+2177 287 24 , , .,
+2180 287 24 , , .,
+1650 287 24 , , .,
+2181 287 24 , , .,
+1651 287 24 , , .,
+2179 287 24 , , .,
+2182 287 24 , , .,
+2224 287 24 , , .,
+288 288 24 , , .
+1652 288 24 , , .,
+2036 288 24 , , .,
+1657 288 24 , , .,
+1653 288 24 , , .,
+1656 288 24 , , .,
+2040 288 24 , , .,
+2037 288 24 , , .,
+2043 288 24 , , .,
+3300 288 24 , , .,
+2039 288 24 , , .,
+2038 288 24 , , .,
+2042 288 24 , , .,
+2044 288 24 , , .,
+1655 288 24 , , .,
+2034 288 24 , , .,
+1654 288 24 , , .,
+2041 288 24 , , .,
+2035 288 24 , , .,
+2227 288 24 , , .,
+289 289 24 , , .
+2050 289 24 , , .,
+2051 289 24 , , .,
+3301 289 24 , , .,
+2052 289 24 , , .,
+1660 289 24 , , .,
+1658 289 24 , , .,
+2046 289 24 , , .,
+1661 289 24 , , .,
+2053 289 24 , , .,
+2049 289 24 , , .,
+1659 289 24 , , .,
+2054 289 24 , , .,
+2055 289 24 , , .,
+2047 289 24 , , .,
+1662 289 24 , , .,
+2057 289 24 , , .,
+2056 289 24 , , .,-
+2045 289 24 , , .,
+1663 289 24 , , .,
+2131 289 24 , , .,
+2048 289 24 , , .,
+2233 289 24 , , .,
+290 290 24 , , .
+1664 290 24 , , .,
+1665 290 24 , , .,
+1666 290 24 , , .,
+2059 290 24 , , .,
+1667 290 24 , , .,
+3302 290 24 , , .,--
+1668 290 24 , , .,
+2060 290 24 , , .,
+1669 290 24 , , .,
+2061 290 24 , , .,
+2062 290 24 , , .,
+2058 290 24 , , .,
+1670 290 24 , , .,
+2240 290 24 , , .,
+291 291 24 , , .
+1671 291 24 , , .,-
+1673 291 24 , , .,
+3279 291 24 , , .,
+1672 291 24 , , .,
+2187 291 24 , , .,
+2188 291 24 , , .,
+2184 291 24 , , .,
+2185 291 24 , , .,
+2183 291 24 , , .,
+2189 291 24 , , .,
+2186 291 24 , , .,
+2244 291 24 , , .,
+292 292 24 , , .
+2194 292 24 , , .,
+2193 292 24 , , .,
+1674 292 24 , , .,
+2190 292 24 , , .,
+2195 292 24 , , .,
+1675 292 24 , , .,
+2192 292 24 , , .,
+2191 292 24 , , .,
+2245 292 24 , , .,
+293 293 24 , , .
+1733 293 24 , , .,
+1732 293 24 , , .,
+1731 293 24 , , .,
+1730 293 24 , , .,
+2063 293 24 , , .,
+2064 293 24 , , .,
+1729 293 24 , , .,
+1728 293 24 , , .,
+1727 293 24 , , .,
+2065 293 24 , , .,
+1726 293 24 , , .,
+1725 293 24 , , .,
+1724 293 24 , , .,
+1723 293 24 , , .,
+2066 293 24 , , .,
+1722 293 24 , , .,
+1721 293 24 , , .,
+1720 293 24 , , .,
+1719 293 24 , , .,
+2067 293 24 , , .,
+1718 293 24 , , .,
+1715 293 24 , , .,
+1717 293 24 , , .,
+2068 293 24 , , .,
+2069 293 24 , , .,
+1716 293 24 , , .,
+1714 293 24 , , .,
+1713 293 24 , , .,
+1712 293 24 , , .,
+1711 293 24 , , .,
+1710 293 24 , , .,
+2070 293 24 , , .,
+2071 293 24 , , .,
+1709 293 24 , , .,-
+1708 293 24 , , .,
+2072 293 24 , , .,-
+1707 293 24 , , .,
+1706 293 24 , , .,
+1705 293 24 , , .,
+1704 293 24 , , .,
+1703 293 24 , , .,
+1702 293 24 , , .,
+1701 293 24 , , .,-
+1700 293 24 , , .,
+1698 293 24 , , .,
+2073 293 24 , , .,
+2074 293 24 , , .,
+1699 293 24 , , .,-
+1697 293 24 , , .,
+1696 293 24 , , .,
+1695 293 24 , , .,
+1694 293 24 , , .,
+1693 293 24 , , .,
+1692 293 24 , , .,
+1691 293 24 , , .,
+1690 293 24 , , .,
+2075 293 24 , , .,
+2076 293 24 , , .,
+1689 293 24 , , .,
+1688 293 24 , , .,
+1687 293 24 , , .,
+1686 293 24 , , .,
+2077 293 24 , , .,
+2078 293 24 , , .,
+1685 293 24 , , .,
+1684 293 24 , , .,
+1683 293 24 , , .,
+1682 293 24 , , .,
+1681 293 24 , , .,
+1680 293 24 , , .,
+1679 293 24 , , .,
+1678 293 24 , , .,
+2080 293 24 , , .,
+1677 293 24 , , .,
+1676 293 24 , , .,
+2079 293 24 , , .,
+3031 293 24 , , .,
+2081 293 24 , , .,
+2249 293 24 , , .,
+294 294 24 , , .
+2083 294 24 , , .,
+2082 294 24 , , .,-
+3160 294 24 , , .,
+1736 294 24 , , .,
+2084 294 24 , , .,
+1737 294 24 , , .,
+2085 294 24 , , .,
+1735 294 24 , , .,
+2255 294 24 , , .,
+295 295 24 , , .
+1740 295 24 , , .,-
+1741 295 24 , , .,
+2086 295 24 , , .,
+2087 295 24 , , .,
+2089 295 24 , , .,
+2091 295 24 , , .,
+2093 295 24 , , .,
+1738 295 24 , , .,
+3305 295 24 , , .,
+1739 295 24 , , .,
+2090 295 24 , , .,
+2088 295 24 , , .,-
+2092 295 24 , , .,-
+2094 295 24 , , .,
+3320 295 24 , , .,
+2260 295 24 , , .,
+296 296 24 , , .
+2095 296 24 , , .,
+1743 296 24 , , .,
+1744 296 24 , , .,
+2096 296 24 , , .,
+1745 296 24 , , .,
+1746 296 24 , , .,
+2097 296 24 , , .,
+2098 296 24 , , .,
+2099 296 24 , , .,
+2100 296 24 , , .,
+2101 296 24 , , .,
+1747 296 24 , , .,
+1742 296 24 , , .,
+2102 296 24 , , .,
+1748 296 24 , , .,
+2267 296 24 , , .,
+297 297 24 , , .
+2198 297 24 , , .,
+2199 297 24 , , .,
+1752 297 24 , , .,
+1751 297 24 , , .,
+2196 297 24 , , .,
+1750 297 24 , , .,
+3271 297 24 , , .,
+1749 297 24 , , .,
+3272 297 24 , , .,
+2197 297 24 , , .,
+2270 297 24 , , .,
+298 298 24 , , .
+2103 298 24 , , .,
+2104 298 24 , , .,
+2105 298 24 , , .,
+2106 298 24 , , .,
+2107 298 24 , , .,
+1753 298 24 , , .,
+2108 298 24 , , .,
+2109 298 24 , , .,
+2110 298 24 , , .,
+2111 298 24 , , .,
+1758 298 24 , , .,
+1756 298 24 , , .,
+2112 298 24 , , .,
+1759 298 24 , , .,
+1760 298 24 , , .,
+1761 298 24 , , .,
+2113 298 24 , , .,
+1757 298 24 , , .,
+2114 298 24 , , .,
+1754 298 24 , , .,
+2115 298 24 , , .,
+2116 298 24 , , .,
+1755 298 24 , , .,
+2272 298 24 , , .,
+299 299 24 , , .
+2127 299 24 , , .,
+2126 299 24 , , .,
+2118 299 24 , , .,
+2122 299 24 , , .,
+2129 299 24 , , .,
+1762 299 24 , , .,
+2128 299 24 , , .,
+3354 299 24 , , .,
+2124 299 24 , , .,
+1763 299 24 , , .,
+2123 299 24 , , .,
+1764 299 24 , , .,
+2117 299 24 , , .,
+2130 299 24 , , .,-
+2120 299 24 , , .,
+2119 299 24 , , .,
+2125 299 24 , , .,
+1765 299 24 , , .,
+1766 299 24 , , .,
+2121 299 24 , , .,
+1767 299 24 , , .,
+2274 299 24 , , .,
+300 300 24 , , .
+3053 300 24 , , .,
+3268 300 24 , , .,
+1773 300 24 , , .,-
+2132 300 24 , , .,
+3269 300 24 , , .,
+2133 300 24 , , .,
+3270 300 24 , , .,
+1774 300 24 , , .,
+2994 300 24 , , .,
+1775 300 24 , , .,-
+2134 300 24 , , .,
+1769 300 24 , , .,
+1771 300 24 , , .,
+1772 300 24 , , .,
+1770 300 24 , , .,
+1768 300 24 , , .,
+2290 300 24 , , .,
+3182 300 24 ,
+301 301 24 , ,
+2849 301 24 , ,,
+1776 301 24 , ,,
+2214 301 24 , ,,
+304 304 24 , ,
+2617 304 24 , ,,
+1791 304 24 , ,,
+1788 304 24 , ,,
+2619 304 24 , ,,
+1789 304 24 , ,,
+2618 304 24 , ,,
+1790 304 24 , ,,
+1792 304 24 , ,,
+2620 304 24 , ,,
+2225 304 24 , ,,
+305 305 24 , ,
+3052 305 24 , ,,
+1787 305 24 , ,,
+2228 305 24 , ,,
+306 306 24 , ,-
+2621 306 24 , ,-,
+1794 306 24 , ,-,
+1793 306 24 , ,-,
+2622 306 24 , ,-,
+1795 306 24 , ,-,
+2623 306 24 , ,-,
+2624 306 24 , ,-,
+3274 306 24 , ,-,
+2230 306 24 , ,-,
+307 307 24 , ,
+2567 307 24 , ,,
+2568 307 24 , ,,
+3324 307 24 , ,,
+1796 307 24 , ,,
+2232 307 24 , ,,
+308 308 24 , ,-
+1799 308 24 , ,-,
+1798 308 24 , ,-,
+2626 308 24 , ,-,
+2625 308 24 , ,-,-
+1797 308 24 , ,-,
+2235 308 24 , ,-,
+311 311 24 , , -
+2630 311 24 , , - ,
+2631 311 24 , , - ,
+2628 311 24 , , - ,
+1839 311 24 , , - ,
+2629 311 24 , , - ,
+2627 311 24 , , - ,
+2266 311 24 , , - ,
+313 313 24 , ,
+2632 313 24 , ,,
+1853 313 24 , ,,
+2633 313 24 , ,,
+2284 313 24 , ,,
+309 309 24 , ,
+2636 309 24 , , ,
+1800 309 24 , , ,
+1801 309 24 , , ,
+1802 309 24 , , ,
+1803 309 24 , , ,
+1804 309 24 , , ,
+1805 309 24 , , ,
+2637 309 24 , , ,
+1806 309 24 , , ,
+1807 309 24 , , ,
+2638 309 24 , , ,
+1808 309 24 , , ,
+1809 309 24 , , ,
+1810 309 24 , , ,
+1811 309 24 , , ,
+3232 309 24 , , ,
+2639 309 24 , , ,
+1812 309 24 , , ,
+1813 309 24 , , ,
+1814 309 24 , , ,-
+3102 309 24 , , ,
+1815 309 24 , , ,--
+1816 309 24 , , ,
+3266 309 24 , , ,
+3039 309 24 , , ,
+1817 309 24 , , ,
+2635 309 24 , , ,
+1818 309 24 , , ,
+1819 309 24 , , ,
+1820 309 24 , , ,-
+2634 309 24 , , ,
+2241 309 24 , , ,
+312 312 24 , ,
+1840 312 24 , , ,
+2644 312 24 , , ,
+1841 312 24 , , ,
+1842 312 24 , , ,
+1843 312 24 , , ,
+1844 312 24 , , ,
+2647 312 24 , , ,
+2641 312 24 , , ,
+2642 312 24 , , ,
+1845 312 24 , , ,
+1846 312 24 , , ,
+3367 312 24 , , ,
+3265 312 24 , , ,
+1847 312 24 , , ,
+1848 312 24 , , ,
+1849 312 24 , , ,
+2645 312 24 , , ,
+2643 312 24 , , ,
+1850 312 24 , , ,
+1851 312 24 , , ,
+1852 312 24 , , ,
+2646 312 24 , , ,
+2640 312 24 , , ,
+2268 312 24 , , ,
+302 302 24 , , .
+1777 302 24 , , .,
+1778 302 24 , , .,
+3383 302 24 , , .,
+2578 302 24 , , .,
+2579 302 24 , , .,
+1786 302 24 , , .,
+2219 302 24 , , .,
+303 303 24 , , .
+1779 303 24 , , .,
+1780 303 24 , , .,
+2584 303 24 , , .,
+1781 303 24 , , .,
+1782 303 24 , , .,--
+1783 303 24 , , .,
+2588 303 24 , , .,
+2591 303 24 , , .,
+2587 303 24 , , .,
+2582 303 24 , , .,
+2590 303 24 , , .,
+1784 303 24 , , .,
+2581 303 24 , , .,
+2583 303 24 , , .,
+2580 303 24 , , .,
+2589 303 24 , , .,
+2585 303 24 , , .,
+1785 303 24 , , .,
+2586 303 24 , , .,
+2223 303 24 , , .,
+310 310 24 , , .
+1821 310 24 , , .,
+1822 310 24 , , .,
+1823 310 24 , , .,
+1824 310 24 , , .,
+1825 310 24 , , .,
+1826 310 24 , , .,
+1827 310 24 , , .,
+2651 310 24 , , .,
+1828 310 24 , , .,
+3264 310 24 , , .,
+2652 310 24 , , .,-
+2649 310 24 , , .,
+2648 310 24 , , .,
+1829 310 24 , , .,
+2653 310 24 , , .,
+1830 310 24 , , .,
+1831 310 24 , , .,
+1832 310 24 , , .,
+1833 310 24 , , .,--
+1834 310 24 , , .,
+1835 310 24 , , .,
+1836 310 24 , , .,
+1837 310 24 , , .,-
+3263 310 24 , , .,
+2650 310 24 , , .,
+1838 310 24 , , .,
+2259 310 24 , , .,
+28 0 0
+81 0 81 ,
+1055 1055 81 ,,
+1058 1058 81 ,,
+1056 1056 81 ,,
+1057 1057 81 ,,
+3153 3153 81 ,,
+2291 2291 81 ,,
+82 0 82 ,
+2932 2932 82 ,,
+1060 1060 82 ,,
+3084 3084 82 ,,
+3011 3011 82 ,,
+3306 3306 82 ,,
+1059 1059 82 ,,
+3145 3145 82 ,,
+2292 2292 82 ,,
+97 0 97 ,
+1061 1061 97 ,,
+2293 2293 97 ,,
+96 0 96 ,
+1062 1062 96 ,,
+2294 2294 96 ,,
+99 0 99 ,
+1063 1063 99 ,,
+2295 2295 99 ,,
+100 0 100 ,-
+1064 1064 100 ,-,--
+2296 2296 100 ,-,
+101 0 101 ,
+1065 1065 101 ,,
+2297 2297 101 ,,
+102 0 102 ,
+1066 1066 102 ,,
+2298 2298 102 ,,
+83 0 83 ,
+1067 1067 83 ,,
+3158 3158 83 ,,
+1068 1068 83 ,,
+3129 3129 83 ,,
+1069 1069 83 ,,
+1070 1070 83 ,,
+2299 2299 83 ,,
+86 0 86 ,
+3345 3345 86 ,,
+1071 1071 86 ,,
+2992 2992 86 ,,
+3175 3175 86 ,,
+3363 3363 86 ,,-
+2884 2884 86 ,,-
+3243 3243 86 ,,-
+1074 1074 86 ,,-
+3348 3348 86 ,,
+3241 3241 86 ,,
+1075 1075 86 ,,
+3350 3350 86 ,,-
+2982 2982 86 ,,
+2971 2971 86 ,,-
+3136 3136 86 ,,
+1080 1080 86 ,,
+3303 3303 86 ,,
+3050 3050 86 ,,
+3151 3151 86 ,,
+3141 3141 86 ,,
+3012 3012 86 ,,
+1081 1081 86 ,,
+1077 1077 86 ,,-
+1079 1079 86 ,,
+1078 1078 86 ,,
+1076 1076 86 ,,
+2929 2929 86 ,,
+2928 2928 86 ,,
+2300 2300 86 ,,
+95 0 95 ,
+3315 3315 95 ,,
+1082 1082 95 ,,
+1083 1083 95 ,,
+3144 3144 95 ,,
+3025 3025 95 ,,
+3277 3277 95 ,,
+1084 1084 95 ,,
+2301 2301 95 ,,
+103 0 103 ,
+1085 1085 103 ,,
+2302 2302 103 ,,
+79 0 79 ,
+1086 1086 79 ,,
+2303 2303 79 ,,
+85 0 85 ,
+1087 1087 85 ,,
+2304 2304 85 ,,
+87 0 87 ,
+1088 1088 87 ,,
+2305 2305 87 ,,
+104 0 104 ,
+1089 1089 104 ,,
+2306 2306 104 ,,
+84 0 84 ,
+1090 1090 84 ,,
+1091 1091 84 ,,
+1092 1092 84 ,,-
+3242 3242 84 ,,
+1093 1093 84 ,,
+1094 1094 84 ,, ()
+1095 1095 84 ,,
+3245 3245 84 ,,
+3083 3083 84 ,,
+1096 1096 84 ,,
+1097 1097 84 ,,
+1098 1098 84 ,,
+1099 1099 84 ,,
+2868 2868 84 ,,
+1100 1100 84 ,,
+1101 1101 84 ,, (.-. .)
+1102 1102 84 ,,
+1103 1103 84 ,,
+1104 1104 84 ,,
+3166 3166 84 ,,
+1105 1105 84 ,,-
+2927 2927 84 ,,
+1106 1106 84 ,,
+1107 1107 84 ,,
+1108 1108 84 ,,-
+1109 1109 84 ,,
+1110 1110 84 ,,
+2307 2307 84 ,,
+105 0 105 ,
+1111 1111 105 ,,
+2308 2308 105 ,,
+106 0 106 ,
+1112 1112 106 ,,
+2309 2309 106 ,,
+107 0 107 ,
+1113 1113 107 ,,
+1114 1114 107 ,,
+1115 1115 107 ,,
+2954 2954 107 ,,
+2310 2310 107 ,,
+92 0 92 , ()
+1116 1116 92 , (),
+1117 1117 92 , (),-
+3027 3027 92 , (),-
+1118 1118 92 , (),
+1119 1119 92 , (),
+1120 1120 92 , (),
+2933 2933 92 , (),
+2311 2311 92 , (),
+76 0 76 ,
+3214 3214 76 ,, ()
+1121 1121 76 ,,
+2869 2869 76 ,,
+3262 3262 76 ,,
+1122 1122 76 ,,
+1123 1123 76 ,,
+1124 1124 76 ,,
+3043 3043 76 ,,
+2312 2312 76 ,,
+3215 0 3215 , (.)
+29 0 29 , ()
+1125 1125 29 , (),
+2313 2313 29 , (),
+108 0 108 ,,
+1126 1126 108 ,, ,
+3240 3240 108 ,, ,
+2314 2314 108 ,, ,
+88 0 88 ,
+1127 1127 88 ,,-
+2315 2315 88 ,,
+109 0 109 ,
+1128 1128 109 ,,
+2316 2316 109 ,,
+110 0 110 ,
+1129 1129 110 ,,
+2317 2317 110 ,,
+111 0 111 ,
+1130 1130 111 ,,-
+1131 1131 111 ,,-
+2318 2318 111 ,,
+112 0 112 ,
+1132 1132 112 ,,
+2319 2319 112 ,,
+113 0 113 ,
+1133 1133 113 ,,-
+1134 1134 113 ,,
+2320 2320 113 ,,
+114 0 114 ,
+1135 1135 114 ,,
+2321 2321 114 ,,
+115 0 115 ,
+1136 1136 115 ,,
+2322 2322 115 ,,
+116 0 116 ,
+1137 1137 116 , ,-
+1138 1138 116 , ,
+1139 1139 116 , ,
+2323 2323 116 , ,
+117 0 117 ,
+1140 1140 117 ,,
+2324 2324 117 ,,
+3216 0 3216 , (.)
+122 0 122 ,
+1141 1141 122 ,,
+2325 2325 122 ,,
+89 0 89 ,
+1072 1072 89 ,,
+1073 1073 89 ,,
+1142 1142 89 ,,
+2326 2326 89 ,,
+94 0 94 ,
+3250 3250 94 , ,
+1143 1143 94 , ,-
+2327 2327 94 , ,
+118 0 118 ,
+78 0 78 ,
+1144 1144 78 ,,
+2328 2328 78 ,,
+91 0 91 ,
+1145 1145 91 ,,
+3307 3307 91 ,,
+3308 3308 91 ,,
+2329 2329 91 ,,
+119 0 119 ,
+1146 1146 119 ,,
+1147 1147 119 ,,
+2330 2330 119 ,,
+120 0 120 ,
+1148 1148 120 ,,
+2331 2331 120 ,,
+132 0 132 ,
+1149 1149 132 ,,
+2332 2332 132 ,,
+90 0 90 ,
+1150 1150 90 ,,
+3079 3079 90 ,,
+2333 2333 90 ,,
+77 0 77 ,
+1152 1152 77 ,,
+1153 1153 77 ,,
+3080 3080 77 ,,
+1151 1151 77 ,,
+1154 1154 77 ,,
+1155 1155 77 ,,
+2334 2334 77 ,,
+93 0 93 ,
+3362 3362 93 ,,
+3137 3137 93 ,,
+3273 3273 93 ,,
+1156 1156 93 ,,
+1157 1157 93 ,,
+3167 3167 93 ,,
+3347 3347 93 ,,
+1158 1158 93 ,,
+1159 1159 93 ,,
+1160 1160 93 ,,
+1161 1161 93 ,,
+1162 1162 93 ,,
+1163 1163 93 ,,
+1164 1164 93 ,,
+2335 2335 93 ,,
+121 0 121 ,
+1165 1165 121 ,,
+3319 3319 121 ,,
+2336 2336 121 ,,
+98 0 98 ,
+1166 1166 98 , ,
+2337 2337 98 , ,
+75 0 75 ,
+3176 3176 75 ,,
+3339 3339 75 ,,
+1167 1167 75 ,,
+1168 1168 75 ,,
+2338 2338 75 ,,
+31 0 0
+123 0 123 ,
+1914 1914 123 ,,
+2957 2957 123 ,,
+1915 1915 123 ,,
+3331 3331 123 ,,
+1916 1916 123 ,,
+3001 3001 123 ,,
+1917 1917 123 ,,
+3217 3217 123 ,,
+3064 3064 123 ,,
+3020 3020 123 ,,
+1918 1918 123 ,,
+3238 3238 123 ,,
+2339 2339 123 ,,
+454 0 454 ,
+1192 1192 454 , ,-
+2366 2366 454 , ,
+124 0 124 ,
+1919 1919 124 ,,-
+2340 2340 124 ,,
+453 0 453 , ()
+1193 1193 453 , (),
+2368 2368 453 , (),
+126 0 126 ,
+1921 1921 126 ,,
+2342 2342 126 ,,
+127 0 127 ,
+1922 1922 127 , ,
+2343 2343 127 , ,
+128 0 128 , ( )
+1923 1923 128 , ( ),
+2344 2344 128 , ( ),
+129 0 129 ,
+1924 1924 129 ,,
+2345 2345 129 ,,
+3220 0 3220 , (..)
+130 0 130 ,
+1925 1925 130 , ,
+1926 1926 130 , ,
+1928 1928 130 , ,
+1929 1929 130 , ,
+3235 3235 130 , ,
+1927 1927 130 , ,
+3323 3323 130 , ,
+2346 2346 130 , ,
+3218 0 3218 , (.)
+3221 0 3221 , (..)
+3230 0 3230 , (.)
+131 0 131 ,
+1930 1930 131 ,,
+2347 2347 131 ,,
+133 0 133 , -
+1931 1931 133 , - ,-
+2348 2348 133 , - ,
+3222 0 3222 , (.)
+125 0 125 ,
+1920 1920 125 ,,
+2341 2341 125 ,,
+3219 0 3219 ,. ()
+134 0 134 ,
+1932 1932 134 , ,
+2349 2349 134 , ,
+3223 0 3223 , (..)
+135 0 135 ,
+1933 1933 135 ,,
+2350 2350 135 ,,
+136 0 136 ,
+1934 1934 136 ,,
+2351 2351 136 ,,
+3224 0 3224 , (.)
+137 0 137 ,
+1935 1935 137 ,,
+2352 2352 137 ,,
+3226 0 3226 ,
+3225 0 3225 ,
+30 0 0
+138 0 138 ,
+3055 3055 138 ,,
+3049 3049 138 ,,
+3330 3330 138 ,,
+1169 1169 138 ,,
+3106 3106 138 ,,
+1170 1170 138 ,,
+1171 1171 138 ,,
+1172 1172 138 ,,
+3365 3365 138 ,,
+1173 1173 138 ,,
+3104 3104 138 ,,
+3366 3366 138 ,,
+1174 1174 138 ,,
+2964 2964 138 ,,
+3113 3113 138 ,,
+1175 1175 138 ,,
+2920 2920 138 ,,-
+2889 2889 138 ,,-
+1176 1176 138 ,,
+2903 2903 138 ,,
+1177 1177 138 ,,
+1178 1178 138 ,,
+2946 2946 138 ,,
+1179 1179 138 ,,
+1180 1180 138 ,,
+2353 2353 138 ,,
+139 0 139 ,
+407 407 139 ,,,
+426 426 139 ,,
+427 426 139 ,,,
+2354 426 139 ,,,
+378 378 139 ,,
+3109 378 139 ,,,
+379 378 139 ,,,-
+2963 378 139 ,,,
+2355 378 139 ,,,
+412 412 139 ,,
+3236 412 139 ,,,
+413 412 139 ,,,
+1181 412 139 ,,,
+2356 412 139 ,,,
+446 446 139 ,,
+1182 446 139 ,,,
+447 446 139 ,,,
+1183 446 139 ,,,
+2357 446 139 ,,,
+434 434 139 ,,
+2917 434 139 ,,,
+1184 434 139 ,,,
+435 434 139 ,,,
+3061 434 139 ,,,
+2358 434 139 ,,,
+416 416 139 ,,
+417 416 139 ,,,-
+2359 416 139 ,,,
+428 428 139 ,,
+3017 428 139 ,,,
+429 428 139 ,,,
+2360 428 139 ,,,
+440 440 139 ,,
+2956 440 139 ,,,
+2967 440 139 ,,,
+3385 440 139 ,,,
+2865 440 139 ,,,
+441 440 139 ,,,
+3352 440 139 ,,,
+2876 440 139 ,,,
+3003 440 139 ,,,
+1185 440 139 ,,,
+2983 440 139 ,,,
+1186 440 139 ,,,
+3152 440 139 ,,,
+2886 440 139 ,,,
+2361 440 139 ,,,
+352 352 139 ,,
+353 352 139 ,,,
+2861 352 139 ,,,
+2362 352 139 ,,,
+394 394 139 ,,
+1188 394 139 ,,,
+1187 394 139 ,,,
+2969 394 139 ,,,
+1189 394 139 ,,,
+3114 394 139 ,,,
+2885 394 139 ,,,-
+2979 394 139 ,,,
+3338 394 139 ,,,
+395 394 139 ,,,
+3005 394 139 ,,,
+2991 394 139 ,,,
+2996 394 139 ,,,
+3097 394 139 ,,,
+2981 394 139 ,,,
+2363 394 139 ,,,
+374 374 139 ,,
+2995 374 139 ,,,-
+375 374 139 ,,,
+2365 374 139 ,,,
+448 448 139 ,,
+449 448 139 ,,,
+1191 448 139 ,,,
+2367 448 139 ,,,
+390 390 139 ,,
+3021 390 139 ,,,
+391 390 139 ,,,
+2973 390 139 ,,,
+2369 390 139 ,,,
+402 402 139 ,,
+403 402 139 ,,,
+2370 402 139 ,,,
+396 396 139 ,,
+397 396 139 ,, ,
+2371 396 139 ,, ,
+370 370 139 ,,
+2911 370 139 ,,,
+3074 370 139 ,,,
+371 370 139 ,,,
+2930 370 139 ,,,
+1194 370 139 ,,,
+2372 370 139 ,,,
+368 368 139 ,,
+369 368 139 ,,,
+1195 368 139 ,,,
+2373 368 139 ,,,
+444 444 139 ,,
+2959 444 139 ,,,
+2961 444 139 ,,,
+2912 444 139 ,,,
+2899 444 139 ,,,
+1196 444 139 ,,,
+3249 444 139 ,,,
+3014 444 139 ,,,
+3048 444 139 ,,,
+2901 444 139 ,,,-
+2926 444 139 ,,,
+2922 444 139 ,,,
+1203 444 139 ,,,
+2978 444 139 ,,,
+2990 444 139 ,,,
+3077 444 139 ,,,
+2918 444 139 ,,,
+2881 444 139 ,,,
+3247 444 139 ,,,
+3092 444 139 ,,,
+2948 444 139 ,,,
+1197 444 139 ,,,-
+1198 444 139 ,,,-
+3058 444 139 ,,,-
+3328 444 139 ,,,--
+2874 444 139 ,,,-
+2998 444 139 ,,,
+3087 444 139 ,,,
+2947 444 139 ,,,
+2900 444 139 ,,,
+1199 444 139 ,,,
+3335 444 139 ,,,
+2966 444 139 ,,,
+445 444 139 ,,,
+1200 444 139 ,,,-
+3317 444 139 ,,,-
+1201 444 139 ,,,-
+1202 444 139 ,,,-
+2878 444 139 ,,,
+2925 444 139 ,,,-
+2875 444 139 ,,,-
+1204 444 139 ,,,-
+2859 444 139 ,,,-
+3157 444 139 ,,,
+3146 444 139 ,,,
+2970 444 139 ,,,
+2949 444 139 ,,,-
+3057 444 139 ,,,
+3032 444 139 ,,,-
+3381 444 139 ,,,
+3028 444 139 ,,,
+2858 444 139 ,,,
+3040 444 139 ,,,
+2374 444 139 ,,,
+388 388 139 ,,
+3041 388 139 ,,,
+389 388 139 ,,,
+2375 388 139 ,,,
+408 408 139 ,,
+3004 408 139 ,,,
+1205 408 139 ,,,
+409 408 139 ,,,
+2376 408 139 ,,,
+430 430 139 ,,
+1206 430 139 ,,,
+3095 430 139 ,,,
+431 430 139 ,,,
+1207 430 139 ,,,-
+3046 430 139 ,,,
+2377 430 139 ,,,
+358 358 139 ,,
+2968 358 139 ,,,
+3018 358 139 ,,,
+2882 358 139 ,,,
+359 358 139 ,,,
+3047 358 139 ,,,
+2378 358 139 ,,,
+418 418 139 ,,
+419 418 139 ,,,-
+1208 418 139 ,,,
+2408 418 139 ,,,
+354 354 139 ,,
+2931 354 139 ,,,
+3334 354 139 ,,,
+355 354 139 ,,,
+3059 354 139 ,,,
+2919 354 139 ,,,
+2902 354 139 ,,,
+1209 354 139 ,,,
+3336 354 139 ,,,
+2985 354 139 ,,,
+3022 354 139 ,,,
+2407 354 139 ,,,
+376 376 139 ,,
+1210 376 139 ,,,
+2980 376 139 ,,,
+377 376 139 ,,,-
+3035 376 139 ,,,
+2406 376 139 ,,,
+414 414 139 ,,
+415 414 139 ,,,
+2405 414 139 ,,,
+380 380 139 ,,
+381 380 139 ,,,-
+3062 380 139 ,,,
+3038 380 139 ,,,
+1211 380 139 ,,,-
+2895 380 139 ,,,
+2404 380 139 ,,,
+372 372 139 ,,
+3357 372 139 ,,,
+1212 372 139 ,,,-
+1213 372 139 ,,,
+3103 372 139 ,,,
+373 372 139 ,,,
+2987 372 139 ,,,
+2887 372 139 ,,,
+2403 372 139 ,,,
+424 424 139 ,,
+1214 424 139 ,,,-
+425 424 139 ,,,
+2402 424 139 ,,,
+348 348 139 ,,
+349 348 139 ,,,
+3000 348 139 ,,,
+2401 348 139 ,,,
+392 392 139 ,,
+393 392 139 ,,,
+1215 392 139 ,,,
+3143 392 139 ,,,
+3337 392 139 ,,,
+2904 392 139 ,,,
+3329 392 139 ,,,
+2400 392 139 ,,,
+386 386 139 ,,
+387 386 139 ,,,
+1216 386 139 ,,,
+2399 386 139 ,,,
+438 438 139 ,,
+439 438 139 ,,,-
+1217 438 139 ,,,-
+2890 438 139 ,,,
+2398 438 139 ,,,
+362 362 139 ,,-
+1219 362 139 ,,-,-
+1218 362 139 ,,-,
+3276 362 139 ,,-,
+3073 362 139 ,,-,
+2955 362 139 ,,-,
+3349 362 139 ,,-,
+363 362 139 ,,-,
+3078 362 139 ,,-,
+3248 362 139 ,,-,
+2397 362 139 ,,-,
+360 360 139 ,,-
+3134 360 139 ,,-,
+3081 360 139 ,,-,
+2997 360 139 ,,-,
+2999 360 139 ,,-,
+3139 360 139 ,,-,
+3060 360 139 ,,-,
+1220 360 139 ,,-,-
+361 360 139 ,,-,
+2914 360 139 ,,-,
+3056 360 139 ,,-,
+2396 360 139 ,,-,
+432 432 139 ,,-
+1222 432 139 ,,-,
+433 432 139 ,,-,-
+2395 432 139 ,,-,
+350 350 139 ,,-
+2989 350 139 ,,-,
+351 350 139 ,,-,
+2950 350 139 ,,-,
+1221 350 139 ,,-,
+3111 350 139 ,,-,
+2898 350 139 ,,-,
+2938 350 139 ,,-,
+2394 350 139 ,,-,
+366 366 139 ,,
+2953 366 139 ,,,
+3112 366 139 ,,,
+1223 366 139 ,,,
+367 366 139 ,,,
+2951 366 139 ,,,
+2862 366 139 ,,,
+3034 366 139 ,,,
+2860 366 139 ,,,
+2393 366 139 ,,,
+420 420 139 ,,
+421 420 139 ,,,-
+1224 420 139 ,,,
+2392 420 139 ,,,
+442 442 139 ,,
+2877 442 139 ,,,-
+2945 442 139 ,,,-
+1225 442 139 ,,,
+443 442 139 ,,,
+1226 442 139 ,,,
+2391 442 139 ,,,
+364 364 139 ,,
+3316 364 139 ,,,
+3282 364 139 ,,,
+2972 364 139 ,,,
+1227 364 139 ,,,
+2893 364 139 ,,,
+3110 364 139 ,,,
+1228 364 139 ,,,
+365 364 139 ,,,
+2390 364 139 ,,,
+450 450 139 ,,-
+451 450 139 ,,-,
+3093 450 139 ,,-,-
+2389 450 139 ,,-,
+356 356 139 ,,-
+357 356 139 ,,-,
+2388 356 139 ,,-,
+382 382 139 ,,
+383 382 139 ,, ,
+2387 382 139 ,, ,
+398 398 139 ,,
+2960 398 139 ,, ,
+2915 398 139 ,, ,
+399 398 139 ,, ,
+2386 398 139 ,, ,
+410 410 139 ,,
+2863 410 139 ,,,
+411 410 139 ,,,
+1229 410 139 ,,,
+2385 410 139 ,,,
+422 422 139 ,,
+3085 422 139 ,,,
+2913 422 139 ,,,
+1233 422 139 ,,,
+2916 422 139 ,,,
+3123 422 139 ,,,
+2873 422 139 ,,,
+3096 422 139 ,,,
+423 422 139 ,,,
+1232 422 139 ,,,-
+3023 422 139 ,,,
+1231 422 139 ,,,
+1230 422 139 ,,,-
+2384 422 139 ,,,
+406 406 139 ,,
+2383 406 139 ,, ,
+404 404 139 ,,
+2879 404 139 ,,,-
+2880 404 139 ,,,
+3086 404 139 ,,,
+3002 404 139 ,,,
+3124 404 139 ,,,
+2894 404 139 ,,,-
+3290 404 139 ,,,-
+1234 404 139 ,,,
+1236 404 139 ,,,
+3372 404 139 ,,,
+2952 404 139 ,,,-
+3340 404 139 ,,,
+1235 404 139 ,,,-
+405 404 139 ,,,
+2962 404 139 ,,,
+2382 404 139 ,,,
+384 384 139 ,,
+385 384 139 ,, ,
+2381 384 139 ,, ,
+400 400 139 ,,
+401 400 139 ,, ,
+3090 400 139 ,, ,
+1237 400 139 ,, ,
+2380 400 139 ,, ,
+436 436 139 ,,
+3036 436 139 ,,,
+3024 436 139 ,,,
+3108 436 139 ,,,
+2866 436 139 ,,,-
+437 436 139 ,,,--
+2379 436 139 ,,,
+3200 0 3200 , (.)
+140 0 140 ,
+1238 1238 140 , ,-
+2442 2442 140 , ,
+141 0 141 ,
+1239 1239 141 ,,-
+2441 2441 141 ,,
+3202 0 3202 , (.)
+142 0 142 ,
+1240 1240 142 ,,
+2440 2440 142 ,,
+143 0 143 ,
+1241 1241 143 ,,
+2439 2439 143 ,,
+146 0 146 ,
+1242 1242 146 ,,
+2438 2438 146 ,,
+3203 0 3203 , (.)
+144 0 144 ,
+1243 1243 144 ,,-
+2437 2437 144 ,,
+145 0 145 ,
+1244 1244 145 ,,
+3094 3094 145 ,,
+1245 1245 145 ,,--
+1246 1246 145 ,,-
+2436 2436 145 ,,
+147 0 147 ,
+1247 1247 147 ,,
+2435 2435 147 ,,
+3204 0 3204 , (.)
+452 0 452 , ()
+1190 1190 452 , (),-
+2364 2364 452 , (),
+149 0 149 ,
+1248 1248 149 ,,--
+2434 2434 149 ,,
+148 0 148 ,
+1249 1249 148 ,,
+2433 2433 148 ,,
+3205 0 3205 , (.)
+173 0 173 ,
+1250 1250 173 ,,
+2432 2432 173 ,,
+150 0 150 ,
+1251 1251 150 ,,
+2431 2431 150 ,,
+151 0 151 ,
+1252 1252 151 ,,-
+2430 2430 151 ,,
+152 0 152 , (.)
+1253 1253 152 , (.),
+2429 2429 152 , (.),
+153 0 153 ,
+1254 1254 153 ,,
+2428 2428 153 ,,
+154 0 154 ,
+1255 1255 154 , ,-
+2427 2427 154 , ,
+155 0 155 ,
+1256 1256 155 ,,
+2426 2426 155 ,,
+156 0 156 ,-
+1257 1257 156 ,-,-
+2425 2425 156 ,-,
+157 0 157 ,
+1258 1258 157 ,,
+2424 2424 157 ,,
+3208 0 3208 , (.)
+158 0 158 ,
+1259 1259 158 ,,
+1260 1260 158 ,,
+2423 2423 158 ,,
+3209 0 3209 , ()
+3201 0 3201 ,
+159 0 159 ,
+1261 1261 159 ,,
+2422 2422 159 ,,
+3207 0 3207 , (.)
+3211 0 3211 , (.)
+160 0 160 ,
+1262 1262 160 ,,
+2421 2421 160 ,,
+161 0 161 ,
+1263 1263 161 ,,
+2420 2420 161 ,,
+162 0 162 ,
+1264 1264 162 ,,
+2419 2419 162 ,,
+163 0 163 ,
+1265 1265 163 ,,-
+2418 2418 163 ,,
+164 0 164 ,-
+1266 1266 164 ,- ,
+2417 2417 164 ,- ,
+165 0 165 ,-
+1267 1267 165 ,- ,
+2416 2416 165 ,- ,
+166 0 166 ,-
+1268 1268 166 ,-,
+2415 2415 166 ,-,
+3210 0 3210 ,- (.)
+167 0 167 ,
+1269 1269 167 ,,
+2414 2414 167 ,,
+168 0 168 ,
+1270 1270 168 , ,--
+2413 2413 168 , ,
+169 0 169 ,
+1271 1271 169 ,,
+2412 2412 169 ,,
+3212 0 3212 , (.)
+3206 0 3206 ,
+170 0 170 ,
+1272 1272 170 ,,
+2411 2411 170 ,,
+171 0 171 ,
+1273 1273 171 ,,
+1274 1274 171 ,,
+2410 2410 171 ,,
+3213 0 3213 ,. . - (.)
+172 0 172 ,
+1275 1275 172 ,,
+2409 2409 172 ,,
+27 0 0
+174 0 174 ,
+1854 1854 174 ,,
+2495 2495 174 ,,
+175 0 175 ,
+1855 1855 175 ,,
+2494 2494 175 ,,
+176 0 176 ,
+1856 1856 176 ,,
+1857 1857 176 ,,-
+2493 2493 176 ,,
+177 0 177 ,
+1858 1858 177 ,,
+2492 2492 177 ,,
+3228 0 3228 ,
+178 0 178 ,-
+1859 1859 178 ,-,
+2491 2491 178 ,-,
+179 0 179 ,
+1860 1860 179 ,,
+2490 2490 179 ,,
+180 0 180 ,
+1861 1861 180 ,,
+2489 2489 180 ,,
+181 0 181 ,
+1862 1862 181 ,,
+2488 2488 181 ,,
+182 0 182 ,
+1863 1863 182 ,,
+2487 2487 182 ,,
+183 0 183 ,
+1864 1864 183 ,,
+2486 2486 183 ,,
+184 0 184 ,-
+1865 1865 184 ,-,
+2485 2485 184 ,-,
+185 0 185 ,
+1866 1866 185 ,,
+2484 2484 185 ,,
+186 0 186 ,
+3312 3312 186 ,,
+1867 1867 186 ,,
+1868 1868 186 ,,
+2483 2483 186 ,,
+187 0 187 ,
+1869 1869 187 ,,
+2482 2482 187 ,,
+3198 0 3198 ,.
+23 0 23 ,
+1870 1870 23 ,,
+2481 2481 23 ,,
+188 0 188 ,-
+1871 1871 188 ,-,
+2480 2480 188 ,-,
+189 0 189 ,
+1872 1872 189 ,,
+2479 2479 189 ,,
+190 0 190 ,
+1873 1873 190 ,,
+2478 2478 190 ,,
+191 0 191 ,
+1874 1874 191 ,,
+2477 2477 191 ,,
+193 0 193 , ()
+1875 1875 193 , (),
+2476 2476 193 , (),
+192 0 192 ,,
+1876 1876 192 ,, ,
+2475 2475 192 ,, ,
+194 0 194 ,-`
+1877 1877 194 ,-`,
+2474 2474 194 ,-`,
+195 0 195 ,
+1878 1878 195 ,,
+2473 2473 195 ,,
+196 0 196 ,
+1879 1879 196 ,,
+2472 2472 196 ,,
+197 0 197 ,
+1880 1880 197 ,,
+2471 2471 197 ,,
+198 0 198 ,
+1881 1881 198 ,,-
+2470 2470 198 ,,
+199 0 199 ,
+1882 1882 199 ,,
+2469 2469 199 ,,
+200 0 200 ,
+1883 1883 200 ,,
+2468 2468 200 ,,
+3229 0 3229 , (.)
+201 0 201 ,
+1884 1884 201 ,,
+2467 2467 201 ,,
+202 0 202 ,
+1885 1885 202 ,,
+2466 2466 202 ,,
+203 0 203 ,
+1886 1886 203 ,,
+1887 1887 203 ,,
+2465 2465 203 ,,
+204 0 204 ,
+1888 1888 204 ,,
+2464 2464 204 ,,
+205 0 205 ,
+1889 1889 205 ,,
+2463 2463 205 ,,
+206 0 206 ,
+1890 1890 206 ,,
+2462 2462 206 ,,
+207 0 207 ,
+1891 1891 207 ,,
+2461 2461 207 ,,
+3227 0 3227 , (.)
+3197 0 3197 , (.)
+208 0 208 ,
+1892 1892 208 ,,
+2460 2460 208 ,,
+209 0 209 ,-
+1893 1893 209 ,- ,-
+2459 2459 209 ,- ,
+210 0 210 ,
+1894 1894 210 ,,
+2458 2458 210 ,,
+3199 0 3199 , (.)
+211 0 211 ,
+1895 1895 211 ,,
+2457 2457 211 ,,
+212 0 212 ,
+1896 1896 212 ,,
+2456 2456 212 ,,
+213 0 213 ,
+1897 1897 213 ,,
+2455 2455 213 ,,
+214 0 214 ,
+1898 1898 214 ,,
+2454 2454 214 ,,
+215 0 215 ,-
+1899 1899 215 ,-,
+2453 2453 215 ,-,
+216 0 216 ,
+1900 1900 216 ,,--
+1901 1901 216 ,,
+2452 2452 216 ,,
+217 0 217 ,
+1902 1902 217 ,,
+2451 2451 217 ,,
+218 0 218 ,
+1903 1903 218 ,,
+2450 2450 218 ,,
+219 0 219 ,
+1904 1904 219 ,,
+2449 2449 219 ,,
+220 0 220 ,
+1905 1905 220 , ,
+2448 2448 220 , ,
+222 0 222 ,
+1906 1906 222 ,,
+2447 2447 222 ,,
+223 0 223 ,
+1907 1907 223 , ,
+2446 2446 223 , ,
+221 0 221 ,
+1908 1908 221 ,,
+2445 2445 221 ,,
+224 0 224 ,
+1909 1909 224 ,,-
+2444 2444 224 ,,
+225 0 225 ,- ()
+1910 1910 225 ,- (),
+1913 1913 225 ,- (),
+1912 1912 225 ,- (),
+3033 3033 225 ,- (),
+1911 1911 225 ,- (),
+2443 2443 225 ,- (),
+26 0 0
+39 0 39 ,
+314 314 39 ,,
+315 315 39 ,, .
+614 315 39 ,, .,
+615 315 39 ,, .,
+2566 315 39 ,, .,
+316 316 39 ,, .
+2940 316 39 ,, .,
+616 316 39 ,, .,
+2565 316 39 ,, .,
+317 317 39 ,, .
+617 317 39 ,, .,
+618 317 39 ,, .,
+619 317 39 ,, .,
+620 317 39 ,, .,
+621 317 39 ,, .,
+622 317 39 ,, .,
+623 317 39 ,, .,
+2564 317 39 ,, .,
+318 318 39 ,, .
+624 318 39 ,, .,
+625 318 39 ,, .,
+626 318 39 ,, .,
+627 318 39 ,, .,
+628 318 39 ,, .,
+629 318 39 ,, .,
+630 318 39 ,, .,
+2944 318 39 ,, .,
+631 318 39 ,, .,
+632 318 39 ,, .,
+633 318 39 ,, .,
+634 318 39 ,, .,
+635 318 39 ,, .,
+2563 318 39 ,, .,
+319 319 39 ,, .
+636 319 39 ,, .,
+637 319 39 ,, .,
+2942 319 39 ,, .,
+638 319 39 ,, .,
+2907 319 39 ,, .,
+639 319 39 ,, .,-
+2562 319 39 ,, .,
+320 320 39 ,, .
+640 320 39 ,, .,
+641 320 39 ,, .,
+3119 320 39 ,, .,
+3162 320 39 ,, .,
+642 320 39 ,, .,
+643 320 39 ,, .,
+2561 320 39 ,, .,
+321 321 39 ,, .
+644 321 39 ,, .,
+3128 321 39 ,, .,
+645 321 39 ,, .,
+646 321 39 ,, .,
+3121 321 39 ,, .,
+3378 321 39 ,, .,
+2560 321 39 ,, .,
+322 322 39 ,,- .
+3379 322 39 ,,- .,
+647 322 39 ,,- .,-
+3170 322 39 ,,- .,
+2559 322 39 ,,- .,
+323 323 39 ,, .
+648 323 39 ,, .,
+649 323 39 ,, .,
+651 323 39 ,, .,
+650 323 39 ,, .,
+652 323 39 ,, .,
+3341 323 39 ,, .,-
+653 323 39 ,, .,
+654 323 39 ,, .,
+655 323 39 ,, .,
+2558 323 39 ,, .,
+324 324 39 ,, .
+656 324 39 ,, .,
+657 324 39 ,, .,
+658 324 39 ,, .,
+2557 324 39 ,, .,
+325 325 39 ,,
+659 325 39 ,,,
+2984 325 39 ,,,
+3042 325 39 ,,,
+660 325 39 ,,,
+662 325 39 ,,,
+3382 325 39 ,,,
+663 325 39 ,,,
+667 325 39 ,,,
+666 325 39 ,,,
+668 325 39 ,,,
+669 325 39 ,,,
+665 325 39 ,,,
+661 325 39 ,,,
+3370 325 39 ,,,
+670 325 39 ,,,
+664 325 39 ,,,
+3148 325 39 ,,,
+671 325 39 ,,,
+2556 325 39 ,,,
+326 326 39 ,, .
+672 326 39 ,, .,
+673 326 39 ,, .,
+674 326 39 ,, .,
+675 326 39 ,, .,
+3364 326 39 ,, .,
+676 326 39 ,, .,
+677 326 39 ,, .,
+678 326 39 ,, .,
+679 326 39 ,, .,
+680 326 39 ,, .,
+2555 326 39 ,, .,
+327 327 39 ,, .
+3284 327 39 ,, .,
+681 327 39 ,, .,
+682 327 39 ,, .,
+2554 327 39 ,, .,
+328 328 39 ,, .
+3322 328 39 ,, .,
+2870 328 39 ,, .,
+683 328 39 ,, .,
+3118 328 39 ,, .,
+3325 328 39 ,, .,
+2553 328 39 ,, .,
+329 329 39 ,, .
+684 329 39 ,, .,-
+685 329 39 ,, .,
+689 329 39 ,, .,
+686 329 39 ,, .,
+688 329 39 ,, .,
+687 329 39 ,, .,
+2552 329 39 ,, .,
+330 330 39 ,, .
+690 330 39 ,, .,
+691 330 39 ,, .,
+693 330 39 ,, .,
+694 330 39 ,, .,
+695 330 39 ,, .,
+692 330 39 ,, .,
+2551 330 39 ,, .,
+331 331 39 ,, .
+696 331 39 ,, .,
+697 331 39 ,, .,
+3361 331 39 ,, .,
+2550 331 39 ,, .,
+332 332 39 ,, .
+3356 332 39 ,, .,
+698 332 39 ,, .,
+700 332 39 ,, .,
+699 332 39 ,, .,
+701 332 39 ,, .,
+2549 332 39 ,, .,
+333 333 39 ,, .
+702 333 39 ,, .,
+3171 333 39 ,, .,
+703 333 39 ,, .,
+704 333 39 ,, .,
+2548 333 39 ,, .,
+334 334 39 ,, .
+705 334 39 ,, .,
+3346 334 39 ,, .,
+3351 334 39 ,, .,
+706 334 39 ,, .,
+708 334 39 ,, .,
+707 334 39 ,, .,
+709 334 39 ,, .,
+2547 334 39 ,, .,
+335 335 39 ,, .
+710 335 39 ,, .,
+711 335 39 ,, .,
+712 335 39 ,, .,
+3280 335 39 ,, .,
+713 335 39 ,, .,
+2546 335 39 ,, .,
+336 336 39 ,, .
+714 336 39 ,, .,-
+715 336 39 ,, .,
+2941 336 39 ,, .,
+716 336 39 ,, .,
+3120 336 39 ,, .,
+2943 336 39 ,, .,
+717 336 39 ,, .,
+3155 336 39 ,, .,
+2542 336 39 ,, .,
+337 337 39 ,, .
+3169 337 39 ,, .,
+3016 337 39 ,, .,
+3333 337 39 ,, .,
+718 337 39 ,, .,
+719 337 39 ,, .,
+720 337 39 ,, .,
+2545 337 39 ,, .,
+338 338 39 ,, .
+721 338 39 ,, .,
+722 338 39 ,, .,
+723 338 39 ,, .,
+2544 338 39 ,, .,
+339 339 39 ,, .
+724 339 39 ,, .,
+2543 339 39 ,, .,
+40 0 40 ,
+602 602 40 ,,
+604 604 40 ,,
+603 603 40 ,,
+608 608 40 ,,
+606 606 40 ,,
+3099 3099 40 ,,--
+605 605 40 ,,
+3174 3174 40 ,,
+609 609 40 ,,
+607 607 40 ,,
+610 610 40 ,,
+611 611 40 ,,
+2541 2541 40 ,,
+32 0 32 ,
+612 612 32 ,,
+2540 2540 32 ,,
+33 0 33 ,
+613 613 33 ,,--
+2539 2539 33 ,,
+340 0 340 ,
+341 341 340 ,,
+342 342 340 ,, .
+725 342 340 ,, .,
+726 342 340 ,, .,
+727 342 340 ,, .,
+728 342 340 ,, .,
+3172 342 340 ,, .,
+729 342 340 ,, .,
+730 342 340 ,, .,
+731 342 340 ,, .,
+732 342 340 ,, .,
+2538 342 340 ,, .,
+343 343 340 ,, .
+733 343 340 ,, .,
+735 343 340 ,, .,
+734 343 340 ,, .,
+736 343 340 ,, .,
+737 343 340 ,, .,
+738 343 340 ,, .,
+2537 343 340 ,, .,
+344 344 340 ,, .
+739 344 340 ,, .,
+740 344 340 ,, .,
+741 344 340 ,, .,
+742 344 340 ,, .,
+743 344 340 ,, .,
+744 344 340 ,, .,
+2536 344 340 ,, .,
+345 345 340 ,, .
+745 345 340 ,, .,
+746 345 340 ,, .,
+747 345 340 ,, .,
+3244 345 340 ,, .,
+748 345 340 ,, .,
+2535 345 340 ,, .,
+346 346 340 ,, .
+3149 346 340 ,, .,
+749 346 340 ,, .,
+750 346 340 ,, .,
+751 346 340 ,, .,
+752 346 340 ,, .,
+753 346 340 ,, .,
+2896 346 340 ,, .,
+754 346 340 ,, .,
+755 346 340 ,, .,
+756 346 340 ,, .,
+2534 346 340 ,, .,
+347 347 340 ,, .
+757 347 340 ,, .,
+758 347 340 ,, .,
+759 347 340 ,, .,
+2533 347 340 ,, .,
+38 0 38 ,
+760 760 38 ,,
+767 767 38 ,,
+762 762 38 ,,
+761 761 38 ,,
+763 763 38 ,,
+769 769 38 ,,
+765 765 38 ,,
+764 764 38 ,,
+3117 3117 38 ,,
+766 766 38 ,,
+768 768 38 ,,
+2532 2532 38 ,,
+41 0 41 ,
+3098 3098 41 ,,
+792 792 41 ,,
+770 770 41 ,,
+771 771 41 ,,
+773 773 41 ,,
+776 776 41 ,,-
+788 788 41 ,,
+789 789 41 ,,
+796 796 41 ,,
+777 777 41 ,,
+781 781 41 ,,
+786 786 41 ,,
+791 791 41 ,,
+793 793 41 ,,
+795 795 41 ,,
+787 787 41 ,,
+790 790 41 ,,
+3133 3133 41 ,,
+794 794 41 ,,
+782 782 41 ,,
+780 780 41 ,,
+779 779 41 ,,
+774 774 41 ,,
+784 784 41 ,,
+772 772 41 ,,
+775 775 41 ,,
+3116 3116 41 ,,
+785 785 41 ,,
+778 778 41 ,,
+783 783 41 ,,
+2531 2531 41 ,,
+42 0 42 ,
+797 797 42 , ,-
+799 799 42 , ,
+798 798 42 , ,
+800 800 42 , ,
+2530 2530 42 , ,
+43 0 43 ,
+45 0 45 ,
+802 802 45 ,,
+3075 3075 45 ,,
+801 801 45 ,,
+804 804 45 ,,
+803 803 45 ,,
+805 805 45 ,,
+3168 3168 45 ,,
+806 806 45 ,,
+807 807 45 ,,
+808 808 45 ,,
+809 809 45 ,,
+3131 3131 45 ,,
+810 810 45 ,,
+3342 3342 45 ,,
+811 811 45 ,,
+812 812 45 ,,
+813 813 45 ,,
+814 814 45 ,,
+3089 3089 45 ,,
+815 815 45 ,,
+816 816 45 ,,
+817 817 45 ,,
+818 818 45 ,,
+819 819 45 ,,
+820 820 45 ,,
+2976 2976 45 ,,
+2988 2988 45 ,,
+821 821 45 ,,
+3088 3088 45 ,,
+822 822 45 ,,
+823 823 45 ,,
+824 824 45 ,,
+825 825 45 ,,
+3343 3343 45 ,,
+2867 2867 45 ,,
+2986 2986 45 ,,-
+826 826 45 ,,
+3063 3063 45 ,,
+827 827 45 ,,
+3140 3140 45 ,,
+828 828 45 ,,
+829 829 45 ,,
+830 830 45 ,,
+2529 2529 45 ,,
+44 0 44 ,
+831 831 44 ,,
+832 832 44 ,,
+836 836 44 ,,
+835 835 44 ,,
+834 834 44 ,,
+833 833 44 ,,
+2528 2528 44 ,,
+46 0 46 ,
+3007 3007 46 ,,
+837 837 46 ,,
+838 838 46 ,,-
+3371 3371 46 ,,
+839 839 46 ,,-
+840 840 46 ,,
+841 841 46 ,,
+3163 3163 46 ,,
+842 842 46 ,,
+843 843 46 ,,
+3015 3015 46 ,,
+844 844 46 ,,
+2921 2921 46 ,,
+845 845 46 ,,
+846 846 46 ,,
+847 847 46 ,,
+848 848 46 ,,
+849 849 46 ,,
+3010 3010 46 ,,
+850 850 46 ,,
+851 851 46 ,,
+3072 3072 46 ,,
+852 852 46 ,,
+853 853 46 ,,
+854 854 46 ,,
+855 855 46 ,,
+3082 3082 46 ,,
+3309 3309 46 ,,
+856 856 46 ,,
+857 857 46 ,,
+3138 3138 46 ,,
+858 858 46 ,,
+859 859 46 ,,
+2872 2872 46 ,,
+2965 2965 46 ,,
+3135 3135 46 ,,
+3156 3156 46 ,,
+3192 3192 46 ,,
+860 860 46 ,,
+861 861 46 ,,
+2864 2864 46 ,,
+862 862 46 ,,
+3009 3009 46 ,,
+2993 2993 46 ,,
+863 863 46 ,,
+864 864 46 ,,
+865 865 46 ,,
+866 866 46 ,,
+3191 3191 46 ,,
+2974 2974 46 ,,-
+3127 3127 46 ,,
+867 867 46 ,,
+868 868 46 ,,
+869 869 46 ,,--
+3373 3373 46 ,,
+3313 3313 46 ,,
+870 870 46 ,,
+3045 3045 46 ,,
+2906 2906 46 ,,
+2527 2527 46 ,,
+3193 0 3193 , (.)
+47 0 47 , (.)
+48 0 48 ,
+871 871 48 ,,
+873 873 48 ,,
+3147 3147 48 ,,
+872 872 48 ,,
+3178 3178 48 ,,
+2526 2526 48 ,,
+49 0 49 ,
+3006 3006 49 ,,
+874 874 49 ,,
+875 875 49 ,,
+3285 3285 49 ,,
+876 876 49 ,,
+3126 3126 49 ,,
+2525 2525 49 ,,
+3194 0 3194 , (.)
+50 0 50 ,
+3377 3377 50 ,,
+3067 3067 50 ,,
+877 877 50 ,,
+3065 3065 50 ,,
+3066 3066 50 ,,
+878 878 50 ,,
+3069 3069 50 ,,
+3068 3068 50 ,,
+2524 2524 50 ,,
+51 0 51 ,
+879 879 51 ,,
+2523 2523 51 ,,
+34 0 34 ,
+880 880 34 ,,
+3125 3125 34 ,,
+881 881 34 ,,
+890 890 34 ,,
+3076 3076 34 ,,
+882 882 34 ,,
+3070 3070 34 ,,
+888 888 34 ,,
+886 886 34 ,,
+891 891 34 ,,-
+3310 3310 34 ,,
+883 883 34 ,,
+884 884 34 ,,
+885 885 34 ,,
+892 892 34 ,,
+3179 3179 34 ,,
+3177 3177 34 ,,-
+3289 3289 34 ,,---
+889 889 34 ,,
+887 887 34 ,,
+893 893 34 ,,
+2522 2522 34 ,,
+52 0 52 ,
+3318 3318 52 ,,
+3278 3278 52 ,,
+906 906 52 ,,
+894 894 52 ,,
+895 895 52 ,,
+905 905 52 ,,
+896 896 52 ,,
+897 897 52 ,,
+3369 3369 52 ,,
+3327 3327 52 ,,
+898 898 52 ,,
+899 899 52 ,,
+907 907 52 ,,
+908 908 52 ,,
+900 900 52 ,,
+901 901 52 ,,
+3368 3368 52 ,,-
+3384 3384 52 ,,
+3252 3252 52 ,,
+902 902 52 ,,
+903 903 52 ,,
+3130 3130 52 ,,
+904 904 52 ,,
+2521 2521 52 ,,
+53 0 53 ,
+2939 2939 53 ,,
+3054 3054 53 ,,
+909 909 53 ,,
+2934 2934 53 ,,
+913 913 53 ,,
+2935 2935 53 ,,
+912 912 53 ,,
+2905 2905 53 ,,
+911 911 53 ,,
+2936 2936 53 ,,
+2937 2937 53 ,,
+910 910 53 ,,
+2520 2520 53 ,,
+54 0 54 ,
+914 914 54 ,,
+915 915 54 ,,
+916 916 54 ,,
+918 918 54 ,,
+919 919 54 ,,
+3173 3173 54 ,,
+917 917 54 ,,
+2519 2519 54 ,,
+55 0 55 ,
+920 920 55 ,,
+2518 2518 55 ,,
+56 0 56 ,
+3376 3376 56 ,,
+921 921 56 ,,
+2517 2517 56 ,,
+57 0 57 ,
+3142 3142 57 ,,
+922 922 57 ,,
+2516 2516 57 ,,
+58 0 58 ,
+923 923 58 ,,
+3154 3154 58 ,,
+924 924 58 ,,
+2515 2515 58 ,,
+59 0 59 ,
+925 925 59 ,,
+926 926 59 ,,
+3234 3234 59 ,,
+3275 3275 59 ,,
+927 927 59 ,,
+3321 3321 59 ,,
+928 928 59 ,,
+929 929 59 ,,
+3281 3281 59 ,,-
+2514 2514 59 ,,
+36 0 36 ,
+930 930 36 ,,-
+2513 2513 36 ,,
+60 0 60 ,
+931 931 60 ,,
+933 933 60 ,,
+932 932 60 ,,
+934 934 60 ,,
+935 935 60 ,,
+2977 2977 60 ,,
+3030 3030 60 ,,
+3091 3091 60 ,,
+936 936 60 ,,
+937 937 60 ,,
+3044 3044 60 ,,
+3380 3380 60 ,,
+2512 2512 60 ,,
+61 0 61 ,
+3190 3190 61 ,,
+2857 2857 61 ,,
+938 938 61 ,,
+3355 3355 61 ,,
+939 939 61 ,,
+2511 2511 61 ,,
+3195 0 3195 , (.)
+62 0 62 ,
+940 940 62 ,,
+941 941 62 ,,
+3164 3164 62 ,,
+942 942 62 ,,
+943 943 62 ,,
+3237 3237 62 ,,
+3165 3165 62 ,,
+944 944 62 ,,
+945 945 62 ,,
+3008 3008 62 ,,
+3150 3150 62 ,,
+946 946 62 ,,
+947 947 62 ,,
+948 948 62 ,,
+2958 2958 62 ,,
+2510 2510 62 ,,
+35 0 35 ,
+949 949 35 ,,
+950 950 35 ,,
+2509 2509 35 ,,
+63 0 63 ,
+952 952 63 ,,
+951 951 63 ,,
+954 954 63 ,,
+955 955 63 ,,
+953 953 63 ,,
+2508 2508 63 ,,
+64 0 64 ,-
+956 956 64 ,-,-
+2507 2507 64 ,-,
+74 0 74 ,
+957 957 74 , ,
+960 960 74 , ,
+958 958 74 , ,-
+959 959 74 , ,
+2506 2506 74 , ,
+65 0 65 ,
+961 961 65 ,,
+962 962 65 ,,
+3101 3101 65 ,,
+963 963 65 ,,
+964 964 65 ,,
+965 965 65 ,,
+966 966 65 ,,
+2505 2505 65 ,,
+66 0 66 ,
+968 968 66 ,,
+967 967 66 ,,
+969 969 66 ,,
+2504 2504 66 ,,
+67 0 67 , - ()
+970 970 67 , - (),
+2503 2503 67 , - (),
+68 0 68 ,
+2888 2888 68 ,,
+971 971 68 ,,
+979 979 68 ,,
+972 972 68 ,,
+980 980 68 ,,
+973 973 68 ,,
+3375 3375 68 ,,
+3159 3159 68 ,,
+974 974 68 ,,
+975 975 68 ,,
+976 976 68 ,,
+977 977 68 ,,
+978 978 68 ,,
+2502 2502 68 ,,
+37 0 37 ,
+996 996 37 ,,
+983 983 37 ,,
+997 997 37 ,,
+984 984 37 ,,
+998 998 37 ,,
+987 987 37 ,,
+988 988 37 ,,
+993 993 37 ,,-
+3037 3037 37 ,,
+989 989 37 ,,
+985 985 37 ,,
+991 991 37 ,,
+3161 3161 37 ,,
+990 990 37 ,,
+994 994 37 ,,
+995 995 37 ,,
+999 999 37 ,,
+981 981 37 ,,
+3374 3374 37 ,,
+992 992 37 ,,
+982 982 37 ,,
+986 986 37 ,,
+3314 3314 37 ,,
+2501 2501 37 ,,
+69 0 69 ,
+1003 1003 69 ,,
+1000 1000 69 ,,
+1001 1001 69 ,,
+1004 1004 69 ,,
+1002 1002 69 ,,
+2500 2500 69 ,,
+70 0 70 ,
+1005 1005 70 ,,
+3291 3291 70 ,,-
+1007 1007 70 ,,-
+1008 1008 70 ,,-
+3019 3019 70 ,,
+1010 1010 70 ,,
+1009 1009 70 ,,
+1015 1015 70 ,,
+3105 3105 70 ,,
+1006 1006 70 ,,
+3246 3246 70 ,,
+1011 1011 70 ,,
+1012 1012 70 ,,--
+1014 1014 70 ,,-
+1013 1013 70 ,,--
+2499 2499 70 ,,
+71 0 71 ,
+1016 1016 71 ,,
+1019 1019 71 ,,
+1017 1017 71 ,,
+1018 1018 71 ,,
+1020 1020 71 ,,
+1021 1021 71 ,,
+1022 1022 71 ,,
+3189 3189 71 ,,
+1023 1023 71 ,,
+1024 1024 71 ,,
+1025 1025 71 ,,
+1026 1026 71 ,,
+1027 1027 71 ,,
+1028 1028 71 ,,
+1029 1029 71 ,,
+1030 1030 71 ,,
+2498 2498 71 ,,
+72 0 72 ,
+2883 2883 72 ,,
+1031 1031 72 ,,
+1032 1032 72 ,,
+1037 1037 72 ,,
+1036 1036 72 ,,
+1042 1042 72 ,,
+1033 1033 72 ,,
+1034 1034 72 ,,
+1041 1041 72 ,,
+1039 1039 72 ,,
+1043 1043 72 ,,
+1040 1040 72 ,,
+1038 1038 72 ,,
+2497 2497 72 ,,
+3196 0 3196 , (.)
+73 0 73 ,
+3013 3013 73 ,,
+1044 1044 73 ,,
+1045 1045 73 ,,-
+1046 1046 73 ,,
+1047 1047 73 ,,
+1048 1048 73 ,,
+1049 1049 73 ,,
+1050 1050 73 ,,
+1051 1051 73 ,,
+1052 1052 73 ,,
+1053 1053 73 ,,
+1054 1054 73 ,,
+2496 2496 73 ,,
diff --git a/protocols/MRA/Docs/region_m.txt b/protocols/MRA/Docs/region_m.txt
new file mode 100644
index 0000000000..4b199ea30b
--- /dev/null
+++ b/protocols/MRA/Docs/region_m.txt
@@ -0,0 +1,3150 @@
+24 0 24
+25 25 24 ,
+1734 25 24 ,,.
+226 226 24 ,-
+233 233 24 , ()
+474 233 24 , (),
+2809 233 24 , (),
+2804 233 24 , (),
+475 233 24 , (),
+477 233 24 , (),
+476 233 24 , (),
+2806 233 24 , (),
+3115 233 24 , (),
+2808 233 24 , (),
+2807 233 24 , (),
+2805 233 24 , (),
+478 233 24 , (),-
+479 233 24 , (),
+2263 233 24 , (),
+232 232 24 ,
+2819 232 24 , ,
+464 232 24 , ,
+465 232 24 , ,
+466 232 24 , ,
+2817 232 24 , ,
+2818 232 24 , ,
+3359 232 24 , ,
+467 232 24 , ,-
+468 232 24 , ,
+469 232 24 , ,
+470 232 24 , ,
+471 232 24 , ,
+472 232 24 , ,
+2816 232 24 , ,-
+473 232 24 , ,
+2258 232 24 , ,
+235 235 24 ,
+487 235 24 , ,
+2821 235 24 , ,
+488 235 24 , ,
+2820 235 24 , ,
+489 235 24 , ,--
+490 235 24 , ,--
+491 235 24 , ,
+3353 235 24 , ,
+492 235 24 , ,
+2280 235 24 , ,
+227 227 24 , .
+455 227 24 , .,
+456 227 24 , .,
+2814 227 24 , .,
+2813 227 24 , .,
+2815 227 24 , .,
+2812 227 24 , .,
+2811 227 24 , .,
+457 227 24 , .,
+2217 227 24 , .,
+2218 227 24 , .,
+229 229 24 , .
+460 229 24 , .,
+2822 229 24 , .,
+459 229 24 , .,-.
+2234 229 24 , .,
+231 231 24 , .
+462 231 24 , .,
+2823 231 24 , .,
+463 231 24 , .,
+2246 231 24 , .,
+234 234 24 , .
+480 234 24 , .,-
+2829 234 24 , .,
+2833 234 24 , .,
+2825 234 24 , .,
+481 234 24 , .,
+482 234 24 , .,
+2826 234 24 , .,
+2832 234 24 , .,
+2836 234 24 , .,
+2830 234 24 , .,
+483 234 24 , .,
+2828 234 24 , .,
+2824 234 24 , .,-
+2827 234 24 , .,
+2831 234 24 , .,
+484 234 24 , .,
+2834 234 24 , .,
+2835 234 24 , .,
+485 234 24 , .,-
+486 234 24 , .,-
+2264 234 24 , .,
+228 228 24 ,
+458 228 24 , ,
+2810 228 24 , ,
+2226 228 24 , ,
+230 230 24 ,
+461 230 24 , ,
+2239 230 24 , ,
+236 236 24 ,
+493 236 24 , ,
+2287 236 24 , ,
+237 237 24 ,
+2850 237 24 ,,
+2851 237 24 ,,
+2657 237 24 ,,
+2662 237 24 ,,
+494 237 24 ,,
+2658 237 24 ,,
+2660 237 24 ,,
+2659 237 24 ,,
+2663 237 24 ,,
+495 237 24 ,,
+496 237 24 ,,
+2655 237 24 ,,
+497 237 24 ,,
+2654 237 24 ,,
+499 237 24 ,,
+2656 237 24 ,,
+498 237 24 ,,
+500 237 24 ,,
+2661 237 24 ,,
+501 237 24 ,,
+502 237 24 ,,
+2664 237 24 ,,
+2220 237 24 ,,
+240 240 24 ,-
+509 240 24 ,-,
+510 240 24 ,-,
+511 240 24 ,-,-
+512 240 24 ,-,
+2247 240 24 ,-,
+241 241 24 ,
+513 241 24 ,,
+2147 241 24 ,,
+2150 241 24 ,,
+2148 241 24 ,,
+2910 241 24 ,,
+515 241 24 ,,
+514 241 24 ,,
+2149 241 24 ,,
+2923 241 24 ,,
+2248 241 24 ,,
+248 248 24 ,
+2569 248 24 ,,
+2575 248 24 ,,
+569 248 24 ,,
+570 248 24 ,,
+2571 248 24 ,,
+571 248 24 ,,
+2570 248 24 ,,
+572 248 24 ,,
+573 248 24 ,,
+2576 248 24 ,,
+574 248 24 ,,
+575 248 24 ,,
+2577 248 24 ,,
+2572 248 24 ,,
+576 248 24 ,,
+2573 248 24 ,,
+577 248 24 ,,
+578 248 24 ,,
+579 248 24 ,,
+2574 248 24 ,,
+580 248 24 ,,
+2271 248 24 ,,
+249 249 24 ,
+3311 249 24 ,,
+581 249 24 ,,
+582 249 24 ,,
+583 249 24 ,,
+584 249 24 ,,
+2665 249 24 ,,
+585 249 24 ,,
+586 249 24 ,,
+587 249 24 ,,
+2277 249 24 ,,
+251 251 24 ,
+2158 251 24 ,,
+2156 251 24 ,,
+2151 251 24 ,,
+2152 251 24 ,,
+2155 251 24 ,,
+2153 251 24 ,,
+592 251 24 ,,
+2157 251 24 ,,
+2154 251 24 ,,
+2286 251 24 ,,
+238 238 24 , .
+2168 238 24 , .,
+503 238 24 , .,
+2164 238 24 , .,
+504 238 24 , .,
+505 238 24 , .,-
+2160 238 24 , .,
+506 238 24 , .,
+2167 238 24 , .,
+2159 238 24 , .,
+2169 238 24 , .,
+2163 238 24 , .,
+2170 238 24 , .,
+2166 238 24 , .,
+2165 238 24 , .,
+2162 238 24 , .,
+2171 238 24 , .,
+2161 238 24 , .,
+507 238 24 , .,
+2237 238 24 , .,
+242 242 24 , .
+516 242 24 , .,
+517 242 24 , .,
+2139 242 24 , .,
+518 242 24 , .,
+519 242 24 , .,
+520 242 24 , .,
+2140 242 24 , .,
+2138 242 24 , .,
+521 242 24 , .,
+2137 242 24 , .,
+522 242 24 , .,
+523 242 24 , .,
+524 242 24 , .,
+2891 242 24 , .,
+525 242 24 , .,
+2145 242 24 , .,
+2143 242 24 , .,
+2144 242 24 , .,
+2146 242 24 , .,
+526 242 24 , .,
+527 242 24 , .,
+2135 242 24 , .,
+528 242 24 , .,
+529 242 24 , .,
+530 242 24 , .,
+2141 242 24 , .,
+2136 242 24 , .,
+2897 242 24 , .,
+2142 242 24 , .,
+2251 242 24 , .,
+243 243 24 , .
+2678 243 24 , .,
+2673 243 24 , .,
+531 243 24 , .,
+532 243 24 , .,
+2674 243 24 , .,
+2675 243 24 , .,
+533 243 24 , .,
+535 243 24 , .,
+536 243 24 , .,
+3360 243 24 , .,
+2677 243 24 , .,-
+2676 243 24 , .,
+537 243 24 , .,
+538 243 24 , .,
+2254 243 24 , .,
+244 244 24 , .
+539 244 24 , .,
+2597 244 24 , .,
+2595 244 24 , .,
+2593 244 24 , .,
+540 244 24 , .,
+2598 244 24 , .,
+2592 244 24 , .,
+541 244 24 , .,
+3304 244 24 , .,
+2596 244 24 , .,
+2594 244 24 , .,
+2256 244 24 , .,
+245 245 24 , .
+2690 245 24 , .,
+542 245 24 , .,
+2679 245 24 , .,
+2680 245 24 , .,
+2687 245 24 , .,
+2686 245 24 , .,
+543 245 24 , .,
+544 245 24 , .,
+2681 245 24 , .,
+545 245 24 , .,
+546 245 24 , .,
+547 245 24 , .,
+548 245 24 , .,
+2683 245 24 , .,
+2684 245 24 , .,
+2682 245 24 , .,
+549 245 24 , .,
+550 245 24 , .,
+2685 245 24 , .,
+551 245 24 , .,
+2689 245 24 , .,
+2688 245 24 , .,
+552 245 24 , .,
+553 245 24 , .,
+2257 245 24 , .,
+246 246 24 , .
+554 246 24 , .,
+555 246 24 , .,
+2599 246 24 , .,
+3293 246 24 , .,
+2602 246 24 , .,
+556 246 24 , .,
+2600 246 24 , .,
+557 246 24 , .,
+558 246 24 , .,
+559 246 24 , .,
+560 246 24 , .,
+561 246 24 , .,
+2601 246 24 , .,
+562 246 24 , .,
+2261 246 24 , .,
+247 247 24 , .
+2613 247 24 , .,
+2606 247 24 , .,
+563 247 24 , .,
+564 247 24 , .,
+565 247 24 , .,
+2608 247 24 , .,
+2607 247 24 , .,
+2609 247 24 , .,
+2610 247 24 , .,
+2605 247 24 , .,
+566 247 24 , .,
+2603 247 24 , .,
+2604 247 24 , .,
+2612 247 24 , .,
+567 247 24 , .,
+2611 247 24 , .,
+568 247 24 , .,
+3267 247 24 , .,-12
+2262 247 24 , .,
+250 250 24 , .
+2614 250 24 , .,
+588 250 24 , .,
+2615 250 24 , .,
+589 250 24 , .,
+2616 250 24 , .,
+590 250 24 , .,
+591 250 24 , .,
+2278 250 24 , .,
+239 239 24 ,-
+508 239 24 ,- ,
+2238 239 24 ,- ,
+255 255 24 ,
+1355 255 24 ,,
+1356 255 24 ,,
+1357 255 24 ,,
+1358 255 24 ,,
+1359 255 24 ,,
+1360 255 24 ,,
+1362 255 24 ,,
+1361 255 24 ,,
+3286 255 24 ,,
+1937 255 24 ,,
+1363 255 24 ,,
+1938 255 24 ,,
+3287 255 24 ,,
+1936 255 24 ,,
+1364 255 24 ,,
+1365 255 24 ,,
+1939 255 24 ,,
+2201 255 24 ,,
+256 256 24 ,
+1366 256 24 ,,
+1367 256 24 ,,
+2202 256 24 ,,
+1368 256 24 ,,
+1940 256 24 ,,
+1369 256 24 ,,
+1941 256 24 ,,
+1370 256 24 ,,
+1371 256 24 ,,
+1372 256 24 ,,
+2203 256 24 ,,
+252 252 24 , .
+593 252 24 , .,
+594 252 24 , .,
+1945 252 24 , .,
+595 252 24 , .,
+596 252 24 , .,
+1944 252 24 , .,
+597 252 24 , .,
+598 252 24 , .,
+1946 252 24 , .,
+599 252 24 , .,
+600 252 24 , .,
+601 252 24 , .,
+1942 252 24 , .,
+3239 252 24 , .,
+1943 252 24 , .,
+2204 252 24 , .,
+253 253 24 , .
+1950 253 24 , .,
+1949 253 24 , .,
+1338 253 24 , .,
+1339 253 24 , .,
+1951 253 24 , .,
+1340 253 24 , .,
+1952 253 24 , .,
+2871 253 24 , .,
+1341 253 24 , .,
+1955 253 24 , .,
+1342 253 24 , .,
+1947 253 24 , .,
+1343 253 24 , .,
+1953 253 24 , .,
+1954 253 24 , .,
+1948 253 24 , .,
+1344 253 24 , .,
+2205 253 24 , .,
+254 254 24 , .
+2838 254 24 , .,
+1345 254 24 , .,
+2846 254 24 , .,
+2843 254 24 , .,
+1346 254 24 , .,
+1347 254 24 , .,
+1348 254 24 , .,
+2842 254 24 , .,
+2845 254 24 , .,
+2848 254 24 , .,
+2837 254 24 , .,
+2844 254 24 , .,
+1349 254 24 , .,
+2841 254 24 , .,
+2839 254 24 , .,
+1350 254 24 , .,
+1351 254 24 , .,
+1352 254 24 , .,
+2840 254 24 , .,
+1353 254 24 , .,
+1354 254 24 , .,
+2231 254 24 , .,
+257 257 24 , .
+1985 257 24 , .,
+1374 257 24 , .,
+1373 257 24 , .,
+1375 257 24 , .,
+1995 257 24 , .,
+1376 257 24 , .,
+1378 257 24 , .,
+1993 257 24 , .,
+1379 257 24 , .,
+1380 257 24 , .,
+1381 257 24 , .,
+1384 257 24 , .,
+1984 257 24 , .,
+1990 257 24 , .,
+1994 257 24 , .,
+1386 257 24 , .,
+1987 257 24 , .,
+1996 257 24 , .,
+1986 257 24 , .,
+1983 257 24 , .,
+1992 257 24 , .,
+1988 257 24 , .,
+3071 257 24 , .,
+1989 257 24 , .,
+1389 257 24 , .,
+1991 257 24 , .,
+1391 257 24 , .,
+1392 257 24 , .,
+1393 257 24 , .,
+1394 257 24 , .,
+2207 257 24 , .,
+258 258 24 , .
+1395 258 24 , .,
+1959 258 24 , .,
+1396 258 24 , .,
+1397 258 24 , .,
+1398 258 24 , .,
+1399 258 24 , .,
+1958 258 24 , .,
+1400 258 24 , .,
+1401 258 24 , .,
+1402 258 24 , .,
+1403 258 24 , .,
+1404 258 24 , .,
+1956 258 24 , .,
+1957 258 24 , .,
+3288 258 24 , .,
+2206 258 24 , .,
+260 260 24 , .
+1406 260 24 , .,
+2001 260 24 , .,
+2003 260 24 , .,
+1407 260 24 , .,
+1408 260 24 , .,
+2002 260 24 , .,
+1409 260 24 , .,
+2000 260 24 , .,
+1997 260 24 , .,
+1410 260 24 , .,
+1998 260 24 , .,
+1999 260 24 , .,
+2208 260 24 , .,
+261 261 24 , .
+1412 261 24 , .,
+2004 261 24 , .,
+2009 261 24 , .,
+2005 261 24 , .,
+1413 261 24 , .,
+2006 261 24 , .,
+2008 261 24 , .,
+1414 261 24 , .,
+1415 261 24 , .,
+1411 261 24 , .,
+1416 261 24 , .,
+2007 261 24 , .,
+1417 261 24 , .,
+2209 261 24 , .,
+259 259 24 ,
+1405 259 24 , ,-
+2250 259 24 , ,
+265 265 24 ,
+2764 265 24 ,,
+2760 265 24 ,,
+2762 265 24 ,,
+2763 265 24 ,,
+2761 265 24 ,,
+1446 265 24 ,,-
+2222 265 24 ,,
+263 263 24 ,
+1439 263 24 , ,-
+2215 263 24 , ,
+273 273 24 ,
+2766 273 24 ,,-
+1494 273 24 ,,
+2768 273 24 ,,
+2767 273 24 ,,
+2765 273 24 ,,
+2275 273 24 ,,
+275 275 24 ,
+2769 275 24 ,,
+1496 275 24 ,,
+1497 275 24 ,,
+2770 275 24 ,,
+2771 275 24 ,,
+2281 275 24 ,,
+264 264 24 ,
+1440 264 24 , ,
+1441 264 24 , ,
+1442 264 24 , ,
+1443 264 24 , ,
+2728 264 24 , ,
+2731 264 24 , ,
+2729 264 24 , ,
+2732 264 24 , ,--
+3292 264 24 , ,
+2730 264 24 , ,
+1444 264 24 , ,
+1445 264 24 , ,
+3231 264 24 , ,
+2216 264 24 , ,
+268 268 24 ,
+2781 268 24 , ,
+1469 268 24 , ,
+2784 268 24 , ,
+2773 268 24 , ,
+2774 268 24 , ,
+3122 268 24 , ,
+2772 268 24 , ,
+3294 268 24 , ,
+2777 268 24 , ,
+1470 268 24 , ,
+2778 268 24 , ,
+2782 268 24 , ,
+2783 268 24 , ,
+1471 268 24 , ,
+1472 268 24 , ,
+1473 268 24 , ,
+2775 268 24 , ,
+2776 268 24 , ,
+2780 268 24 , ,
+2779 268 24 , ,
+2785 268 24 , ,
+1474 268 24 , ,
+2242 268 24 , ,
+266 266 24 , .
+2792 266 24 , .,
+1447 266 24 , .,
+1448 266 24 , .,
+2791 266 24 , .,
+1450 266 24 , .,
+1451 266 24 , .,
+2793 266 24 , .,
+2789 266 24 , .,-
+2786 266 24 , .,
+1452 266 24 , .,
+2794 266 24 , .,
+2787 266 24 , .,
+1449 266 24 , .,
+2790 266 24 , .,
+1453 266 24 , .,
+2788 266 24 , .,
+1454 266 24 , .,
+1455 266 24 , .,-
+2908 266 24 , .,
+1456 266 24 , .,-
+1457 266 24 , .,-
+1458 266 24 , .,
+1459 266 24 , .,
+2795 266 24 , .,
+2229 266 24 , .,
+267 267 24 , .
+2737 267 24 , .,-
+2740 267 24 , .,
+2746 267 24 , .,
+2739 267 24 , .,
+2742 267 24 , .,
+1460 267 24 , .,
+1461 267 24 , .,
+2738 267 24 , .,-
+2745 267 24 , .,
+1462 267 24 , .,
+1463 267 24 , .,
+1464 267 24 , .,
+2744 267 24 , .,
+3358 267 24 , .,
+1465 267 24 , .,
+1466 267 24 , .,
+2743 267 24 , .,
+2741 267 24 , .,
+1467 267 24 , .,
+1468 267 24 , .,
+2236 267 24 , .,
+269 269 24 , .
+1475 269 24 , .,
+1476 269 24 , .,
+1477 269 24 , .,
+2750 269 24 , .,
+1478 269 24 , .,
+2752 269 24 , .,
+2751 269 24 , .,
+3107 269 24 , .,
+2753 269 24 , .,
+2755 269 24 , .,
+1479 269 24 , .,
+2759 269 24 , .,
+2756 269 24 , .,
+2758 269 24 , .,
+2757 269 24 , .,
+2754 269 24 , .,
+2252 269 24 , .,
+270 270 24 , .
+2733 270 24 , .,
+1480 270 24 , .,
+1481 270 24 , .,
+2735 270 24 , .,
+1482 270 24 , .,
+2734 270 24 , .,
+2736 270 24 , .,
+2253 270 24 , .,
+272 272 24 , .
+1488 272 24 , .,
+1489 272 24 , .,
+3295 272 24 , .,
+1491 272 24 , .,
+1492 272 24 , .,
+1493 272 24 , .,
+1490 272 24 , .,
+2273 272 24 , .,
+276 276 24 , .
+2803 276 24 , .,
+2799 276 24 , .,
+1499 276 24 , .,
+2801 276 24 , .,
+2800 276 24 , .,
+2802 276 24 , .,-
+2798 276 24 , .,
+2796 276 24 , .,
+1498 276 24 , .,
+2797 276 24 , .,
+2285 276 24 , .,
+262 262 24 ,
+1438 262 24 , ,
+2213 262 24 , ,
+271 271 24 ,
+3233 271 24 , ,
+1485 271 24 , ,
+1487 271 24 , ,
+1483 271 24 , ,
+1484 271 24 , ,
+1486 271 24 , ,
+2269 271 24 , ,
+274 274 24 ,-
+1495 274 24 ,- ,-
+2279 274 24 ,- ,
+277 277 24 ,
+1500 277 24 , ,
+2288 277 24 , ,
+278 278 24 , .
+2668 278 24 , .,
+2667 278 24 , .,
+1524 278 24 , .,
+2669 278 24 , .,
+2666 278 24 , .,
+2671 278 24 , .,
+1525 278 24 , .,
+2670 278 24 , .,
+2672 278 24 , .,
+2243 278 24 , .,
+279 279 24 , .
+1526 279 24 , .,
+1527 279 24 , .,
+2691 279 24 , .,
+1528 279 24 , .,
+2924 279 24 , .,
+2707 279 24 , .,
+1529 279 24 , .,
+2698 279 24 , .,
+1530 279 24 , .,
+1531 279 24 , .,
+1532 279 24 , .,
+2696 279 24 , .,
+2692 279 24 , .,
+2706 279 24 , .,
+2709 279 24 , .,
+1533 279 24 , .,
+1534 279 24 , .,
+1535 279 24 , .,
+1536 279 24 , .,
+1537 279 24 , .,-
+1538 279 24 , .,
+2708 279 24 , .,
+1539 279 24 , .,
+2712 279 24 , .,
+1540 279 24 , .,
+2694 279 24 , .,
+2693 279 24 , .,
+1541 279 24 , .,
+2711 279 24 , .,
+2713 279 24 , .,
+1542 279 24 , .,
+2702 279 24 , .,
+1543 279 24 , .,
+2695 279 24 , .,
+2697 279 24 , .,
+2699 279 24 , .,
+2909 279 24 , .,
+1544 279 24 , .,
+1545 279 24 , .,
+1546 279 24 , .,
+1547 279 24 , .,
+3296 279 24 , .,
+2700 279 24 , .,
+1548 279 24 , .,
+2710 279 24 , .,
+2701 279 24 , .,
+2703 279 24 , .,
+1549 279 24 , .,
+2704 279 24 , .,
+2705 279 24 , .,
+2265 279 24 , .,
+280 280 24 , .
+1550 280 24 , .,
+1551 280 24 , .,
+3326 280 24 , .,
+1552 280 24 , .,
+1553 280 24 , .,
+2748 280 24 , .,
+2276 280 24 , .,
+282 282 24 , .
+1564 282 24 , .,
+2723 282 24 , .,
+2724 282 24 , .,
+2716 282 24 , .,
+3297 282 24 , .,
+2725 282 24 , .,
+1565 282 24 , .,
+2722 282 24 , .,
+1566 282 24 , .,
+2718 282 24 , .,
+2720 282 24 , .,-
+1567 282 24 , .,
+2721 282 24 , .,
+2715 282 24 , .,
+1568 282 24 , .,
+1569 282 24 , .,
+1570 282 24 , .,
+2726 282 24 , .,
+2717 282 24 , .,
+3100 282 24 , .,
+1571 282 24 , .,
+2719 282 24 , .,
+2727 282 24 , .,
+1572 282 24 , .,
+3332 282 24 , .,
+1573 282 24 , .,
+1574 282 24 , .,-
+1575 282 24 , .,
+1576 282 24 , .,
+1577 282 24 , .,
+2714 282 24 , .,
+2283 282 24 , .,
+281 281 24 ,- -
+2749 281 24 ,- - ,
+1554 281 24 ,- - ,
+1555 281 24 ,- - ,
+1556 281 24 ,- - ,
+1561 281 24 ,- - ,
+1562 281 24 ,- - ,
+1559 281 24 ,- - ,
+2852 281 24 ,- - ,
+2853 281 24 ,- - ,
+2854 281 24 ,- - ,-
+1560 281 24 ,- - ,
+1563 281 24 ,- - ,
+2747 281 24 ,- - ,
+1557 281 24 ,- - ,
+1558 281 24 ,- - ,-
+3344 281 24 ,- - ,
+2282 281 24 ,- - ,
+283 283 24 ,-
+3298 283 24 ,- ,
+1578 283 24 ,- ,
+2856 283 24 ,- ,
+1579 283 24 ,- ,
+1580 283 24 ,- ,
+1581 283 24 ,- ,
+1582 283 24 ,- ,
+1583 283 24 ,- ,
+2289 283 24 ,- ,
+284 284 24 , .
+1625 284 24 , .,
+1626 284 24 , .,
+2172 284 24 , .,
+2173 284 24 , .,
+1627 284 24 , .,
+2174 284 24 , .,
+2175 284 24 , .,
+1628 284 24 , .,
+1629 284 24 , .,
+2221 284 24 , .,
+285 285 24 , .
+1630 285 24 , .,
+3283 285 24 , .,
+1631 285 24 , .,
+2013 285 24 , .,
+2015 285 24 , .,
+1632 285 24 , .,
+1633 285 24 , .,
+1634 285 24 , .,
+2016 285 24 , .,
+2018 285 24 , .,
+2017 285 24 , .,
+2020 285 24 , .,
+2014 285 24 , .,
+2010 285 24 , .,
+2012 285 24 , .,
+2011 285 24 , .,
+2019 285 24 , .,
+2210 285 24 , .,
+286 286 24 , .
+1635 286 24 , .,
+1636 286 24 , .,
+2021 286 24 , .,
+1637 286 24 , .,
+2022 286 24 , .,
+1638 286 24 , .,-
+2023 286 24 , .,
+2031 286 24 , .,
+2024 286 24 , .,
+1639 286 24 , .,
+1640 286 24 , .,
+2026 286 24 , .,
+3299 286 24 , .,
+2033 286 24 , .,
+2025 286 24 , .,
+1641 286 24 , .,
+1642 286 24 , .,
+2027 286 24 , .,
+2211 286 24 , .,
+2028 286 24 , .,
+2032 286 24 , .,
+2029 286 24 , .,
+1643 286 24 , .,
+2030 286 24 , .,-
+2212 286 24 , .,
+287 287 24 , .
+1644 287 24 , .,
+1645 287 24 , .,
+1646 287 24 , .,
+1647 287 24 , .,
+1648 287 24 , .,
+2178 287 24 , .,
+2176 287 24 , .,
+1649 287 24 , .,
+2177 287 24 , .,
+2180 287 24 , .,
+1650 287 24 , .,
+2181 287 24 , .,
+1651 287 24 , .,
+2179 287 24 , .,
+2182 287 24 , .,
+2224 287 24 , .,
+288 288 24 , .
+1652 288 24 , .,
+2036 288 24 , .,
+1657 288 24 , .,
+1653 288 24 , .,
+1656 288 24 , .,
+2040 288 24 , .,
+2037 288 24 , .,
+2043 288 24 , .,
+3300 288 24 , .,
+2039 288 24 , .,
+2038 288 24 , .,
+2042 288 24 , .,
+2044 288 24 , .,
+1655 288 24 , .,
+2034 288 24 , .,
+1654 288 24 , .,
+2041 288 24 , .,
+2035 288 24 , .,
+2227 288 24 , .,
+289 289 24 , .
+2050 289 24 , .,
+2051 289 24 , .,
+3301 289 24 , .,
+2052 289 24 , .,
+1660 289 24 , .,
+1658 289 24 , .,
+2046 289 24 , .,
+1661 289 24 , .,
+2053 289 24 , .,
+2049 289 24 , .,
+1659 289 24 , .,
+2054 289 24 , .,
+2055 289 24 , .,
+2047 289 24 , .,
+1662 289 24 , .,
+2057 289 24 , .,
+2056 289 24 , .,-
+2045 289 24 , .,
+1663 289 24 , .,
+2131 289 24 , .,
+2048 289 24 , .,
+2233 289 24 , .,
+290 290 24 , .
+1664 290 24 , .,
+1665 290 24 , .,
+1666 290 24 , .,
+2059 290 24 , .,
+1667 290 24 , .,
+3302 290 24 , .,--
+1668 290 24 , .,
+2060 290 24 , .,
+1669 290 24 , .,
+2061 290 24 , .,
+2062 290 24 , .,
+2058 290 24 , .,
+1670 290 24 , .,
+2240 290 24 , .,
+291 291 24 , .
+1671 291 24 , .,-
+1673 291 24 , .,
+3279 291 24 , .,
+1672 291 24 , .,
+2187 291 24 , .,
+2188 291 24 , .,
+2184 291 24 , .,
+2185 291 24 , .,
+2183 291 24 , .,
+2189 291 24 , .,
+2186 291 24 , .,
+2244 291 24 , .,
+292 292 24 , .
+2194 292 24 , .,
+2193 292 24 , .,
+1674 292 24 , .,
+2190 292 24 , .,
+2195 292 24 , .,
+1675 292 24 , .,
+2192 292 24 , .,
+2191 292 24 , .,
+2245 292 24 , .,
+293 293 24 , .
+1733 293 24 , .,
+1732 293 24 , .,
+1731 293 24 , .,
+1730 293 24 , .,
+2063 293 24 , .,
+2064 293 24 , .,
+1729 293 24 , .,
+1728 293 24 , .,
+1727 293 24 , .,
+2065 293 24 , .,
+1726 293 24 , .,
+1725 293 24 , .,
+1724 293 24 , .,
+1723 293 24 , .,
+2066 293 24 , .,
+1722 293 24 , .,
+1721 293 24 , .,
+1720 293 24 , .,
+1719 293 24 , .,
+2067 293 24 , .,
+1718 293 24 , .,
+1715 293 24 , .,
+1717 293 24 , .,
+2068 293 24 , .,
+2069 293 24 , .,
+1716 293 24 , .,
+1714 293 24 , .,
+1713 293 24 , .,
+1712 293 24 , .,
+1711 293 24 , .,
+1710 293 24 , .,
+2070 293 24 , .,
+2071 293 24 , .,
+1709 293 24 , .,-
+1708 293 24 , .,
+2072 293 24 , .,-
+1707 293 24 , .,
+1706 293 24 , .,
+1705 293 24 , .,
+1704 293 24 , .,
+1703 293 24 , .,
+1702 293 24 , .,
+1701 293 24 , .,-
+1700 293 24 , .,
+1698 293 24 , .,
+2073 293 24 , .,
+2074 293 24 , .,
+1699 293 24 , .,-
+1697 293 24 , .,
+1696 293 24 , .,
+1695 293 24 , .,
+1694 293 24 , .,
+1693 293 24 , .,
+1692 293 24 , .,
+1691 293 24 , .,
+1690 293 24 , .,
+2075 293 24 , .,
+2076 293 24 , .,
+1689 293 24 , .,
+1688 293 24 , .,
+1687 293 24 , .,
+1686 293 24 , .,
+2077 293 24 , .,
+2078 293 24 , .,
+1685 293 24 , .,
+1684 293 24 , .,
+1683 293 24 , .,
+1682 293 24 , .,
+1681 293 24 , .,
+1680 293 24 , .,
+1679 293 24 , .,
+1678 293 24 , .,
+2080 293 24 , .,
+1677 293 24 , .,
+1676 293 24 , .,
+2079 293 24 , .,
+3031 293 24 , .,
+2081 293 24 , .,
+2249 293 24 , .,
+294 294 24 , .
+2083 294 24 , .,
+2082 294 24 , .,-
+3160 294 24 , .,
+1736 294 24 , .,
+2084 294 24 , .,
+1737 294 24 , .,
+2085 294 24 , .,
+1735 294 24 , .,
+2255 294 24 , .,
+295 295 24 , .
+1740 295 24 , .,-
+1741 295 24 , .,
+2086 295 24 , .,
+2087 295 24 , .,
+2089 295 24 , .,
+2091 295 24 , .,
+2093 295 24 , .,
+1738 295 24 , .,
+3305 295 24 , .,
+1739 295 24 , .,
+2090 295 24 , .,
+2088 295 24 , .,-
+2092 295 24 , .,-
+2094 295 24 , .,
+3320 295 24 , .,
+2260 295 24 , .,
+296 296 24 , .
+2095 296 24 , .,
+1743 296 24 , .,
+1744 296 24 , .,
+2096 296 24 , .,
+1745 296 24 , .,
+1746 296 24 , .,
+2097 296 24 , .,
+2098 296 24 , .,
+2099 296 24 , .,
+2100 296 24 , .,
+2101 296 24 , .,
+1747 296 24 , .,
+1742 296 24 , .,
+2102 296 24 , .,
+1748 296 24 , .,
+2267 296 24 , .,
+297 297 24 , .
+2198 297 24 , .,
+2199 297 24 , .,
+1752 297 24 , .,
+1751 297 24 , .,
+2196 297 24 , .,
+1750 297 24 , .,
+3271 297 24 , .,
+1749 297 24 , .,
+3272 297 24 , .,
+2197 297 24 , .,
+2270 297 24 , .,
+298 298 24 , .
+2103 298 24 , .,
+2104 298 24 , .,
+2105 298 24 , .,
+2106 298 24 , .,
+2107 298 24 , .,
+1753 298 24 , .,
+2108 298 24 , .,
+2109 298 24 , .,
+2110 298 24 , .,
+2111 298 24 , .,
+1758 298 24 , .,
+1756 298 24 , .,
+2112 298 24 , .,
+1759 298 24 , .,
+1760 298 24 , .,
+1761 298 24 , .,
+2113 298 24 , .,
+1757 298 24 , .,
+2114 298 24 , .,
+1754 298 24 , .,
+2115 298 24 , .,
+2116 298 24 , .,
+1755 298 24 , .,
+2272 298 24 , .,
+299 299 24 , .
+2127 299 24 , .,
+2126 299 24 , .,
+2118 299 24 , .,
+2122 299 24 , .,
+2129 299 24 , .,
+1762 299 24 , .,
+2128 299 24 , .,
+3354 299 24 , .,
+2124 299 24 , .,
+1763 299 24 , .,
+2123 299 24 , .,
+1764 299 24 , .,
+2117 299 24 , .,
+2130 299 24 , .,-
+2120 299 24 , .,
+2119 299 24 , .,
+2125 299 24 , .,
+1765 299 24 , .,
+1766 299 24 , .,
+2121 299 24 , .,
+1767 299 24 , .,
+2274 299 24 , .,
+300 300 24 , .
+3053 300 24 , .,
+3268 300 24 , .,
+1773 300 24 , .,-
+2132 300 24 , .,
+3269 300 24 , .,
+2133 300 24 , .,
+3270 300 24 , .,
+1774 300 24 , .,
+2994 300 24 , .,
+1775 300 24 , .,-
+2134 300 24 , .,
+1769 300 24 , .,
+1771 300 24 , .,
+1772 300 24 , .,
+1770 300 24 , .,
+1768 300 24 , .,
+2290 300 24 , .,
+301 301 24 ,
+2849 301 24 ,,
+1776 301 24 ,,
+2214 301 24 ,,
+304 304 24 ,
+2617 304 24 ,,
+1791 304 24 ,,
+1788 304 24 ,,
+2619 304 24 ,,
+1789 304 24 ,,
+2618 304 24 ,,
+1790 304 24 ,,
+1792 304 24 ,,
+2620 304 24 ,,
+2225 304 24 ,,
+305 305 24 ,
+3052 305 24 ,,
+1787 305 24 ,,
+2228 305 24 ,,
+306 306 24 ,-
+2621 306 24 ,-,
+1794 306 24 ,-,
+1793 306 24 ,-,
+2622 306 24 ,-,
+1795 306 24 ,-,
+2623 306 24 ,-,
+2624 306 24 ,-,
+3274 306 24 ,-,
+2230 306 24 ,-,
+307 307 24 ,
+2567 307 24 ,,
+2568 307 24 ,,
+3324 307 24 ,,
+1796 307 24 ,,
+2232 307 24 ,,
+308 308 24 ,-
+1799 308 24 ,-,
+1798 308 24 ,-,
+2626 308 24 ,-,
+2625 308 24 ,-,-
+1797 308 24 ,-,
+2235 308 24 ,-,
+311 311 24 , -
+2630 311 24 , - ,
+2631 311 24 , - ,
+2628 311 24 , - ,
+1839 311 24 , - ,
+2629 311 24 , - ,
+2627 311 24 , - ,
+2266 311 24 , - ,
+313 313 24 ,
+2632 313 24 ,,
+1853 313 24 ,,
+2633 313 24 ,,
+2284 313 24 ,,
+309 309 24 ,
+2636 309 24 , ,
+1800 309 24 , ,
+1801 309 24 , ,
+1802 309 24 , ,
+1803 309 24 , ,
+1804 309 24 , ,
+1805 309 24 , ,
+2637 309 24 , ,
+1806 309 24 , ,
+1807 309 24 , ,
+2638 309 24 , ,
+1808 309 24 , ,
+1809 309 24 , ,
+1810 309 24 , ,
+1811 309 24 , ,
+3232 309 24 , ,
+2639 309 24 , ,
+1812 309 24 , ,
+1813 309 24 , ,
+1814 309 24 , ,-
+3102 309 24 , ,
+1815 309 24 , ,--
+1816 309 24 , ,
+3266 309 24 , ,
+3039 309 24 , ,
+1817 309 24 , ,
+2635 309 24 , ,
+1818 309 24 , ,
+1819 309 24 , ,
+1820 309 24 , ,-
+2634 309 24 , ,
+2241 309 24 , ,
+312 312 24 ,
+1840 312 24 , ,
+2644 312 24 , ,
+1841 312 24 , ,
+1842 312 24 , ,
+1843 312 24 , ,
+1844 312 24 , ,
+2647 312 24 , ,
+2641 312 24 , ,
+2642 312 24 , ,
+1845 312 24 , ,
+1846 312 24 , ,
+3367 312 24 , ,
+3265 312 24 , ,
+1847 312 24 , ,
+1848 312 24 , ,
+1849 312 24 , ,
+2645 312 24 , ,
+2643 312 24 , ,
+1850 312 24 , ,
+1851 312 24 , ,
+1852 312 24 , ,
+2646 312 24 , ,
+2640 312 24 , ,
+2268 312 24 , ,
+302 302 24 , .
+1777 302 24 , .,
+1778 302 24 , .,
+3383 302 24 , .,
+2578 302 24 , .,
+2579 302 24 , .,
+1786 302 24 , .,
+2219 302 24 , .,
+303 303 24 , .
+1779 303 24 , .,
+1780 303 24 , .,
+2584 303 24 , .,
+1781 303 24 , .,
+1782 303 24 , .,--
+1783 303 24 , .,
+2588 303 24 , .,
+2591 303 24 , .,
+2587 303 24 , .,
+2582 303 24 , .,
+2590 303 24 , .,
+1784 303 24 , .,
+2581 303 24 , .,
+2583 303 24 , .,
+2580 303 24 , .,
+2589 303 24 , .,
+2585 303 24 , .,
+1785 303 24 , .,
+2586 303 24 , .,
+2223 303 24 , .,
+310 310 24 , .
+1821 310 24 , .,
+1822 310 24 , .,
+1823 310 24 , .,
+1824 310 24 , .,
+1825 310 24 , .,
+1826 310 24 , .,
+1827 310 24 , .,
+2651 310 24 , .,
+1828 310 24 , .,
+3264 310 24 , .,
+2652 310 24 , .,-
+2649 310 24 , .,
+2648 310 24 , .,
+1829 310 24 , .,
+2653 310 24 , .,
+1830 310 24 , .,
+1831 310 24 , .,
+1832 310 24 , .,
+1833 310 24 , .,--
+1834 310 24 , .,
+1835 310 24 , .,
+1836 310 24 , .,
+1837 310 24 , .,-
+3263 310 24 , .,
+2650 310 24 , .,
+1838 310 24 , .,
+2259 310 24 , .,
+81 0 81
+1055 1055 81 ,
+1058 1058 81 ,
+1056 1056 81 ,
+1057 1057 81 ,
+3153 3153 81 ,
+2291 2291 81 ,
+82 0 82
+2932 2932 82 ,
+1060 1060 82 ,
+3084 3084 82 ,
+3011 3011 82 ,
+3306 3306 82 ,
+1059 1059 82 ,
+3145 3145 82 ,
+2292 2292 82 ,
+97 0 97
+1061 1061 97 ,
+2293 2293 97 ,
+96 0 96
+1062 1062 96 ,
+2294 2294 96 ,
+99 0 99
+1063 1063 99 ,
+2295 2295 99 ,
+100 0 100 -
+1064 1064 100 -,--
+2296 2296 100 -,
+101 0 101
+1065 1065 101 ,
+2297 2297 101 ,
+102 0 102
+1066 1066 102 ,
+2298 2298 102 ,
+83 0 83
+1067 1067 83 ,
+3158 3158 83 ,
+1068 1068 83 ,
+3129 3129 83 ,
+1069 1069 83 ,
+1070 1070 83 ,
+2299 2299 83 ,
+86 0 86
+3345 3345 86 ,
+1071 1071 86 ,
+2992 2992 86 ,
+3175 3175 86 ,
+3363 3363 86 ,-
+2884 2884 86 ,-
+3243 3243 86 ,-
+1074 1074 86 ,-
+3348 3348 86 ,
+3241 3241 86 ,
+1075 1075 86 ,
+3350 3350 86 ,-
+2982 2982 86 ,
+2971 2971 86 ,-
+3136 3136 86 ,
+1080 1080 86 ,
+3303 3303 86 ,
+3050 3050 86 ,
+3151 3151 86 ,
+3141 3141 86 ,
+3012 3012 86 ,
+1081 1081 86 ,
+1077 1077 86 ,-
+1079 1079 86 ,
+1078 1078 86 ,
+1076 1076 86 ,
+2929 2929 86 ,
+2928 2928 86 ,
+2300 2300 86 ,
+95 0 95
+3315 3315 95 ,
+1082 1082 95 ,
+1083 1083 95 ,
+3144 3144 95 ,
+3025 3025 95 ,
+3277 3277 95 ,
+1084 1084 95 ,
+2301 2301 95 ,
+103 0 103
+1085 1085 103 ,
+2302 2302 103 ,
+79 0 79
+1086 1086 79 ,
+2303 2303 79 ,
+85 0 85
+1087 1087 85 ,
+2304 2304 85 ,
+87 0 87
+1088 1088 87 ,
+2305 2305 87 ,
+104 0 104
+1089 1089 104 ,
+2306 2306 104 ,
+84 0 84
+1090 1090 84 ,
+1091 1091 84 ,
+1092 1092 84 ,-
+3242 3242 84 ,
+1093 1093 84 ,
+1094 1094 84 , ()
+1095 1095 84 ,
+3245 3245 84 ,
+3083 3083 84 ,
+1096 1096 84 ,
+1097 1097 84 ,
+1098 1098 84 ,
+1099 1099 84 ,
+2868 2868 84 ,
+1100 1100 84 ,
+1101 1101 84 , (.-. .)
+1102 1102 84 ,
+1103 1103 84 ,
+1104 1104 84 ,
+3166 3166 84 ,
+1105 1105 84 ,-
+2927 2927 84 ,
+1106 1106 84 ,
+1107 1107 84 ,
+1108 1108 84 ,-
+1109 1109 84 ,
+1110 1110 84 ,
+2307 2307 84 ,
+105 0 105
+1111 1111 105 ,
+2308 2308 105 ,
+106 0 106
+1112 1112 106 ,
+2309 2309 106 ,
+107 0 107
+1113 1113 107 ,
+1114 1114 107 ,
+1115 1115 107 ,
+2954 2954 107 ,
+2310 2310 107 ,
+92 0 92 ()
+1116 1116 92 (),
+1117 1117 92 (),-
+3027 3027 92 (),-
+1118 1118 92 (),
+1119 1119 92 (),
+1120 1120 92 (),
+2933 2933 92 (),
+2311 2311 92 (),
+76 0 76
+3214 3214 76 , ()
+1121 1121 76 ,
+2869 2869 76 ,
+3262 3262 76 ,
+1122 1122 76 ,
+1123 1123 76 ,
+1124 1124 76 ,
+3043 3043 76 ,
+2312 2312 76 ,
+3215 0 3215 (.)
+29 0 29 ()
+1125 1125 29 (),
+2313 2313 29 (),
+108 0 108
+1126 1126 108 ,
+3240 3240 108 ,
+2314 2314 108 ,
+88 0 88
+1127 1127 88 ,-
+2315 2315 88 ,
+109 0 109
+1128 1128 109 ,
+2316 2316 109 ,
+110 0 110
+1129 1129 110 ,
+2317 2317 110 ,
+111 0 111
+1130 1130 111 ,-
+1131 1131 111 ,-
+2318 2318 111 ,
+112 0 112
+1132 1132 112 ,
+2319 2319 112 ,
+113 0 113
+1133 1133 113 ,-
+1134 1134 113 ,
+2320 2320 113 ,
+114 0 114
+1135 1135 114 ,
+2321 2321 114 ,
+115 0 115
+1136 1136 115 ,
+2322 2322 115 ,
+116 0 116
+1137 1137 116 ,-
+1138 1138 116 ,
+1139 1139 116 ,
+2323 2323 116 ,
+117 0 117
+1140 1140 117 ,
+2324 2324 117 ,
+3216 0 3216 (.)
+122 0 122
+1141 1141 122 ,
+2325 2325 122 ,
+89 0 89
+1072 1072 89 ,
+1073 1073 89 ,
+1142 1142 89 ,
+2326 2326 89 ,
+94 0 94
+3250 3250 94 ,
+1143 1143 94 ,-
+2327 2327 94 ,
+118 0 118
+78 0 78
+1144 1144 78 ,
+2328 2328 78 ,
+91 0 91
+1145 1145 91 ,
+3307 3307 91 ,
+3308 3308 91 ,
+2329 2329 91 ,
+119 0 119
+1146 1146 119 ,
+1147 1147 119 ,
+2330 2330 119 ,
+120 0 120
+1148 1148 120 ,
+2331 2331 120 ,
+132 0 132
+1149 1149 132 ,
+2332 2332 132 ,
+90 0 90
+1150 1150 90 ,
+3079 3079 90 ,
+2333 2333 90 ,
+77 0 77
+1152 1152 77 ,
+1153 1153 77 ,
+3080 3080 77 ,
+1151 1151 77 ,
+1154 1154 77 ,
+1155 1155 77 ,
+2334 2334 77 ,
+93 0 93
+3362 3362 93 ,
+3137 3137 93 ,
+3273 3273 93 ,
+1156 1156 93 ,
+1157 1157 93 ,
+3167 3167 93 ,
+3347 3347 93 ,
+1158 1158 93 ,
+1159 1159 93 ,
+1160 1160 93 ,
+1161 1161 93 ,
+1162 1162 93 ,
+1163 1163 93 ,
+1164 1164 93 ,
+2335 2335 93 ,
+121 0 121
+1165 1165 121 ,
+3319 3319 121 ,
+2336 2336 121 ,
+98 0 98
+1166 1166 98 ,
+2337 2337 98 ,
+75 0 75
+3176 3176 75 ,
+3339 3339 75 ,
+1167 1167 75 ,
+1168 1168 75 ,
+2338 2338 75 ,
+123 0 123
+1914 1914 123 ,
+2957 2957 123 ,
+1915 1915 123 ,
+3331 3331 123 ,
+1916 1916 123 ,
+3001 3001 123 ,
+1917 1917 123 ,
+3217 3217 123 ,
+3064 3064 123 ,
+3020 3020 123 ,
+1918 1918 123 ,
+3238 3238 123 ,
+2339 2339 123 ,
+454 0 454
+1192 1192 454 ,-
+2366 2366 454 ,
+124 0 124
+1919 1919 124 ,-
+2340 2340 124 ,
+453 0 453 ()
+1193 1193 453 (),
+2368 2368 453 (),
+126 0 126
+1921 1921 126 ,
+2342 2342 126 ,
+127 0 127
+1922 1922 127 ,
+2343 2343 127 ,
+128 0 128 ( )
+1923 1923 128 ( ),
+2344 2344 128 ( ),
+129 0 129
+1924 1924 129 ,
+2345 2345 129 ,
+3220 0 3220 (..)
+130 0 130
+1925 1925 130 ,
+1926 1926 130 ,
+1928 1928 130 ,
+1929 1929 130 ,
+3235 3235 130 ,
+1927 1927 130 ,
+3323 3323 130 ,
+2346 2346 130 ,
+3218 0 3218 (.)
+3221 0 3221 (..)
+3230 0 3230 (.)
+131 0 131
+1930 1930 131 ,
+2347 2347 131 ,
+133 0 133 -
+1931 1931 133 - ,-
+2348 2348 133 - ,
+3222 0 3222 (.)
+125 0 125
+1920 1920 125 ,
+2341 2341 125 ,
+3219 0 3219 . ()
+134 0 134
+1932 1932 134 ,
+2349 2349 134 ,
+3223 0 3223 (..)
+135 0 135
+1933 1933 135 ,
+2350 2350 135 ,
+136 0 136
+1934 1934 136 ,
+2351 2351 136 ,
+3224 0 3224 (.)
+137 0 137
+1935 1935 137 ,
+2352 2352 137 ,
+3226 0 3226
+3225 0 3225
+138 0 138
+3055 3055 138 ,
+3049 3049 138 ,
+3330 3330 138 ,
+1169 1169 138 ,
+3106 3106 138 ,
+1170 1170 138 ,
+1171 1171 138 ,
+1172 1172 138 ,
+3365 3365 138 ,
+1173 1173 138 ,
+3104 3104 138 ,
+3366 3366 138 ,
+1174 1174 138 ,
+2964 2964 138 ,
+3113 3113 138 ,
+1175 1175 138 ,
+2920 2920 138 ,-
+2889 2889 138 ,-
+1176 1176 138 ,
+2903 2903 138 ,
+1177 1177 138 ,
+1178 1178 138 ,
+2946 2946 138 ,
+1179 1179 138 ,
+1180 1180 138 ,
+2353 2353 138 ,
+407 407 139 ,,
+426 426 139 ,
+427 426 139 ,,
+2354 426 139 ,,
+378 378 139 ,
+3109 378 139 ,,
+379 378 139 ,,-
+2963 378 139 ,,
+2355 378 139 ,,
+412 412 139 ,
+3236 412 139 ,,
+413 412 139 ,,
+1181 412 139 ,,
+2356 412 139 ,,
+446 446 139 ,
+1182 446 139 ,,
+447 446 139 ,,
+1183 446 139 ,,
+2357 446 139 ,,
+434 434 139 ,
+2917 434 139 ,,
+1184 434 139 ,,
+435 434 139 ,,
+3061 434 139 ,,
+2358 434 139 ,,
+416 416 139 ,
+417 416 139 ,,-
+2359 416 139 ,,
+428 428 139 ,
+3017 428 139 ,,
+429 428 139 ,,
+2360 428 139 ,,
+440 440 139 ,
+2956 440 139 ,,
+2967 440 139 ,,
+3385 440 139 ,,
+2865 440 139 ,,
+441 440 139 ,,
+3352 440 139 ,,
+2876 440 139 ,,
+3003 440 139 ,,
+1185 440 139 ,,
+2983 440 139 ,,
+1186 440 139 ,,
+3152 440 139 ,,
+2886 440 139 ,,
+2361 440 139 ,,
+352 352 139 ,
+353 352 139 ,,
+2861 352 139 ,,
+2362 352 139 ,,
+394 394 139 ,
+1188 394 139 ,,
+1187 394 139 ,,
+2969 394 139 ,,
+1189 394 139 ,,
+3114 394 139 ,,
+2885 394 139 ,,-
+2979 394 139 ,,
+3338 394 139 ,,
+395 394 139 ,,
+3005 394 139 ,,
+2991 394 139 ,,
+2996 394 139 ,,
+3097 394 139 ,,
+2981 394 139 ,,
+2363 394 139 ,,
+374 374 139 ,
+2995 374 139 ,,-
+375 374 139 ,,
+2365 374 139 ,,
+448 448 139 ,
+449 448 139 ,,
+1191 448 139 ,,
+2367 448 139 ,,
+390 390 139 ,
+3021 390 139 ,,
+391 390 139 ,,
+2973 390 139 ,,
+2369 390 139 ,,
+402 402 139 ,
+403 402 139 ,,
+2370 402 139 ,,
+396 396 139 ,
+397 396 139 , ,
+2371 396 139 , ,
+370 370 139 ,
+2911 370 139 ,,
+3074 370 139 ,,
+371 370 139 ,,
+2930 370 139 ,,
+1194 370 139 ,,
+2372 370 139 ,,
+368 368 139 ,
+369 368 139 ,,
+1195 368 139 ,,
+2373 368 139 ,,
+444 444 139 ,
+2959 444 139 ,,
+2961 444 139 ,,
+2912 444 139 ,,
+2899 444 139 ,,
+1196 444 139 ,,
+3249 444 139 ,,
+3014 444 139 ,,
+3048 444 139 ,,
+2901 444 139 ,,-
+2926 444 139 ,,
+2922 444 139 ,,
+1203 444 139 ,,
+2978 444 139 ,,
+2990 444 139 ,,
+3077 444 139 ,,
+2918 444 139 ,,
+2881 444 139 ,,
+3247 444 139 ,,
+3092 444 139 ,,
+2948 444 139 ,,
+1197 444 139 ,,-
+1198 444 139 ,,-
+3058 444 139 ,,-
+3328 444 139 ,,--
+2874 444 139 ,,-
+2998 444 139 ,,
+3087 444 139 ,,
+2947 444 139 ,,
+2900 444 139 ,,
+1199 444 139 ,,
+3335 444 139 ,,
+2966 444 139 ,,
+445 444 139 ,,
+1200 444 139 ,,-
+3317 444 139 ,,-
+1201 444 139 ,,-
+1202 444 139 ,,-
+2878 444 139 ,,
+2925 444 139 ,,-
+2875 444 139 ,,-
+1204 444 139 ,,-
+2859 444 139 ,,-
+3157 444 139 ,,
+3146 444 139 ,,
+2970 444 139 ,,
+2949 444 139 ,,-
+3057 444 139 ,,
+3032 444 139 ,,-
+3381 444 139 ,,
+3028 444 139 ,,
+2858 444 139 ,,
+3040 444 139 ,,
+2374 444 139 ,,
+388 388 139 ,
+3041 388 139 ,,
+389 388 139 ,,
+2375 388 139 ,,
+408 408 139 ,
+3004 408 139 ,,
+1205 408 139 ,,
+409 408 139 ,,
+2376 408 139 ,,
+430 430 139 ,
+1206 430 139 ,,
+3095 430 139 ,,
+431 430 139 ,,
+1207 430 139 ,,-
+3046 430 139 ,,
+2377 430 139 ,,
+358 358 139 ,
+2968 358 139 ,,
+3018 358 139 ,,
+2882 358 139 ,,
+359 358 139 ,,
+3047 358 139 ,,
+2378 358 139 ,,
+418 418 139 ,
+419 418 139 ,,-
+1208 418 139 ,,
+2408 418 139 ,,
+354 354 139 ,
+2931 354 139 ,,
+3334 354 139 ,,
+355 354 139 ,,
+3059 354 139 ,,
+2919 354 139 ,,
+2902 354 139 ,,
+1209 354 139 ,,
+3336 354 139 ,,
+2985 354 139 ,,
+3022 354 139 ,,
+2407 354 139 ,,
+376 376 139 ,
+1210 376 139 ,,
+2980 376 139 ,,
+377 376 139 ,,-
+3035 376 139 ,,
+2406 376 139 ,,
+414 414 139 ,
+415 414 139 ,,
+2405 414 139 ,,
+380 380 139 ,
+381 380 139 ,,-
+3062 380 139 ,,
+3038 380 139 ,,
+1211 380 139 ,,-
+2895 380 139 ,,
+2404 380 139 ,,
+372 372 139 ,
+3357 372 139 ,,
+1212 372 139 ,,-
+1213 372 139 ,,
+3103 372 139 ,,
+373 372 139 ,,
+2987 372 139 ,,
+2887 372 139 ,,
+2403 372 139 ,,
+424 424 139 ,
+1214 424 139 ,,-
+425 424 139 ,,
+2402 424 139 ,,
+348 348 139 ,
+349 348 139 ,,
+3000 348 139 ,,
+2401 348 139 ,,
+392 392 139 ,
+393 392 139 ,,
+1215 392 139 ,,
+3143 392 139 ,,
+3337 392 139 ,,
+2904 392 139 ,,
+3329 392 139 ,,
+2400 392 139 ,,
+386 386 139 ,
+387 386 139 ,,
+1216 386 139 ,,
+2399 386 139 ,,
+438 438 139 ,
+439 438 139 ,,-
+1217 438 139 ,,-
+2890 438 139 ,,
+2398 438 139 ,,
+362 362 139 ,-
+1219 362 139 ,-,-
+1218 362 139 ,-,
+3276 362 139 ,-,
+3073 362 139 ,-,
+2955 362 139 ,-,
+3349 362 139 ,-,
+363 362 139 ,-,
+3078 362 139 ,-,
+3248 362 139 ,-,
+2397 362 139 ,-,
+360 360 139 ,-
+3134 360 139 ,-,
+3081 360 139 ,-,
+2997 360 139 ,-,
+2999 360 139 ,-,
+3139 360 139 ,-,
+3060 360 139 ,-,
+1220 360 139 ,-,-
+361 360 139 ,-,
+2914 360 139 ,-,
+3056 360 139 ,-,
+2396 360 139 ,-,
+432 432 139 ,-
+1222 432 139 ,-,
+433 432 139 ,-,-
+2395 432 139 ,-,
+350 350 139 ,-
+2989 350 139 ,-,
+351 350 139 ,-,
+2950 350 139 ,-,
+1221 350 139 ,-,
+3111 350 139 ,-,
+2898 350 139 ,-,
+2938 350 139 ,-,
+2394 350 139 ,-,
+366 366 139 ,
+2953 366 139 ,,
+3112 366 139 ,,
+1223 366 139 ,,
+367 366 139 ,,
+2951 366 139 ,,
+2862 366 139 ,,
+3034 366 139 ,,
+2860 366 139 ,,
+2393 366 139 ,,
+420 420 139 ,
+421 420 139 ,,-
+1224 420 139 ,,
+2392 420 139 ,,
+442 442 139 ,
+2877 442 139 ,,-
+2945 442 139 ,,-
+1225 442 139 ,,
+443 442 139 ,,
+1226 442 139 ,,
+2391 442 139 ,,
+364 364 139 ,
+3316 364 139 ,,
+3282 364 139 ,,
+2972 364 139 ,,
+1227 364 139 ,,
+2893 364 139 ,,
+3110 364 139 ,,
+1228 364 139 ,,
+365 364 139 ,,
+2390 364 139 ,,
+450 450 139 ,-
+451 450 139 ,-,
+3093 450 139 ,-,-
+2389 450 139 ,-,
+356 356 139 ,-
+357 356 139 ,-,
+2388 356 139 ,-,
+382 382 139 ,
+383 382 139 , ,
+2387 382 139 , ,
+398 398 139 ,
+2960 398 139 , ,
+2915 398 139 , ,
+399 398 139 , ,
+2386 398 139 , ,
+410 410 139 ,
+2863 410 139 ,,
+411 410 139 ,,
+1229 410 139 ,,
+2385 410 139 ,,
+422 422 139 ,
+3085 422 139 ,,
+2913 422 139 ,,
+1233 422 139 ,,
+2916 422 139 ,,
+3123 422 139 ,,
+2873 422 139 ,,
+3096 422 139 ,,
+423 422 139 ,,
+1232 422 139 ,,-
+3023 422 139 ,,
+1231 422 139 ,,
+1230 422 139 ,,-
+2384 422 139 ,,
+406 406 139 ,
+2383 406 139 , ,
+404 404 139 ,
+2879 404 139 ,,-
+2880 404 139 ,,
+3086 404 139 ,,
+3002 404 139 ,,
+3124 404 139 ,,
+2894 404 139 ,,-
+3290 404 139 ,,-
+1234 404 139 ,,
+1236 404 139 ,,
+3372 404 139 ,,
+2952 404 139 ,,-
+3340 404 139 ,,
+1235 404 139 ,,-
+405 404 139 ,,
+2962 404 139 ,,
+2382 404 139 ,,
+384 384 139 ,
+385 384 139 , ,
+2381 384 139 , ,
+400 400 139 ,
+401 400 139 , ,
+3090 400 139 , ,
+1237 400 139 , ,
+2380 400 139 , ,
+436 436 139 ,
+3036 436 139 ,,
+3024 436 139 ,,
+3108 436 139 ,,
+2866 436 139 ,,-
+437 436 139 ,,--
+2379 436 139 ,,
+3200 0 3200 (.)
+140 0 140
+1238 1238 140 ,-
+2442 2442 140 ,
+141 0 141
+1239 1239 141 ,-
+2441 2441 141 ,
+3202 0 3202 (.)
+142 0 142
+1240 1240 142 ,
+2440 2440 142 ,
+143 0 143
+1241 1241 143 ,
+2439 2439 143 ,
+146 0 146
+1242 1242 146 ,
+2438 2438 146 ,
+3203 0 3203 (.)
+144 0 144
+1243 1243 144 ,-
+2437 2437 144 ,
+145 0 145
+1244 1244 145 ,
+3094 3094 145 ,
+1245 1245 145 ,--
+1246 1246 145 ,-
+2436 2436 145 ,
+147 0 147
+1247 1247 147 ,
+2435 2435 147 ,
+3204 0 3204 (.)
+452 0 452 ()
+1190 1190 452 (),-
+2364 2364 452 (),
+149 0 149
+1248 1248 149 ,--
+2434 2434 149 ,
+148 0 148
+1249 1249 148 ,
+2433 2433 148 ,
+3205 0 3205 (.)
+173 0 173
+1250 1250 173 ,
+2432 2432 173 ,
+150 0 150
+1251 1251 150 ,
+2431 2431 150 ,
+151 0 151
+1252 1252 151 ,-
+2430 2430 151 ,
+152 0 152 (.)
+1253 1253 152 (.),
+2429 2429 152 (.),
+153 0 153
+1254 1254 153 ,
+2428 2428 153 ,
+154 0 154
+1255 1255 154 ,-
+2427 2427 154 ,
+155 0 155
+1256 1256 155 ,
+2426 2426 155 ,
+156 0 156 -
+1257 1257 156 -,-
+2425 2425 156 -,
+157 0 157
+1258 1258 157 ,
+2424 2424 157 ,
+3208 0 3208 (.)
+158 0 158
+1259 1259 158 ,
+1260 1260 158 ,
+2423 2423 158 ,
+3209 0 3209 ()
+3201 0 3201
+159 0 159
+1261 1261 159 ,
+2422 2422 159 ,
+3207 0 3207 (.)
+3211 0 3211 (.)
+160 0 160
+1262 1262 160 ,
+2421 2421 160 ,
+161 0 161
+1263 1263 161 ,
+2420 2420 161 ,
+162 0 162
+1264 1264 162 ,
+2419 2419 162 ,
+163 0 163
+1265 1265 163 ,-
+2418 2418 163 ,
+164 0 164 -
+1266 1266 164 - ,
+2417 2417 164 - ,
+165 0 165 -
+1267 1267 165 - ,
+2416 2416 165 - ,
+166 0 166 -
+1268 1268 166 -,
+2415 2415 166 -,
+3210 0 3210 - (.)
+167 0 167
+1269 1269 167 ,
+2414 2414 167 ,
+168 0 168
+1270 1270 168 ,--
+2413 2413 168 ,
+169 0 169
+1271 1271 169 ,
+2412 2412 169 ,
+3212 0 3212 (.)
+3206 0 3206
+170 0 170
+1272 1272 170 ,
+2411 2411 170 ,
+171 0 171
+1273 1273 171 ,
+1274 1274 171 ,
+2410 2410 171 ,
+3213 0 3213 . . - (.)
+172 0 172
+1275 1275 172 ,
+2409 2409 172 ,
+174 0 174
+1854 1854 174 ,
+2495 2495 174 ,
+175 0 175
+1855 1855 175 ,
+2494 2494 175 ,
+176 0 176
+1856 1856 176 ,
+1857 1857 176 ,-
+2493 2493 176 ,
+177 0 177
+1858 1858 177 ,
+2492 2492 177 ,
+3228 0 3228
+178 0 178 -
+1859 1859 178 -,
+2491 2491 178 -,
+179 0 179
+1860 1860 179 ,
+2490 2490 179 ,
+180 0 180
+1861 1861 180 ,
+2489 2489 180 ,
+181 0 181
+1862 1862 181 ,
+2488 2488 181 ,
+182 0 182
+1863 1863 182 ,
+2487 2487 182 ,
+183 0 183
+1864 1864 183 ,
+2486 2486 183 ,
+184 0 184 -
+1865 1865 184 -,
+2485 2485 184 -,
+185 0 185
+1866 1866 185 ,
+2484 2484 185 ,
+186 0 186
+3312 3312 186 ,
+1867 1867 186 ,
+1868 1868 186 ,
+2483 2483 186 ,
+187 0 187
+1869 1869 187 ,
+2482 2482 187 ,
+3198 0 3198 .
+23 0 23
+1870 1870 23 ,
+2481 2481 23 ,
+188 0 188 -
+1871 1871 188 -,
+2480 2480 188 -,
+189 0 189
+1872 1872 189 ,
+2479 2479 189 ,
+190 0 190
+1873 1873 190 ,
+2478 2478 190 ,
+191 0 191
+1874 1874 191 ,
+2477 2477 191 ,
+193 0 193 ()
+1875 1875 193 (),
+2476 2476 193 (),
+192 0 192
+1876 1876 192 ,
+2475 2475 192 ,
+194 0 194 -`
+1877 1877 194 -`,
+2474 2474 194 -`,
+195 0 195
+1878 1878 195 ,
+2473 2473 195 ,
+196 0 196
+1879 1879 196 ,
+2472 2472 196 ,
+197 0 197
+1880 1880 197 ,
+2471 2471 197 ,
+198 0 198
+1881 1881 198 ,-
+2470 2470 198 ,
+199 0 199
+1882 1882 199 ,
+2469 2469 199 ,
+200 0 200
+1883 1883 200 ,
+2468 2468 200 ,
+3229 0 3229 (.)
+201 0 201
+1884 1884 201 ,
+2467 2467 201 ,
+202 0 202
+1885 1885 202 ,
+2466 2466 202 ,
+203 0 203
+1886 1886 203 ,
+1887 1887 203 ,
+2465 2465 203 ,
+204 0 204
+1888 1888 204 ,
+2464 2464 204 ,
+205 0 205
+1889 1889 205 ,
+2463 2463 205 ,
+206 0 206
+1890 1890 206 ,
+2462 2462 206 ,
+207 0 207
+1891 1891 207 ,
+2461 2461 207 ,
+3227 0 3227 (.)
+3197 0 3197 (.)
+208 0 208
+1892 1892 208 ,
+2460 2460 208 ,
+209 0 209 -
+1893 1893 209 - ,-
+2459 2459 209 - ,
+210 0 210
+1894 1894 210 ,
+2458 2458 210 ,
+3199 0 3199 (.)
+211 0 211
+1895 1895 211 ,
+2457 2457 211 ,
+212 0 212
+1896 1896 212 ,
+2456 2456 212 ,
+213 0 213
+1897 1897 213 ,
+2455 2455 213 ,
+214 0 214
+1898 1898 214 ,
+2454 2454 214 ,
+215 0 215 -
+1899 1899 215 -,
+2453 2453 215 -,
+216 0 216
+1900 1900 216 ,--
+1901 1901 216 ,
+2452 2452 216 ,
+217 0 217
+1902 1902 217 ,
+2451 2451 217 ,
+218 0 218
+1903 1903 218 ,
+2450 2450 218 ,
+219 0 219
+1904 1904 219 ,
+2449 2449 219 ,
+220 0 220
+1905 1905 220 ,
+2448 2448 220 ,
+222 0 222
+1906 1906 222 ,
+2447 2447 222 ,
+223 0 223
+1907 1907 223 ,
+2446 2446 223 ,
+221 0 221
+1908 1908 221 ,
+2445 2445 221 ,
+224 0 224
+1909 1909 224 ,-
+2444 2444 224 ,
+225 0 225 - ()
+1910 1910 225 - (),
+1913 1913 225 - (),
+1912 1912 225 - (),
+3033 3033 225 - (),
+1911 1911 225 - (),
+2443 2443 225 - (),
+39 0 39
+314 314 39 ,
+315 315 39 , .
+614 315 39 , .,
+615 315 39 , .,
+2566 315 39 , .,
+316 316 39 , .
+2940 316 39 , .,
+616 316 39 , .,
+2565 316 39 , .,
+317 317 39 , .
+617 317 39 , .,
+618 317 39 , .,
+619 317 39 , .,
+620 317 39 , .,
+621 317 39 , .,
+622 317 39 , .,
+623 317 39 , .,
+2564 317 39 , .,
+318 318 39 , .
+624 318 39 , .,
+625 318 39 , .,
+626 318 39 , .,
+627 318 39 , .,
+628 318 39 , .,
+629 318 39 , .,
+630 318 39 , .,
+2944 318 39 , .,
+631 318 39 , .,
+632 318 39 , .,
+633 318 39 , .,
+634 318 39 , .,
+635 318 39 , .,
+2563 318 39 , .,
+319 319 39 , .
+636 319 39 , .,
+637 319 39 , .,
+2942 319 39 , .,
+638 319 39 , .,
+2907 319 39 , .,
+639 319 39 , .,-
+2562 319 39 , .,
+320 320 39 , .
+640 320 39 , .,
+641 320 39 , .,
+3119 320 39 , .,
+3162 320 39 , .,
+642 320 39 , .,
+643 320 39 , .,
+2561 320 39 , .,
+321 321 39 , .
+644 321 39 , .,
+3128 321 39 , .,
+645 321 39 , .,
+646 321 39 , .,
+3121 321 39 , .,
+3378 321 39 , .,
+2560 321 39 , .,
+322 322 39 ,- .
+3379 322 39 ,- .,
+647 322 39 ,- .,-
+3170 322 39 ,- .,
+2559 322 39 ,- .,
+323 323 39 , .
+648 323 39 , .,
+649 323 39 , .,
+651 323 39 , .,
+650 323 39 , .,
+652 323 39 , .,
+3341 323 39 , .,-
+653 323 39 , .,
+654 323 39 , .,
+655 323 39 , .,
+2558 323 39 , .,
+324 324 39 , .
+656 324 39 , .,
+657 324 39 , .,
+658 324 39 , .,
+2557 324 39 , .,
+325 325 39 ,
+659 325 39 ,,
+2984 325 39 ,,
+3042 325 39 ,,
+660 325 39 ,,
+662 325 39 ,,
+3382 325 39 ,,
+663 325 39 ,,
+667 325 39 ,,
+666 325 39 ,,
+668 325 39 ,,
+669 325 39 ,,
+665 325 39 ,,
+661 325 39 ,,
+3370 325 39 ,,
+670 325 39 ,,
+664 325 39 ,,
+3148 325 39 ,,
+671 325 39 ,,
+2556 325 39 ,,
+326 326 39 , .
+672 326 39 , .,
+673 326 39 , .,
+674 326 39 , .,
+675 326 39 , .,
+3364 326 39 , .,
+676 326 39 , .,
+677 326 39 , .,
+678 326 39 , .,
+679 326 39 , .,
+680 326 39 , .,
+2555 326 39 , .,
+327 327 39 , .
+3284 327 39 , .,
+681 327 39 , .,
+682 327 39 , .,
+2554 327 39 , .,
+328 328 39 , .
+3322 328 39 , .,
+2870 328 39 , .,
+683 328 39 , .,
+3118 328 39 , .,
+3325 328 39 , .,
+2553 328 39 , .,
+329 329 39 , .
+684 329 39 , .,-
+685 329 39 , .,
+689 329 39 , .,
+686 329 39 , .,
+688 329 39 , .,
+687 329 39 , .,
+2552 329 39 , .,
+330 330 39 , .
+690 330 39 , .,
+691 330 39 , .,
+693 330 39 , .,
+694 330 39 , .,
+695 330 39 , .,
+692 330 39 , .,
+2551 330 39 , .,
+331 331 39 , .
+696 331 39 , .,
+697 331 39 , .,
+3361 331 39 , .,
+2550 331 39 , .,
+332 332 39 , .
+3356 332 39 , .,
+698 332 39 , .,
+700 332 39 , .,
+699 332 39 , .,
+701 332 39 , .,
+2549 332 39 , .,
+333 333 39 , .
+702 333 39 , .,
+3171 333 39 , .,
+703 333 39 , .,
+704 333 39 , .,
+2548 333 39 , .,
+334 334 39 , .
+705 334 39 , .,
+3346 334 39 , .,
+3351 334 39 , .,
+706 334 39 , .,
+708 334 39 , .,
+707 334 39 , .,
+709 334 39 , .,
+2547 334 39 , .,
+335 335 39 , .
+710 335 39 , .,
+711 335 39 , .,
+712 335 39 , .,
+3280 335 39 , .,
+713 335 39 , .,
+2546 335 39 , .,
+336 336 39 , .
+714 336 39 , .,-
+715 336 39 , .,
+2941 336 39 , .,
+716 336 39 , .,
+3120 336 39 , .,
+2943 336 39 , .,
+717 336 39 , .,
+3155 336 39 , .,
+2542 336 39 , .,
+337 337 39 , .
+3169 337 39 , .,
+3016 337 39 , .,
+3333 337 39 , .,
+718 337 39 , .,
+719 337 39 , .,
+720 337 39 , .,
+2545 337 39 , .,
+338 338 39 , .
+721 338 39 , .,
+722 338 39 , .,
+723 338 39 , .,
+2544 338 39 , .,
+339 339 39 , .
+724 339 39 , .,
+2543 339 39 , .,
+40 0 40
+602 602 40 ,
+604 604 40 ,
+603 603 40 ,
+608 608 40 ,
+606 606 40 ,
+3099 3099 40 ,--
+605 605 40 ,
+3174 3174 40 ,
+609 609 40 ,
+607 607 40 ,
+610 610 40 ,
+611 611 40 ,
+2541 2541 40 ,
+32 0 32
+612 612 32 ,
+2540 2540 32 ,
+33 0 33
+613 613 33 ,--
+2539 2539 33 ,
+340 0 340
+341 341 340 ,
+342 342 340 , .
+725 342 340 , .,
+726 342 340 , .,
+727 342 340 , .,
+728 342 340 , .,
+3172 342 340 , .,
+729 342 340 , .,
+730 342 340 , .,
+731 342 340 , .,
+732 342 340 , .,
+2538 342 340 , .,
+343 343 340 , .
+733 343 340 , .,
+735 343 340 , .,
+734 343 340 , .,
+736 343 340 , .,
+737 343 340 , .,
+738 343 340 , .,
+2537 343 340 , .,
+344 344 340 , .
+739 344 340 , .,
+740 344 340 , .,
+741 344 340 , .,
+742 344 340 , .,
+743 344 340 , .,
+744 344 340 , .,
+2536 344 340 , .,
+345 345 340 , .
+745 345 340 , .,
+746 345 340 , .,
+747 345 340 , .,
+3244 345 340 , .,
+748 345 340 , .,
+2535 345 340 , .,
+346 346 340 , .
+3149 346 340 , .,
+749 346 340 , .,
+750 346 340 , .,
+751 346 340 , .,
+752 346 340 , .,
+753 346 340 , .,
+2896 346 340 , .,
+754 346 340 , .,
+755 346 340 , .,
+756 346 340 , .,
+2534 346 340 , .,
+347 347 340 , .
+757 347 340 , .,
+758 347 340 , .,
+759 347 340 , .,
+2533 347 340 , .,
+38 0 38
+760 760 38 ,
+767 767 38 ,
+762 762 38 ,
+761 761 38 ,
+763 763 38 ,
+769 769 38 ,
+765 765 38 ,
+764 764 38 ,
+3117 3117 38 ,
+766 766 38 ,
+768 768 38 ,
+2532 2532 38 ,
+41 0 41
+3098 3098 41 ,
+792 792 41 ,
+770 770 41 ,
+771 771 41 ,
+773 773 41 ,
+776 776 41 ,-
+788 788 41 ,
+789 789 41 ,
+796 796 41 ,
+777 777 41 ,
+781 781 41 ,
+786 786 41 ,
+791 791 41 ,
+793 793 41 ,
+795 795 41 ,
+787 787 41 ,
+790 790 41 ,
+3133 3133 41 ,
+794 794 41 ,
+782 782 41 ,
+780 780 41 ,
+779 779 41 ,
+774 774 41 ,
+784 784 41 ,
+772 772 41 ,
+775 775 41 ,
+3116 3116 41 ,
+785 785 41 ,
+778 778 41 ,
+783 783 41 ,
+2531 2531 41 ,
+42 0 42
+797 797 42 ,-
+799 799 42 ,
+798 798 42 ,
+800 800 42 ,
+2530 2530 42 ,
+43 0 43
+45 0 45
+802 802 45 ,
+3075 3075 45 ,
+801 801 45 ,
+804 804 45 ,
+803 803 45 ,
+805 805 45 ,
+3168 3168 45 ,
+806 806 45 ,
+807 807 45 ,
+808 808 45 ,
+809 809 45 ,
+3131 3131 45 ,
+810 810 45 ,
+3342 3342 45 ,
+811 811 45 ,
+812 812 45 ,
+813 813 45 ,
+814 814 45 ,
+3089 3089 45 ,
+815 815 45 ,
+816 816 45 ,
+817 817 45 ,
+818 818 45 ,
+819 819 45 ,
+820 820 45 ,
+2976 2976 45 ,
+2988 2988 45 ,
+821 821 45 ,
+3088 3088 45 ,
+822 822 45 ,
+823 823 45 ,
+824 824 45 ,
+825 825 45 ,
+3343 3343 45 ,
+2867 2867 45 ,
+2986 2986 45 ,-
+826 826 45 ,
+3063 3063 45 ,
+827 827 45 ,
+3140 3140 45 ,
+828 828 45 ,
+829 829 45 ,
+830 830 45 ,
+2529 2529 45 ,
+44 0 44
+831 831 44 ,
+832 832 44 ,
+836 836 44 ,
+835 835 44 ,
+834 834 44 ,
+833 833 44 ,
+2528 2528 44 ,
+46 0 46
+3007 3007 46 ,
+837 837 46 ,
+838 838 46 ,-
+3371 3371 46 ,
+839 839 46 ,-
+840 840 46 ,
+841 841 46 ,
+3163 3163 46 ,
+842 842 46 ,
+843 843 46 ,
+3015 3015 46 ,
+844 844 46 ,
+2921 2921 46 ,
+845 845 46 ,
+846 846 46 ,
+847 847 46 ,
+848 848 46 ,
+849 849 46 ,
+3010 3010 46 ,
+850 850 46 ,
+851 851 46 ,
+3072 3072 46 ,
+852 852 46 ,
+853 853 46 ,
+854 854 46 ,
+855 855 46 ,
+3082 3082 46 ,
+3309 3309 46 ,
+856 856 46 ,
+857 857 46 ,
+3138 3138 46 ,
+858 858 46 ,
+859 859 46 ,
+2872 2872 46 ,
+2965 2965 46 ,
+3135 3135 46 ,
+3156 3156 46 ,
+3192 3192 46 ,
+860 860 46 ,
+861 861 46 ,
+2864 2864 46 ,
+862 862 46 ,
+3009 3009 46 ,
+2993 2993 46 ,
+863 863 46 ,
+864 864 46 ,
+865 865 46 ,
+866 866 46 ,
+3191 3191 46 ,
+2974 2974 46 ,-
+3127 3127 46 ,
+867 867 46 ,
+868 868 46 ,
+869 869 46 ,--
+3373 3373 46 ,
+3313 3313 46 ,
+870 870 46 ,
+3045 3045 46 ,
+2906 2906 46 ,
+2527 2527 46 ,
+3193 0 3193 (.)
+47 0 47 (.)
+48 0 48
+871 871 48 ,
+873 873 48 ,
+3147 3147 48 ,
+872 872 48 ,
+3178 3178 48 ,
+2526 2526 48 ,
+49 0 49
+3006 3006 49 ,
+874 874 49 ,
+875 875 49 ,
+3285 3285 49 ,
+876 876 49 ,
+3126 3126 49 ,
+2525 2525 49 ,
+3194 0 3194 (.)
+50 0 50
+3377 3377 50 ,
+3067 3067 50 ,
+877 877 50 ,
+3065 3065 50 ,
+3066 3066 50 ,
+878 878 50 ,
+3069 3069 50 ,
+3068 3068 50 ,
+2524 2524 50 ,
+51 0 51
+879 879 51 ,
+2523 2523 51 ,
+34 0 34
+880 880 34 ,
+3125 3125 34 ,
+881 881 34 ,
+890 890 34 ,
+3076 3076 34 ,
+882 882 34 ,
+3070 3070 34 ,
+888 888 34 ,
+886 886 34 ,
+891 891 34 ,-
+3310 3310 34 ,
+883 883 34 ,
+884 884 34 ,
+885 885 34 ,
+892 892 34 ,
+3179 3179 34 ,
+3177 3177 34 ,-
+3289 3289 34 ,---
+889 889 34 ,
+887 887 34 ,
+893 893 34 ,
+2522 2522 34 ,
+52 0 52
+3318 3318 52 ,
+3278 3278 52 ,
+906 906 52 ,
+894 894 52 ,
+895 895 52 ,
+905 905 52 ,
+896 896 52 ,
+897 897 52 ,
+3369 3369 52 ,
+3327 3327 52 ,
+898 898 52 ,
+899 899 52 ,
+907 907 52 ,
+908 908 52 ,
+900 900 52 ,
+901 901 52 ,
+3368 3368 52 ,-
+3384 3384 52 ,
+3252 3252 52 ,
+902 902 52 ,
+903 903 52 ,
+3130 3130 52 ,
+904 904 52 ,
+2521 2521 52 ,
+53 0 53
+2939 2939 53 ,
+3054 3054 53 ,
+909 909 53 ,
+2934 2934 53 ,
+913 913 53 ,
+2935 2935 53 ,
+912 912 53 ,
+2905 2905 53 ,
+911 911 53 ,
+2936 2936 53 ,
+2937 2937 53 ,
+910 910 53 ,
+2520 2520 53 ,
+54 0 54
+914 914 54 ,
+915 915 54 ,
+916 916 54 ,
+918 918 54 ,
+919 919 54 ,
+3173 3173 54 ,
+917 917 54 ,
+2519 2519 54 ,
+55 0 55
+920 920 55 ,
+2518 2518 55 ,
+56 0 56
+3376 3376 56 ,
+921 921 56 ,
+2517 2517 56 ,
+57 0 57
+3142 3142 57 ,
+922 922 57 ,
+2516 2516 57 ,
+58 0 58
+923 923 58 ,
+3154 3154 58 ,
+924 924 58 ,
+2515 2515 58 ,
+59 0 59
+925 925 59 ,
+926 926 59 ,
+3234 3234 59 ,
+3275 3275 59 ,
+927 927 59 ,
+3321 3321 59 ,
+928 928 59 ,
+929 929 59 ,
+3281 3281 59 ,-
+2514 2514 59 ,
+36 0 36
+930 930 36 ,-
+2513 2513 36 ,
+60 0 60
+931 931 60 ,
+933 933 60 ,
+932 932 60 ,
+934 934 60 ,
+935 935 60 ,
+2977 2977 60 ,
+3030 3030 60 ,
+3091 3091 60 ,
+936 936 60 ,
+937 937 60 ,
+3044 3044 60 ,
+3380 3380 60 ,
+2512 2512 60 ,
+61 0 61
+3190 3190 61 ,
+2857 2857 61 ,
+938 938 61 ,
+3355 3355 61 ,
+939 939 61 ,
+2511 2511 61 ,
+3195 0 3195 (.)
+62 0 62
+940 940 62 ,
+941 941 62 ,
+3164 3164 62 ,
+942 942 62 ,
+943 943 62 ,
+3237 3237 62 ,
+3165 3165 62 ,
+944 944 62 ,
+945 945 62 ,
+3008 3008 62 ,
+3150 3150 62 ,
+946 946 62 ,
+947 947 62 ,
+948 948 62 ,
+2958 2958 62 ,
+2510 2510 62 ,
+35 0 35
+949 949 35 ,
+950 950 35 ,
+2509 2509 35 ,
+63 0 63
+952 952 63 ,
+951 951 63 ,
+954 954 63 ,
+955 955 63 ,
+953 953 63 ,
+2508 2508 63 ,
+64 0 64 -
+956 956 64 -,-
+2507 2507 64 -,
+74 0 74
+957 957 74 ,
+960 960 74 ,
+958 958 74 ,-
+959 959 74 ,
+2506 2506 74 ,
+65 0 65
+961 961 65 ,
+962 962 65 ,
+3101 3101 65 ,
+963 963 65 ,
+964 964 65 ,
+965 965 65 ,
+966 966 65 ,
+2505 2505 65 ,
+66 0 66
+968 968 66 ,
+967 967 66 ,
+969 969 66 ,
+2504 2504 66 ,
+67 0 67 - ()
+970 970 67 - (),
+2503 2503 67 - (),
+68 0 68
+2888 2888 68 ,
+971 971 68 ,
+979 979 68 ,
+972 972 68 ,
+980 980 68 ,
+973 973 68 ,
+3375 3375 68 ,
+3159 3159 68 ,
+974 974 68 ,
+975 975 68 ,
+976 976 68 ,
+977 977 68 ,
+978 978 68 ,
+2502 2502 68 ,
+37 0 37
+996 996 37 ,
+983 983 37 ,
+997 997 37 ,
+984 984 37 ,
+998 998 37 ,
+987 987 37 ,
+988 988 37 ,
+993 993 37 ,-
+3037 3037 37 ,
+989 989 37 ,
+985 985 37 ,
+991 991 37 ,
+3161 3161 37 ,
+990 990 37 ,
+994 994 37 ,
+995 995 37 ,
+999 999 37 ,
+981 981 37 ,
+3374 3374 37 ,
+992 992 37 ,
+982 982 37 ,
+986 986 37 ,
+3314 3314 37 ,
+2501 2501 37 ,
+69 0 69
+1003 1003 69 ,
+1000 1000 69 ,
+1001 1001 69 ,
+1004 1004 69 ,
+1002 1002 69 ,
+2500 2500 69 ,
+70 0 70
+1005 1005 70 ,
+3291 3291 70 ,-
+1007 1007 70 ,-
+1008 1008 70 ,-
+3019 3019 70 ,
+1010 1010 70 ,
+1009 1009 70 ,
+1015 1015 70 ,
+3105 3105 70 ,
+1006 1006 70 ,
+3246 3246 70 ,
+1011 1011 70 ,
+1012 1012 70 ,--
+1014 1014 70 ,-
+1013 1013 70 ,--
+2499 2499 70 ,
+71 0 71
+1016 1016 71 ,
+1019 1019 71 ,
+1017 1017 71 ,
+1018 1018 71 ,
+1020 1020 71 ,
+1021 1021 71 ,
+1022 1022 71 ,
+3189 3189 71 ,
+1023 1023 71 ,
+1024 1024 71 ,
+1025 1025 71 ,
+1026 1026 71 ,
+1027 1027 71 ,
+1028 1028 71 ,
+1029 1029 71 ,
+1030 1030 71 ,
+2498 2498 71 ,
+72 0 72
+2883 2883 72 ,
+1031 1031 72 ,
+1032 1032 72 ,
+1037 1037 72 ,
+1036 1036 72 ,
+1042 1042 72 ,
+1033 1033 72 ,
+1034 1034 72 ,
+1041 1041 72 ,
+1039 1039 72 ,
+1043 1043 72 ,
+1040 1040 72 ,
+1038 1038 72 ,
+2497 2497 72 ,
+3196 0 3196 (.)
+73 0 73
+3013 3013 73 ,
+1044 1044 73 ,
+1045 1045 73 ,-
+1046 1046 73 ,
+1047 1047 73 ,
+1048 1048 73 ,
+1049 1049 73 ,
+1050 1050 73 ,
+1051 1051 73 ,
+1052 1052 73 ,
+1053 1053 73 ,
+1054 1054 73 ,
+2496 2496 73 ,
diff --git a/protocols/MRA/Icons/Alarm.ico b/protocols/MRA/Icons/Alarm.ico
new file mode 100644
index 0000000000..9da83ea0b8
--- /dev/null
+++ b/protocols/MRA/Icons/Alarm.ico
Binary files differ
diff --git a/protocols/MRA/Icons/AuthGrant.ico b/protocols/MRA/Icons/AuthGrant.ico
new file mode 100644
index 0000000000..f24b71c739
--- /dev/null
+++ b/protocols/MRA/Icons/AuthGrant.ico
Binary files differ
diff --git a/protocols/MRA/Icons/AuthReguest.ico b/protocols/MRA/Icons/AuthReguest.ico
new file mode 100644
index 0000000000..d7fb7db98c
--- /dev/null
+++ b/protocols/MRA/Icons/AuthReguest.ico
Binary files differ
diff --git a/protocols/MRA/Icons/Bagz.ico b/protocols/MRA/Icons/Bagz.ico
new file mode 100644
index 0000000000..87de879d85
--- /dev/null
+++ b/protocols/MRA/Icons/Bagz.ico
Binary files differ
diff --git a/protocols/MRA/Icons/BlogStatus.ico b/protocols/MRA/Icons/BlogStatus.ico
new file mode 100644
index 0000000000..a5dcea42b9
--- /dev/null
+++ b/protocols/MRA/Icons/BlogStatus.ico
Binary files differ
diff --git a/protocols/MRA/Icons/Blogs.ico b/protocols/MRA/Icons/Blogs.ico
new file mode 100644
index 0000000000..7de74d39c9
--- /dev/null
+++ b/protocols/MRA/Icons/Blogs.ico
Binary files differ
diff --git a/protocols/MRA/Icons/Chat.ico b/protocols/MRA/Icons/Chat.ico
new file mode 100644
index 0000000000..5427f1120e
--- /dev/null
+++ b/protocols/MRA/Icons/Chat.ico
Binary files differ
diff --git a/protocols/MRA/Icons/Info.ico b/protocols/MRA/Icons/Info.ico
new file mode 100644
index 0000000000..3cbe896a02
--- /dev/null
+++ b/protocols/MRA/Icons/Info.ico
Binary files differ
diff --git a/protocols/MRA/Icons/Magent.ico b/protocols/MRA/Icons/Magent.ico
new file mode 100644
index 0000000000..468cbcd278
--- /dev/null
+++ b/protocols/MRA/Icons/Magent.ico
Binary files differ
diff --git a/protocols/MRA/Icons/Mail.ico b/protocols/MRA/Icons/Mail.ico
new file mode 100644
index 0000000000..55007a879c
--- /dev/null
+++ b/protocols/MRA/Icons/Mail.ico
Binary files differ
diff --git a/protocols/MRA/Icons/MailNotify.ico b/protocols/MRA/Icons/MailNotify.ico
new file mode 100644
index 0000000000..a4520bc8af
--- /dev/null
+++ b/protocols/MRA/Icons/MailNotify.ico
Binary files differ
diff --git a/protocols/MRA/Icons/Phone.ico b/protocols/MRA/Icons/Phone.ico
new file mode 100644
index 0000000000..0716aed2b6
--- /dev/null
+++ b/protocols/MRA/Icons/Phone.ico
Binary files differ
diff --git a/protocols/MRA/Icons/Photo.ico b/protocols/MRA/Icons/Photo.ico
new file mode 100644
index 0000000000..dab4e204e4
--- /dev/null
+++ b/protocols/MRA/Icons/Photo.ico
Binary files differ
diff --git a/protocols/MRA/Icons/PostCards.ico b/protocols/MRA/Icons/PostCards.ico
new file mode 100644
index 0000000000..517653aee4
--- /dev/null
+++ b/protocols/MRA/Icons/PostCards.ico
Binary files differ
diff --git a/protocols/MRA/Icons/WebSearch.ico b/protocols/MRA/Icons/WebSearch.ico
new file mode 100644
index 0000000000..6ac68cdd7e
--- /dev/null
+++ b/protocols/MRA/Icons/WebSearch.ico
Binary files differ
diff --git a/protocols/MRA/Icons/answers.ico b/protocols/MRA/Icons/answers.ico
new file mode 100644
index 0000000000..1b2bf773e3
--- /dev/null
+++ b/protocols/MRA/Icons/answers.ico
Binary files differ
diff --git a/protocols/MRA/Icons/my world.ico b/protocols/MRA/Icons/my world.ico
new file mode 100644
index 0000000000..6e0a4a650d
--- /dev/null
+++ b/protocols/MRA/Icons/my world.ico
Binary files differ
diff --git a/protocols/MRA/Icons/video.ico b/protocols/MRA/Icons/video.ico
new file mode 100644
index 0000000000..9c075ab008
--- /dev/null
+++ b/protocols/MRA/Icons/video.ico
Binary files differ
diff --git a/protocols/MRA/Mra.cpp b/protocols/MRA/Mra.cpp
new file mode 100644
index 0000000000..3d8cea3744
--- /dev/null
+++ b/protocols/MRA/Mra.cpp
@@ -0,0 +1,912 @@
+#include "Mra.h"
+
+
+
+
+
+
+#ifndef _WIN64
+
+/*extern "C" __declspec(naked) void _chkstk()
+{
+ #define _PAGESIZE_ 4096
+
+ __asm
+ {
+ push ecx
+
+ ; Calculate new TOS.
+
+ lea ecx, [esp] + 8 - 4 ; TOS before entering function + size for ret value
+ sub ecx, eax ; new TOS
+
+ ; Handle allocation size that results in wraparound.
+ ; Wraparound will result in StackOverflow exception.
+
+ sbb eax, eax ; 0 if CF==0, ~0 if CF==1
+ not eax ; ~0 if TOS did not wrapped around, 0 otherwise
+ and ecx, eax ; set to 0 if wraparound
+
+ mov eax, esp ; current TOS
+ and eax, not ( _PAGESIZE_ - 1) ; Round down to current page boundary
+
+ cs10:
+ cmp ecx, eax ; Is new TOS
+ jb short cs20 ; in probed page?
+ mov eax, ecx ; yes.
+ pop ecx
+ xchg esp, eax ; update esp
+ mov eax, dword ptr [eax] ; get return address
+ mov dword ptr [esp], eax ; and put it at new TOS
+ ret
+
+ ; Find next lower page and probe
+ cs20:
+ sub eax, _PAGESIZE_ ; decrease by PAGESIZE
+ test dword ptr [eax],eax ; probe page.
+ jmp short cs10
+
+ }
+}//*/
+
+
+
+
+/*extern "C" __declspec(naked) void __cdecl _chkstk()
+{
+ _asm { jz esp_okay };
+ _asm { int 3 };
+esp_okay:
+ _asm { ret };
+} //*/
+
+
+
+
+
+
+ /*//_alloca_probe_16 : 16 byte aligned alloca
+ extern "C" void _alloca_probe_16()
+ {
+ __asm
+ {
+ push ecx
+ lea ecx, [esp] + 8 ; TOS before entering this function
+ sub ecx, eax ; New TOS
+ and ecx, (16 - 1) ; Distance from 16 bit align (align down)
+ add eax, ecx ; Increase allocation size
+ sbb ecx, ecx ; ecx = 0xFFFFFFFF if size wrapped around
+ or eax, ecx ; cap allocation size on wraparound
+ pop ecx ; Restore ecx
+ jmp _chkstk
+ }
+ }
+
+ //alloca_8: 8 byte aligned alloca
+ extern "C" void _alloca_probe_8()
+ {
+ __asm
+ {
+ push ecx
+ lea ecx, [esp] + 8 ; TOS before entering this function
+ sub ecx, eax ; New TOS
+ and ecx, (8 - 1) ; Distance from 8 bit align (align down)
+ add eax, ecx ; Increase allocation Size
+ sbb ecx, ecx ; ecx = 0xFFFFFFFF if size wrapped around
+ or eax, ecx ; cap allocation size on wraparound
+ pop ecx ; Restore ecx
+ jmp _chkstk
+ }
+ }//*/
+
+/*extern "C" void __cdecl _chkstk()
+{
+ __asm
+ {
+ push ebp
+ sub eax, 4
+ xchg [esp+4], ebp
+ sub esp, eax
+ xchg [esp], ebp
+ mov ebp, esp
+ add ebp, eax
+ mov ebp, [ebp]
+ }
+}//*/
+
+
+
+/*#define _PAGESIZE_ 1000h
+
+#if !defined (__MARM__)
+extern "C" void __declspec(naked) _chkstk(void)
+{
+ _asm
+ {
+ push ecx
+ cmp eax,_PAGESIZE_
+ lea ecx,[esp] + 8
+ jb short lastpage
+
+ probepages:
+ sub ecx,_PAGESIZE_
+ sub eax,_PAGESIZE_
+
+ test dword ptr [ecx],eax
+
+ cmp eax,_PAGESIZE_
+ jae short probepages
+
+ lastpage:
+ sub ecx,eax
+ mov eax,esp
+
+ test dword ptr [ecx],eax
+
+ mov esp,ecx
+
+ mov ecx,dword ptr [eax]
+ mov eax,dword ptr [eax + 4]
+
+ push eax
+ ret
+ }
+}
+#endif**/
+
+
+
+/*//
+extern "C" __declspec(naked) void _chkstk()
+{
+ __asm
+ {
+ // Enter: EAX = size
+
+ xor ebx, ebx
+ xchg [esp], ebx //
+ add esp, 4 //
+ sub esp, eax //
+ push ebx //
+ retn
+ }
+}//*/
+
+
+
+//extern "C" void __declspec(naked) __cdecl _chkesp()
+/*extern "C" __declspec(naked) void __cdecl _chkstk()
+{
+#ifndef _PAGESIZE_
+ #define _PAGESIZE_ 1000h
+#endif //_PAGESIZE_
+
+ __asm
+ {
+ push ecx // save ecx
+ cmp eax, _PAGESIZE_ // more than one page requested?
+ lea ecx, [esp] + 8 // compute new stack pointer in ecx
+ // correct for return address and
+ // saved ecx
+ jb short lastpage // no
+
+
+probepages:
+
+ sub ecx, _PAGESIZE_ // yes, move down a page
+ sub eax, _PAGESIZE_ // adjust request and...
+
+ test dword ptr [ecx], eax // ...probe it
+
+ cmp eax, _PAGESIZE_ // more than one page requested?
+ jae short probepages // no
+
+
+lastpage:
+
+ sub ecx, eax // move stack down by eax
+ mov eax, esp // save current tos and do a...
+
+ test dword ptr [ecx], eax // ...probe in case a page was crossed
+
+ mov esp, ecx // set the new stack pointer
+
+ mov ecx, dword ptr [eax] // recover ecx
+ mov eax, dword ptr [eax + 4]// recover return address
+
+ push eax // prepare return address
+ // ...probe in case a page was crossed
+ ret
+ }
+}//*/
+
+
+
+
+
+
+extern "C" __declspec(naked) void __cdecl _chkstk()
+{
+ #define _PAGESIZE_ 4096
+
+ __asm
+ {
+ push ecx
+
+ ; Calculate new TOS.
+
+ lea ecx, [esp] + 8 - 4 ; TOS before entering function + size for ret value
+ sub ecx, eax ; new TOS
+
+ ; Handle allocation size that results in wraparound.
+ ; Wraparound will result in StackOverflow exception.
+
+ sbb eax, eax ; 0 if CF==0, ~0 if CF==1
+ not eax ; ~0 if TOS did not wrapped around, 0 otherwise
+ and ecx, eax ; set to 0 if wraparound
+
+ mov eax, esp ; current TOS
+ and eax, not ( _PAGESIZE_ - 1) ; Round down to current page boundary
+
+ cs10:
+ cmp ecx, eax ; Is new TOS
+ jb short cs20 ; in probed page?
+ mov eax, ecx ; yes.
+ pop ecx
+ xchg esp, eax ; update esp
+ mov eax, dword ptr [eax] ; get return address
+ mov dword ptr [esp], eax ; and put it at new TOS
+ ret
+
+ ; Find next lower page and probe
+ cs20:
+ sub eax, _PAGESIZE_ ; decrease by PAGESIZE
+ test dword ptr [eax],eax ; probe page.
+ jmp short cs10
+
+ }
+}//
+
+
+extern "C" void __declspec(naked) __cdecl _aulldiv()
+{// http://tamiaode.3322.org/svn/ntldr/trunk/source/ntldr/ia32/x86stub.cpp
+ __asm
+ {
+ push ebx
+ push esi
+
+ mov eax,[esp + 24]
+ or eax,eax
+ jnz short L1
+
+ mov ecx,[esp + 20]
+ mov eax,[esp + 16]
+ xor edx,edx
+ div ecx
+ mov ebx,eax
+ mov eax,[esp + 12]
+ div ecx
+ mov edx,ebx
+ jmp short L2
+
+ L1:
+ mov ecx,eax
+ mov ebx,[esp + 20]
+ mov edx,[esp + 14]
+ mov eax,[esp + 12]
+
+ L3:
+ shr ecx,1
+ rcr ebx,1
+ shr edx,1
+ rcr eax,1
+ or ecx,ecx
+ jnz short L3
+ div ebx
+ mov esi,eax
+
+ mul dword ptr [esp + 24]
+ mov ecx,eax
+ mov eax,[esp + 20]
+ mul esi
+ add edx,ecx
+ jc short L4
+
+ cmp edx,[esp + 16]
+ ja short L4
+ jb short L5
+ cmp eax,[esp + 12]
+ jbe short L5
+ L4:
+ dec esi
+ L5:
+ xor edx,edx
+ mov eax,esi
+
+ L2:
+
+ pop esi
+ pop ebx
+
+ ret 16
+ }
+}//
+
+//
+// LONG64 mul
+//
+extern "C" void __declspec(naked) __cdecl _allmul()
+{
+ __asm
+ {
+ mov eax,[esp + 4][4]
+ mov ecx,[esp + 12][4]
+ or ecx,eax
+ mov ecx,[esp + 12]
+ jnz short hard
+
+ mov eax,[esp + 4]
+ mul ecx
+ ret 16
+
+hard:
+ push ebx
+ mul ecx
+ mov ebx,eax
+ mov eax,[esp + 8]
+ mul dword ptr [esp + 16][4]
+ add ebx,eax
+ mov eax,[esp + 8]
+ mul ecx
+ add edx,ebx
+ pop ebx
+
+ ret 16
+ }
+}//*/
+
+
+//
+// 64bits shift left
+//
+extern "C" __declspec(naked) void __cdecl _allshl()
+{
+ __asm
+ {
+ cmp cl, 64
+ jae short RETZERO
+
+ cmp cl, 32
+ jae short MORE32
+ shld edx,eax,cl
+ shl eax,cl
+ ret
+
+ MORE32:
+ mov edx,eax
+ xor eax,eax
+ and cl,31
+ shl edx,cl
+ ret
+
+ RETZERO:
+ xor eax,eax
+ xor edx,edx
+ ret
+ }
+}
+#endif
+
+
+
+
+PLUGINLINK *pluginLink;
+MM_INTERFACE mmi;
+MRA_SETTINGS masMraSettings;
+int hLangpack;
+
+PLUGININFOEX pluginInfoEx={
+ sizeof(PLUGININFOEX),
+ PROTOCOL_DISPLAY_NAME_ORIGA,
+ PLUGIN_VERSION_DWORD,
+ "Provides support for Mail.ru agent Instant Messenger protocol.",
+ "Rozhuk Ivan",
+ "Rozhuk_I@mail.ru",
+ " 2006-2011 Rozhuk Ivan",
+ "http://addons.miranda-im.org/details.php?action=viewfile&id=2544",
+ UNICODE_AWARE, //not transient
+ 0, //doesn't replace anything built-in
+ // {E7C48BAB-8ACE-4CB3-8446-D4B73481F497}
+ { 0xe7c48bab, 0x8ace, 0x4cb3, { 0x84, 0x46, 0xd4, 0xb7, 0x34, 0x81, 0xf4, 0x97 } }
+};
+
+static const MUUID interfaces[]={MIID_PROTOCOL,MIID_LAST};
+
+
+int OnModulesLoaded (WPARAM wParam,LPARAM lParam);
+int OnPreShutdown (WPARAM wParam,LPARAM lParam);
+void VersionConversions ();
+
+
+
+
+
+
+BOOL WINAPI DllMain(HINSTANCE hInstance,DWORD dwReason,LPVOID Reserved)
+{
+ switch(dwReason){
+ case DLL_PROCESS_ATTACH:
+ memset(&masMraSettings, 0, sizeof(masMraSettings));
+ masMraSettings.hInstance=hInstance;
+ masMraSettings.hHeap=HeapCreate(0,0,0);//GetProcessHeap();
+ masMraSettings.bLoggedIn=FALSE;
+ masMraSettings.dwStatusMode=ID_STATUS_OFFLINE;
+ masMraSettings.dwDesiredStatusMode=ID_STATUS_OFFLINE;
+ DisableThreadLibraryCalls((HMODULE)hInstance);
+ break;
+ case DLL_PROCESS_DETACH:
+ HeapDestroy(masMraSettings.hHeap);
+ masMraSettings.hHeap=NULL;
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ break;
+ }
+
+ /*BYTE szBuff[1024]={0};
+ LPSTR lpszString="\r\n\t GET \t \r\n \r\n \r\n http://mail.ru/ \tHTTP/1.1 \t ";
+ LPSTR lpszFindString="123456 ";
+ LPSTR lpszWhatFindString="123456";
+ SIZE_T dwStringLen=lstrlenA(lpszString),dwBuffSize,dwBuffLen;
+
+//#define LWSHT "\r\n\t"
+//#define LWSSP "\r\n "
+
+
+ //lpszString=(LPSTR)MemoryFind(0,lpszFindString,(lstrlenA(lpszFindString)),lpszWhatFindString,lstrlenA(lpszWhatFindString));
+ //lpszString=(LPSTR)MemoryFindByte(0,lpszFindString,(lstrlenA(lpszFindString)-1),'6');
+
+
+ //WSP2SP(lpszString,dwStringLen,(LPSTR)szBuff,&dwBuffSize);
+ //HT2SP(lpszString,dwStringLen,(LPSTR)szBuff,&dwBuffSize);
+ CleanUnneededSP(lpszString,dwStringLen,(LPSTR)szBuff,&dwBuffSize);
+
+ dwBuffLen=lstrlenA((LPSTR)szBuff);
+ if (dwBuffSize!=dwBuffLen) DebugBreak();
+ //*/
+
+
+ /*LPCSTR lpszHeader,lpszHeaderLow,lpszValueName;
+ LPSTR lpszValueNameRet;
+ SIZE_T dwHeaderSize,dwValueNameSize,dwValueNameRetSize;
+ CHAR szHeader[4096]={0},szHeaderLow[4096]={0};
+
+ //lstrcpynA(szHeader,"Server: squid/3.1.0.15\r\nMime-Version: 1.0\r\nContent-Length: 0\r\nX-Cache: MISS from Firewall\r\nProxy-Connection: keep-alive",SIZEOF(szHeader));
+ lstrcpynA(szHeader,"http/1.0 200 ok\r\nserver: apache-coyote/1.1\r\ndate: fri, 30 apr 2010 08:36:10 gmt\r\nlast-modified: wed, 28 apr 2010 03:22:49 gmt\r\ncache-control: max-age=360000\r\ncontent-type: \r\ncontent-length: 55946",SIZEOF(szHeader));
+ lpszHeader=(LPCSTR)szHeader;
+ lpszHeaderLow=(LPCSTR)szHeaderLow;
+ dwHeaderSize=lstrlenA(lpszHeader);
+
+ //lpszValueName="proxy-connection";
+ //lpszValueName="content-length";
+ lpszValueName="content-type";
+ dwValueNameSize=lstrlenA(lpszValueName);
+
+
+ BuffToLowerCase(lpszHeaderLow,lpszHeader,dwHeaderSize);
+
+ HeaderValueGet(lpszHeader,lpszHeaderLow,dwHeaderSize,lpszValueName,dwValueNameSize,&lpszValueNameRet,&dwValueNameRetSize);
+ //HeaderValueRemove(lpszHeader,lpszHeaderLow,dwHeaderSize,&dwBuffLen,lpszValueName,dwValueNameSize);
+ szHeader[dwBuffLen]=0;
+ szHeaderLow[dwBuffLen]=0;//*/
+
+
+return(TRUE);
+}
+
+
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+{
+ if (mirandaVersion<MIN_MIR_VER_VERSION_DWORD)
+ {
+ MessageBox(NULL, TranslateT("Pleace, update your Miranda IM, MRA will not load with this version."), NULL, (MB_OK|MB_ICONERROR));
+ return(NULL);
+ }
+ return(&pluginInfoEx);
+}
+
+extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces()
+{
+ return(interfaces);
+}
+
+
+extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+{
+ SIZE_T dwBuffLen;
+ WCHAR szBuff[MAX_FILEPATH];
+ LPSTR lpszFullFileName=(LPSTR)szBuff;
+ LPWSTR lpwszFileName;
+ PROTOCOLDESCRIPTOR pd={0};
+
+ pluginLink=link;
+ mir_getLP(&pluginInfoEx);
+ mir_getMMI(&mmi);
+
+
+ // Get module name from DLL file name
+ if (GetModuleFileName(masMraSettings.hInstance,szBuff,MAX_FILEPATH))
+ {
+ WCHAR sztmBuff[MAX_FILEPATH];
+ if ((dwBuffLen=GetFullPathName(szBuff,MAX_FILEPATH,sztmBuff,&lpwszFileName)))
+ {
+ dwBuffLen=(lstrlenW(lpwszFileName)-4);
+ //lpwszFileName=L"MRA.dll";
+ //dwBuffLen=3;
+ masMraSettings.dwModuleNameLen=(dwBuffLen<MAXMODULELABELLENGTH)? dwBuffLen:(MAXMODULELABELLENGTH-1);
+ memmove(masMraSettings.wszModuleName,lpwszFileName,(masMraSettings.dwModuleNameLen*sizeof(WCHAR)));
+ CharUpperBuff(masMraSettings.wszModuleName,masMraSettings.dwModuleNameLen);
+ masMraSettings.wszModuleName[masMraSettings.dwModuleNameLen]=0;
+ WideCharToMultiByte(MRA_CODE_PAGE,0,masMraSettings.wszModuleName,(masMraSettings.dwModuleNameLen+1),masMraSettings.szModuleName,MAXMODULELABELLENGTH,NULL,NULL);
+
+ if (DB_Mra_GetByte(NULL,"UseDisplayModuleName",TRUE))
+ {
+ masMraSettings.dwDisplayModuleNameLen=mir_sntprintf(masMraSettings.wszDisplayModuleName,SIZEOF(masMraSettings.wszDisplayModuleName),L"%s: %S",PROTOCOL_NAMEW,PROTOCOL_DISPLAY_NAME_ORIGA);
+ }else{
+ memmove(masMraSettings.wszDisplayModuleName,masMraSettings.wszModuleName,(masMraSettings.dwModuleNameLen*sizeof(WCHAR)));
+ masMraSettings.dwDisplayModuleNameLen=masMraSettings.dwModuleNameLen;
+ masMraSettings.szDisplayModuleName[masMraSettings.dwDisplayModuleNameLen]=0;
+ }
+ WideCharToMultiByte(MRA_CODE_PAGE,0,masMraSettings.wszDisplayModuleName,(masMraSettings.dwDisplayModuleNameLen+1),masMraSettings.szDisplayModuleName,MAX_PATH,NULL,NULL);
+ }
+ }
+
+ // load libs
+ if (GetModuleFileName(NULL,szBuff,MAX_FILEPATH))
+ {//
+ DWORD dwErrorCode;
+
+ masMraSettings.dwMirWorkDirPathLen=GetFullPathName(szBuff,MAX_FILEPATH,masMraSettings.szMirWorkDirPath,&lpwszFileName);
+ if (masMraSettings.dwMirWorkDirPathLen)
+ {
+ masMraSettings.dwMirWorkDirPathLen-=lstrlenW(lpwszFileName);
+ masMraSettings.szMirWorkDirPath[masMraSettings.dwMirWorkDirPathLen]=0;
+
+ // load xstatus icons lib
+ dwErrorCode=FindFile(masMraSettings.szMirWorkDirPath,masMraSettings.dwMirWorkDirPathLen,L"xstatus_MRA.dll",-1,szBuff,SIZEOF(szBuff),(DWORD*)&dwBuffLen);
+ if (dwErrorCode==NO_ERROR)
+ {
+ masMraSettings.hDLLXStatusIcons=LoadLibraryEx(szBuff,NULL,/*LOAD_LIBRARY_AS_DATAFILE*/0);
+ if (masMraSettings.hDLLXStatusIcons)
+ {
+ if ((dwBuffLen=LoadStringW(masMraSettings.hDLLXStatusIcons,IDS_IDENTIFY,szBuff,MAX_FILEPATH))==0 || CompareStringW(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,L"# Custom Status Icons #",23,szBuff,dwBuffLen)!=CSTR_EQUAL)
+ {
+ FreeLibrary(masMraSettings.hDLLXStatusIcons);
+ masMraSettings.hDLLXStatusIcons=NULL;
+ }
+ }
+ }
+
+ // load zlib
+ dwErrorCode=FindFile(masMraSettings.szMirWorkDirPath,masMraSettings.dwMirWorkDirPathLen,L"zlib.dll",-1,szBuff,SIZEOF(szBuff),(DWORD*)&dwBuffLen);
+ if (dwErrorCode!=NO_ERROR) dwErrorCode=FindFile(masMraSettings.szMirWorkDirPath,masMraSettings.dwMirWorkDirPathLen,L"zlib1.dll",-1,szBuff,SIZEOF(szBuff),(DWORD*)&dwBuffLen);
+ if (dwErrorCode==NO_ERROR)
+ {// load xstatus icons lib
+ masMraSettings.hDLLZLib=LoadLibraryEx(szBuff,NULL,0);
+ if (masMraSettings.hDLLZLib)
+ {
+ masMraSettings.lpfnCompress2=(HANDLE)GetProcAddress(masMraSettings.hDLLZLib,"compress2");
+ masMraSettings.lpfnUncompress=(HANDLE)GetProcAddress(masMraSettings.hDLLZLib,"uncompress");
+ }
+ }
+ }
+ }
+
+
+ /*HMODULE hDLLCrypt32=LoadLibraryW(L"Crypt32.dll");
+ if (hDLLCrypt32)
+ {
+ HANDLE hFunc=(HANDLE)GetProcAddress(hDLLCrypt32,"CryptProtectMemory");
+ FreeLibrary(hDLLCrypt32);
+ }
+
+ HMODULE hDLLAdvapi32=LoadLibraryW(L"Advapi32.dll");
+ if (hDLLAdvapi32)
+ {
+ HANDLE hFunc=(HANDLE)GetProcAddress(hDLLAdvapi32,"SystemFunction040");
+ FreeLibrary(hDLLAdvapi32);
+ }
+
+ for(DWORD i=0;i<MRA_XSTATUS_COUNT;i++)
+ {
+ if (lstrlenA(lpcszXStatusNameDef[i])>STATUS_TITLE_MAX)
+ {
+ DebugPrintCRLF(lpcszXStatusNameDef[i]);
+ }
+ if (lstrlenA(TranslateW(lpcszXStatusNameDef[i]))>STATUS_TITLE_MAX)
+ {
+ DebugPrintCRLF(TranslateW(lpcszXStatusNameDef[i]));
+ }
+ }*/
+
+
+
+ InitializeCriticalSectionAndSpinCount(&masMraSettings.csCriticalSectionSend,0);
+ MraSendQueueInitialize(0,&masMraSettings.hSendQueueHandle);
+ MraFilesQueueInitialize(0,&masMraSettings.hFilesQueueHandle);
+ MraMPopSessionQueueInitialize(&masMraSettings.hMPopSessionQueue);
+
+ FifoMTInitialize(&masMraSettings.ffmtAPCQueue,0);
+ masMraSettings.hWaitEventThreadAPCHandle=CreateEvent(NULL,FALSE,FALSE,NULL);
+ InterlockedExchange((volatile LONG*)&masMraSettings.dwAPCThreadRunning,TRUE);
+ masMraSettings.hThreadAPC=(HANDLE)mir_forkthread((pThreadFunc)MraUserAPCThreadProc,NULL);
+ if (masMraSettings.hThreadAPC==NULL)
+ {
+ MraAPCQueueDestroy(&masMraSettings.ffmtAPCQueue);
+ CloseHandle(masMraSettings.hWaitEventThreadAPCHandle);
+ masMraSettings.hWaitEventThreadAPCHandle=NULL;
+ DuplicateHandle(GetCurrentProcess(),GetCurrentThread(),GetCurrentProcess(),&masMraSettings.hThreadAPC,THREAD_SET_CONTEXT,FALSE,0);
+ DebugPrintCRLFW(L"Fail on create event APC thread, using miranda main thread");
+ MessageBoxW(NULL,L"Fail on create event APC thread, using miranda main thread",PROTOCOL_DISPLAY_NAMEW,(MB_OK|MB_ICONINFORMATION));
+ }//*/
+
+ masMraSettings.hHookModulesLoaded=HookEvent(ME_SYSTEM_MODULESLOADED,OnModulesLoaded);
+ masMraSettings.hHookPreShutdown=HookEvent(ME_SYSTEM_PRESHUTDOWN,OnPreShutdown);
+
+ LoadServices();
+
+ //pd.cbSize=sizeof(pd);
+ pd.cbSize=PROTOCOLDESCRIPTOR_V3_SIZE;
+ pd.szName=PROTOCOL_NAMEA;
+ pd.type=PROTOTYPE_PROTOCOL;
+ CallService(MS_PROTO_REGISTERMODULE,0,(LPARAM)&pd);
+
+ DebugPrintCRLFW(L"Load - DONE");
+return(0);
+}
+
+
+extern "C" __declspec(dllexport) int Unload(void)
+{
+ UnloadServices();
+ //if (hHookOnUserInfoInit) UnhookEvent(hHookOnUserInfoInit);
+ if (masMraSettings.hHookPreShutdown) {UnhookEvent(masMraSettings.hHookPreShutdown); masMraSettings.hHookPreShutdown=NULL;}
+ if (masMraSettings.hHookModulesLoaded) {UnhookEvent(masMraSettings.hHookModulesLoaded); masMraSettings.hHookModulesLoaded=NULL;}
+
+ Netlib_CloseHandle(masMraSettings.hNetlibUser);
+ masMraSettings.hNetlibUser=NULL;
+
+ MraMPopSessionQueueDestroy(masMraSettings.hMPopSessionQueue);
+ masMraSettings.hMPopSessionQueue=NULL;
+
+ MraFilesQueueDestroy(masMraSettings.hFilesQueueHandle);
+ masMraSettings.hFilesQueueHandle=NULL;
+
+ MraSendQueueDestroy(masMraSettings.hSendQueueHandle);
+ masMraSettings.hSendQueueHandle=NULL;
+
+ DeleteCriticalSection(&masMraSettings.csCriticalSectionSend);
+ SecureZeroMemory(&masMraSettings.csCriticalSectionSend,sizeof(CRITICAL_SECTION));
+
+ if (masMraSettings.hDLLXStatusIcons)
+ {
+ FreeLibrary(masMraSettings.hDLLXStatusIcons);
+ masMraSettings.hDLLXStatusIcons=NULL;
+ }
+
+ if (masMraSettings.hDLLZLib)
+ {
+ FreeLibrary(masMraSettings.hDLLZLib);
+ masMraSettings.hDLLZLib=NULL;
+ masMraSettings.lpfnCompress2=NULL;
+ masMraSettings.lpfnUncompress=NULL;
+ }
+
+ SecureZeroMemory(pluginLink,sizeof(pluginLink));
+ SecureZeroMemory(&mmi,sizeof(pluginLink));
+
+ DebugPrintCRLFW(L"Unload - DONE");
+return(0);
+}
+
+
+static int OnModulesLoaded(WPARAM wParam,LPARAM lParam)
+{
+ WCHAR szBuffer[MAX_PATH];
+ NETLIBUSER nlu={0};
+
+ mir_sntprintf(szBuffer,SIZEOF(szBuffer),L"%s %s",PROTOCOL_NAMEW,TranslateW(L"plugin connections"));
+ nlu.cbSize=sizeof(nlu);
+ nlu.flags=(NUF_INCOMING|NUF_OUTGOING|NUF_HTTPCONNS|NUF_UNICODE);
+ nlu.szSettingsModule=PROTOCOL_NAMEA;
+ nlu.ptszDescriptiveName=szBuffer;
+ masMraSettings.hNetlibUser=(HANDLE)CallService(MS_NETLIB_REGISTERUSER,0,(LPARAM)&nlu);
+
+#ifdef _DEBUG
+ // offline // unsaved values
+ for(HANDLE hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ {// MRA
+ SetContactBasicInfoW(hContact,SCBIFSI_LOCK_CHANGES_EVENTS,(SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS),-1,-1,0,0,ID_STATUS_OFFLINE,NULL,0,NULL,0,NULL,0);
+ }
+#else
+ // unsaved values
+ DB_Mra_CreateResidentSetting("Status");// NOTE: XStatus cannot be temporary
+ DB_Mra_CreateResidentSetting("LogonTS");
+ DB_Mra_CreateResidentSetting("ContactID");
+ DB_Mra_CreateResidentSetting("GroupID");
+ DB_Mra_CreateResidentSetting("ContactFlags");
+ DB_Mra_CreateResidentSetting("ContactSeverFlags");
+ DB_Mra_CreateResidentSetting("HooksLocked");
+ DB_Mra_CreateResidentSetting(DBSETTING_CAPABILITIES);
+ DB_Mra_CreateResidentSetting(DBSETTING_XSTATUSNAME);
+ DB_Mra_CreateResidentSetting(DBSETTING_XSTATUSMSG);
+ DB_Mra_CreateResidentSetting(DBSETTING_BLOGSTATUSTIME);
+ DB_Mra_CreateResidentSetting(DBSETTING_BLOGSTATUSID);
+ DB_Mra_CreateResidentSetting(DBSETTING_BLOGSTATUS);
+ DB_Mra_CreateResidentSetting(DBSETTING_BLOGSTATUSMUSIC);
+
+ // offline // unsaved values
+ for(HANDLE hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ {// MRA
+ SetContactBasicInfoW(hContact,SCBIFSI_LOCK_CHANGES_EVENTS,(SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS),-1,-1,0,0,ID_STATUS_OFFLINE,NULL,0,NULL,0,NULL,0);
+ }
+#endif
+
+ MraAvatarsQueueInitialize(&masMraSettings.hAvatarsQueueHandle);
+ /*{
+ HANDLE hContact;
+ for(hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ {// MRA
+ if (IsContactMra(hContact)) break;
+ }
+ DB_Mra_DeleteValue(hContact,"AvatarLastCheckTime");
+ MraAvatarsQueueGetAvatar(masMraSettings.hAvatarsQueueHandle,GAIF_FORCE,hContact,NULL,NULL,NULL);
+ }//*/
+
+ VersionConversions();
+
+ MraAntiSpamLoadBadWordsW();
+
+ LoadModules();
+
+ CallService(MS_UPDATE_REGISTERFL,(WPARAM)MRA_PLUGIN_UPDATER_ID,(LPARAM)&pluginInfoEx);
+
+
+ //hHookOnUserInfoInit=HookEvent(ME_USERINFO_INITIALISE,MsnOnDetailsInit);
+
+
+ /*//BYTE btRND[MAX_PATH]={0};
+ char szPass[MAX_PATH]={0};
+ //LPSTR lpszPass="1234567890";
+ SIZE_T dwBuffLen;
+
+ //dwBuffLen=lstrlenA(lpszPass);
+ //SetPassDB(lpszPass,dwBuffLen);
+ GetPassDB(szPass,sizeof(szPass),&dwBuffLen);
+
+ MessageBoxA(NULL,szPass,"Password",(MB_OK));
+
+ //*/
+
+
+ InterlockedExchange((volatile LONG*)&masMraSettings.dwGlobalPluginRunning,TRUE);
+
+ //MraSetStatus(ID_STATUS_OFFLINE,0);
+
+ DebugPrintCRLFW(L"OnModulesLoaded - DONE");
+return(0);
+}
+
+
+int OnPreShutdown(WPARAM wParam,LPARAM lParam)
+{
+ InterlockedExchange((volatile LONG*)&masMraSettings.dwGlobalPluginRunning,FALSE);
+
+ MraSetStatus(ID_STATUS_OFFLINE,0);
+
+ MraAvatarsQueueDestroy(masMraSettings.hAvatarsQueueHandle);
+ masMraSettings.hAvatarsQueueHandle=NULL;
+
+ if (masMraSettings.hThreadWorker)
+ {
+ if (IsThreadAlive(masMraSettings.hThreadWorker)) WaitForSingleObjectEx(masMraSettings.hThreadWorker,(WAIT_FOR_THREAD_TIMEOUT*1000),FALSE);
+ masMraSettings.hThreadWorker=NULL;
+ }
+
+ InterlockedExchange((volatile LONG*)&masMraSettings.dwAPCThreadRunning,FALSE);
+ if (masMraSettings.hWaitEventThreadAPCHandle)
+ if (IsThreadAlive(masMraSettings.hThreadAPC))
+ {
+ SetEvent(masMraSettings.hWaitEventThreadAPCHandle);
+ }else{
+ CloseHandle(masMraSettings.hWaitEventThreadAPCHandle);
+ //WaitForSingleObjectEx(masMraSettings.hThreadAPC,(WAIT_FOR_THREAD_TIMEOUT*1000),FALSE); // no wait - dead lock.
+ masMraSettings.hWaitEventThreadAPCHandle=NULL;
+ masMraSettings.hThreadAPC=NULL;
+ }
+
+ UnloadModules();
+
+ MraAntiSpamFreeBadWords();
+
+ DebugPrintCRLFW(L"OnPreShutdown - DONE");
+return(0);
+}
+
+
+
+void VersionConversions()
+{
+ /*switch(DB_Mra_GetDword(NULL,"LastPluginVersion",PLUGIN_MAKE_VERSION(0,0,0,0))){
+ default:
+ case PLUGIN_MAKE_VERSION(1,14,0,0):
+ case PLUGIN_MAKE_VERSION(1,14,0,1):
+ case PLUGIN_MAKE_VERSION(1,14,0,2):
+ DB_Mra_DeleteValue(NULL,"MirVer");
+ DB_Mra_DeleteValue(NULL,"MessagesCountSend");
+ DB_Mra_DeleteValue(NULL,"MRAClient");
+ DB_Mra_DeleteValue(NULL,"MRAClientVer");
+ DB_Mra_DeleteValue(NULL,"MRAClientCapabilities");
+ DB_Mra_DeleteValue(NULL,"Status");
+ DB_Mra_DeleteValue(NULL,"ContactID");
+ DB_Mra_DeleteValue(NULL,"GroupID");
+ DB_Mra_DeleteValue(NULL,"ContactSeverFlags");
+ DB_Mra_DeleteValue(NULL,"HooksLocked");
+ for(HANDLE hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ {
+ DB_Mra_DeleteValue(hContact,"MessagesCountSend");
+ DB_Mra_DeleteValue(hContact,"MRAClient");
+ DB_Mra_DeleteValue(hContact,"MRAClientVer");
+ DB_Mra_DeleteValue(hContact,"MRAClientCapabilities");
+ DB_Mra_DeleteValue(hContact,"Status");
+ DB_Mra_DeleteValue(hContact,"ContactID");
+ DB_Mra_DeleteValue(hContact,"GroupID");
+ DB_Mra_DeleteValue(hContact,"ContactSeverFlags");
+ DB_Mra_DeleteValue(hContact,"HooksLocked");
+ }
+ case PLUGIN_MAKE_VERSION(1,14,0,3):
+ case PLUGIN_MAKE_VERSION(1,14,0,4):
+ case PLUGIN_MAKE_VERSION(1,14,0,5):
+ case PLUGIN_MAKE_VERSION(1,14,0,6):
+ case PLUGIN_MAKE_VERSION(1,14,0,7):
+ //case PLUGIN_MAKE_VERSION(1,14,1,0):
+ DB_Mra_SetByte(NULL,DBSETTING_XSTATUSID,(BYTE)DB_Mra_GetDword(NULL,DBSETTING_XSTATUSID,MRA_MIR_XSTATUS_NONE));
+ for(HANDLE hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ {
+ if (IsContactMra(hContact)) DB_Mra_SetByte(hContact,DBSETTING_XSTATUSID,(BYTE)DB_Mra_GetDword(hContact,DBSETTING_XSTATUSID,MRA_MIR_XSTATUS_NONE));
+ }
+ case PLUGIN_MAKE_VERSION(1,16,0,2):
+ DB_Mra_DeleteValue(NULL,"CvtSmilesToTags");
+ case PLUGIN_MAKE_VERSION(1,16,0,3):
+ for(HANDLE hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ {
+ if (IsContactMra(hContact)==FALSE) DB_Mra_DeleteValue(hContact,DBSETTING_XSTATUSID);
+ }
+ case PLUGIN_MAKE_VERSION(0,0,0,0):// no previos version
+ MraAntiSpamResetBadWordsList();
+ case PLUGIN_VERSION_DWORD:// current version
+ break;
+ }*/
+
+ DB_Mra_SetDword(NULL,"LastPluginVersion",PLUGIN_VERSION_DWORD);
+
+
+
+ {// pass conv
+ char szPass[MAX_PATH];
+ SIZE_T dwPassSize;
+
+ if(DB_Mra_GetStaticStringA(NULL,"Password",(LPSTR)szPass,SIZEOF(szPass),&dwPassSize))
+ {//bit of a security hole here, since it's easy to extract a password from an edit box
+ CallService(MS_DB_CRYPT_DECODESTRING,(dwPassSize+1),(LPARAM)szPass);
+
+ SetPassDB(szPass,dwPassSize);
+
+ SecureZeroMemory(szPass,sizeof(szPass));
+ DB_Mra_DeleteValue(NULL,"Password");
+ }
+ }
+
+//*/
+}
+
+
diff --git a/protocols/MRA/Mra.h b/protocols/MRA/Mra.h
new file mode 100644
index 0000000000..bbe4384255
--- /dev/null
+++ b/protocols/MRA/Mra.h
@@ -0,0 +1,432 @@
+#if !defined(AFX_MRA_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
+#define AFX_MRA_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_
+
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#define _CRT_SECURE_NO_WARNINGS
+
+#if defined( UNICODE ) && !defined( _UNICODE )
+ #define _UNICODE
+#endif
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+#define WINVER 0x0502
+#define _WIN32_WINNT 0x0502
+
+#define MIRANDA_VER 0x0900
+#define MIRANDA_CUSTOM_LP
+
+#include <windows.h>
+#include <wincrypt.h>
+#include <shlwapi.h>
+#include <winsock2.h>
+#include <mswsock.h>
+#include <WS2tcpip.h>
+#include <PrSht.h>
+#include <Commdlg.h>
+#include <Ntsecapi.h>
+#include <stdio.h>
+#include <time.h>
+#include <commctrl.h>
+#include <uxtheme.h>
+
+// miranda API
+#include <newpluginapi.h>
+#include <m_system.h>
+#include <m_protocols.h>
+#include <m_clc.h>
+#include <m_clist.h>
+#include <m_cluiframes.h>
+#include <m_clui.h>
+#include <m_genmenu.h>
+#include <m_ignore.h>
+#include <m_message.h>
+#include <m_options.h>
+#include <m_protomod.h>
+#include <m_protosvc.h>
+#include <m_skin.h>
+#include <m_userinfo.h>
+#include <m_utils.h>
+#include <m_database.h>
+#include <m_langpack.h>
+#include <m_netlib.h>
+#include <m_updater.h>
+#include <m_icolib.h>
+#include <win2k.h>
+#include <m_popup.h>
+#include <m_popup2.h>
+#include <m_nudge.h>
+#include <m_folders.h>
+#include <m_avatars.h>
+#include <m_chat.h>
+#include <m_extraicons.h>
+#include <m_music.h>
+#include <m_proto_listeningto.h>
+
+//sdk
+#include <timefuncs.h>
+#include "zlib.h"
+#include <DebugFunctions.h>
+#include <SocketFunctions.h>
+#include <MemoryFind.h>
+#include <MemoryFindByte.h>
+#include <MemoryCompare.h>
+#include <MemoryReplace.h>
+#include <BuffToLowerCase.h>
+#include <StrToNum.h>
+#include <StrToNum.h>
+#include <StrHexToNum.h>
+#include <Base64.h>
+#include <InternetTime.h>
+#include <ListMT.h>
+#include <FIFOMT.h>
+#include <RC4.h>
+#include <SHA1.h>
+
+#include "resource.h"
+#include ".\xstatus_MRA\resource.h"
+#include "proto.h"
+#include "MraSendQueue.h"
+#include "MraFilesQueue.h"
+#include "MraPopUp.h"
+#include "MraAvatars.h"
+#include "MraIcons.h"
+#include "MraSelectEMail.h"
+#include "MraAntiSpam.h"
+#include "MraMPop.h"
+#include "MraChat.h"
+
+typedef int (*PUNCOMPRESS)(unsigned char*,DWORD*,unsigned char*,DWORD);
+typedef int (*PCOMPRESS2)(unsigned char*,DWORD*,unsigned char*,DWORD,int);
+
+// LPS
+typedef struct
+{
+ SIZE_T dwSize;
+
+ union {
+ LPSTR lpszData;
+ LPWSTR lpwszData;
+ };
+} MRA_LPS;
+
+// GUID
+typedef struct
+{
+ DWORD id[4];
+} MRA_GUID;
+
+struct MRA_ADDR_LIST_ITEM
+{
+ DWORD dwPort;
+ DWORD dwAddr;
+};
+
+struct MRA_ADDR_LIST
+{
+ DWORD dwAddrCount;
+ MRA_ADDR_LIST_ITEM *pmaliAddress;
+};
+
+//
+struct GUI_DISPLAY_ITEM
+{
+ LPSTR lpszName; // ,
+ LPWSTR lpwszDescr; //
+ LONG defIcon; //
+ MIRANDASERVICE lpFunc; //
+};
+
+// /
+struct SERVICE_ITEM
+{
+ LPSTR lpszName; // ,
+ MIRANDASERVICE lpFunc; //
+};
+
+#include "MraConstans.h"
+#include "MraSendCommand.h"
+#include "MraMRIMProxy.h"
+
+
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// plugin options
+
+
+#define MAIN_MENU_ITEMS_COUNT 15
+#define CONTACT_MENU_ITEMS_COUNT 10
+
+typedef struct
+{
+ HANDLE hHeap;
+ HINSTANCE hInstance;
+ HMODULE hDLLZLib;
+ HANDLE lpfnCompress2;
+ HANDLE lpfnUncompress;
+ HMODULE hDLLXStatusIcons;
+ char szModuleName[MAXMODULELABELLENGTH];
+ WCHAR wszModuleName[MAXMODULELABELLENGTH];
+ SIZE_T dwModuleNameLen;
+ char szDisplayModuleName[MAX_PATH];
+ WCHAR wszDisplayModuleName[MAX_PATH];
+ SIZE_T dwDisplayModuleNameLen;
+
+ DWORD dwGlobalPluginRunning;//
+ BOOL bLoggedIn;
+ BOOL bChatExist;
+ DWORD dwStatusMode;
+ DWORD dwXStatusMode;
+ DWORD dwDesiredStatusMode;
+
+ HWND hWndEMailPopupStatus;
+ DWORD dwEmailMessagesTotal;
+ DWORD dwEmailMessagesUnRead;
+
+ BOOL bHideXStatusUI;
+ HANDLE hXStatusMenuItems[MRA_XSTATUS_COUNT+4];
+ HANDLE hXStatusAdvancedStatusIcons[MRA_XSTATUS_COUNT+4];
+ HANDLE hXStatusAdvancedStatusItems[MRA_XSTATUS_COUNT+4];
+ HANDLE hExtraXstatusIcon;
+
+ HANDLE hMainMenuIcons[MAIN_MENU_ITEMS_COUNT+4];
+ HANDLE hMainMenuItems[MAIN_MENU_ITEMS_COUNT+4];
+
+ HANDLE hContactMenuIcons[CONTACT_MENU_ITEMS_COUNT+4];
+ HANDLE hContactMenuItems[CONTACT_MENU_ITEMS_COUNT+4];
+
+ HANDLE hAdvancedStatusIcons[ADV_ICON_MAX+4];
+ HANDLE hAdvancedStatusItems[ADV_ICON_MAX+4];
+ HANDLE hExtraInfo;
+
+ HANDLE hThreadAPC; // APC thread, for queue tasks
+ HANDLE hWaitEventThreadAPCHandle;
+ DWORD dwAPCThreadRunning;
+ FIFO_MT ffmtAPCQueue;
+ HANDLE hMPopSessionQueue;
+ HANDLE hSendQueueHandle;
+ HANDLE hFilesQueueHandle;
+ HANDLE hAvatarsQueueHandle;
+
+ HANDLE hNetlibUser;
+ HANDLE hThreadWorker;
+ HANDLE hConnection;
+ DWORD dwThreadWorkerLastPingTime;
+ DWORD dwThreadWorkerRunning;
+ DWORD dwCMDNum;
+ CRITICAL_SECTION csCriticalSectionSend;
+
+ HANDLE hHookModulesLoaded;
+ HANDLE hHookPreShutdown;
+ HANDLE hHookOptInitialize;
+ HANDLE hHookContactDeleted;
+ HANDLE hHookSettingChanged;
+ HANDLE hHookRebuildCMenu;
+ HANDLE hHookExtraIconsApply;
+ HANDLE hHookExtraIconsRebuild;
+ HANDLE hHookIconsChanged;
+ HANDLE heNudgeReceived;
+ HANDLE hHookRebuildStatusMenu;
+ HANDLE hWATrack;
+
+ char szNewMailSound[MAX_PATH];
+
+ SIZE_T dwMirWorkDirPathLen;
+ WCHAR szMirWorkDirPath[MAX_FILEPATH];
+} MRA_SETTINGS;
+
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// External variables
+extern MRA_SETTINGS masMraSettings;
+
+
+INT_PTR LoadServices ();
+INT_PTR LoadModules ();
+void UnloadModules ();
+void UnloadServices ();
+void InitExtraIcons ();
+void SetExtraIcons (HANDLE hContact);
+DWORD MraSetXStatusInternal (DWORD dwXStatus);
+DWORD MraGetXStatusInternal ();
+
+int OptInit (WPARAM wParam,LPARAM lParam);
+
+
+INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM lParam);
+DWORD AdvancedSearchFromDlg(HWND hWndDlg);
+
+
+DWORD MraRecvCommand_Message (DWORD dwTime,DWORD dwFlags,MRA_LPS *plpsFrom,MRA_LPS *plpsText,MRA_LPS *plpsRFTText,MRA_LPS *plpsMultiChatData);
+
+
+DWORD MraGetSelfVersionString (LPSTR lpszSelfVersion,SIZE_T dwSelfVersionSize,SIZE_T *pdwSelfVersionSizeRet);
+
+DWORD MraAddrListGetFromBuff (LPSTR lpszAddreses,SIZE_T dwAddresesSize,MRA_ADDR_LIST *pmalAddrList);
+DWORD MraAddrListGetToBuff (MRA_ADDR_LIST *pmalAddrList,LPSTR lpszBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSizeRet);
+void MraAddrListStoreToContact (HANDLE hContact,MRA_ADDR_LIST *pmalAddrList);
+void MraAddrListFree (MRA_ADDR_LIST *pmalAddrList);
+
+
+
+#define GetContactNameA(Contact) (LPSTR)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)Contact,0)
+#define GetContactNameW(Contact) (LPWSTR)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)Contact,GCDNF_UNICODE)
+
+#define GetStatusModeDescriptionA(Status) (LPSTR)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,(WPARAM)Status,0)
+#define GetStatusModeDescriptionW(Status) (LPWSTR)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,(WPARAM)Status,GSMDF_UNICODE)
+
+#define DB_Mra_DeleteValue(Contact,valueName) DBDeleteContactSetting(Contact,PROTOCOL_NAMEA,valueName)
+
+#define DB_Mra_GetDword(Contact,valueName,parDefltValue) DBGetContactSettingDword(Contact,PROTOCOL_NAMEA,valueName,parDefltValue)
+#define DB_Mra_SetDword(Contact,valueName,parValue) DBWriteContactSettingDword(Contact,PROTOCOL_NAMEA,valueName,parValue)
+
+#define DB_Mra_GetWord(Contact,valueName,parDefltValue) DBGetContactSettingWord(Contact,PROTOCOL_NAMEA,valueName,parDefltValue)
+#define DB_Mra_SetWord(Contact,valueName,parValue) DBWriteContactSettingWord(Contact,PROTOCOL_NAMEA,valueName,parValue)
+
+#define DB_Mra_GetByte(Contact,valueName,parDefltValue) DBGetContactSettingByte(Contact,PROTOCOL_NAMEA,valueName,parDefltValue)
+#define DB_Mra_SetByte(Contact,valueName,parValue) DBWriteContactSettingByte(Contact,PROTOCOL_NAMEA,valueName,parValue)
+
+void DB_Mra_CreateResidentSetting(LPSTR lpszValueName);
+
+BOOL DB_GetStaticStringA(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPSTR lpszRetBuff,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize);
+BOOL DB_GetStaticStringW(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpszRetBuff,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize);
+#define DB_Mra_GetStaticStringA(Contact,ValueName,Ret,RetBuffSize,pRetBuffSize) DB_GetStaticStringA(Contact,PROTOCOL_NAMEA,ValueName,Ret,RetBuffSize,pRetBuffSize)
+#define DB_Mra_GetStaticStringW(Contact,ValueName,Ret,RetBuffSize,pRetBuffSize) DB_GetStaticStringW(Contact,PROTOCOL_NAMEA,ValueName,Ret,RetBuffSize,pRetBuffSize)
+
+BOOL DB_SetStringExA(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPSTR lpszValue,SIZE_T dwValueSize);
+BOOL DB_SetStringExW(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpwszValue,SIZE_T dwValueSize);
+#define DB_SetStringA(Contact,Module,valueName,parValue) DB_SetStringExA(Contact,Module,valueName,parValue,lstrlenA(parValue))
+#define DB_SetStringW(Contact,Module,valueName,parValue) DBWriteContactSettingWString(Contact,Module,valueName,parValue)
+#define DB_SetLPSStringA(Contact,Module,valueName,parValue) if ((parValue)) DB_SetStringExA(Contact,Module,valueName,(parValue)->lpszData,(parValue)->dwSize)
+#define DB_SetLPSStringW(Contact,Module,valueName,parValue) if ((parValue)) DB_SetStringExW(Contact,Module,valueName,(parValue)->lpwszData,((parValue)->dwSize/sizeof(WCHAR)))
+#define DB_Mra_SetStringA(Contact,valueName,parValue) DB_SetStringExA(Contact,PROTOCOL_NAMEA,valueName,parValue,lstrlenA(parValue))
+#define DB_Mra_SetStringW(Contact,valueName,parValue) DBWriteContactSettingWString(Contact,PROTOCOL_NAMEA,valueName,parValue)
+#define DB_Mra_SetLPSStringA(Contact,valueName,parValue) DB_SetLPSStringA(Contact,PROTOCOL_NAMEA,valueName,parValue)
+#define DB_Mra_SetLPSStringW(Contact,valueName,parValue) DB_SetLPSStringW(Contact,PROTOCOL_NAMEA,valueName,parValue)
+#define DB_Mra_SetStringExA(Contact,valueName,parValue,parValueSize) DB_SetStringExA(Contact,PROTOCOL_NAMEA,valueName,parValue,parValueSize)
+#define DB_Mra_SetStringExW(Contact,valueName,parValue,parValueSize) DB_SetStringExW(Contact,PROTOCOL_NAMEA,valueName,parValue,parValueSize)
+
+int DB_WriteContactSettingBlob(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPVOID lpValue,SIZE_T dwValueSize);
+#define DB_Mra_WriteContactSettingBlob(hContact,lpszValueName,lpbValue,dwValueSize) DB_WriteContactSettingBlob(hContact,PROTOCOL_NAMEA,lpszValueName,lpbValue,dwValueSize)
+BOOL DB_GetContactSettingBlob(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPVOID lpRet,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize);
+#define DB_Mra_GetContactSettingBlob(hContact,lpszValueName,lpbRet,dwRetBuffSize,pdwRetBuffSize) DB_GetContactSettingBlob(hContact,PROTOCOL_NAMEA,lpszValueName,lpbRet,dwRetBuffSize,pdwRetBuffSize)
+
+#define MEMALLOC(Size) HeapAlloc(masMraSettings.hHeap,HEAP_ZERO_MEMORY,((Size)+sizeof(void*)))
+#define MEMREALLOC(Mem,Size) HeapReAlloc(masMraSettings.hHeap,(HEAP_ZERO_MEMORY),(void*)(Mem),((Size)+sizeof(void*)))
+#define MEMFREE(Mem) if ((Mem)) {HeapFree(masMraSettings.hHeap,0,(void*)(Mem));(Mem)=NULL;}
+
+#define SetBit(bytes,bitpos) bytes|=(1<<bitpos)
+#define GetBit(bytes,bitpos) ((bytes&(1<<bitpos))? TRUE:FALSE)
+
+
+#define IsXStatusValid(XStatus) (((XStatus) && (XStatus)<MRA_XSTATUS_COUNT))
+
+
+#define SEND_DLG_ITEM_MESSAGEW(hDlg,nIDDlgItem,Msg,wParam,lParam) SendMessageW(GetDlgItem(hDlg,nIDDlgItem),Msg,wParam,lParam)
+#define SEND_DLG_ITEM_MESSAGEA(hDlg,nIDDlgItem,Msg,wParam,lParam) SendMessageA(GetDlgItem(hDlg,nIDDlgItem),Msg,wParam,lParam)
+#define SEND_DLG_ITEM_MESSAGE(hDlg,nIDDlgItem,Msg,wParam,lParam) SendMessage(GetDlgItem(hDlg,nIDDlgItem),Msg,wParam,lParam)
+
+#define IS_DLG_BUTTON_CHECKED(hDlg,nIDDlgItem) SEND_DLG_ITEM_MESSAGE(hDlg,nIDDlgItem,BM_GETCHECK,NULL,NULL)
+#define CHECK_DLG_BUTTON(hDlg,nIDDlgItem,uCheck) SEND_DLG_ITEM_MESSAGE(hDlg,nIDDlgItem,BM_SETCHECK,(WPARAM)uCheck,NULL)
+
+#define SET_DLG_ITEM_TEXTW(hDlg,nIDDlgItem,lpString) SEND_DLG_ITEM_MESSAGEW(hDlg,nIDDlgItem,WM_SETTEXT,0,(LPARAM)lpString)
+#define SET_DLG_ITEM_TEXTA(hDlg,nIDDlgItem,lpString) SEND_DLG_ITEM_MESSAGEA(hDlg,nIDDlgItem,WM_SETTEXT,0,(LPARAM)lpString)
+#define SET_DLG_ITEM_TEXT(hDlg,nIDDlgItem,lpString) SEND_DLG_ITEM_MESSAGE(hDlg,nIDDlgItem,WM_SETTEXT,0,(LPARAM)lpString)
+
+#define GET_DLG_ITEM_TEXTW(hDlg,nIDDlgItem,lpString,nMaxCount) SEND_DLG_ITEM_MESSAGEW(hDlg,nIDDlgItem,WM_GETTEXT,(WPARAM)nMaxCount,(LPARAM)lpString)
+#define GET_DLG_ITEM_TEXTA(hDlg,nIDDlgItem,lpString,nMaxCount) SEND_DLG_ITEM_MESSAGEA(hDlg,nIDDlgItem,WM_GETTEXT,(WPARAM)nMaxCount,(LPARAM)lpString)
+#define GET_DLG_ITEM_TEXT(hDlg,nIDDlgItem,lpString,nMaxCount) SEND_DLG_ITEM_MESSAGE(hDlg,nIDDlgItem,WM_GETTEXT,(WPARAM)nMaxCount,(LPARAM)lpString)
+
+#define GET_DLG_ITEM_TEXT_LENGTH(hDlg,nIDDlgItem) SEND_DLG_ITEM_MESSAGE(hDlg,nIDDlgItem,WM_GETTEXTLENGTH,NULL,NULL)
+#define GET_WINDOW_TEXT_LENGTH(hDlg) SendMessage(hDlg,WM_GETTEXTLENGTH,NULL,NULL)
+
+#define GET_CURRENT_COMBO_DATA(hWndDlg,ControlID) SEND_DLG_ITEM_MESSAGE(hWndDlg,ControlID,CB_GETITEMDATA,SEND_DLG_ITEM_MESSAGE(hWndDlg,ControlID,CB_GETCURSEL,0,0),0)
+
+
+#define IsFileExist(FileName) (GetFileAttributes(FileName)!=INVALID_FILE_ATTRIBUTES)
+#define IsFileExistA(FileName) (GetFileAttributesA(FileName)!=INVALID_FILE_ATTRIBUTES)
+#define IsFileExistW(FileName) (GetFileAttributesW(FileName)!=INVALID_FILE_ATTRIBUTES)
+
+
+#define IsThreadAlive(hThread) (GetThreadPriority(hThread)!=THREAD_PRIORITY_ERROR_RETURN)
+
+
+
+DWORD MraGetVersionStringFromFormated (LPSTR lpszUserAgentFormated,SIZE_T dwUserAgentFormatedSize,LPSTR lpszVersion,SIZE_T dwVersionSize,SIZE_T *pdwVersionSizeRet);
+HANDLE MraHContactFromEmail (LPSTR lpszEMail,SIZE_T dwEMailSize,BOOL bAddIfNeeded,BOOL bTemporary,BOOL *pbAdded);
+BOOL MraUpdateContactInfo (HANDLE hContact);
+DWORD MraContactCapabilitiesGet (HANDLE hContact);
+void MraContactCapabilitiesSet (HANDLE hContact,DWORD dwFutureFlags);
+DWORD MraGetContactStatus (HANDLE hContact);
+DWORD MraSetContactStatus (HANDLE hContact,DWORD dwNewStatus);
+void MraUpdateEmailStatus (LPSTR lpszFrom,SIZE_T dwFromSize,LPSTR lpszSubject,SIZE_T dwSubjectSize,DWORD dwDate,DWORD dwUIDL);
+BOOL IsUnicodeEnv ();
+BOOL IsHTTPSProxyUsed (HANDLE hNetlibUser);
+BOOL IsContactMra (HANDLE hContact);
+BOOL IsContactMraProto (HANDLE hContact);
+BOOL IsEMailMy (LPSTR lpszEMail,SIZE_T dwEMailSize);
+BOOL IsEMailChatAgent (LPSTR lpszEMail,SIZE_T dwEMailSize);
+BOOL IsContactChatAgent (HANDLE hContact);
+BOOL IsEMailMR (LPSTR lpszEMail,SIZE_T dwEMailSize);
+BOOL GetEMailFromString (LPSTR lpszBuff,SIZE_T dwBuffSize,LPSTR *plpszEMail,SIZE_T *pdwEMailSize);
+DWORD GetContactEMailCount (HANDLE hContact,BOOL bMRAOnly);
+BOOL GetContactFirstEMail (HANDLE hContact,BOOL bMRAOnly,LPSTR lpszRetBuff,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize);
+DWORD MraAPCQueueAdd (PAPCFUNC pfnAPC,PFIFO_MT pffmtAPCQueue,ULONG_PTR dwData);
+void MraAPCQueueDestroy (PFIFO_MT pffmtAPCQueue);
+void ShowFormatedErrorMessage (LPWSTR lpwszErrText,DWORD dwErrorCode);
+DWORD ProtoBroadcastAckAsynchEx (const char *szModule,HANDLE hContact,int type,int result,HANDLE hProcess,LPARAM lParam,SIZE_T dwLparamSize);
+void MraUserAPCThreadProc (LPVOID lpParameter);
+
+DWORD CreateBlobFromContact (HANDLE hContact,LPWSTR lpwszRequestReason,SIZE_T dwRequestReasonSize,LPBYTE lpbBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSizeRet);
+void CListCreateMenu (LONG lPosition,LONG lPopupPosition,HANDLE hMainIcon,LPSTR pszContactOwner,LPSTR lpszCListMenuType,const GUI_DISPLAY_ITEM *pgdiItems,HANDLE *hIcoLibIcons,SIZE_T dwCount,HANDLE *hResult);
+void CListDestroyMenu (const GUI_DISPLAY_ITEM *pgdiItems,SIZE_T dwCount);
+void CListShowMenuItem (HANDLE hMenuItem,BOOL bShow);
+//void CListSetMenuItemIcon (HANDLE hMenuItem,HANDLE hIcon);
+int ExtraSetIcon (HANDLE hExtraIcon,HANDLE hContact,HANDLE hImage,int iColumnType);
+SIZE_T CopyNumber (LPCVOID lpcOutBuff,LPCVOID lpcBuff,SIZE_T dwLen);
+BOOL IsPhone (LPSTR lpszString,SIZE_T dwStringSize);
+BOOL IsContactPhone (HANDLE hContact,LPSTR lpszPhone,SIZE_T dwPhoneSize);
+HANDLE MraHContactFromPhone (LPSTR lpszPhone,SIZE_T dwPhoneSize,BOOL bAddIfNeeded,BOOL bTemporary,BOOL *pbAdded);
+void EnableControlsArray (HWND hWndDlg,WORD *pwControlsList,SIZE_T dwControlsListCount,BOOL bEnabled);
+BOOL MraRequestXStatusDetails (DWORD dwXStatus);
+BOOL MraSendReplyBlogStatus (HANDLE hContact);
+DWORD GetYears (CONST PSYSTEMTIME pcstSystemTime);
+DWORD FindFile (LPWSTR lpszFolder,DWORD dwFolderLen,LPWSTR lpszFileName,DWORD dwFileNameLen,LPWSTR lpszRetFilePathName,DWORD dwRetFilePathLen,DWORD *pdwRetFilePathLen);
+DWORD MemFillRandom (LPVOID lpBuff,SIZE_T dwBuffSize);
+BOOL SetPassDB (LPSTR lpszBuff,SIZE_T dwBuffSize);
+BOOL GetPassDB (LPSTR lpszBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSize);
+DWORD DecodeXML (LPTSTR lptszMessage,SIZE_T dwMessageSize,LPTSTR lptszMessageConverted,SIZE_T dwMessageConvertedBuffSize,SIZE_T *pdwMessageConvertedSize);
+DWORD EncodeXML (LPTSTR lptszMessage,SIZE_T dwMessageSize,LPTSTR lptszMessageConverted,SIZE_T dwMessageConvertedBuffSize,SIZE_T *pdwMessageConvertedSize);
+
+
+DWORD StartConnect ();
+void MraThreadClean ();
+
+DWORD GetMraStatusFromMiradaStatus (DWORD dwMirandaStatus,DWORD dwXStatusMir,DWORD *pdwXStatusMra);
+DWORD GetMiradaStatusFromMraStatus (DWORD dwMraStatus,DWORD dwXStatusMra,DWORD *pdwXStatusMir);
+DWORD GetMraXStatusIDFromMraUriStatus (LPSTR lpszStatusUri,SIZE_T dwStatusUriSize);
+
+
+DWORD GetContactFlags (HANDLE hContact);
+DWORD SetContactFlags (HANDLE hContact,DWORD dwContactFlag);
+
+DWORD GetContactBasicInfoW (HANDLE hContact,DWORD *pdwID,DWORD *pdwGroupID,DWORD *pdwContactFlag,DWORD *pdwContactSeverFlags,DWORD *pdwStatus,LPSTR lpszEMail,SIZE_T dwEMailSize,SIZE_T *pdwEMailSize,LPWSTR lpwszNick,SIZE_T dwNickSize,SIZE_T *pdwNickSize,LPSTR lpszPhones,SIZE_T dwPhonesSize,SIZE_T *pdwPhonesSize);
+
+#define SCBIFSI_LOCK_CHANGES_EVENTS 1
+#define SCBIF_ID 1
+#define SCBIF_GROUP_ID 2
+#define SCBIF_FLAG 4
+#define SCBIF_SERVER_FLAG 8
+#define SCBIF_STATUS 16
+#define SCBIF_EMAIL 32
+#define SCBIF_NICK 64
+#define SCBIF_PHONES 128
+DWORD SetContactBasicInfoW (HANDLE hContact,DWORD dwSetInfoFlags,DWORD dwFlags,DWORD dwID,DWORD dwGroupID,DWORD dwContactFlag,DWORD dwContactSeverFlags,DWORD dwStatus,LPSTR lpszEMail,SIZE_T dwEMailSize,LPWSTR lpwszNick,SIZE_T dwNickSize,LPSTR lpszPhones,SIZE_T dwPhonesSize);
+
+
+
+
+#endif // !defined(AFX_MRA_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/Mra.sln b/protocols/MRA/Mra.sln
new file mode 100644
index 0000000000..29aeb336ad
--- /dev/null
+++ b/protocols/MRA/Mra.sln
@@ -0,0 +1,25 @@
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual C++ Express 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MRA", "Mra.vcxproj", "{EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug Unicode|Win32 = Debug Unicode|Win32
+ Debug Unicode|x64 = Debug Unicode|x64
+ Release Unicode|Win32 = Release Unicode|Win32
+ Release Unicode|x64 = Release Unicode|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32
+ {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32
+ {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64
+ {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Debug Unicode|x64.Build.0 = Debug Unicode|x64
+ {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32
+ {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release Unicode|Win32.Build.0 = Release Unicode|Win32
+ {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release Unicode|x64.ActiveCfg = Release Unicode|x64
+ {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release Unicode|x64.Build.0 = Release Unicode|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/protocols/MRA/Mra.vcproj b/protocols/MRA/Mra.vcproj
new file mode 100644
index 0000000000..dd50bffc3c
--- /dev/null
+++ b/protocols/MRA/Mra.vcproj
@@ -0,0 +1,1209 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="Mra"
+ ProjectGUID="{EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}"
+ RootNamespace="Mra"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;C:\Documents and Settings\Rozhuk_IM\ \Programmer\VC\Mra\Debug\Mra.dll&quot; &quot;C:\Documents and Settings\Rozhuk_IM\ \Programmer\VC\MirandaIM\x32\Plugins\Mra.dll&quot;&#x0D;&#x0A;"
+ Outputs="w"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MRA_EXPORTS"
+ StringPooling="true"
+ MinimalRebuild="true"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ BufferSecurityCheck="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderThrough=""
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ CompileAs="2"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="Crypt32.lib shlwapi.lib Ws2_32.lib mswsock.lib"
+ OutputFile="$(OutDir)/Mra.dll"
+ LinkIncremental="2"
+ AdditionalManifestDependencies="type=&apos;Win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; processorArchitecture=&apos;X86&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos;"
+ IgnoreAllDefaultLibraries="false"
+ IgnoreDefaultLibraryNames="msvcrtd.lib"
+ ModuleDefinitionFile="MRA.def"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/Mra.pdb"
+ SubSystem="2"
+ OptimizeReferences="1"
+ EnableCOMDATFolding="1"
+ OptimizeForWindows98="0"
+ ResourceOnlyDLL="false"
+ SetChecksum="false"
+ RandomizedBaseAddress="1"
+ FixedBaseAddress="1"
+ DataExecutionPrevention="2"
+ ImportLibrary="$(OutDir)/Mra.lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ ExcludedFromBuild="false"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;C:\Documents and Settings\Rozhuk_IM\ \Programmer\VC\Mra\x64\Debug\Mra.dll&quot; &quot;C:\Documents and Settings\Rozhuk_IM\ \Programmer\VC\MirandaIM\x64\Plugins\Mra.dll&quot;&#x0D;&#x0A;"
+ Outputs="w"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="WIN64;_DEBUG;_WINDOWS;_USRDLL;MRA_EXPORTS"
+ StringPooling="true"
+ MinimalRebuild="true"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ BufferSecurityCheck="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderThrough=""
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ CompileAs="2"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="shlwapi.lib Ws2_32.lib mswsock.lib"
+ OutputFile="$(OutDir)/Mra.dll"
+ LinkIncremental="2"
+ GenerateManifest="false"
+ AdditionalManifestDependencies=""
+ IgnoreAllDefaultLibraries="false"
+ IgnoreDefaultLibraryNames="msvcrtd.lib"
+ ModuleDefinitionFile="MRA.def"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/Mra.pdb"
+ SubSystem="2"
+ OptimizeReferences="1"
+ EnableCOMDATFolding="1"
+ OptimizeForWindows98="0"
+ ResourceOnlyDLL="false"
+ SetChecksum="false"
+ RandomizedBaseAddress="1"
+ FixedBaseAddress="1"
+ DataExecutionPrevention="2"
+ ImportLibrary="$(OutDir)/Mra.lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ ExcludedFromBuild="false"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="!release.cmd&#x0D;&#x0A;"
+ Outputs="w"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="1"
+ InlineFunctionExpansion="1"
+ EnableIntrinsicFunctions="false"
+ FavorSizeOrSpeed="2"
+ EnableFiberSafeOptimizations="true"
+ WholeProgramOptimization="false"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MRA_EXPORTS"
+ StringPooling="true"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="false"
+ EnableEnhancedInstructionSet="1"
+ RuntimeTypeInfo="false"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ UseLibraryDependencyInputs="false"
+ AdditionalDependencies="shlwapi.lib Ws2_32.lib mswsock.lib"
+ OutputFile="$(OutDir)/Mra.dll"
+ LinkIncremental="0"
+ AdditionalManifestDependencies="type=&apos;Win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; processorArchitecture=&apos;X86&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos;"
+ IgnoreAllDefaultLibraries="true"
+ IgnoreDefaultLibraryNames=""
+ ModuleDefinitionFile="MRA.def"
+ AddModuleNamesToAssembly=""
+ AssemblyLinkResource=""
+ GenerateDebugInformation="false"
+ GenerateMapFile="true"
+ MapFileName="$(OutDir)\mra.map"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="0"
+ LinkTimeCodeGeneration="0"
+ EntryPointSymbol=""
+ ResourceOnlyDLL="true"
+ SetChecksum="true"
+ RandomizedBaseAddress="2"
+ FixedBaseAddress="1"
+ DataExecutionPrevention="2"
+ ImportLibrary="$(OutDir)/Mra.lib"
+ TargetMachine="1"
+ CLRThreadAttribute="0"
+ CLRImageType="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="!releasex64.cmd&#x0D;&#x0A;"
+ Outputs="w"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="1"
+ InlineFunctionExpansion="1"
+ EnableIntrinsicFunctions="false"
+ FavorSizeOrSpeed="2"
+ EnableFiberSafeOptimizations="true"
+ WholeProgramOptimization="false"
+ PreprocessorDefinitions="WIN64;NDEBUG;_WINDOWS;_USRDLL;MRA_EXPORTS"
+ StringPooling="true"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="false"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ UseLibraryDependencyInputs="false"
+ AdditionalDependencies="shlwapi.lib Ws2_32.lib mswsock.lib runtmchk.lib"
+ OutputFile="$(OutDir)/Mra.dll"
+ LinkIncremental="0"
+ GenerateManifest="false"
+ AdditionalManifestDependencies=""
+ IgnoreAllDefaultLibraries="true"
+ IgnoreDefaultLibraryNames=""
+ ModuleDefinitionFile="MRA.def"
+ AddModuleNamesToAssembly=""
+ AssemblyLinkResource=""
+ GenerateDebugInformation="false"
+ GenerateMapFile="true"
+ MapFileName="$(OutDir)\mra.map"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="0"
+ LinkTimeCodeGeneration="0"
+ EntryPointSymbol=""
+ ResourceOnlyDLL="true"
+ SetChecksum="true"
+ RandomizedBaseAddress="2"
+ FixedBaseAddress="1"
+ DataExecutionPrevention="2"
+ ImportLibrary="$(OutDir)/Mra.lib"
+ TargetMachine="17"
+ CLRThreadAttribute="0"
+ CLRImageType="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release - dbg|Win32"
+ OutputDirectory="$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;C:\Documents and Settings\Rozhuk_IM\ \Programmer\VC\Mra\Release - dbg\Mra.dll&quot; &quot;C:\Documents and Settings\Rozhuk_IM\ \Programmer\VC\MirandaIM\x32\Plugins\Mra.dll&quot;&#x0D;&#x0A;"
+ Outputs="w"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ InlineFunctionExpansion="0"
+ EnableIntrinsicFunctions="false"
+ FavorSizeOrSpeed="2"
+ EnableFiberSafeOptimizations="true"
+ WholeProgramOptimization="false"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MRA_EXPORTS"
+ StringPooling="true"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="false"
+ EnableEnhancedInstructionSet="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ UseLibraryDependencyInputs="false"
+ AdditionalDependencies="shlwapi.lib Ws2_32.lib mswsock.lib"
+ OutputFile="$(OutDir)/Mra.dll"
+ LinkIncremental="0"
+ AdditionalManifestDependencies="type=&apos;Win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; processorArchitecture=&apos;X86&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos;"
+ IgnoreAllDefaultLibraries="true"
+ IgnoreDefaultLibraryNames=""
+ ModuleDefinitionFile="MRA.def"
+ AddModuleNamesToAssembly=""
+ AssemblyLinkResource=""
+ GenerateDebugInformation="true"
+ GenerateMapFile="false"
+ MapFileName="$(OutDir)\mra.map"
+ SubSystem="2"
+ OptimizeReferences="0"
+ EnableCOMDATFolding="0"
+ OptimizeForWindows98="0"
+ LinkTimeCodeGeneration="0"
+ EntryPointSymbol=""
+ ResourceOnlyDLL="true"
+ SetChecksum="true"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="2"
+ ImportLibrary="$(OutDir)/Mra.lib"
+ TargetMachine="1"
+ CLRThreadAttribute="0"
+ CLRImageType="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release - dbg|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="copy &quot;C:\Documents and Settings\Rozhuk_IM\ \Programmer\VC\Mra\x64\Release - dbg\Mra.dll&quot; &quot;C:\Documents and Settings\Rozhuk_IM\ \Programmer\VC\MirandaIM\x64\Plugins\Mra.dll&quot;&#x0D;&#x0A;"
+ Outputs="w"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ InlineFunctionExpansion="0"
+ EnableIntrinsicFunctions="false"
+ FavorSizeOrSpeed="0"
+ EnableFiberSafeOptimizations="false"
+ WholeProgramOptimization="false"
+ PreprocessorDefinitions="WIN64;REL_DEB;NDEBUG;_WINDOWS;_USRDLL;MRA_EXPORTS"
+ StringPooling="true"
+ MinimalRebuild="true"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="true"
+ EnableFunctionLevelLinking="false"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ UseLibraryDependencyInputs="false"
+ AdditionalDependencies="shlwapi.lib Ws2_32.lib mswsock.lib runtmchk.lib"
+ OutputFile="$(OutDir)/Mra.dll"
+ LinkIncremental="1"
+ GenerateManifest="false"
+ AdditionalManifestDependencies=""
+ IgnoreAllDefaultLibraries="true"
+ IgnoreDefaultLibraryNames=""
+ ModuleDefinitionFile="MRA.def"
+ AddModuleNamesToAssembly=""
+ AssemblyLinkResource=""
+ GenerateDebugInformation="true"
+ GenerateMapFile="false"
+ MapFileName="$(OutDir)\mra.map"
+ SubSystem="2"
+ OptimizeReferences="1"
+ EnableCOMDATFolding="1"
+ OptimizeForWindows98="0"
+ LinkTimeCodeGeneration="0"
+ EntryPointSymbol=""
+ ResourceOnlyDLL="false"
+ SetChecksum="false"
+ RandomizedBaseAddress="2"
+ FixedBaseAddress="1"
+ DataExecutionPrevention="2"
+ ImportLibrary="$(OutDir)/Mra.lib"
+ TargetMachine="17"
+ CLRThreadAttribute="0"
+ CLRImageType="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+ >
+ <File
+ RelativePath="Mra.cpp"
+ >
+ </File>
+ <File
+ RelativePath="Mra_functions.cpp"
+ >
+ </File>
+ <File
+ RelativePath="Mra_options.cpp"
+ >
+ </File>
+ <File
+ RelativePath="Mra_proto.cpp"
+ >
+ </File>
+ <File
+ RelativePath="Mra_svcs.cpp"
+ >
+ </File>
+ <File
+ RelativePath="MraAdvancedSearch.cpp"
+ >
+ </File>
+ <File
+ RelativePath="MraAntiSpam.cpp"
+ >
+ </File>
+ <File
+ RelativePath="MraAvatars.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\MraChat.cpp"
+ >
+ </File>
+ <File
+ RelativePath="MraFilesQueue.cpp"
+ >
+ </File>
+ <File
+ RelativePath="MraIcons.cpp"
+ >
+ </File>
+ <File
+ RelativePath="MraMPop.cpp"
+ >
+ </File>
+ <File
+ RelativePath="MraMRIMProxy.cpp"
+ >
+ </File>
+ <File
+ RelativePath="MraOfflineMsg.cpp"
+ >
+ </File>
+ <File
+ RelativePath="MraPopUp.cpp"
+ >
+ </File>
+ <File
+ RelativePath="MraRTFMsg.cpp"
+ >
+ </File>
+ <File
+ RelativePath="MraSelectEMail.cpp"
+ >
+ </File>
+ <File
+ RelativePath="MraSendCommand.cpp"
+ >
+ </File>
+ <File
+ RelativePath="MraSendQueue.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc"
+ >
+ <File
+ RelativePath="MRA.def"
+ >
+ </File>
+ <File
+ RelativePath="Mra.h"
+ >
+ </File>
+ <File
+ RelativePath="MraAntiSpam.h"
+ >
+ </File>
+ <File
+ RelativePath="MraAvatars.h"
+ >
+ </File>
+ <File
+ RelativePath=".\MraChat.h"
+ >
+ </File>
+ <File
+ RelativePath="MraConstans.h"
+ >
+ </File>
+ <File
+ RelativePath="MraFilesQueue.h"
+ >
+ </File>
+ <File
+ RelativePath="MraIcons.h"
+ >
+ </File>
+ <File
+ RelativePath="MraMPop.h"
+ >
+ </File>
+ <File
+ RelativePath="MraMRIMProxy.h"
+ >
+ </File>
+ <File
+ RelativePath="MraOfflineMsg.h"
+ >
+ </File>
+ <File
+ RelativePath="MraPlaces.h"
+ >
+ </File>
+ <File
+ RelativePath="MraPopUp.h"
+ >
+ </File>
+ <File
+ RelativePath="MraRTFMsg.h"
+ >
+ </File>
+ <File
+ RelativePath="MraSelectEMail.h"
+ >
+ </File>
+ <File
+ RelativePath="MraSendCommand.h"
+ >
+ </File>
+ <File
+ RelativePath="MraSendQueue.h"
+ >
+ </File>
+ <File
+ RelativePath="proto.h"
+ >
+ </File>
+ <File
+ RelativePath="resource.h"
+ >
+ </File>
+ <Filter
+ Name="Miranda"
+ >
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_avatars.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_clist.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_clui.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_cluiframes.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_contactdir.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_contacts.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_database.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_email.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_extraicons.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_findadd.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_folders.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_fuse.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_icolib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_ignore.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_langpack.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_music.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_netlib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_nudge.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_options.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_plugins.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_popup.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_proto_listeningto.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_protocols.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_protomod.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_protosvc.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_system.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_updater.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_url.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_userinfo.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\m_utils.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\newpluginapi.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\statusmodes.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\Miranda\win2k.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Functions"
+ >
+ <File
+ RelativePath="..\!Clases\include\Base64.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\BuffToLowerCase.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\DebugFunctions.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\FIFOMT.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\InternetTime.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\ListMT.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\minicrt\memfuncs.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\MemoryCompare.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\MemoryFind.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\MemoryFindByte.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\minicrt\minicrt.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\RC4.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\SHA1.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\SocketFunctions.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\StrHexToNum.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\StrToNum.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\SystemHeaders.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\zconf.h"
+ >
+ </File>
+ <File
+ RelativePath="..\!Clases\include\zlib.h"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ <File
+ RelativePath=".\Icons\Alarm.ico"
+ >
+ </File>
+ <File
+ RelativePath="Icons\answers.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\Icons\AuthGrant.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\Icons\AuthReguest.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\Icons\Bagz.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\Icons\Blogs.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\Icons\BlogStatus.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\Icons\Chat.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\Icons\icon2.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\Icons\Info.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\Icons\Magent.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\Icons\Mail.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\Icons\MailNotify.ico"
+ >
+ </File>
+ <File
+ RelativePath="MraIconAlarm.ico"
+ >
+ </File>
+ <File
+ RelativePath="MraIconAuthGrant.ico"
+ >
+ </File>
+ <File
+ RelativePath="MraIconAuthReguest.ico"
+ >
+ </File>
+ <File
+ RelativePath="MraIconBagz.ico"
+ >
+ </File>
+ <File
+ RelativePath="MraIconBlogs.ico"
+ >
+ </File>
+ <File
+ RelativePath="MraIconChat.ico"
+ >
+ </File>
+ <File
+ RelativePath="MraIconDeleted.ico"
+ >
+ </File>
+ <File
+ RelativePath="MraIconInfo.ico"
+ >
+ </File>
+ <File
+ RelativePath="MraIconMagent.ico"
+ >
+ </File>
+ <File
+ RelativePath="MraIconMail.ico"
+ >
+ </File>
+ <File
+ RelativePath="MraIconMailNotify.ico"
+ >
+ </File>
+ <File
+ RelativePath="MraIconPhone.ico"
+ >
+ </File>
+ <File
+ RelativePath="MraIconPhoto.ico"
+ >
+ </File>
+ <File
+ RelativePath="MraIconPostCards.ico"
+ >
+ </File>
+ <File
+ RelativePath="MraIconSMS.ico"
+ >
+ </File>
+ <File
+ RelativePath="MraIconWebSearch.ico"
+ >
+ </File>
+ <File
+ RelativePath="Icons\my world.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\Icons\Phone.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\Icons\Photo.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\Icons\PostCards.ico"
+ >
+ </File>
+ <File
+ RelativePath="resource.rc"
+ >
+ </File>
+ <File
+ RelativePath="Icons\video.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\Icons\WebSearch.ico"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath=".\langpack_MRA_russian.txt"
+ >
+ </File>
+ <File
+ RelativePath="Readme_MRA.txt"
+ >
+ </File>
+ <File
+ RelativePath="TODO.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/protocols/MRA/Mra.vcxproj b/protocols/MRA/Mra.vcxproj
new file mode 100644
index 0000000000..e4e40a0efc
--- /dev/null
+++ b/protocols/MRA/Mra.vcxproj
@@ -0,0 +1,434 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug Unicode|Win32">
+ <Configuration>Debug Unicode</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug Unicode|x64">
+ <Configuration>Debug Unicode</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release Unicode|Win32">
+ <Configuration>Release Unicode</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release Unicode|x64">
+ <Configuration>Release Unicode</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}</ProjectGuid>
+ <RootNamespace>Mra</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ <ProjectName>MRA</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">$(SolutionDir)$(Configuration)/Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">$(SolutionDir)$(Configuration)/Obj/$(ProjectName)\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">$(SolutionDir)$(Configuration)64/Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">$(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">false</GenerateManifest>
+ <PostBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">true</PostBuildEventUseInBuild>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">$(SolutionDir)$(Configuration)/Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">$(SolutionDir)$(Configuration)/Obj/$(ProjectName)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'" />
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">$(SolutionDir)$(Configuration)64/Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">$(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'" />
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">false</GenerateManifest>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'" />
+ <RunCodeAnalysis Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">false</RunCodeAnalysis>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">
+ <CustomBuildStep>
+ <Command>
+ </Command>
+ <Outputs>
+ </Outputs>
+ </CustomBuildStep>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MRA_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>true</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <PrecompiledHeaderFile>
+ </PrecompiledHeaderFile>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <AdditionalIncludeDirectories>./sdk;../../include;../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>Crypt32.lib;shlwapi.lib;Ws2_32.lib;mswsock.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
+ <IgnoreAllDefaultLibraries>
+ </IgnoreAllDefaultLibraries>
+ <IgnoreSpecificDefaultLibraries>
+ </IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>
+ </ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>
+ </SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">
+ <CustomBuildStep>
+ <Command>copy "C:\Documents and Settings\Rozhuk_IM\Мои документы\Programmer\VC\Mra\x64\Debug\Mra.dll" "C:\Documents and Settings\Rozhuk_IM\Мои документы\Programmer\VC\MirandaIM\x64\Plugins\Mra.dll"
+</Command>
+ <Outputs>w;%(Outputs)</Outputs>
+ </CustomBuildStep>
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN64;_DEBUG;_WINDOWS;_USRDLL;MRA_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>true</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <PrecompiledHeaderFile>
+ </PrecompiledHeaderFile>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsCpp</CompileAs>
+ <AdditionalIncludeDirectories>./sdk;../../include;../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>shlwapi.lib;Ws2_32.lib;mswsock.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)Mra.dll</OutputFile>
+ <AdditionalManifestDependencies>%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <IgnoreSpecificDefaultLibraries>msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>MRA.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)Mra.pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ <NoEntryPoint>false</NoEntryPoint>
+ <SetChecksum>false</SetChecksum>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <FixedBaseAddress>false</FixedBaseAddress>
+ <DataExecutionPrevention>true</DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">
+ <CustomBuildStep>
+ <Command>
+ </Command>
+ <Outputs>
+ </Outputs>
+ </CustomBuildStep>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MRA_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <AdditionalIncludeDirectories>./sdk;../../include;../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ </ClCompile>
+ <ProjectReference />
+ <Link>
+ <AdditionalDependencies>Crypt32.lib;shlwapi.lib;Ws2_32.lib;mswsock.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
+ <ModuleDefinitionFile>
+ </ModuleDefinitionFile>
+ <AddModuleNamesToAssembly>
+ </AddModuleNamesToAssembly>
+ <AssemblyLinkResource>
+ </AssemblyLinkResource>
+ <SubSystem>
+ </SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <EntryPointSymbol>
+ </EntryPointSymbol>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ <CLRThreadAttribute>
+ </CLRThreadAttribute>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">
+ <CustomBuildStep>
+ <Command>!releasex64.cmd
+</Command>
+ <Outputs>w;%(Outputs)</Outputs>
+ </CustomBuildStep>
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WIN64;NDEBUG;_WINDOWS;_USRDLL;MRA_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>
+ </DebugInformationFormat>
+ <AdditionalIncludeDirectories>./sdk;../../include;../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ </ClCompile>
+ <ProjectReference>
+ <UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
+ </ProjectReference>
+ <Link>
+ <AdditionalDependencies>shlwapi.lib;Ws2_32.lib;mswsock.lib;runtmchk.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)Mra.dll</OutputFile>
+ <AdditionalManifestDependencies>%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
+ <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
+ <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>MRA.def</ModuleDefinitionFile>
+ <AddModuleNamesToAssembly>%(AddModuleNamesToAssembly)</AddModuleNamesToAssembly>
+ <AssemblyLinkResource>%(AssemblyLinkResource)</AssemblyLinkResource>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)mra.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <EntryPointSymbol>
+ </EntryPointSymbol>
+ <NoEntryPoint>true</NoEntryPoint>
+ <SetChecksum>true</SetChecksum>
+ <RandomizedBaseAddress>true</RandomizedBaseAddress>
+ <FixedBaseAddress>false</FixedBaseAddress>
+ <DataExecutionPrevention>true</DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ <CLRThreadAttribute>DefaultThreadingAttribute</CLRThreadAttribute>
+ <CLRImageType>Default</CLRImageType>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="Mra.cpp" />
+ <ClCompile Include="Mra_functions.cpp" />
+ <ClCompile Include="Mra_options.cpp" />
+ <ClCompile Include="Mra_proto.cpp" />
+ <ClCompile Include="Mra_svcs.cpp" />
+ <ClCompile Include="MraAdvancedSearch.cpp" />
+ <ClCompile Include="MraAntiSpam.cpp" />
+ <ClCompile Include="MraAvatars.cpp" />
+ <ClCompile Include="MraChat.cpp" />
+ <ClCompile Include="MraFilesQueue.cpp" />
+ <ClCompile Include="MraIcons.cpp" />
+ <ClCompile Include="MraMPop.cpp" />
+ <ClCompile Include="MraMRIMProxy.cpp" />
+ <ClCompile Include="MraOfflineMsg.cpp" />
+ <ClCompile Include="MraPopUp.cpp" />
+ <ClCompile Include="MraRTFMsg.cpp" />
+ <ClCompile Include="MraSelectEMail.cpp" />
+ <ClCompile Include="MraSendCommand.cpp" />
+ <ClCompile Include="MraSendQueue.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Icons\Alarm.ico" />
+ <None Include="Icons\answers.ico" />
+ <None Include="Icons\AuthGrant.ico" />
+ <None Include="Icons\AuthReguest.ico" />
+ <None Include="Icons\Bagz.ico" />
+ <None Include="Icons\Blogs.ico" />
+ <None Include="Icons\BlogStatus.ico" />
+ <None Include="Icons\Chat.ico" />
+ <None Include="Icons\icon2.ico" />
+ <None Include="Icons\Info.ico" />
+ <None Include="Icons\Magent.ico" />
+ <None Include="Icons\Mail.ico" />
+ <None Include="Icons\MailNotify.ico" />
+ <None Include="MraIconAlarm.ico" />
+ <None Include="MraIconAuthGrant.ico" />
+ <None Include="MraIconAuthReguest.ico" />
+ <None Include="MraIconBagz.ico" />
+ <None Include="MraIconBlogs.ico" />
+ <None Include="MraIconChat.ico" />
+ <None Include="MraIconDeleted.ico" />
+ <None Include="MraIconInfo.ico" />
+ <None Include="MraIconMagent.ico" />
+ <None Include="MraIconMail.ico" />
+ <None Include="MraIconMailNotify.ico" />
+ <None Include="MraIconPhone.ico" />
+ <None Include="MraIconPhoto.ico" />
+ <None Include="MraIconPostCards.ico" />
+ <None Include="MraIconSMS.ico" />
+ <None Include="MraIconWebSearch.ico" />
+ <None Include="Icons\my world.ico" />
+ <None Include="Icons\Phone.ico" />
+ <None Include="Icons\Photo.ico" />
+ <None Include="Icons\PostCards.ico" />
+ <None Include="Icons\video.ico" />
+ <None Include="Icons\WebSearch.ico" />
+ <None Include="langpack_MRA_russian.txt" />
+ <None Include="Readme_MRA.txt" />
+ <None Include="TODO.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="Mra.h" />
+ <ClInclude Include="MraAntiSpam.h" />
+ <ClInclude Include="MraAvatars.h" />
+ <ClInclude Include="MraChat.h" />
+ <ClInclude Include="MraConstans.h" />
+ <ClInclude Include="MraFilesQueue.h" />
+ <ClInclude Include="MraIcons.h" />
+ <ClInclude Include="MraMPop.h" />
+ <ClInclude Include="MraMRIMProxy.h" />
+ <ClInclude Include="MraOfflineMsg.h" />
+ <ClInclude Include="MraPlaces.h" />
+ <ClInclude Include="MraPopUp.h" />
+ <ClInclude Include="MraRTFMsg.h" />
+ <ClInclude Include="MraSelectEMail.h" />
+ <ClInclude Include="MraSendCommand.h" />
+ <ClInclude Include="MraSendQueue.h" />
+ <ClInclude Include="proto.h" />
+ <ClInclude Include="resource.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_avatars.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_clist.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_clui.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_cluiframes.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_contactdir.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_contacts.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_database.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_email.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_extraicons.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_findadd.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_folders.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_fuse.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_icolib.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_ignore.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_langpack.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_music.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_netlib.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_nudge.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_options.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_plugins.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_popup.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_proto_listeningto.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_protocols.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_protomod.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_protosvc.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_system.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_updater.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_url.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_userinfo.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\m_utils.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\newpluginapi.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\statusmodes.h" />
+ <ClInclude Include="..\!Clases\include\Miranda\win2k.h" />
+ <ClInclude Include="..\!Clases\include\Base64.h" />
+ <ClInclude Include="..\!Clases\include\BuffToLowerCase.h" />
+ <ClInclude Include="..\!Clases\include\DebugFunctions.h" />
+ <ClInclude Include="..\!Clases\include\FIFOMT.h" />
+ <ClInclude Include="..\!Clases\include\InternetTime.h" />
+ <ClInclude Include="..\!Clases\include\ListMT.h" />
+ <ClInclude Include="..\!Clases\include\MemoryCompare.h" />
+ <ClInclude Include="..\!Clases\include\MemoryFind.h" />
+ <ClInclude Include="..\!Clases\include\MemoryFindByte.h" />
+ <ClInclude Include="..\!Clases\include\RC4.h" />
+ <ClInclude Include="..\!Clases\include\SHA1.h" />
+ <ClInclude Include="..\!Clases\include\SocketFunctions.h" />
+ <ClInclude Include="..\!Clases\include\StrHexToNum.h" />
+ <ClInclude Include="..\!Clases\include\StrToNum.h" />
+ <ClInclude Include="..\!Clases\include\zconf.h" />
+ <ClInclude Include="..\!Clases\include\zlib.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="resource.rc" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/MRA/Mra.vcxproj.filters b/protocols/MRA/Mra.vcxproj.filters
new file mode 100644
index 0000000000..55e8105457
--- /dev/null
+++ b/protocols/MRA/Mra.vcxproj.filters
@@ -0,0 +1,400 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{28f9c5b1-e22e-47c3-9588-4f293878aa27}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{fb50d277-d7b3-44a3-9330-fa8332ee1975}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc</Extensions>
+ </Filter>
+ <Filter Include="Header Files\Miranda">
+ <UniqueIdentifier>{725fa008-c36d-4165-8899-02f9387ed0f6}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Header Files\Functions">
+ <UniqueIdentifier>{b86b234f-e9db-45b3-97ed-47c15ca4bb75}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{482639cd-fb25-4cfb-9e55-4a299271787c}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="Mra.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Mra_functions.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Mra_options.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Mra_proto.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Mra_svcs.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="MraAdvancedSearch.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="MraAntiSpam.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="MraAvatars.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="MraChat.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="MraFilesQueue.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="MraIcons.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="MraMPop.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="MraMRIMProxy.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="MraOfflineMsg.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="MraPopUp.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="MraRTFMsg.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="MraSelectEMail.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="MraSendCommand.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="MraSendQueue.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Icons\Alarm.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Icons\answers.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Icons\AuthGrant.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Icons\AuthReguest.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Icons\Bagz.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Icons\Blogs.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Icons\BlogStatus.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Icons\Chat.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Icons\icon2.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Icons\Info.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Icons\Magent.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Icons\Mail.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Icons\MailNotify.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="MraIconAlarm.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="MraIconAuthGrant.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="MraIconAuthReguest.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="MraIconBagz.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="MraIconBlogs.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="MraIconChat.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="MraIconDeleted.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="MraIconInfo.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="MraIconMagent.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="MraIconMail.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="MraIconMailNotify.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="MraIconPhone.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="MraIconPhoto.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="MraIconPostCards.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="MraIconSMS.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="MraIconWebSearch.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Icons\my world.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Icons\Phone.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Icons\Photo.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Icons\PostCards.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Icons\video.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Icons\WebSearch.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="langpack_MRA_russian.txt" />
+ <None Include="Readme_MRA.txt" />
+ <None Include="TODO.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="Mra.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="MraAntiSpam.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="MraAvatars.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="MraChat.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="MraConstans.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="MraFilesQueue.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="MraIcons.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="MraMPop.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="MraMRIMProxy.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="MraOfflineMsg.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="MraPlaces.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="MraPopUp.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="MraRTFMsg.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="MraSelectEMail.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="MraSendCommand.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="MraSendQueue.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="proto.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_avatars.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_clist.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_clui.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_cluiframes.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_contactdir.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_contacts.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_database.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_email.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_extraicons.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_findadd.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_folders.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_fuse.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_icolib.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_ignore.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_langpack.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_music.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_netlib.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_nudge.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_options.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_plugins.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_popup.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_proto_listeningto.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_protocols.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_protomod.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_protosvc.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_system.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_updater.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_url.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_userinfo.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\m_utils.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\newpluginapi.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\statusmodes.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Miranda\win2k.h">
+ <Filter>Header Files\Miranda</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\Base64.h">
+ <Filter>Header Files\Functions</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\BuffToLowerCase.h">
+ <Filter>Header Files\Functions</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\DebugFunctions.h">
+ <Filter>Header Files\Functions</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\FIFOMT.h">
+ <Filter>Header Files\Functions</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\InternetTime.h">
+ <Filter>Header Files\Functions</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\ListMT.h">
+ <Filter>Header Files\Functions</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\MemoryCompare.h">
+ <Filter>Header Files\Functions</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\MemoryFind.h">
+ <Filter>Header Files\Functions</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\MemoryFindByte.h">
+ <Filter>Header Files\Functions</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\RC4.h">
+ <Filter>Header Files\Functions</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\SHA1.h">
+ <Filter>Header Files\Functions</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\SocketFunctions.h">
+ <Filter>Header Files\Functions</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\StrHexToNum.h">
+ <Filter>Header Files\Functions</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\StrToNum.h">
+ <Filter>Header Files\Functions</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\zconf.h">
+ <Filter>Header Files\Functions</Filter>
+ </ClInclude>
+ <ClInclude Include="..\!Clases\include\zlib.h">
+ <Filter>Header Files\Functions</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="resource.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/MRA/MraAdvancedSearch.cpp b/protocols/MRA/MraAdvancedSearch.cpp
new file mode 100644
index 0000000000..86ac51309a
--- /dev/null
+++ b/protocols/MRA/MraAdvancedSearch.cpp
@@ -0,0 +1,361 @@
+#include "Mra.h"
+#include "proto.h"
+#include "MraPlaces.h"
+
+
+
+struct FieldNames
+{
+ BYTE dwCode;
+ LPWSTR lpszText;
+};
+
+
+
+static const FieldNames GenderField[]=
+{
+ {1, L"Male"},
+ {2, L"Female"},
+ {-1, NULL}
+};
+
+static const FieldNames MonthField[]=
+{
+ {1, L"January"},
+ {2, L"February"},
+ {3, L"March"},
+ {4, L"April"},
+ {5, L"May"},
+ {6, L"June"},
+ {7, L"July"},
+ {8, L"August"},
+ {9, L"September"},
+ {10, L"October"},
+ {11, L"November"},
+ {12, L"December"},
+ {-1, NULL}
+};
+
+static const FieldNames ZodiakField[]=
+{
+ {1, L"Aries"},
+ {2, L"Taurus"},
+ {3, L"Gemini"},
+ {4, L"Cancer"},
+ {5, L"Leo"},
+ {6, L"Virgo"},
+ {7, L"Libra"},
+ {8, L"Scorpio"},
+ {9, L"Sagitarius"},
+ {10, L"Capricorn"},
+ {11, L"Aquarius"},
+ {12, L"Pisces"},
+ {-1, NULL}
+};
+
+
+
+
+
+
+void ResetComboBox(HWND hWndCombo)
+{
+ DWORD dwItem;
+
+ SendMessage(hWndCombo,CB_RESETCONTENT,0,0);
+ dwItem=SendMessage(hWndCombo,CB_ADDSTRING,0,(LPARAM)L"");
+ SendMessage(hWndCombo,CB_SETITEMDATA,dwItem,0);
+ SendMessage(hWndCombo,CB_SETCURSEL,dwItem,0);
+}
+
+
+void InitComboBox(HWND hWndCombo,FieldNames *lpNames)
+{
+ DWORD dwItem;
+
+ ResetComboBox(hWndCombo);
+
+ for (SIZE_T i=0;lpNames[i].lpszText;i++)
+ {
+ dwItem=SendMessage(hWndCombo,CB_ADDSTRING,0,(LPARAM)TranslateW(lpNames[i].lpszText));
+ SendMessage(hWndCombo,CB_SETITEMDATA,dwItem,lpNames[i].dwCode);
+ }
+}
+
+
+void InitComboBoxNumders(HWND hWndCombo,DWORD dwStart,DWORD dwEnd)
+{
+ DWORD dwItem;
+ WCHAR szBuff[MAX_PATH];
+
+ ResetComboBox(hWndCombo);
+
+ for (DWORD i=dwStart;i<=dwEnd;i++)
+ {
+ mir_sntprintf(szBuff,SIZEOF(szBuff),L"%lu",i);
+ dwItem=SendMessage(hWndCombo,CB_ADDSTRING,0,(LPARAM)szBuff);
+ SendMessage(hWndCombo,CB_SETITEMDATA,dwItem,i);
+ }
+}
+
+
+INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM lParam)
+{
+ switch(message){
+ case WM_INITDIALOG:
+ {
+ HWND hWndCombo;
+ DWORD dwItem;
+ WCHAR wszBuff[MAX_PATH];
+ SYSTEMTIME stTime;
+ GetLocalTime(&stTime);
+
+ //InitComboBox(GetDlgItem(hWndDlg,IDC_EMAIL_DOMAIN),(FieldNames*)DomainField);
+ {
+ hWndCombo=GetDlgItem(hWndDlg,IDC_EMAIL_DOMAIN);
+ ResetComboBox(hWndCombo);
+ for (SIZE_T i=0;lpcszMailRuDomains[i];i++)
+ {
+ MultiByteToWideChar(MRA_CODE_PAGE,0,lpcszMailRuDomains[i],-1,wszBuff,SIZEOF(wszBuff));
+ SendMessage(hWndCombo,CB_ADDSTRING,0,(LPARAM)wszBuff);
+ }
+ }
+ InitComboBox(GetDlgItem(hWndDlg,IDC_GENDER),(FieldNames*)GenderField);
+ InitComboBoxNumders(GetDlgItem(hWndDlg,IDC_AGERANGE_FROM),1,100);
+ InitComboBoxNumders(GetDlgItem(hWndDlg,IDC_AGERANGE_TO),1,100);
+ InitComboBoxNumders(GetDlgItem(hWndDlg,IDC_BIRTHDAY_DAY),1,31);
+ InitComboBox(GetDlgItem(hWndDlg,IDC_BIRTHDAY_MONTH),(FieldNames*)MonthField);
+ InitComboBoxNumders(GetDlgItem(hWndDlg,IDC_BIRTHDAY_YEAR),1900,(DWORD)stTime.wYear);
+ InitComboBox(GetDlgItem(hWndDlg,IDC_ZODIAK),(FieldNames*)ZodiakField);
+
+ hWndCombo=GetDlgItem(hWndDlg,IDC_COUNTRY);
+ ResetComboBox(hWndCombo);
+ for(SIZE_T i=0;mrapPlaces[i].lpszData;i++)
+ {
+ if (mrapPlaces[i].dwCityID==0 && mrapPlaces[i].dwPlaceID==0)
+ {
+ dwItem=SendMessage(hWndCombo,CB_ADDSTRING,0,(LPARAM)mrapPlaces[i].lpszData);
+ SendMessage(hWndCombo,CB_SETITEMDATA,dwItem,mrapPlaces[i].dwCountryID);
+ }
+ }
+
+
+ ResetComboBox(GetDlgItem(hWndDlg,IDC_CITY));
+
+ if (DB_Mra_GetByte(NULL,"AdvancedSearchRemember",MRA_DEFAULT_SEARCH_REMEMBER))
+ {
+ SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_GENDER,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchGender",0),0);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_AGERANGE_FROM,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchAgeFrom",0),0);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_AGERANGE_TO,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchAgeTo",0),0);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BIRTHDAY_MONTH,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchBirthDayMonth",0),0);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BIRTHDAY_DAY,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchBirthDayDay",0),0);
+
+ SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_ZODIAK,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchZodiakID",0),0);
+
+
+ SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_COUNTRY,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchCountryID",0),0);
+ SendMessageW(hWndDlg,WM_COMMAND,(WPARAM)MAKELONG(IDC_COUNTRY,CBN_SELCHANGE),(LPARAM)GetDlgItem(hWndDlg,IDC_COUNTRY));
+
+ SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_STATE,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchStateID",0),0);
+ SendMessageW(hWndDlg,WM_COMMAND,(WPARAM)MAKELONG(IDC_STATE,CBN_SELCHANGE),(LPARAM)GetDlgItem(hWndDlg,IDC_STATE));
+
+ SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_CITY,CB_SETCURSEL,DB_Mra_GetWord(NULL,"AdvancedSearchCityID",0),0);
+
+
+ CHECK_DLG_BUTTON(hWndDlg,IDC_ONLINEONLY,DB_Mra_GetByte(NULL,"AdvancedSearchOnlineOnly",FALSE));
+ CHECK_DLG_BUTTON(hWndDlg,IDC_CHK_REMEMBER,TRUE);
+ }
+ TranslateDialogDefault(hWndDlg);
+ }
+ return(TRUE);
+ case WM_DESTROY:
+ {
+ /*dwUserSize=GET_DLG_ITEM_TEXTA(hWndDlg,IDC_EMAIL_USER,szUser,SIZEOF(szUser));
+ dwDomainSize=GET_DLG_ITEM_TEXTA(hWndDlg,IDC_EMAIL_DOMAIN,szDomain,SIZEOF(szDomain));
+
+ dwNickNameSize=GET_DLG_ITEM_TEXT(hWndDlg,IDC_NICK,wszNickName,SIZEOF(wszNickName));
+
+ dwFirstNameSize=GET_DLG_ITEM_TEXT(hWndDlg,IDC_FIRSTNAME,wszFirstName,SIZEOF(wszFirstName));
+
+ dwLastNameSize=GET_DLG_ITEM_TEXT(hWndDlg,IDC_LASTNAME,wszLastName,SIZEOF(wszLastName));*/
+
+ DB_Mra_SetWord(NULL,"AdvancedSearchGender",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_GENDER,CB_GETCURSEL,0,0));
+ DB_Mra_SetWord(NULL,"AdvancedSearchAgeFrom",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_AGERANGE_FROM,CB_GETCURSEL,0,0));
+ DB_Mra_SetWord(NULL,"AdvancedSearchAgeTo",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_AGERANGE_TO,CB_GETCURSEL,0,0));
+ DB_Mra_SetWord(NULL,"AdvancedSearchBirthDayMonth",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BIRTHDAY_MONTH,CB_GETCURSEL,0,0));
+ DB_Mra_SetWord(NULL,"AdvancedSearchBirthDayDay",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BIRTHDAY_DAY,CB_GETCURSEL,0,0));
+
+ DB_Mra_SetWord(NULL,"AdvancedSearchZodiakID",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_ZODIAK,CB_GETCURSEL,0,0));
+
+ DB_Mra_SetWord(NULL,"AdvancedSearchCityID",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_CITY,CB_GETCURSEL,0,0));
+ DB_Mra_SetWord(NULL,"AdvancedSearchStateID",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_STATE,CB_GETCURSEL,0,0));
+ DB_Mra_SetWord(NULL,"AdvancedSearchCountryID",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_COUNTRY,CB_GETCURSEL,0,0));
+
+ DB_Mra_SetByte(NULL,"AdvancedSearchOnlineOnly",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_ONLINEONLY));
+ DB_Mra_SetByte(NULL,"AdvancedSearchRemember",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_CHK_REMEMBER));
+ }
+ break;
+ case WM_COMMAND:
+ switch(LOWORD(wParam)){
+ case IDOK:
+ SendMessage(GetParent(hWndDlg),WM_COMMAND,MAKEWPARAM(IDOK,BN_CLICKED),(LPARAM)GetDlgItem(GetParent(hWndDlg),IDOK));
+ break;
+ case IDC_AGERANGE_FROM:
+ case IDC_AGERANGE_TO:
+ if (HIWORD(wParam)==CBN_SELCHANGE)
+ {
+ if (LOWORD(wParam)==IDC_AGERANGE_FROM)
+ {
+ DWORD dwAgeFrom,dwAgeTo;
+
+ dwAgeFrom=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_AGERANGE_FROM);
+ dwAgeTo=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_AGERANGE_TO);
+ if (dwAgeFrom==0) dwAgeFrom++;
+ InitComboBoxNumders(GetDlgItem(hWndDlg,IDC_AGERANGE_TO),dwAgeFrom,100);
+ SendMessage(GetDlgItem(hWndDlg,IDC_AGERANGE_TO),CB_SETCURSEL,((dwAgeTo-dwAgeFrom)+1),0);
+ }
+ SendMessage(GetDlgItem(hWndDlg,IDC_BIRTHDAY_YEAR),CB_SETCURSEL,0,0);
+ }
+ break;
+ case IDC_BIRTHDAY_DAY:
+ case IDC_BIRTHDAY_MONTH:
+ case IDC_BIRTHDAY_YEAR:
+ if (HIWORD(wParam)==CBN_SELCHANGE)
+ {
+ DWORD dwAge;
+ SYSTEMTIME stTime={0};
+
+ stTime.wYear=(WORD)GET_CURRENT_COMBO_DATA(hWndDlg,IDC_BIRTHDAY_YEAR);
+ stTime.wMonth=(WORD)GET_CURRENT_COMBO_DATA(hWndDlg,IDC_BIRTHDAY_MONTH);
+ stTime.wDay=(WORD)GET_CURRENT_COMBO_DATA(hWndDlg,IDC_BIRTHDAY_DAY);
+
+ dwAge=GetYears(&stTime);
+ SendMessage(GetDlgItem(hWndDlg,IDC_AGERANGE_FROM),CB_SETCURSEL,dwAge,0);
+ SendMessage(GetDlgItem(hWndDlg,IDC_AGERANGE_TO),CB_SETCURSEL,dwAge,0);
+ SendMessage(GetDlgItem(hWndDlg,IDC_ZODIAK),CB_SETCURSEL,0,0);
+ }
+ break;
+ case IDC_ZODIAK:
+ if (HIWORD(wParam)==CBN_SELCHANGE)
+ {
+ SendMessage(GetDlgItem(hWndDlg,IDC_BIRTHDAY_DAY),CB_SETCURSEL,0,0);
+ SendMessage(GetDlgItem(hWndDlg,IDC_BIRTHDAY_MONTH),CB_SETCURSEL,0,0);
+ //SendMessage(GetDlgItem(hWndDlg,IDC_BIRTHDAY_YEAR),CB_SETCURSEL,0,0);
+ }
+ break;
+ case IDC_COUNTRY:
+ if (HIWORD(wParam)==CBN_SELCHANGE)
+ {
+ HWND hWndCombo;
+ DWORD dwItem,dwCountryID;
+
+ dwCountryID=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_COUNTRY);
+ hWndCombo=GetDlgItem(hWndDlg,IDC_STATE);
+ SendMessage(hWndCombo,CB_RESETCONTENT,0,0);
+ ResetComboBox(GetDlgItem(hWndDlg,IDC_CITY));
+ dwItem=SendMessage(hWndCombo,CB_ADDSTRING,0,(LPARAM)L"");
+ SendMessage(hWndCombo,CB_SETITEMDATA,dwItem,0);
+ SendMessage(hWndCombo,CB_SETCURSEL,dwItem,0);
+
+ for(SIZE_T i=0;mrapPlaces[i].lpszData;i++)
+ {
+ if (mrapPlaces[i].dwCountryID==dwCountryID && mrapPlaces[i].dwCityID && mrapPlaces[i].dwPlaceID==0)
+ {
+ dwItem=SendMessage(hWndCombo,CB_ADDSTRING,0,(LPARAM)mrapPlaces[i].lpszData);
+ SendMessage(hWndCombo,CB_SETITEMDATA,dwItem,mrapPlaces[i].dwCityID);
+ }
+ }
+ }
+ break;
+ case IDC_STATE:
+ if (HIWORD(wParam)==CBN_SELCHANGE)
+ {
+ HWND hWndCombo;
+ DWORD dwItem,dwCountryID,dwStateID;
+
+ dwCountryID=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_COUNTRY);
+ dwStateID=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_STATE);
+ hWndCombo=GetDlgItem(hWndDlg,IDC_CITY);
+ SendMessage(hWndCombo,CB_RESETCONTENT,0,0);
+ dwItem=SendMessage(hWndCombo,CB_ADDSTRING,0,(LPARAM)L"");
+ SendMessage(hWndCombo,CB_SETITEMDATA,dwItem,0);
+ SendMessage(hWndCombo,CB_SETCURSEL,dwItem,0);
+
+ for(SIZE_T i=0;mrapPlaces[i].lpszData;i++)
+ {
+ if (mrapPlaces[i].dwCountryID==dwCountryID && mrapPlaces[i].dwCityID==dwStateID && mrapPlaces[i].dwPlaceID)
+ {
+ dwItem=SendMessage(hWndCombo,CB_ADDSTRING,0,(LPARAM)mrapPlaces[i].lpszData);
+ SendMessage(hWndCombo,CB_SETITEMDATA,dwItem,mrapPlaces[i].dwPlaceID);
+ }
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+return(FALSE);
+}
+
+
+DWORD AdvancedSearchFromDlg(HWND hWndDlg)
+{
+ DWORD dwRequestFlags=0;
+ CHAR szUser[MAX_PATH],szDomain[MAX_PATH];
+ WCHAR wszNickName[MAX_PATH],wszFirstName[MAX_PATH],wszLastName[MAX_PATH];
+ SIZE_T dwUserSize,dwDomainSize,dwNickNameSize,dwFirstNameSize,dwLastNameSize;
+ DWORD dwSex,dwDate1,dwDate2,dwCityID,dwZodiak,dwBirthdayMonth,dwBirthdayDay,dwCountryID,dwOnline;
+
+
+ dwUserSize=GET_DLG_ITEM_TEXTA(hWndDlg,IDC_EMAIL_USER,szUser,SIZEOF(szUser));
+ dwDomainSize=GET_DLG_ITEM_TEXTA(hWndDlg,IDC_EMAIL_DOMAIN,szDomain,SIZEOF(szDomain));
+ if (dwUserSize && dwDomainSize)
+ {
+ SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_USER);
+ SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_DOMAIN);
+ }
+
+ dwNickNameSize=GET_DLG_ITEM_TEXT(hWndDlg,IDC_NICK,wszNickName,SIZEOF(wszNickName));
+ if (dwNickNameSize) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_NICKNAME);
+
+ dwFirstNameSize=GET_DLG_ITEM_TEXT(hWndDlg,IDC_FIRSTNAME,wszFirstName,SIZEOF(wszFirstName));
+ if (dwFirstNameSize) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_FIRSTNAME);
+
+ dwLastNameSize=GET_DLG_ITEM_TEXT(hWndDlg,IDC_LASTNAME,wszLastName,SIZEOF(wszLastName));
+ if (dwLastNameSize) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_LASTNAME);
+
+ dwSex=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_GENDER);
+ if (dwSex) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_SEX);
+
+ dwDate1=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_AGERANGE_FROM);
+ if (dwDate1) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_DATE1);
+
+ dwDate2=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_AGERANGE_TO);
+ if (dwDate2) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_DATE2);
+
+ dwCityID=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_CITY);
+ if (dwCityID==0) dwCityID=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_STATE);
+ if (dwCityID) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_CITY_ID);
+
+ dwZodiak=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_ZODIAK);
+ if (dwZodiak) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_ZODIAC);
+
+ dwBirthdayMonth=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_BIRTHDAY_MONTH);
+ if (dwBirthdayMonth) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_MONTH);
+
+ dwBirthdayDay=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_BIRTHDAY_DAY);
+ if (dwBirthdayMonth) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_DAY);
+
+ dwCountryID=GET_CURRENT_COMBO_DATA(hWndDlg,IDC_COUNTRY);
+ if (dwCountryID) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_COUNTRY_ID);
+
+
+ dwOnline=IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_ONLINEONLY);
+ if (dwOnline) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_ONLINE);
+
+return(MraSendCommand_WPRequestW(NULL,ACKTYPE_SEARCH,dwRequestFlags,szUser,dwUserSize,szDomain,dwDomainSize,wszNickName,dwNickNameSize,wszFirstName,dwFirstNameSize,wszLastName,dwLastNameSize,dwSex,dwDate1,dwDate2,dwCityID,dwZodiak,dwBirthdayMonth,dwBirthdayDay,dwCountryID,dwOnline));
+} \ No newline at end of file
diff --git a/protocols/MRA/MraAntiSpam.cpp b/protocols/MRA/MraAntiSpam.cpp
new file mode 100644
index 0000000000..38607c2107
--- /dev/null
+++ b/protocols/MRA/MraAntiSpam.cpp
@@ -0,0 +1,540 @@
+// started: 19.12.2006
+
+#include "Mra.h"
+#include "MraAntiSpam.h"
+#include "MraRTFMsg.h"
+
+
+typedef struct
+{
+ LPWSTR lpwszBadWord;
+ DWORD dwBadWordLen;
+} MRA_ANTISPAM_BAD_WORD;
+
+static MRA_ANTISPAM_BAD_WORD *pmabwBadWords=NULL;
+static SIZE_T dwBadWordsCount=0;
+
+
+
+#define MRA_ANTISPAM_PREALLOC_COUNT 256
+SIZE_T MraAntiSpamLoadBadWordsW()
+{
+ SIZE_T dwRet=0;
+
+ char szSettingName[MAX_PATH];
+ SIZE_T i=0,dwValueSize,dwAllocatedItemsCount=MRA_ANTISPAM_PREALLOC_COUNT;
+ DBVARIANT dbv={0};
+ DBCONTACTGETSETTING sVal={0};
+
+ dbv.type=DBVT_WCHAR;
+ sVal.pValue=&dbv;
+ sVal.szModule=PROTOCOL_NAMEA;
+ sVal.szSetting=szSettingName;
+
+
+ if (pmabwBadWords || dwBadWordsCount) MraAntiSpamFreeBadWords();
+
+ pmabwBadWords=(MRA_ANTISPAM_BAD_WORD*)MEMALLOC((sizeof(MRA_ANTISPAM_BAD_WORD)*dwAllocatedItemsCount));
+
+ for(i=0;TRUE;i++)
+ {
+ mir_snprintf(szSettingName,SIZEOF(szSettingName),"AntiSpamBadWord %lu",i);
+ dbv.type=DBVT_WCHAR;
+ if (CallService(MS_DB_CONTACT_GETSETTING_STR,NULL,(LPARAM)&sVal))
+ {
+ break;
+ }else{
+ if (dwAllocatedItemsCount==i)
+ {
+ dwAllocatedItemsCount+=MRA_ANTISPAM_PREALLOC_COUNT;
+ pmabwBadWords=(MRA_ANTISPAM_BAD_WORD*)MEMREALLOC(pmabwBadWords,(sizeof(MRA_ANTISPAM_BAD_WORD)*dwAllocatedItemsCount));
+ if (pmabwBadWords==NULL) break;
+ }
+
+ dwValueSize=lstrlenW(dbv.pwszVal);
+ pmabwBadWords[i].lpwszBadWord=(LPWSTR)MEMALLOC((dwValueSize*sizeof(WCHAR)));
+ if (pmabwBadWords[i].lpwszBadWord)
+ {//BuffToLowerCase(szValue,dbv.pszVal,dwValueSize);
+ memmove(pmabwBadWords[i].lpwszBadWord,dbv.pwszVal,(dwValueSize*sizeof(WCHAR)));
+ CharLowerBuffW(pmabwBadWords[i].lpwszBadWord,dwValueSize);
+ pmabwBadWords[i].dwBadWordLen=dwValueSize;
+ }
+ DBFreeVariant(&dbv);
+
+ if (pmabwBadWords[i].lpwszBadWord==NULL) break;
+ }
+ }
+ dwBadWordsCount=i;
+
+return(dwRet);
+}
+
+
+void MraAntiSpamFreeBadWords()
+{
+ SIZE_T i;
+
+ for(i=0;i<dwBadWordsCount;i++)
+ {
+ if (pmabwBadWords[i].lpwszBadWord) MEMFREE(pmabwBadWords[i].lpwszBadWord);
+ }
+
+ MEMFREE(pmabwBadWords);
+ dwBadWordsCount=0;
+}
+
+
+
+
+void MraAntiSpamEnableControls(HWND hWndDlg,BOOL bEnabled)
+{
+ WORD wMraAntiSpamControlsList[]={
+ IDC_CHK_TEMP_CONTACTS,
+ IDC_CLN_NON_ALPHNUM,
+ IDC_MAX_LANG_CHANGES,
+ IDC_SHOWPOPUP,
+ IDC_WRITETOSYSTEMHISTORY,
+ IDC_SEND_SPAM_REPORT_TO_SERVER,
+ IDC_BAD_WORDS_LIST,
+ IDC_EDIT_BAD_WORD,
+ IDC_BUTTON_ADD,
+ IDC_BUTTONREMOVE,
+ IDC_BUTTON_DEFAULT
+ };
+
+ EnableControlsArray(hWndDlg,(WORD*)&wMraAntiSpamControlsList,SIZEOF(wMraAntiSpamControlsList),bEnabled);
+ EnableWindow(GetDlgItem(hWndDlg,IDC_DELETE_SPAMBOT_CONTACT),(bEnabled && IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_CHK_TEMP_CONTACTS)));
+}
+
+INT_PTR CALLBACK MraAntiSpamDlgProcOpts(HWND hWndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
+{
+ switch(msg){
+ case WM_INITDIALOG:
+ {
+ TranslateDialogDefault(hWndDlg);
+
+ CHECK_DLG_BUTTON(hWndDlg,IDC_ENABLE,DB_Mra_GetByte(NULL,"AntiSpamEnable",MRA_ANTISPAM_DEFAULT_ENABLE));
+ CHECK_DLG_BUTTON(hWndDlg,IDC_CHK_TEMP_CONTACTS,DB_Mra_GetByte(NULL,"AntiSpamCheckTempContacts",MRA_ANTISPAM_DEFAULT_CHK_TEMP_CONTACTS));
+ CHECK_DLG_BUTTON(hWndDlg,IDC_DELETE_SPAMBOT_CONTACT,DB_Mra_GetByte(NULL,"AntiSpamDeteleSpamBotContacts",MRA_ANTISPAM_DEFAULT_DELETE_SPAMBOT_CONTACT));
+ CHECK_DLG_BUTTON(hWndDlg,IDC_CLN_NON_ALPHNUM,DB_Mra_GetByte(NULL,"AntiSpamCleanNonAlphaNumeric",MRA_ANTISPAM_DEFAULT_CLN_NON_ALPHNUM));
+ SetDlgItemInt(hWndDlg,IDC_MAX_LANG_CHANGES,DB_Mra_GetDword(NULL,"AntiSpamMaxLangChanges",MRA_ANTISPAM_DEFAULT_MAX_LNG_CHANGES),FALSE);
+ CHECK_DLG_BUTTON(hWndDlg,IDC_SHOWPOPUP,DB_Mra_GetByte(NULL,"AntiSpamShowPopUp",MRA_ANTISPAM_DEFAULT_SHOWPOP));
+ CHECK_DLG_BUTTON(hWndDlg,IDC_WRITETOSYSTEMHISTORY,DB_Mra_GetByte(NULL,"AntiSpamWriteToSystemHistory",MRA_ANTISPAM_DEFAULT_WRITETOSYSTEMHISTORY));
+ CHECK_DLG_BUTTON(hWndDlg,IDC_SEND_SPAM_REPORT_TO_SERVER,DB_Mra_GetByte(NULL,"AntiSpamSendSpamReportToSrv",MRA_ANTISPAM_DEFAULT_SEND_SPAM_REPORT_TO_SERVER));
+
+
+ {// fill list
+ char szSettingName[MAX_PATH];
+ WCHAR wszBuff[MAX_PATH];
+
+ SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_RESETCONTENT,0,0);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_INITSTORAGE,(WPARAM)1024,(LPARAM)32768);
+ for(SIZE_T i=0;TRUE;i++)
+ {
+ mir_snprintf(szSettingName,SIZEOF(szSettingName),"AntiSpamBadWord %lu",i);
+ if (DB_Mra_GetStaticStringW(NULL,szSettingName,wszBuff,SIZEOF(wszBuff),NULL))
+ {
+ if (SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_FINDSTRING,-1,(LPARAM)wszBuff)==LB_ERR) SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_ADDSTRING,0,(LPARAM)wszBuff);
+ }else{
+ break;
+ }
+ }
+ }
+ //SET_DLG_ITEM_TEXTW(hWndDlg,IDC_EDIT_BAD_WORD,L"");
+
+ MraAntiSpamEnableControls(hWndDlg,IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_ENABLE));
+ }
+ return(TRUE);
+ case WM_COMMAND:
+ if (LOWORD(wParam)==IDC_ENABLE)
+ {
+ MraAntiSpamEnableControls(hWndDlg,IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_ENABLE));
+ }
+
+ if (LOWORD(wParam)==IDC_CHK_TEMP_CONTACTS)
+ {
+ EnableWindow(GetDlgItem(hWndDlg,IDC_DELETE_SPAMBOT_CONTACT),IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_CHK_TEMP_CONTACTS));
+ }
+
+ if (LOWORD(wParam)==IDC_BUTTON_ADD)
+ {
+ WCHAR szBadWord[MAX_PATH];
+
+ if (GET_DLG_ITEM_TEXT(hWndDlg,IDC_EDIT_BAD_WORD,szBadWord,SIZEOF(szBadWord)))
+ {
+ SET_DLG_ITEM_TEXTW(hWndDlg,IDC_EDIT_BAD_WORD,L"");
+ if (SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_FINDSTRING,-1,(LPARAM)szBadWord)==LB_ERR) SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_ADDSTRING,0,(LPARAM)szBadWord);
+ }
+ }
+
+ if (LOWORD(wParam)==IDC_BUTTONREMOVE)
+ {
+ SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_DELETESTRING,SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_GETCURSEL,0,0),0);
+ }
+
+ if (LOWORD(wParam)==IDC_BUTTON_DEFAULT)
+ {
+ MraAntiSpamResetBadWordsList();
+ {// fill list
+ char szSettingName[MAX_PATH];
+ WCHAR wszBuff[MAX_PATH];
+
+ SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_RESETCONTENT,0,0);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_INITSTORAGE,(WPARAM)1024,(LPARAM)32768);
+ for(SIZE_T i=0;TRUE;i++)
+ {
+ mir_snprintf(szSettingName,SIZEOF(szSettingName),"AntiSpamBadWord %lu",i);
+ if (DB_Mra_GetStaticStringW(NULL,szSettingName,wszBuff,SIZEOF(wszBuff),NULL))
+ {
+ if (SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_FINDSTRING,-1,(LPARAM)wszBuff)==LB_ERR) SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_ADDSTRING,0,(LPARAM)wszBuff);
+ }else{
+ break;
+ }
+ }
+ }
+ MraAntiSpamLoadBadWordsW();
+ }
+
+ if ((LOWORD(wParam)==IDC_EDIT_BAD_WORD) && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus()) ) return(0);
+ SendMessage(GetParent(hWndDlg),PSM_CHANGED,0,0);
+ break;
+ case WM_NOTIFY:
+ switch (((LPNMHDR)lParam)->code){
+ case PSN_APPLY:
+ {
+ char szSettingName[MAX_PATH];
+ WCHAR szBadWord[MAX_PATH];
+ SIZE_T i,dwCount;
+
+ DBWriteContactSettingByte(NULL,PROTOCOL_NAMEA,"AntiSpamEnable",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_ENABLE));
+ DBWriteContactSettingByte(NULL,PROTOCOL_NAMEA,"AntiSpamCheckTempContacts",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_CHK_TEMP_CONTACTS));
+ DBWriteContactSettingByte(NULL,PROTOCOL_NAMEA,"AntiSpamDeteleSpamBotContacts",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_DELETE_SPAMBOT_CONTACT));
+ DBWriteContactSettingByte(NULL,PROTOCOL_NAMEA,"AntiSpamCleanNonAlphaNumeric",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_CLN_NON_ALPHNUM));
+ DB_Mra_SetDword(NULL,"AntiSpamMaxLangChanges",(DWORD)GetDlgItemInt(hWndDlg,IDC_MAX_LANG_CHANGES,NULL,FALSE));
+ DBWriteContactSettingByte(NULL,PROTOCOL_NAMEA,"AntiSpamShowPopUp",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_SHOWPOPUP));
+ DBWriteContactSettingByte(NULL,PROTOCOL_NAMEA,"AntiSpamWriteToSystemHistory",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_WRITETOSYSTEMHISTORY));
+ DBWriteContactSettingByte(NULL,PROTOCOL_NAMEA,"AntiSpamSendSpamReportToSrv",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_SEND_SPAM_REPORT_TO_SERVER));
+
+ dwCount=SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_GETCOUNT,0,0);
+ for(i=0;i<dwCount;i++)
+ {
+ mir_snprintf(szSettingName,SIZEOF(szSettingName),"AntiSpamBadWord %lu",i);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_BAD_WORDS_LIST,LB_GETTEXT,i,(LPARAM)szBadWord);
+ DB_Mra_SetStringW(NULL,szSettingName,szBadWord);
+ }
+
+ dwCount=((i*2)+1024);
+ for(;i<dwCount;i++)
+ {
+ mir_snprintf(szSettingName,SIZEOF(szSettingName),"AntiSpamBadWord %lu",i);
+ DB_Mra_DeleteValue(NULL,szSettingName);
+ }
+
+ MraAntiSpamLoadBadWordsW();
+ }
+ return(TRUE);
+ }
+ break;
+ }
+return(FALSE);
+}
+
+
+void MraAntiSpamResetBadWordsList()
+{
+ char szSettingName[MAX_PATH];
+ SIZE_T i,dwMax;
+ LPWSTR lpwszBadWords[]=
+ {
+ // web words
+ L"@",L"http://",L"ftp://",L"www",L"wap.",L".com",L".org",L".info",L".net",L".ua",L".uz",L".to",L".biz",L".vu",L".ru",L"mailto:",L"ICQ",L"SKYPE",
+
+ // spam words
+ L"sex",L"seks",L"sekc",L"xxx",L"phorno",L"video",L"photo",L"SMS",L"WMZ",L"WMR",L"narod",L"ucoz",L"ref",L"Agent",L"+7",L"495",L"$",L"spam",L"URL",L"%2E",
+
+ // spam words rus
+ L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",L"",
+
+ // executable
+ L".ade",L".adp",L".bas",L".bat",L".chm",L".cmd",L".com",L".cpl",L".crt",L".exe",L".hlp",L".hta",L".inf",L".ins",L".isp",L".js",L".jse",L".lnk",L".mdb",L".mde",L".msc",L".msi",L".msp",L".mst",L".pcd",L".pif",L".reg",L".scr",L".sct",L".shs",L".shb",L".url",L".vb",L".vbe",L".vbs",L".wsc",L".wsf",L".wsh",
+
+ // archives
+ L".zip",L".rar",L".cab",L".arj",L".tar",L".gz",L".zoo",L".lzh",L".jar",L".ace",L".z",L".iso",L".bz2",L".uue",L".gzip",
+
+ NULL
+ };
+
+ for(i=0;lpwszBadWords[i];i++)
+ {
+ mir_snprintf(szSettingName,SIZEOF(szSettingName),"AntiSpamBadWord %lu",i);
+ DB_Mra_SetStringW(NULL,szSettingName,lpwszBadWords[i]);
+ }
+
+ dwMax=(i+1024);
+ for(;i<dwMax;i++)
+ {
+ mir_snprintf(szSettingName,SIZEOF(szSettingName),"AntiSpamBadWord %lu",i);
+ DB_Mra_DeleteValue(NULL,szSettingName);
+ }
+}
+
+
+BOOL MraAntiSpamIsCharExcepted(WCHAR wcTestChar)
+{
+ BOOL bRet=FALSE;
+ SIZE_T i;
+ LPWSTR lpwszExceptedChars=L"\r\n .,<>//?;:'\"\\][}{`-=~!@#$%^&*()_+1234567890";
+
+ //lstrlenW(lpwszExceptedChars)=46
+ for(i=0;i<46;i++)
+ {
+ if (lpwszExceptedChars[i]==wcTestChar)
+ {
+ bRet=TRUE;
+ break;
+ }
+ }
+return(bRet);
+}
+
+
+SIZE_T MraAntiSpamCalcLangChanges(LPWSTR lpwszMessage,SIZE_T dwMessageSize)
+{
+ SIZE_T dwRet=0;
+
+ if (lpwszMessage && dwMessageSize)
+ {
+ WCHAR wcPrevChar=0;
+ SIZE_T i;
+
+ for(i=1;i<dwMessageSize;i++)
+ {
+ if (MraAntiSpamIsCharExcepted(lpwszMessage[i])==FALSE)
+ {
+ if (wcPrevChar)
+ if ( (max(wcPrevChar,lpwszMessage[i])-min(wcPrevChar,lpwszMessage[i])) > 255)
+ {
+ dwRet++;
+ }
+ wcPrevChar=lpwszMessage[i];
+ }
+ }
+ }
+return(dwRet);
+}
+
+
+SIZE_T MraAntiSpamCleanNonAlphaNumeric(LPWSTR lpwszMessage,SIZE_T dwMessageSize)
+{
+ SIZE_T dwRet=0;
+
+ if (lpwszMessage && dwMessageSize)
+ {
+ LPWSTR lpwszCurWritePos=lpwszMessage;
+ SIZE_T i;
+
+ for(i=0;i<dwMessageSize;i++)
+ {
+ if (IsCharAlphaNumeric(lpwszMessage[i])) (*lpwszCurWritePos++)=lpwszMessage[i];
+ }
+
+ (*lpwszCurWritePos)=0;
+ dwRet=(lpwszCurWritePos-lpwszMessage);
+ }
+return(dwRet);
+}
+
+
+BOOL MraAntiSpamTestMessageForBadWordsW(LPWSTR lpwszMessage,SIZE_T dwMessageSize)
+{
+ BOOL bRet=FALSE;
+
+ if (lpwszMessage && dwMessageSize)
+ {
+ for(SIZE_T i=0;i<dwBadWordsCount;i++)
+ {
+ if (MemoryFind(0,lpwszMessage,(dwMessageSize*sizeof(WCHAR)),pmabwBadWords[i].lpwszBadWord,(pmabwBadWords[i].dwBadWordLen*sizeof(WCHAR))))
+ {
+ bRet=TRUE;
+ break;
+ }
+ }
+ }
+return(bRet);
+}
+
+
+
+BOOL MraAntiSpamHasMessageBadWordsW(LPWSTR lpwszMessage,SIZE_T dwMessageSize)
+{
+ BOOL bRet=FALSE;
+
+ if (lpwszMessage && dwMessageSize)
+ {
+ LPWSTR lpwszMessageConverted;
+
+ lpwszMessageConverted=(LPWSTR)MEMALLOC((dwMessageSize*sizeof(WCHAR)));
+ if (lpwszMessageConverted)
+ {
+ SIZE_T dwtm;
+
+ /*{
+ HANDLE hFile=CreateFile(L"C:\\Documents and Settings\\Rozhuk_IM\\ \\spam_raw.txt",GENERIC_WRITE,FILE_SHARE_READ,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
+
+ if (hFile!=INVALID_HANDLE_VALUE)
+ {
+ WriteFile(hFile,lpwszMessageConverted,(dwMessageSize*sizeof(WCHAR)),&i,NULL);
+ CloseHandle(hFile);
+ }
+ }//*/
+
+ //
+ {//BuffToLowerCase(lpszMessageConverted,lpszMessage,dwMessageSize);
+ memmove(lpwszMessageConverted,lpwszMessage,(dwMessageSize*sizeof(WCHAR)));
+ CharLowerBuffW(lpwszMessageConverted,dwMessageSize);
+ }
+
+ // 1 :
+ dwtm=DB_Mra_GetDword(NULL,"AntiSpamMaxLangChanges",MRA_ANTISPAM_DEFAULT_MAX_LNG_CHANGES);
+ if (dwtm)
+ {
+ if (dwtm<=MraAntiSpamCalcLangChanges(lpwszMessageConverted,dwMessageSize)) bRet=TRUE;
+ }
+
+ // 2 :
+ if (bRet==FALSE) bRet=MraAntiSpamTestMessageForBadWordsW(lpwszMessageConverted,dwMessageSize);
+
+ // 3 : +
+ if (bRet==FALSE)
+ if (DB_Mra_GetByte(NULL,"AntiSpamCleanNonAlphaNumeric",MRA_ANTISPAM_DEFAULT_ENABLE))
+ {
+ dwMessageSize=MraAntiSpamCleanNonAlphaNumeric(lpwszMessageConverted,dwMessageSize);
+ bRet=MraAntiSpamTestMessageForBadWordsW(lpwszMessageConverted,dwMessageSize);
+ }
+
+
+ MEMFREE(lpwszMessageConverted);
+ }
+ }
+return(bRet);
+}
+
+
+DWORD MraAntiSpamReceivedMessageW(LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwMessageFlags,LPWSTR lpwszMessage,SIZE_T dwMessageSize)
+{
+ DWORD dwRet=MESSAGE_NOT_SPAM;;
+
+ if ((dwMessageFlags&(MESSAGE_FLAG_SYSTEM|MESSAGE_FLAG_CONTACT|MESSAGE_FLAG_NOTIFY|MESSAGE_FLAG_SMS|MESSAGE_SMS_DELIVERY_REPORT|MESSAGE_FLAG_ALARM|MESSAGE_FLAG_MULTICHAT))==0)
+ if (DB_Mra_GetByte(NULL,"AntiSpamEnable",MRA_ANTISPAM_DEFAULT_ENABLE))
+ if (IsEMailChatAgent(lpszEMail,dwEMailSize)==FALSE)
+ {// enabled, message mast be cheked
+ BOOL bCheckMessage=TRUE;
+ HANDLE hContact;
+
+ dwRet=MESSAGE_SPAM;
+ hContact=MraHContactFromEmail(lpszEMail,dwEMailSize,FALSE,TRUE,NULL);
+ if (hContact)
+ {
+ DWORD dwID,dwGroupID,dwContactFlag,dwContactSeverFlags;
+
+ GetContactBasicInfoW(hContact,&dwID,&dwGroupID,&dwContactFlag,&dwContactSeverFlags,NULL,NULL,0,NULL,NULL,0,NULL,NULL,0,NULL);
+ if ((dwID!=-1 && DBGetContactSettingByte(hContact,"CList","NotOnList",0)==0) || dwGroupID==-2)
+ {// not temp contact, OK
+ bCheckMessage=FALSE;
+ dwRet=MESSAGE_NOT_SPAM;
+ }else{// temp contact
+ if (DB_Mra_GetByte(NULL,"AntiSpamCheckTempContacts",MRA_ANTISPAM_DEFAULT_CHK_TEMP_CONTACTS)==FALSE ||
+ (((dwMessageFlags&MESSAGE_FLAG_AUTHORIZE) && DB_Mra_GetByte(NULL,"AutoAuthGrandNewUsers",MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS) && DB_Mra_GetByte(NULL,"AutoAuthGrandNewUsersDisableSPAMCheck",MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK))) )
+ {//
+ bCheckMessage=FALSE;
+ dwRet=MESSAGE_NOT_SPAM;
+ }
+ }
+ }
+
+ if (bCheckMessage)
+ {
+ if (MraAntiSpamHasMessageBadWordsW(lpwszMessage,dwMessageSize)==FALSE)
+ {//
+ dwRet=MESSAGE_NOT_SPAM;
+ }
+ }
+
+ if (dwRet==MESSAGE_SPAM)
+ {
+ BOOL bAntiSpamShowPopUp,bAntiSpamWriteToSystemHistory,bAntiSpamDeteleSpamBotContacts;
+
+ bAntiSpamShowPopUp=(BOOL)DB_Mra_GetByte(NULL,"AntiSpamShowPopUp",MRA_ANTISPAM_DEFAULT_SHOWPOP);
+ bAntiSpamWriteToSystemHistory=(BOOL)DB_Mra_GetByte(NULL,"AntiSpamWriteToSystemHistory",MRA_ANTISPAM_DEFAULT_WRITETOSYSTEMHISTORY);
+ bAntiSpamDeteleSpamBotContacts=(BOOL)DB_Mra_GetByte(NULL,"AntiSpamDeteleSpamBotContacts",MRA_ANTISPAM_DEFAULT_DELETE_SPAMBOT_CONTACT);
+
+ if (bAntiSpamShowPopUp || bAntiSpamWriteToSystemHistory)
+ {
+ char szEMail[MAX_EMAIL_LEN];
+ WCHAR wszBuff[MRA_MAXLENOFMESSAGE*2];
+ SIZE_T dwDBMessageSize;
+
+ memmove(szEMail,lpszEMail,dwEMailSize);
+ (*((WORD*)(szEMail+dwEMailSize)))=0;
+
+ dwDBMessageSize=mir_sntprintf(wszBuff,SIZEOF(wszBuff),L"%s: %S\r\n",TranslateW(L"Spam bot blocked"),szEMail);
+ if (dwMessageSize>(SIZEOF(wszBuff)-(dwDBMessageSize+sizeof(DWORD)))) dwMessageSize=(SIZEOF(wszBuff)-(dwDBMessageSize+sizeof(DWORD)));
+ memmove((wszBuff+dwDBMessageSize),lpwszMessage,(dwMessageSize*sizeof(WCHAR)));
+ dwDBMessageSize+=dwMessageSize;
+ (*((DWORD*)(wszBuff+dwDBMessageSize)))=0;
+ dwDBMessageSize+=sizeof(DWORD);
+
+ if (bAntiSpamShowPopUp) MraPopupShowFromAgentW(MRA_POPUP_TYPE_INFORMATION,0,wszBuff);
+
+ if (bAntiSpamWriteToSystemHistory)
+ {
+ CHAR szBuff[MRA_MAXLENOFMESSAGE*2];
+ DBEVENTINFO dbei={0};
+
+ WideCharToMultiByte(CP_UTF8,0,wszBuff,dwDBMessageSize,szBuff,SIZEOF(szBuff),NULL,NULL);
+
+ dbei.cbSize=sizeof(dbei);
+ dbei.szModule=PROTOCOL_NAMEA;
+ dbei.timestamp=_time32(NULL);
+ dbei.flags=(DBEF_READ|DBEF_UTF);
+ dbei.eventType=EVENTTYPE_MESSAGE;
+ dbei.cbBlob=(dwDBMessageSize*sizeof(WCHAR));
+ dbei.pBlob=(PBYTE)szBuff;
+
+ CallService(MS_DB_EVENT_ADD,0,(LPARAM)&dbei);
+ }
+
+ if (hContact && bAntiSpamDeteleSpamBotContacts)
+ {
+ dwDBMessageSize=mir_sntprintf(wszBuff,SIZEOF(wszBuff),L"%s: %S",TranslateW(L"Spam bot contact deleted"),szEMail);
+
+ if (bAntiSpamShowPopUp) MraPopupShowFromAgentW(MRA_POPUP_TYPE_INFORMATION,0,wszBuff);
+
+ if (bAntiSpamWriteToSystemHistory)
+ {
+ CHAR szBuff[MRA_MAXLENOFMESSAGE*2];
+ DBEVENTINFO dbei={0};
+
+ (*((DWORD*)(wszBuff+dwDBMessageSize)))=0;
+ dwDBMessageSize+=sizeof(DWORD);
+
+ WideCharToMultiByte(CP_UTF8,0,wszBuff,dwDBMessageSize,szBuff,SIZEOF(szBuff),NULL,NULL);
+
+ dbei.cbSize=sizeof(dbei);
+ dbei.szModule=PROTOCOL_NAMEA;
+ dbei.timestamp=_time32(NULL);
+ dbei.flags=(DBEF_READ|DBEF_UTF);
+ dbei.eventType=EVENTTYPE_MESSAGE;
+ dbei.cbBlob=(dwDBMessageSize*sizeof(WCHAR));
+ dbei.pBlob=(PBYTE)szBuff;
+
+ CallService(MS_DB_EVENT_ADD,0,(LPARAM)&dbei);
+ }
+ }
+ }
+
+ if (hContact && bAntiSpamDeteleSpamBotContacts) CallService(MS_DB_CONTACT_DELETE,(WPARAM)hContact,0);
+ }
+ }
+return(dwRet);
+}
diff --git a/protocols/MRA/MraAntiSpam.h b/protocols/MRA/MraAntiSpam.h
new file mode 100644
index 0000000000..697daf654b
--- /dev/null
+++ b/protocols/MRA/MraAntiSpam.h
@@ -0,0 +1,24 @@
+#if !defined(AFX_MRA_ANTISPAM_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
+#define AFX_MRA_ANTISPAM_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_
+
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+
+
+SIZE_T MraAntiSpamLoadBadWordsW();
+void MraAntiSpamFreeBadWords();
+
+INT_PTR CALLBACK MraAntiSpamDlgProcOpts(HWND hWndDlg,UINT msg,WPARAM wParam,LPARAM lParam);
+
+void MraAntiSpamResetBadWordsList();
+
+#define MESSAGE_NOT_SPAM 1
+#define MESSAGE_SPAM 2
+DWORD MraAntiSpamReceivedMessageW(LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwMessageFlags,LPWSTR lpwszMessage,SIZE_T dwMessageSize);
+
+
+#endif // !defined(AFX_MRA_ANTISPAM_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/MraAvatars.cpp b/protocols/MRA/MraAvatars.cpp
new file mode 100644
index 0000000000..96e498d964
--- /dev/null
+++ b/protocols/MRA/MraAvatars.cpp
@@ -0,0 +1,912 @@
+#include "Mra.h"
+#include "MraAvatars.h"
+
+
+
+
+#define PA_FORMAT_MAX 7
+const LPSTR lpcszExtensions[9]=
+{
+ ".dat",// PA_FORMAT_UNKNOWN
+ ".png",// PA_FORMAT_PNG
+ ".jpg",// PA_FORMAT_JPEG
+ ".ico",// PA_FORMAT_ICON
+ ".bmp",// PA_FORMAT_BMP
+ ".gif",// PA_FORMAT_GIF
+ ".swf",// PA_FORMAT_SWF
+ ".xml",// PA_FORMAT_XML
+ NULL
+};
+
+
+const LPSTR lpcszContentType[9]=
+{
+ "", // PA_FORMAT_UNKNOWN
+ "image/png", // PA_FORMAT_PNG
+ "image/jpeg", // PA_FORMAT_JPEG
+ "image/icon", // PA_FORMAT_ICON
+ "image/x-xbitmap", // PA_FORMAT_BMP
+ "image/gif", // PA_FORMAT_GIF
+ "", // PA_FORMAT_SWF
+ "", // PA_FORMAT_XML
+ NULL
+};
+
+
+
+typedef struct
+{
+ FIFO_MT ffmtQueueToQuery;
+ BOOL bIsRunning;
+ HANDLE hNetlibUser;
+ HANDLE hThreadEvent;
+ DWORD dwThreadsCount;
+ HANDLE hThread[MAXIMUM_WAIT_OBJECTS];
+ LONG lThreadsRunningCount;
+ HANDLE hAvatarsPath;
+} MRA_AVATARS_QUEUE;
+
+
+typedef struct
+{
+ // internal
+ FIFO_MT_ITEM ffmtiFifoItem;
+ // external
+ DWORD dwAvatarsQueueID;
+ DWORD dwFlags;
+ HANDLE hContact;
+} MRA_AVATARS_QUEUE_ITEM;
+
+
+
+#define FILETIME_SECOND ((DWORDLONG)10000000)
+#define FILETIME_MINUTE ((DWORDLONG)FILETIME_SECOND*60)
+
+
+char szAvtSectName[MAX_PATH];
+#define MRA_AVT_SECT_NAME szAvtSectName
+
+
+
+
+
+//#define MEMALLOC(Size) HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,(Size+sizeof(SIZE_T)))
+//#define MEMREALLOC(Mem,Size) HeapReAlloc(GetProcessHeap(),(HEAP_ZERO_MEMORY),(LPVOID)Mem,(Size+sizeof(SIZE_T)))
+//#define MEMFREE(Mem) if (Mem) {HeapFree(GetProcessHeap(),0,(LPVOID)Mem);Mem=NULL;}
+
+#define NETLIB_CLOSEHANDLE(hConnection) {Netlib_CloseHandle(hConnection);hConnection=NULL;}
+
+void MraAvatarsQueueClear (HANDLE hAvatarsQueueHandle);
+DWORD MraAvatarsQueueAdd (HANDLE hAvatarsQueueHandle,DWORD dwFlags,HANDLE hContact,DWORD *pdwAvatarsQueueID);
+void MraAvatarsThreadProc (LPVOID lpParameter);
+HANDLE MraAvatarsHttpConnect (HANDLE hNetlibUser,LPSTR lpszHost,DWORD dwPort);
+
+
+
+#define MAHTRO_AVT 0
+#define MAHTRO_AVTMRIM 1
+#define MAHTRO_AVTSMALL 2
+#define MAHTRO_AVTSMALLMRIM 3
+DWORD MraAvatarsHttpTransaction (HANDLE hConnection,DWORD dwRequestType,LPSTR lpszUser,LPSTR lpszDomain,LPSTR lpszHost,DWORD dwReqObj,BOOL bUseKeepAliveConn,DWORD *pdwResultCode,BOOL *pbKeepAlive,DWORD *pdwFormat,SIZE_T *pdwAvatarSize,INTERNET_TIME *pitLastModifiedTime);
+BOOL MraAvatarsGetContactTime (HANDLE hContact,LPSTR lpszValueName,SYSTEMTIME *pstTime);
+void MraAvatarsSetContactTime (HANDLE hContact,LPSTR lpszValueName,SYSTEMTIME *pstTime);
+DWORD MraAvatarsGetFileFormat (LPSTR lpszPath,SIZE_T dwPathSize);
+
+
+
+
+
+DWORD MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle)
+{
+ DWORD dwRetErrorCode;
+
+ mir_snprintf(szAvtSectName,SIZEOF(szAvtSectName),"%s Avatars",PROTOCOL_NAMEA);
+
+ if (phAvatarsQueueHandle)
+ {
+ MRA_AVATARS_QUEUE *pmraaqAvatarsQueue;
+
+ pmraaqAvatarsQueue=(MRA_AVATARS_QUEUE*)MEMALLOC(sizeof(MRA_AVATARS_QUEUE));
+ if (pmraaqAvatarsQueue)
+ {
+ dwRetErrorCode=FifoMTInitialize(&pmraaqAvatarsQueue->ffmtQueueToQuery,0);
+ if (dwRetErrorCode==NO_ERROR)
+ {
+ CHAR szBuffer[MAX_PATH];
+ NETLIBUSER nlu={0};
+
+ mir_snprintf(szBuffer,SIZEOF(szBuffer),"%s %s %s",PROTOCOL_NAMEA,Translate("Avatars"),Translate("plugin connections"));
+ nlu.cbSize=sizeof(nlu);
+ nlu.flags=(NUF_OUTGOING|NUF_HTTPCONNS);
+ nlu.szSettingsModule=MRA_AVT_SECT_NAME;
+ nlu.szDescriptiveName=szBuffer;
+ pmraaqAvatarsQueue->hNetlibUser=(HANDLE)CallService(MS_NETLIB_REGISTERUSER,0,(LPARAM)&nlu);
+ if (pmraaqAvatarsQueue->hNetlibUser)
+ {
+ LPSTR lpszPathToAvatarsCache;
+
+ lpszPathToAvatarsCache=Utils_ReplaceVars("%miranda_avatarcache%");
+ pmraaqAvatarsQueue->hAvatarsPath=FoldersRegisterCustomPath(MRA_AVT_SECT_NAME,"AvatarsPath",lpszPathToAvatarsCache);
+ mir_free(lpszPathToAvatarsCache);
+
+ InterlockedExchange((volatile LONG*)&pmraaqAvatarsQueue->bIsRunning,TRUE);
+ pmraaqAvatarsQueue->hThreadEvent=CreateEvent(NULL,FALSE,FALSE,NULL);
+
+ pmraaqAvatarsQueue->dwThreadsCount=DBGetContactSettingDword(NULL,MRA_AVT_SECT_NAME,"WorkThreadsCount",MRA_AVT_DEFAULT_WRK_THREAD_COUNTS);
+ if (pmraaqAvatarsQueue->dwThreadsCount==0) pmraaqAvatarsQueue->dwThreadsCount=1;
+ if (pmraaqAvatarsQueue->dwThreadsCount>MAXIMUM_WAIT_OBJECTS) pmraaqAvatarsQueue->dwThreadsCount=MAXIMUM_WAIT_OBJECTS;
+ for (DWORD i=0;i<pmraaqAvatarsQueue->dwThreadsCount;i++)
+ {
+ pmraaqAvatarsQueue->hThread[i]=(HANDLE)mir_forkthread((pThreadFunc)MraAvatarsThreadProc,pmraaqAvatarsQueue);
+ }
+
+ (*phAvatarsQueueHandle)=(HANDLE)pmraaqAvatarsQueue;
+ }
+ }
+ }else{
+ dwRetErrorCode=GetLastError();
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+void MraAvatarsQueueClear(HANDLE hAvatarsQueueHandle)
+{
+ if (hAvatarsQueueHandle)
+ {
+ MRA_AVATARS_QUEUE *pmraaqAvatarsQueue=(MRA_AVATARS_QUEUE*)hAvatarsQueueHandle;
+ MRA_AVATARS_QUEUE_ITEM *pmraaqiAvatarsQueueItem;
+ PROTO_AVATAR_INFORMATION pai={0};
+
+ pai.cbSize=sizeof(pai);
+ //pai.hContact=pmraaqiAvatarsQueueItem->hContact;
+ pai.format=PA_FORMAT_UNKNOWN;
+ //pai.filename[0]=0;
+
+ while(FifoMTItemPop(&pmraaqAvatarsQueue->ffmtQueueToQuery,NULL,(LPVOID*)&pmraaqiAvatarsQueueItem)==NO_ERROR)
+ {
+ pai.hContact=pmraaqiAvatarsQueueItem->hContact;
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmraaqiAvatarsQueueItem->hContact,ACKTYPE_AVATAR,ACKRESULT_FAILED,(HANDLE)&pai,0);
+ MEMFREE(pmraaqiAvatarsQueueItem);
+ }
+ }
+}
+
+
+void MraAvatarsQueueDestroy(HANDLE hAvatarsQueueHandle)
+{
+ if (hAvatarsQueueHandle)
+ {
+ MRA_AVATARS_QUEUE *pmraaqAvatarsQueue=(MRA_AVATARS_QUEUE*)hAvatarsQueueHandle;
+
+ InterlockedExchange((volatile LONG*)&pmraaqAvatarsQueue->bIsRunning,FALSE);
+ SetEvent(pmraaqAvatarsQueue->hThreadEvent);
+
+ WaitForMultipleObjects(pmraaqAvatarsQueue->dwThreadsCount,(HANDLE*)&pmraaqAvatarsQueue->hThread[0],TRUE,(WAIT_FOR_THREAD_TIMEOUT*1000));
+
+ if (InterlockedExchangeAdd((volatile LONG*)&pmraaqAvatarsQueue->lThreadsRunningCount,0))
+ {// , %)
+ while(InterlockedExchangeAdd((volatile LONG*)&pmraaqAvatarsQueue->lThreadsRunningCount,0))
+ {//
+ SleepEx(100,TRUE);
+ }
+ }
+
+ CloseHandle(pmraaqAvatarsQueue->hThreadEvent);
+
+ MraAvatarsQueueClear(hAvatarsQueueHandle);
+
+ FifoMTDestroy(&pmraaqAvatarsQueue->ffmtQueueToQuery);
+ Netlib_CloseHandle(pmraaqAvatarsQueue->hNetlibUser);
+ MEMFREE(pmraaqAvatarsQueue);
+ }
+}
+
+
+DWORD MraAvatarsQueueAdd(HANDLE hAvatarsQueueHandle,DWORD dwFlags,HANDLE hContact,DWORD *pdwAvatarsQueueID)
+{
+ DWORD dwRetErrorCode;
+
+ if (hAvatarsQueueHandle)
+ {
+ MRA_AVATARS_QUEUE *pmraaqAvatarsQueue=(MRA_AVATARS_QUEUE*)hAvatarsQueueHandle;
+ MRA_AVATARS_QUEUE_ITEM *pmraaqiAvatarsQueueItem;
+
+ pmraaqiAvatarsQueueItem=(MRA_AVATARS_QUEUE_ITEM*)MEMALLOC(sizeof(MRA_AVATARS_QUEUE_ITEM));
+ if (pmraaqiAvatarsQueueItem)
+ {
+ //pmraaqiAvatarsQueueItem->ffmtiFifoItem;
+ pmraaqiAvatarsQueueItem->dwAvatarsQueueID=GetTickCount();
+ pmraaqiAvatarsQueueItem->dwFlags=dwFlags;
+ pmraaqiAvatarsQueueItem->hContact=hContact;
+
+ FifoMTItemPush(&pmraaqAvatarsQueue->ffmtQueueToQuery,&pmraaqiAvatarsQueueItem->ffmtiFifoItem,(LPVOID)pmraaqiAvatarsQueueItem);
+ if (pdwAvatarsQueueID) (*pdwAvatarsQueueID)=pmraaqiAvatarsQueueItem->dwAvatarsQueueID;
+ SetEvent(pmraaqAvatarsQueue->hThreadEvent);
+
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ dwRetErrorCode=GetLastError();
+ ShowFormatedErrorMessage(L"Avatars: can't add request to queue, error",dwRetErrorCode);
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+void MraAvatarsThreadProc(LPVOID lpParameter)
+{
+ MRA_AVATARS_QUEUE *pmraaqAvatarsQueue=(MRA_AVATARS_QUEUE*)lpParameter;
+ MRA_AVATARS_QUEUE_ITEM *pmraaqiAvatarsQueueItem;
+
+ char szEMail[MAX_EMAIL_LEN],szFileName[MAX_FILEPATH],szServer[MAX_PATH];
+ WCHAR szErrorText[2048];
+ BOOL bContinue,bKeepAlive,bUseKeepAliveConn,bFailed,bDownloadNew,bDefaultAvt;
+ BYTE btBuff[BUFF_SIZE_RCV];
+ DWORD dwResultCode,dwAvatarFormat,dwReceived,dwWritten,dwServerPort,dwErrorCode;
+ LPSTR lpszUser,lpszDomain;
+ SIZE_T dwEMailSize,dwAvatarSizeServer,dwFileNameSize;
+ FILETIME ftLastModifiedTimeServer,ftLastModifiedTimeLocal;
+ SYSTEMTIME stAvatarLastModifiedTimeLocal;
+ HANDLE hConnection=NULL,hFile;
+ NETLIBSELECT nls={0};
+ INTERNET_TIME itAvatarLastModifiedTimeServer;
+ PROTO_AVATAR_INFORMATION pai;
+
+ nls.cbSize=sizeof(nls);
+ pai.cbSize=sizeof(pai);
+
+ InterlockedIncrement((volatile LONG*)&pmraaqAvatarsQueue->lThreadsRunningCount);
+
+ while(InterlockedExchangeAdd((volatile LONG*)&pmraaqAvatarsQueue->bIsRunning,0))
+ {
+ if (FifoMTItemPop(&pmraaqAvatarsQueue->ffmtQueueToQuery,NULL,(LPVOID*)&pmraaqiAvatarsQueueItem)==NO_ERROR)
+ {
+ bFailed=TRUE;
+ bDownloadNew=FALSE;
+ bDefaultAvt=FALSE;
+
+ if (DB_GetStaticStringA(NULL,MRA_AVT_SECT_NAME,"Server",szServer,SIZEOF(szServer),NULL)==FALSE) memmove(szServer,MRA_AVT_DEFAULT_SERVER,sizeof(MRA_AVT_DEFAULT_SERVER));
+ dwServerPort=DBGetContactSettingDword(NULL,MRA_AVT_SECT_NAME,"ServerPort",MRA_AVT_DEFAULT_SERVER_PORT);
+ bUseKeepAliveConn=DBGetContactSettingByte(NULL,MRA_AVT_SECT_NAME,"UseKeepAliveConn",MRA_AVT_DEFAULT_USE_KEEPALIVE_CONN);
+
+
+ if (DB_Mra_GetStaticStringA(pmraaqiAvatarsQueueItem->hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ BuffToLowerCase(szEMail,szEMail,dwEMailSize);
+ if (lpszDomain=(LPSTR)MemoryFindByte(0,szEMail,dwEMailSize,'@'))
+ if (lpszUser=(LPSTR)MemoryFindByte((lpszDomain-szEMail),szEMail,dwEMailSize,'.'))
+ {
+ (*lpszUser)=0;
+ lpszUser=szEMail;
+ (*lpszDomain)=0;
+ lpszDomain++;
+
+
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmraaqiAvatarsQueueItem->hContact,ACKTYPE_AVATAR,ACKRESULT_CONNECTING,(HANDLE)pmraaqiAvatarsQueueItem->dwAvatarsQueueID,0);
+ if (hConnection==NULL) hConnection=MraAvatarsHttpConnect(pmraaqAvatarsQueue->hNetlibUser,szServer,dwServerPort);
+ if (hConnection)
+ {
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmraaqiAvatarsQueueItem->hContact,ACKTYPE_AVATAR,ACKRESULT_CONNECTED,(HANDLE)pmraaqiAvatarsQueueItem->dwAvatarsQueueID,0);
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmraaqiAvatarsQueueItem->hContact,ACKTYPE_AVATAR,ACKRESULT_SENTREQUEST,(HANDLE)pmraaqiAvatarsQueueItem->dwAvatarsQueueID,0);
+ if (MraAvatarsHttpTransaction(hConnection,REQUEST_HEAD,lpszUser,lpszDomain,szServer,MAHTRO_AVTMRIM,bUseKeepAliveConn,&dwResultCode,&bKeepAlive,&dwAvatarFormat,&dwAvatarSizeServer,&itAvatarLastModifiedTimeServer)==NO_ERROR)
+ {
+ switch(dwResultCode){
+ case 200:
+ if (MraAvatarsGetContactTime(pmraaqiAvatarsQueueItem->hContact,"AvatarLastModifiedTime",&stAvatarLastModifiedTimeLocal))
+ {
+ SystemTimeToFileTime(&itAvatarLastModifiedTimeServer.stTime,&ftLastModifiedTimeServer);
+ SystemTimeToFileTime(&stAvatarLastModifiedTimeLocal,&ftLastModifiedTimeLocal);
+
+ if ((*((DWORDLONG*)&ftLastModifiedTimeServer))!=(*((DWORDLONG*)&ftLastModifiedTimeLocal)))
+ {// need check for update
+ bDownloadNew=TRUE;
+ //ProtoBroadcastAck(PROTOCOL_NAMEA,pmraaqiAvatarsQueueItem->hContact,ACKTYPE_AVATAR,ACKRESULT_STATUS,0,0);
+ }else{// avatar is valid
+ if (MraAvatarsGetFileName((HANDLE)pmraaqAvatarsQueue,pmraaqiAvatarsQueueItem->hContact,dwAvatarFormat,(LPSTR)szFileName,SIZEOF(szFileName),NULL)==NO_ERROR)
+ {
+ if(IsFileExistA(szFileName))
+ {
+ bFailed=FALSE;
+ }else{
+ bDownloadNew=TRUE;
+ }
+ }
+ }
+ }else{// need update
+ bDownloadNew=TRUE;
+ }
+ break;
+ case 404:// return def avatar
+ if (MraAvatarsGetFileName((HANDLE)pmraaqAvatarsQueue,NULL,PA_FORMAT_DEFAULT,(LPSTR)szFileName,SIZEOF(szFileName),&dwFileNameSize)==NO_ERROR)
+ {
+ if(IsFileExistA(szFileName))
+ {
+ dwAvatarFormat=MraAvatarsGetFileFormat(szFileName,dwFileNameSize);
+ bFailed=FALSE;
+ }else{//loading default avatar
+ bDownloadNew=TRUE;
+ }
+ bDefaultAvt=TRUE;
+ }
+ break;
+ default:
+ mir_sntprintf(szErrorText,SIZEOF(szErrorText),TranslateW(L"Avatars: server return HTTP code: %lu"),dwResultCode);
+ ShowFormatedErrorMessage(szErrorText,NO_ERROR);
+ break;
+ }
+ }
+ if (bUseKeepAliveConn==FALSE || bKeepAlive==FALSE) NETLIB_CLOSEHANDLE(hConnection);
+ }
+
+
+ if (bDownloadNew)
+ {
+ if (hConnection==NULL) hConnection=MraAvatarsHttpConnect(pmraaqAvatarsQueue->hNetlibUser,szServer,dwServerPort);
+ if (hConnection)
+ {
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmraaqiAvatarsQueueItem->hContact,ACKTYPE_AVATAR,ACKRESULT_DATA,(HANDLE)pmraaqiAvatarsQueueItem->dwAvatarsQueueID,0);
+ if (MraAvatarsHttpTransaction(hConnection,REQUEST_GET,lpszUser,lpszDomain,szServer,MAHTRO_AVT,bUseKeepAliveConn,&dwResultCode,&bKeepAlive,&dwAvatarFormat,&dwAvatarSizeServer,&itAvatarLastModifiedTimeServer)==NO_ERROR && dwResultCode==200)
+ {
+ if (bDefaultAvt) dwAvatarFormat=PA_FORMAT_DEFAULT;
+ if (MraAvatarsGetFileName((HANDLE)pmraaqAvatarsQueue,pmraaqiAvatarsQueueItem->hContact,dwAvatarFormat,(LPSTR)szFileName,SIZEOF(szFileName),NULL)==NO_ERROR)
+ {
+ hFile=CreateFileA(szFileName,GENERIC_WRITE,FILE_SHARE_READ,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
+ if (hFile!=INVALID_HANDLE_VALUE)
+ {
+ dwWritten=0;
+ bContinue=TRUE;
+ nls.dwTimeout=(1000*DBGetContactSettingDword(NULL,MRA_AVT_SECT_NAME,"TimeOutReceive",MRA_AVT_DEFAULT_TIMEOUT_RECV));
+ nls.hReadConns[0]=hConnection;
+
+ while(bContinue)
+ {
+ switch(CallService(MS_NETLIB_SELECT,0,(LPARAM)&nls)){
+ case SOCKET_ERROR:
+ case 0:// Time out
+ dwErrorCode=GetLastError();
+ ShowFormatedErrorMessage(L"Avatars: error on receive file data",dwErrorCode);
+ bContinue=FALSE;
+ break;
+ case 1:
+ dwReceived=Netlib_Recv(hConnection,(LPSTR)&btBuff,SIZEOF(btBuff),0);
+ if (dwReceived==0 || dwReceived==SOCKET_ERROR)
+ {
+ dwErrorCode=GetLastError();
+ ShowFormatedErrorMessage(L"Avatars: error on receive file data",dwErrorCode);
+ bContinue=FALSE;
+ }else{
+ if (WriteFile(hFile,(LPVOID)&btBuff,dwReceived,&dwReceived,NULL))
+ {
+ dwWritten+=dwReceived;
+ if (dwWritten>=dwAvatarSizeServer) bContinue=FALSE;
+ }else{
+ dwErrorCode=GetLastError();
+ ShowFormatedErrorMessage(L"Avatars: cant write file data, error",dwErrorCode);
+ bContinue=FALSE;
+ }
+ }
+ break;
+ }
+
+ }
+ CloseHandle(hFile);
+ bFailed=FALSE;
+ }else{
+ dwErrorCode=GetLastError();
+ mir_sntprintf(szErrorText,SIZEOF(szErrorText),TranslateW(L"Avatars: cant open file %S, error"),szFileName);
+ ShowFormatedErrorMessage(szErrorText,dwErrorCode);
+ }
+ }
+ }else{
+ DebugBreak();
+ }
+ if (bUseKeepAliveConn==FALSE || bKeepAlive==FALSE) NETLIB_CLOSEHANDLE(hConnection);
+ }
+ }
+ }
+ }
+
+ if (bFailed)
+ {
+ DeleteFileA(szFileName);
+ pai.hContact=pmraaqiAvatarsQueueItem->hContact;
+ pai.format=PA_FORMAT_UNKNOWN;
+ pai.filename[0]=0;
+ //MraAvatarsSetContactTime(pmraaqiAvatarsQueueItem->hContact,"AvatarLastModifiedTime",NULL);
+ // write owner avatar file name to DB
+ //if (pmraaqiAvatarsQueueItem->hContact==NULL) DB_Mra_DeleteValue(NULL,"AvatarFile");
+
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmraaqiAvatarsQueueItem->hContact,ACKTYPE_AVATAR,ACKRESULT_FAILED,(HANDLE)&pai,0);
+ }else{
+ pai.hContact=pmraaqiAvatarsQueueItem->hContact;
+ pai.format=dwAvatarFormat;
+ if (DBGetContactSettingByte(NULL,MRA_AVT_SECT_NAME,"ReturnAbsolutePath",MRA_AVT_DEFAULT_RET_ABC_PATH))
+ {
+ lstrcpynA(pai.filename,szFileName,SIZEOF(pai.filename));
+ }else{
+ CallService(MS_UTILS_PATHTORELATIVE,(WPARAM)szFileName,(LPARAM)pai.filename);
+ }
+ if (bDefaultAvt) dwAvatarFormat=PA_FORMAT_DEFAULT;
+ SetContactAvatarFormat(pmraaqiAvatarsQueueItem->hContact,dwAvatarFormat);
+ MraAvatarsSetContactTime(pmraaqiAvatarsQueueItem->hContact,"AvatarLastModifiedTime",&itAvatarLastModifiedTimeServer.stTime);
+ // write owner avatar file name to DB
+ if (pmraaqiAvatarsQueueItem->hContact==NULL)
+ {// proto avatar
+ //DB_Mra_SetStringA(NULL,"AvatarFile",pai.filename);
+ CallService(MS_AV_REPORTMYAVATARCHANGED,(WPARAM)PROTOCOL_NAMEA,0);
+ }
+
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmraaqiAvatarsQueueItem->hContact,ACKTYPE_AVATAR,ACKRESULT_SUCCESS,(HANDLE)&pai,0);
+ }
+ MEMFREE(pmraaqiAvatarsQueueItem);
+ }else{// waiting until service stop or new task
+ NETLIB_CLOSEHANDLE(hConnection);
+ WaitForSingleObjectEx(pmraaqAvatarsQueue->hThreadEvent,MRA_AVT_DEFAULT_QE_CHK_INTERVAL,FALSE);
+ }
+ }
+
+ InterlockedDecrement((volatile LONG*)&pmraaqAvatarsQueue->lThreadsRunningCount);
+}
+
+
+HANDLE MraAvatarsHttpConnect(HANDLE hNetlibUser,LPSTR lpszHost,DWORD dwPort)
+{
+ HANDLE hConnection;
+ DWORD dwConnectReTryCount,dwCurConnectReTryCount;
+ NETLIBOPENCONNECTION nloc={0};
+
+ dwConnectReTryCount=DBGetContactSettingDword(NULL,MRA_AVT_SECT_NAME,"ConnectReTryCount",MRA_AVT_DEFAULT_CONN_RETRY_COUNT);
+
+ nloc.cbSize=sizeof(nloc);
+ nloc.flags=(NLOCF_HTTP|NLOCF_V2);
+ nloc.szHost=lpszHost;
+ if (IsHTTPSProxyUsed(hNetlibUser))
+ {// https 443
+ nloc.wPort=MRA_SERVER_PORT_HTTPS;
+ }else{
+ nloc.wPort=(WORD)dwPort;
+ }
+ nloc.timeout=DBGetContactSettingDword(NULL,MRA_AVT_SECT_NAME,"TimeOutConnect",MRA_AVT_DEFAULT_TIMEOUT_CONN);
+ if (nloc.timeout<MRA_TIMEOUT_CONN_MIN) nloc.timeout=MRA_TIMEOUT_CONN_MIN;
+ if (nloc.timeout>MRA_TIMEOUT_CONN_) nloc.timeout=MRA_TIMEOUT_CONN_;
+
+
+ dwCurConnectReTryCount=dwConnectReTryCount;
+ do{
+ hConnection=(HANDLE)CallService(MS_NETLIB_OPENCONNECTION,(WPARAM)hNetlibUser,(LPARAM)&nloc);
+ }while(--dwCurConnectReTryCount && hConnection==NULL);
+
+ if (hConnection==NULL)
+ {
+ ShowFormatedErrorMessage(L"Avatars: can't connect to server, error",GetLastError());
+ }
+return(hConnection);
+}
+
+
+DWORD MraAvatarsHttpTransaction(HANDLE hConnection,DWORD dwRequestType,LPSTR lpszUser,LPSTR lpszDomain,LPSTR lpszHost,DWORD dwReqObj,BOOL bUseKeepAliveConn,DWORD *pdwResultCode,BOOL *pbKeepAlive,DWORD *pdwFormat,SIZE_T *pdwAvatarSize,INTERNET_TIME *pitLastModifiedTime)
+{
+ DWORD dwRetErrorCode;
+
+ if (pdwResultCode) (*pdwResultCode)=0;
+ if (pbKeepAlive) (*pbKeepAlive)=FALSE;
+ if (pdwFormat) (*pdwFormat)=PA_FORMAT_UNKNOWN;
+ if (pdwAvatarSize) (*pdwAvatarSize)=0;
+ if (pitLastModifiedTime) memset(pitLastModifiedTime,0, sizeof(INTERNET_TIME));
+
+ if (hConnection)
+ {
+ char szBuff[4096],szSelfVersionString[MAX_PATH];
+ DWORD dwSended,dwBuffSize;
+ LPSTR lpszReqObj;
+ NETLIBHTTPHEADER nlbhHeaders[8]={0};
+ NETLIBHTTPREQUEST *pnlhr,nlhr={0};
+
+ switch(dwReqObj){
+ case MAHTRO_AVT: lpszReqObj="_avatar"; break;
+ case MAHTRO_AVTMRIM: lpszReqObj="_mrimavatar"; break;
+ case MAHTRO_AVTSMALL: lpszReqObj="_avatarsmall"; break;
+ case MAHTRO_AVTSMALLMRIM: lpszReqObj="_mrimavatarsmall"; break;
+ default: lpszReqObj=""; break;
+ }
+ dwBuffSize=mir_snprintf(szBuff,SIZEOF(szBuff),"http://%s/%s/%s/%s",lpszHost,lpszDomain,lpszUser,lpszReqObj);
+
+ MraGetSelfVersionString(szSelfVersionString,SIZEOF(szSelfVersionString),NULL);
+
+ nlbhHeaders[0].szName="User-Agent"; nlbhHeaders[0].szValue=szSelfVersionString;
+ nlbhHeaders[1].szName="Accept-Encoding";nlbhHeaders[1].szValue="deflate";
+ nlbhHeaders[2].szName="Pragma"; nlbhHeaders[2].szValue="no-cache";
+ nlbhHeaders[3].szName="Connection"; nlbhHeaders[3].szValue=(bUseKeepAliveConn)? "keep-alive":"close";
+ //nlbhHeaders[4].szName="If-Modified-Since";nlbhHeaders[4].szValue="Thu, 03 Aug 2006 19:54:33 GMT";
+
+ nlhr.cbSize=sizeof(nlhr);
+ nlhr.requestType=dwRequestType;
+ nlhr.flags=(NLHRF_GENERATEHOST|NLHRF_SMARTREMOVEHOST|NLHRF_SMARTAUTHHEADER);
+ nlhr.szUrl=szBuff;
+ nlhr.headers=(NETLIBHTTPHEADER*)&nlbhHeaders;
+ nlhr.headersCount=4;
+ //nlhr.pData=NULL;
+ //nlhr.dataLength=0;
+ //nlhr.resultCode=0;
+ //nlhr.szResultDescr=NULL;
+ //nlhr.nlc=NULL;
+
+ dwSended=CallService(MS_NETLIB_SENDHTTPREQUEST,(WPARAM)hConnection,(LPARAM)&nlhr);
+ if (dwSended!=SOCKET_ERROR && dwSended)
+ {
+ pnlhr=(NETLIBHTTPREQUEST*)CallService(MS_NETLIB_RECVHTTPHEADERS,(WPARAM)hConnection,(LPARAM)0);
+ if (pnlhr)
+ {
+ for(SIZE_T i=0;i<(SIZE_T)pnlhr->headersCount;i++)
+ {
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pnlhr->headers[i].szName,-1,"Connection",10)==CSTR_EQUAL)
+ {
+ if (pbKeepAlive) (*pbKeepAlive)=(CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pnlhr->headers[i].szValue,-1,"keep-alive",10)==CSTR_EQUAL);
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pnlhr->headers[i].szName,-1,"Content-Type",12)==CSTR_EQUAL)
+ {
+ if (pdwFormat)
+ {
+ for (SIZE_T j=0;j<PA_FORMAT_MAX;j++)
+ {
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pnlhr->headers[i].szValue,-1,lpcszContentType[j],-1)==CSTR_EQUAL)
+ {
+ (*pdwFormat)=j;
+ break;
+ }
+ }
+ }
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pnlhr->headers[i].szName,-1,"Content-Length",14)==CSTR_EQUAL)
+ {
+ if (pdwAvatarSize) (*pdwAvatarSize)=StrToUNum(pnlhr->headers[i].szValue,lstrlenA(pnlhr->headers[i].szValue));
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pnlhr->headers[i].szName,-1,"Last-Modified",13)==CSTR_EQUAL)
+ {
+ if (pitLastModifiedTime) InternetTimeGetTime(pnlhr->headers[i].szValue,lstrlenA(pnlhr->headers[i].szValue),pitLastModifiedTime);
+ }
+ }// end for
+
+ if (pdwResultCode) (*pdwResultCode)=pnlhr->resultCode;
+ CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT,(WPARAM)0,(LPARAM)pnlhr);
+ dwRetErrorCode=NO_ERROR;
+ }else{// err on receive
+ dwRetErrorCode=GetLastError();
+ ShowFormatedErrorMessage(L"Avatars: error on receive HTTP answer",dwRetErrorCode);
+ }
+ }else{// err on send http request
+ dwRetErrorCode=GetLastError();
+ ShowFormatedErrorMessage(L"Avatars: error on send HTTP request",dwRetErrorCode);
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+
+return(dwRetErrorCode);
+}
+
+
+BOOL MraAvatarsGetContactTime(HANDLE hContact,LPSTR lpszValueName,SYSTEMTIME *pstTime)
+{
+ BOOL bRet=FALSE;
+
+ if (lpszValueName && pstTime)
+ {
+ char szBuff[MAX_PATH];
+ SIZE_T dwBuffSize;
+ INTERNET_TIME itAvatarLastModifiedTimeLocal;
+
+ if (DB_Mra_GetStaticStringA(hContact,lpszValueName,(LPSTR)szBuff,SIZEOF(szBuff),&dwBuffSize))
+ if (InternetTimeGetTime(szBuff,dwBuffSize,&itAvatarLastModifiedTimeLocal)==NO_ERROR)
+ {
+ memmove(pstTime,&itAvatarLastModifiedTimeLocal.stTime,sizeof(SYSTEMTIME));
+ bRet=TRUE;
+ }
+ }
+return(bRet);
+}
+
+
+void MraAvatarsSetContactTime(HANDLE hContact,LPSTR lpszValueName,SYSTEMTIME *pstTime)
+{
+ if (lpszValueName)
+ {
+ char szBuff[MAX_PATH];
+ SIZE_T dwBuffUsedSize;
+ INTERNET_TIME itTime;
+
+ if (pstTime)
+ {
+ itTime.lTimeZone=0;
+ memmove(&itTime.stTime,pstTime,sizeof(SYSTEMTIME));
+ }else{
+ InternetTimeGetCurrentTime(&itTime);
+ }
+
+ if (itTime.stTime.wYear)
+ {
+ InternetTimeGetString(&itTime,(LPSTR)szBuff,SIZEOF(szBuff),&dwBuffUsedSize);
+ DB_Mra_SetStringExA(hContact,lpszValueName,(LPSTR)szBuff,dwBuffUsedSize);
+ }else{
+ DB_Mra_DeleteValue(hContact,lpszValueName);
+ }
+ }
+}
+
+
+DWORD MraAvatarsGetFileFormat(LPSTR lpszPath,SIZE_T dwPathSize)
+{
+ DWORD dwRet=-1,dwExt;
+
+ BuffToLowerCase(&dwExt,(lpszPath+(dwPathSize-sizeof(DWORD))),sizeof(DWORD));
+ for(DWORD i=0;i<PA_FORMAT_MAX;i++)
+ {
+ if (dwExt==(*((DWORD*)lpcszExtensions[i])))
+ {
+ dwRet=i;
+ break;
+ }
+ }
+return(dwRet);
+}
+
+
+DWORD MraAvatarsGetFileName(HANDLE hAvatarsQueueHandle,HANDLE hContact,DWORD dwFormat,LPSTR lpszPath,SIZE_T dwPathSize,SIZE_T *pdwPathSizeRet)
+{
+ DWORD dwRetErrorCode;
+
+ if (hAvatarsQueueHandle)
+ {
+ if (IsContactChatAgent(hContact)==FALSE)
+ {
+ LPSTR lpszCurPath=lpszPath;
+ SIZE_T dwEMailSize;
+ MRA_AVATARS_QUEUE *pmraaqAvatarsQueue=(MRA_AVATARS_QUEUE*)hAvatarsQueueHandle;
+
+ dwRetErrorCode=ERROR_INSUFFICIENT_BUFFER;
+ if (pmraaqAvatarsQueue->hAvatarsPath==NULL || FoldersGetCustomPath(pmraaqAvatarsQueue->hAvatarsPath,lpszCurPath,dwPathSize,""))
+ {// default path
+ LPSTR lpszPathToAvatarsCache;
+ SIZE_T dwPathToAvatarsCacheSize;
+
+ lpszPathToAvatarsCache=Utils_ReplaceVars("%miranda_avatarcache%");
+ dwPathToAvatarsCacheSize=lstrlenA(lpszPathToAvatarsCache);
+ if (dwPathSize>(dwPathToAvatarsCacheSize+8))
+ {
+ memmove(lpszCurPath,lpszPathToAvatarsCache,dwPathToAvatarsCacheSize);
+ dwPathSize-=(dwPathToAvatarsCacheSize+1);
+ lpszCurPath+=dwPathToAvatarsCacheSize;
+ (*((BYTE*)lpszCurPath++))='\\';
+ (*((BYTE*)lpszCurPath))=0;//
+ }else{
+ dwPathSize=0;
+ if (pdwPathSizeRet) (*pdwPathSizeRet)=(dwPathToAvatarsCacheSize+MAX_PATH+32);
+ }
+ mir_free(lpszPathToAvatarsCache);
+ }else{
+ dwEMailSize=lstrlenA(lpszCurPath);
+ dwPathSize-=dwEMailSize;
+ lpszCurPath+=dwEMailSize;
+ }
+
+ if (dwPathSize)
+ {// some path in buff and free space for file name is avaible
+ CreateDirectoryA(lpszPath,NULL);
+
+ if (dwFormat!=PA_FORMAT_DEFAULT)
+ {
+ if (DB_Mra_GetStaticStringA(hContact,"e-mail",lpszCurPath,(dwPathSize-5),&dwEMailSize))
+ {
+ BuffToLowerCase(lpszCurPath,lpszCurPath,dwEMailSize);
+ lpszCurPath+=dwEMailSize;
+ (*((DWORD*)lpszCurPath))=(*((DWORD*)lpcszExtensions[dwFormat]));
+ lpszCurPath+=sizeof(DWORD);
+ (*((BYTE*)lpszCurPath))=0;
+
+ if (pdwPathSizeRet) (*pdwPathSizeRet)=(lpszCurPath-lpszPath);
+ dwRetErrorCode=NO_ERROR;
+ }
+ }else{
+ if (DB_GetStaticStringA(NULL,MRA_AVT_SECT_NAME,"DefaultAvatarFileName",lpszCurPath,(dwPathSize-5),&dwEMailSize)==FALSE)
+ {
+ memmove(lpszCurPath,MRA_AVT_DEFAULT_AVT_FILENAME,sizeof(MRA_AVT_DEFAULT_AVT_FILENAME));
+ lpszCurPath+=(sizeof(MRA_AVT_DEFAULT_AVT_FILENAME)-1);
+ (*((BYTE*)lpszCurPath))=0;
+
+ if (pdwPathSizeRet) (*pdwPathSizeRet)=(lpszCurPath-lpszPath);
+ dwRetErrorCode=NO_ERROR;
+ }
+ }
+ }
+ }else{//146119@chat.agent - conferences has no avatars
+ dwRetErrorCode=ERROR_NOT_SUPPORTED;
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+
+DWORD MraAvatarsQueueGetAvatar(HANDLE hAvatarsQueueHandle,DWORD dwFlags,HANDLE hContact,DWORD *pdwAvatarsQueueID,DWORD *pdwFormat,LPSTR lpszPath)
+{
+ DWORD dwRetCode=GAIR_NOAVATAR;
+
+ if (hAvatarsQueueHandle)
+ if (DBGetContactSettingByte(NULL,MRA_AVT_SECT_NAME,"Enable",MRA_AVT_DEFAULT_ENABLE))
+ if (IsContactChatAgent(hContact)==FALSE)
+ {// not @chat.agent conference
+ BOOL bQueueAdd=TRUE;// check for updates
+ MRA_AVATARS_QUEUE *pmraaqAvatarsQueue=(MRA_AVATARS_QUEUE*)hAvatarsQueueHandle;
+ SYSTEMTIME stAvatarLastCheckTime;
+
+ if ((dwFlags&GAIF_FORCE)==0)// . ,
+ if (MraAvatarsGetContactTime(hContact,"AvatarLastCheckTime",&stAvatarLastCheckTime))
+ {
+ char szFileName[MAX_FILEPATH];
+ SIZE_T dwPathSize;
+ FILETIME ftCurrentTime,ftExpireTime;
+
+ GetSystemTimeAsFileTime(&ftCurrentTime);
+ SystemTimeToFileTime(&stAvatarLastCheckTime,&ftExpireTime);
+ (*((DWORDLONG*)&ftExpireTime))+=(FILETIME_MINUTE*(DWORDLONG)DBGetContactSettingDword(NULL,MRA_AVT_SECT_NAME,"CheckInterval",MRA_AVT_DEFAULT_CHK_INTERVAL));
+
+ if ((*((DWORDLONG*)&ftExpireTime))>(*((DWORDLONG*)&ftCurrentTime)))
+ if (MraAvatarsGetFileName(hAvatarsQueueHandle,hContact,GetContactAvatarFormat(hContact,PA_FORMAT_DEFAULT),(LPSTR)szFileName,SIZEOF(szFileName),&dwPathSize)==NO_ERROR)
+ if (IsFileExistA(szFileName))
+ {// / ( )
+ if (lpszPath)
+ if (DBGetContactSettingByte(NULL,MRA_AVT_SECT_NAME,"ReturnAbsolutePath",MRA_AVT_DEFAULT_RET_ABC_PATH))
+ {
+ lstrcpynA(lpszPath,szFileName,MAX_PATH);
+ }else{
+ CallService(MS_UTILS_PATHTORELATIVE,(WPARAM)szFileName,(LPARAM)lpszPath);
+ }
+ if (pdwFormat) (*pdwFormat)=GetContactAvatarFormat(hContact,PA_FORMAT_DEFAULT);
+ dwRetCode=GAIR_SUCCESS;
+ bQueueAdd=FALSE;
+ }
+ }
+
+ if (bQueueAdd || (dwFlags&GAIF_FORCE))
+ if (MraAvatarsQueueAdd(hAvatarsQueueHandle,dwFlags,hContact,pdwAvatarsQueueID)==NO_ERROR)
+ {
+ MraAvatarsSetContactTime(hContact,"AvatarLastCheckTime",NULL);
+ dwRetCode=GAIR_WAITFOR;
+ }
+ }
+return(dwRetCode);
+}
+
+
+DWORD MraAvatarsQueueGetAvatarSimple(HANDLE hAvatarsQueueHandle,DWORD dwFlags,HANDLE hContact,DWORD dwSourceID)
+{//***deb dwSourceID - for filtering cals from different places
+ DWORD dwRetCode=GAIR_NOAVATAR;
+ PROTO_AVATAR_INFORMATION pai={0};
+
+ pai.cbSize=sizeof(pai);
+ pai.hContact=hContact;
+ if ((dwRetCode=MraAvatarsQueueGetAvatar(hAvatarsQueueHandle,dwFlags,hContact,NULL,(DWORD*)&pai.format,pai.filename))==GAIR_SUCCESS)
+ {
+ // write owner avatar file name to DB
+ if (hContact==NULL)
+ {
+ //DB_Mra_SetStringA(NULL,"AvatarFile",pai.filename);
+ CallService(MS_AV_REPORTMYAVATARCHANGED,(WPARAM)PROTOCOL_NAMEA,0);
+ }
+ ProtoBroadcastAck(PROTOCOL_NAMEA,hContact,ACKTYPE_AVATAR,ACKRESULT_SUCCESS,(HANDLE)&pai,0);
+ }
+return(dwRetCode);
+}
+
+
+WORD wMraAvatarsControlsList[]={
+ IDC_SERVER,
+ IDC_SERVERPORT,
+ IDC_BUTTON_DEFAULT,
+ IDC_USE_KEEPALIVE_CONN,
+ IDC_UPD_CHECK_INTERVAL,
+ IDC_RETURN_ABC_PATH,
+ IDC_DELETE_AVT_ON_CONTACT_DELETE
+};
+
+INT_PTR CALLBACK MraAvatarsQueueDlgProcOpts(HWND hWndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
+{
+ switch(msg){
+ case WM_INITDIALOG:
+ {
+ WCHAR szServer[MAX_PATH];
+
+ TranslateDialogDefault(hWndDlg);
+
+ CHECK_DLG_BUTTON(hWndDlg,IDC_ENABLE,DBGetContactSettingByte(NULL,MRA_AVT_SECT_NAME,"Enable",MRA_AVT_DEFAULT_ENABLE));
+
+ if (DB_GetStaticStringW(NULL,MRA_AVT_SECT_NAME,"Server",szServer,MAX_PATH,NULL))
+ {
+ SET_DLG_ITEM_TEXT(hWndDlg,IDC_SERVER,szServer);
+ }else{
+ SET_DLG_ITEM_TEXTA(hWndDlg,IDC_SERVER,MRA_AVT_DEFAULT_SERVER);
+ }
+
+ SetDlgItemInt(hWndDlg,IDC_SERVERPORT,DBGetContactSettingDword(NULL,MRA_AVT_SECT_NAME,"ServerPort",MRA_AVT_DEFAULT_SERVER_PORT),FALSE);
+ CHECK_DLG_BUTTON(hWndDlg,IDC_USE_KEEPALIVE_CONN,DBGetContactSettingByte(NULL,MRA_AVT_SECT_NAME,"UseKeepAliveConn",MRA_AVT_DEFAULT_USE_KEEPALIVE_CONN));
+ SetDlgItemInt(hWndDlg,IDC_UPD_CHECK_INTERVAL,DBGetContactSettingDword(NULL,MRA_AVT_SECT_NAME,"CheckInterval",MRA_AVT_DEFAULT_CHK_INTERVAL),FALSE);
+ CHECK_DLG_BUTTON(hWndDlg,IDC_RETURN_ABC_PATH,DBGetContactSettingByte(NULL,MRA_AVT_SECT_NAME,"ReturnAbsolutePath",MRA_AVT_DEFAULT_RET_ABC_PATH));
+ CHECK_DLG_BUTTON(hWndDlg,IDC_DELETE_AVT_ON_CONTACT_DELETE,DBGetContactSettingByte(NULL,MRA_AVT_SECT_NAME,"DeleteAvtOnContactDelete",MRA_DELETE_AVT_ON_CONTACT_DELETE));
+
+ EnableControlsArray(hWndDlg,(WORD*)&wMraAvatarsControlsList,SIZEOF(wMraAvatarsControlsList),IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_ENABLE));
+ }
+ return(TRUE);
+ case WM_COMMAND:
+ if (LOWORD(wParam)==IDC_ENABLE)
+ {
+ EnableControlsArray(hWndDlg,(WORD*)&wMraAvatarsControlsList,SIZEOF(wMraAvatarsControlsList),IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_ENABLE));
+ }
+
+ if (LOWORD(wParam)==IDC_BUTTON_DEFAULT)
+ {
+ SET_DLG_ITEM_TEXTA(hWndDlg,IDC_SERVER,MRA_AVT_DEFAULT_SERVER);
+ SetDlgItemInt(hWndDlg,IDC_SERVERPORT,MRA_AVT_DEFAULT_SERVER_PORT,FALSE);
+ }
+
+ if ((LOWORD(wParam)==IDC_SERVER || LOWORD(wParam)==IDC_SERVERPORT || LOWORD(wParam)==IDC_UPD_CHECK_INTERVAL) && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus()) ) return(FALSE);
+ SendMessage(GetParent(hWndDlg),PSM_CHANGED,0,0);
+ break;
+ case WM_NOTIFY:
+ switch (((LPNMHDR)lParam)->code){
+ case PSN_APPLY:
+ {
+ WCHAR szServer[MAX_PATH];
+
+ DBWriteContactSettingByte(NULL,MRA_AVT_SECT_NAME,"Enable",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_ENABLE));
+ DBWriteContactSettingByte(NULL,MRA_AVT_SECT_NAME,"DeleteAvtOnContactDelete",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_DELETE_AVT_ON_CONTACT_DELETE));
+ DBWriteContactSettingByte(NULL,MRA_AVT_SECT_NAME,"ReturnAbsolutePath",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_RETURN_ABC_PATH));
+ DBWriteContactSettingDword(NULL,MRA_AVT_SECT_NAME,"CheckInterval",GetDlgItemInt(hWndDlg,IDC_UPD_CHECK_INTERVAL,NULL,FALSE));
+ DBWriteContactSettingByte(NULL,MRA_AVT_SECT_NAME,"UseKeepAliveConn",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_USE_KEEPALIVE_CONN));
+ DBWriteContactSettingDword(NULL,MRA_AVT_SECT_NAME,"ServerPort",GetDlgItemInt(hWndDlg,IDC_SERVERPORT,NULL,FALSE));
+ GET_DLG_ITEM_TEXT(hWndDlg,IDC_SERVER,szServer,SIZEOF(szServer));DB_SetStringW(NULL,MRA_AVT_SECT_NAME,"Server",szServer);
+ }
+ return(TRUE);
+ }
+ break;
+ }
+return(FALSE);
+}
+
+
+DWORD MraAvatarsDeleteContactAvatarFile(HANDLE hAvatarsQueueHandle,HANDLE hContact)
+{
+ DWORD dwRetErrorCode,dwAvatarFormat;
+ char szFileName[MAX_FILEPATH];
+
+ if (hAvatarsQueueHandle)
+ {
+ MRA_AVATARS_QUEUE *pmraaqAvatarsQueue=(MRA_AVATARS_QUEUE*)hAvatarsQueueHandle;
+
+ dwAvatarFormat=GetContactAvatarFormat(hContact,PA_FORMAT_UNKNOWN);
+ if (DBGetContactSettingByte(NULL,MRA_AVT_SECT_NAME,"DeleteAvtOnContactDelete",MRA_DELETE_AVT_ON_CONTACT_DELETE) && dwAvatarFormat!=PA_FORMAT_DEFAULT)
+ {
+ if ((dwRetErrorCode=MraAvatarsGetFileName(hAvatarsQueueHandle,hContact,dwAvatarFormat,(LPSTR)szFileName,SIZEOF(szFileName),NULL))==NO_ERROR)
+ if (DeleteFileA(szFileName))
+ {
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ dwRetErrorCode=GetLastError();
+ }
+ }else{
+ dwRetErrorCode=NO_ERROR;
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
diff --git a/protocols/MRA/MraAvatars.h b/protocols/MRA/MraAvatars.h
new file mode 100644
index 0000000000..b46b85f4fe
--- /dev/null
+++ b/protocols/MRA/MraAvatars.h
@@ -0,0 +1,35 @@
+#if !defined(AFX_MRA_AVATARS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
+#define AFX_MRA_AVATARS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_
+
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+
+
+
+DWORD MraAvatarsQueueInitialize (HANDLE *phAvatarsQueueHandle);
+void MraAvatarsQueueDestroy (HANDLE hAvatarsQueueHandle);
+
+
+#define PA_FORMAT_DEFAULT 255 // return file name of def avatar
+#define GetContactAvatarFormat(hContact,dwDefaultFormat) DB_Mra_GetByte(hContact,"AvatarType",dwDefaultFormat)
+#define SetContactAvatarFormat(hContact,dwFormat) DB_Mra_SetByte(hContact,"AvatarType",(BYTE)dwFormat)
+
+DWORD MraAvatarsGetFileName (HANDLE hAvatarsQueueHandle,HANDLE hContact,DWORD dwFormat,LPSTR lpszPath,SIZE_T dwPathSize,SIZE_T *pdwPathSizeRet);
+
+// mir flag: GAIF_FORCE
+DWORD MraAvatarsQueueGetAvatar (HANDLE hAvatarsQueueHandle,DWORD dwFlags,HANDLE hContact,DWORD *pdwAvatarsQueueID,DWORD *pdwFormat,LPSTR lpszPath);
+DWORD MraAvatarsQueueGetAvatarSimple (HANDLE hAvatarsQueueHandle,DWORD dwFlags,HANDLE hContact,DWORD dwSourceID);
+
+
+INT_PTR CALLBACK MraAvatarsQueueDlgProcOpts (HWND hWndDlg,UINT msg,WPARAM wParam,LPARAM lParam);
+
+DWORD MraAvatarsDeleteContactAvatarFile (HANDLE hAvatarsQueueHandle,HANDLE hContact);
+
+
+
+
+#endif // !defined(AFX_MRA_AVATARS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/MraChat.cpp b/protocols/MRA/MraChat.cpp
new file mode 100644
index 0000000000..c0e0484c9e
--- /dev/null
+++ b/protocols/MRA/MraChat.cpp
@@ -0,0 +1,389 @@
+#include "Mra.h"
+#include "MraChat.h"
+#include "proto.h"
+
+
+
+//static COLORREF crCols[16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+static LPWSTR lpwszStatuses[]={ L"Owners",L"Inviter",L"Visitors" };
+#define MRA_CHAT_STATUS_OWNER 0
+#define MRA_CHAT_STATUS_INVITER 1
+#define MRA_CHAT_STATUS_VISITOR 2
+
+
+
+
+int MraChatGcEventHook (WPARAM, LPARAM lParam);
+void MraChatSendPrivateMessage (LPWSTR lpwszEMail);
+
+
+void MraChatDllError()
+{
+ MessageBoxW(NULL,TranslateW(L"CHAT plugin is required for conferences. Install it before chatting"),PROTOCOL_DISPLAY_NAMEW,(MB_OK|MB_ICONWARNING));
+}
+
+
+
+BOOL MraChatRegister()
+{
+ BOOL bRet=FALSE;
+
+ if (ServiceExists(MS_GC_REGISTER))
+ {
+ GCREGISTER gcr={0};
+ gcr.cbSize=sizeof(GCREGISTER);
+ gcr.dwFlags=GC_UNICODE;
+ gcr.iMaxText=MRA_MAXLENOFMESSAGE;
+ gcr.nColors=0;
+ //gcr.pColors=&crCols[0];
+ gcr.pszModuleDispName=PROTOCOL_DISPLAY_NAMEA;
+ gcr.pszModule=PROTOCOL_NAMEA;
+ CallServiceSync(MS_GC_REGISTER,NULL,(LPARAM)&gcr);
+
+ HookEvent(ME_GC_EVENT,&MraChatGcEventHook);
+ //HookEvent(ME_GC_BUILDMENU, &CJabberProto::JabberGcMenuHook );
+
+ bRet=TRUE;
+ }else{
+ MraChatDllError();
+ }
+return(bRet);
+}
+
+
+INT_PTR MraChatSessionNew(HANDLE hContact)
+{
+ INT_PTR iRet=1;
+
+ if (masMraSettings.bChatExist)
+ if (hContact)
+ {
+ GCSESSION gcw={0};
+ WCHAR wszEMail[MAX_EMAIL_LEN]={0};
+
+ gcw.cbSize=sizeof(GCSESSION);
+ gcw.iType=GCW_CHATROOM;
+ gcw.pszModule=PROTOCOL_NAMEA;
+ gcw.ptszName=GetContactNameW(hContact);
+ gcw.ptszID=(LPWSTR)wszEMail;
+ gcw.ptszStatusbarText=L"status bar";
+ gcw.dwFlags=GC_UNICODE;
+ gcw.dwItemData=(DWORD)hContact;
+ DB_Mra_GetStaticStringW(hContact,"e-mail",wszEMail,SIZEOF(wszEMail),NULL);
+ iRet=CallServiceSync(MS_GC_NEWSESSION,NULL,(LPARAM)&gcw);
+
+ if (iRet==0)
+ {
+ CHAR szEMail[MAX_EMAIL_LEN]={0};
+ SIZE_T dwEMailSize;
+ GCDEST gcd={0};
+ GCEVENT gce={0};
+
+ gcd.pszModule=PROTOCOL_NAMEA;
+ gcd.ptszID=(LPWSTR)wszEMail;
+ gcd.iType=GC_EVENT_ADDGROUP;
+
+ gce.cbSize=sizeof(GCEVENT);
+ gce.pDest=&gcd;
+ gce.dwFlags=GC_UNICODE;
+ for (SIZE_T i=0;i<SIZEOF(lpwszStatuses);i++)
+ {
+ gce.ptszStatus=TranslateW(lpwszStatuses[i]);
+ CallServiceSync(MS_GC_EVENT,NULL,(LPARAM)&gce);
+ }
+
+ gce.cbSize=sizeof(GCEVENT);
+ gce.pDest=&gcd;
+ gcd.iType=GC_EVENT_CONTROL;
+
+ CallServiceSync(MS_GC_EVENT,SESSION_INITDONE,(LPARAM)&gce);
+ CallServiceSync(MS_GC_EVENT,SESSION_ONLINE,(LPARAM)&gce);
+
+ //MraChatSessionJoinUser(hContact,NULL,0,0);
+ (*(DWORD*)wszEMail)=MULTICHAT_GET_MEMBERS;
+ DB_Mra_GetStaticStringA(hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize);
+ MraSendCommand_MessageW(FALSE,NULL,0,MESSAGE_FLAG_MULTICHAT,szEMail,dwEMailSize,NULL,0,(LPBYTE)wszEMail,4);
+ }
+ }
+return(iRet);
+}
+
+
+void MraChatSessionDestroy(HANDLE hContact)
+{
+ if (masMraSettings.bChatExist)
+ {
+ GCDEST gcd={0};
+ GCEVENT gce={0};
+ WCHAR wszEMail[MAX_EMAIL_LEN]={0};
+
+ gcd.pszModule=PROTOCOL_NAMEA;
+ gcd.iType=GC_EVENT_CONTROL;
+ if (hContact)
+ {
+ gcd.ptszID=(LPWSTR)wszEMail;
+ DB_Mra_GetStaticStringW(hContact,"e-mail",wszEMail,SIZEOF(wszEMail),NULL);
+ }
+ gce.cbSize=sizeof(GCEVENT);
+ gce.pDest=&gcd;
+ gce.dwFlags=GC_UNICODE;
+
+ CallServiceSync(MS_GC_EVENT,SESSION_TERMINATE,(LPARAM)&gce);
+ CallServiceSync(MS_GC_EVENT,WINDOW_CLEARLOG,(LPARAM)&gce);
+ }
+}
+
+
+
+
+INT_PTR MraChatSessionEventSendByHandle(HANDLE hContactChatSession,DWORD dwType,DWORD dwFlags,LPSTR lpszUID,SIZE_T dwUIDSize,LPWSTR lpwszStatus,LPWSTR lpwszMessage,DWORD_PTR dwItemData,DWORD dwTime)
+{
+ INT_PTR iRet=1;
+
+ if (masMraSettings.bChatExist)
+ {
+ GCDEST gcd={0};
+ GCEVENT gce={0};
+ WCHAR wszID[MAX_EMAIL_LEN]={0},wszUID[MAX_EMAIL_LEN]={0},wszNick[MAX_EMAIL_LEN]={0};
+
+ gcd.pszModule=PROTOCOL_NAMEA;
+ if (hContactChatSession)
+ {
+ gcd.ptszID=(LPWSTR)wszID;
+ DB_Mra_GetStaticStringW(hContactChatSession,"e-mail",wszID,SIZEOF(wszID),NULL);
+ }
+ gcd.iType=dwType;
+
+ gce.cbSize=sizeof(GCEVENT);
+ gce.pDest=&gcd;
+ gce.dwFlags=GC_UNICODE|dwFlags;
+ gce.ptszUID=wszUID;
+ gce.ptszStatus=lpwszStatus;
+ gce.ptszText=lpwszMessage;
+ gce.dwItemData=dwItemData;
+ gce.time=dwTime;
+
+ if (lpszUID && dwUIDSize)
+ {
+ gce.bIsMe=IsEMailMy(lpszUID,dwUIDSize);
+ }else{
+ gce.bIsMe=TRUE;
+ }
+
+ if (gce.bIsMe)
+ {
+ DB_Mra_GetStaticStringW(NULL,"e-mail",wszUID,SIZEOF(wszUID),NULL);
+ DB_Mra_GetStaticStringW(NULL,"Nick",wszNick,SIZEOF(wszNick),NULL);
+ gce.ptszNick=wszNick;
+ }else{
+ HANDLE hContactSender;
+
+ hContactSender=MraHContactFromEmail(lpszUID,dwUIDSize,FALSE,TRUE,NULL);
+ MultiByteToWideChar(MRA_CODE_PAGE,0,lpszUID,dwUIDSize,wszUID,SIZEOF(wszUID));
+ if (hContactSender)
+ {
+ gce.ptszNick=GetContactNameW(hContactSender);
+ }else{
+ gce.ptszNick=wszUID;
+ }
+ }
+
+ iRet=CallServiceSync(MS_GC_EVENT,NULL,(LPARAM)&gce);
+ }
+return(iRet);
+}
+
+
+
+
+
+INT_PTR MraChatSessionInvite(HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize,DWORD dwTime)
+{
+ INT_PTR iRet=1;
+
+ if (hContactChatSession)
+ {
+ WCHAR wszEMailInMultiChat[MAX_EMAIL_LEN]={0},wszBuff[((MAX_EMAIL_LEN*2)+MAX_PATH)];
+
+ MultiByteToWideChar(MRA_CODE_PAGE,0,lpszEMailInMultiChat,dwEMailInMultiChatSize,wszEMailInMultiChat,SIZEOF(wszEMailInMultiChat));
+ mir_sntprintf(wszBuff,SIZEOF(wszBuff),L"[%s]: %s",wszEMailInMultiChat,TranslateW(L"invite sender"));
+
+ iRet=MraChatSessionEventSendByHandle(hContactChatSession,GC_EVENT_ACTION,GCEF_ADDTOLOG,lpszEMailInMultiChat,dwEMailInMultiChatSize,NULL,wszBuff,0,dwTime);
+ }
+return(iRet);
+}
+
+
+INT_PTR MraChatSessionMembersAdd(HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize,DWORD dwTime)
+{
+ INT_PTR iRet=1;
+
+ if (hContactChatSession)
+ {
+ WCHAR wszEMailInMultiChat[MAX_EMAIL_LEN]={0},wszBuff[((MAX_EMAIL_LEN*2)+MAX_PATH)];
+
+ MultiByteToWideChar(MRA_CODE_PAGE,0,lpszEMailInMultiChat,dwEMailInMultiChatSize,wszEMailInMultiChat,SIZEOF(wszEMailInMultiChat));
+ mir_sntprintf(wszBuff,SIZEOF(wszBuff),L"[%s]: %s",wszEMailInMultiChat,TranslateW(L"invite new members"));
+
+ iRet=MraChatSessionEventSendByHandle(hContactChatSession,GC_EVENT_ACTION,GCEF_ADDTOLOG,lpszEMailInMultiChat,dwEMailInMultiChatSize,NULL,wszBuff,0,dwTime);
+ }
+return(iRet);
+}
+
+
+INT_PTR MraChatSessionJoinUser(HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize,DWORD dwTime)
+{
+ INT_PTR iRet=1;
+
+ if (hContactChatSession)
+ {
+ iRet=MraChatSessionEventSendByHandle(hContactChatSession,GC_EVENT_JOIN,GCEF_ADDTOLOG,lpszEMailInMultiChat,dwEMailInMultiChatSize,lpwszStatuses[MRA_CHAT_STATUS_VISITOR],L"",0,dwTime);
+ }
+return(iRet);
+}
+
+
+INT_PTR MraChatSessionLeftUser(HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize,DWORD dwTime)
+{
+ INT_PTR iRet=1;
+
+ if (hContactChatSession)
+ {
+ iRet=MraChatSessionEventSendByHandle(hContactChatSession,GC_EVENT_PART,GCEF_ADDTOLOG,lpszEMailInMultiChat,dwEMailInMultiChatSize,NULL,NULL,0,dwTime);
+ }
+return(iRet);
+}
+
+
+INT_PTR MraChatSessionSetIviter(HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize)
+{
+ INT_PTR iRet=1;
+
+ if (hContactChatSession && lpszEMailInMultiChat && dwEMailInMultiChatSize)
+ {
+ //iRet=MraChatSessionEventSendByHandle(hContactChatSession,GC_EVENT_REMOVESTATUS,0,lpszEMailInMultiChat,dwEMailInMultiChatSize,lpwszStatuses[MRA_CHAT_STATUS_VISITOR],NULL,0,0);
+ iRet=MraChatSessionEventSendByHandle(hContactChatSession,GC_EVENT_ADDSTATUS,0,lpszEMailInMultiChat,dwEMailInMultiChatSize,lpwszStatuses[MRA_CHAT_STATUS_INVITER],NULL,0,0);
+ }
+return(iRet);
+}
+
+
+INT_PTR MraChatSessionSetOwner(HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize)
+{
+ INT_PTR iRet=1;
+
+ if (hContactChatSession && lpszEMailInMultiChat && dwEMailInMultiChatSize)
+ {
+ iRet=MraChatSessionEventSendByHandle(hContactChatSession,GC_EVENT_ADDSTATUS,0,lpszEMailInMultiChat,dwEMailInMultiChatSize,lpwszStatuses[MRA_CHAT_STATUS_OWNER],NULL,0,0);
+ }
+return(iRet);
+}
+
+
+INT_PTR MraChatSessionMessageAdd(HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize,LPWSTR lpwszMessage,SIZE_T dwMessageSize,DWORD dwTime)
+{
+ INT_PTR iRet=1;
+
+ if (hContactChatSession)
+ {
+ LPWSTR lpwszMessageLocal;
+
+ lpwszMessageLocal=(LPWSTR)MEMALLOC((dwMessageSize*sizeof(WCHAR)));
+ if (lpwszMessageLocal)
+ {// we need zeros after text allways
+ memmove((LPVOID)lpwszMessageLocal,lpwszMessage,(dwMessageSize*sizeof(WCHAR)));//gce.ptszText=lpwszMessage;
+
+ iRet=MraChatSessionEventSendByHandle(hContactChatSession,GC_EVENT_MESSAGE,GCEF_ADDTOLOG,lpszEMailInMultiChat,dwEMailInMultiChatSize,NULL,lpwszMessageLocal,0,dwTime);
+
+ MEMFREE(lpwszMessageLocal);
+ }
+ }
+return(iRet);
+}
+
+
+
+int MraChatGcEventHook(WPARAM, LPARAM lParam)
+{
+ int iRet=0;
+
+ if (lParam)
+ if (masMraSettings.bChatExist)
+ {
+ GCHOOK* gch=(GCHOOK*)lParam;
+
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,gch->pDest->pszModule,-1,PROTOCOL_NAMEA,PROTOCOL_NAME_LEN)==CSTR_EQUAL)
+ {
+ switch(gch->pDest->iType){
+ case GC_USER_MESSAGE:
+ if (gch->ptszText && lstrlen(gch->ptszText))
+ {
+ BOOL bSlowSend;
+ CHAR szEMail[MAX_EMAIL_LEN]={0};
+ DWORD dwFlags=0;
+ SIZE_T dwEMailSize,dwMessageSize;
+ INT_PTR iSendRet;
+ HANDLE hContact;
+
+ //rtrim(gch->ptszText);
+ //TCHAR* buf = NEWTSTR_ALLOCA(gch->ptszText);
+ //UnEscapeChatTags( buf );
+
+ dwMessageSize=lstrlenW(gch->ptszText);
+ dwEMailSize=(WideCharToMultiByte(MRA_CODE_PAGE,0,gch->pDest->ptszID,-1,szEMail,SIZEOF(szEMail),NULL,NULL)-1);
+ hContact=MraHContactFromEmail(szEMail,dwEMailSize,FALSE,TRUE,NULL);
+ bSlowSend=DB_Mra_GetByte(NULL,"SlowSend",MRA_DEFAULT_SLOW_SEND);
+
+ if (DB_Mra_GetByte(NULL,"RTFSendEnable",MRA_DEFAULT_RTF_SEND_ENABLE) && (MraContactCapabilitiesGet(hContact)&FEATURE_FLAG_RTF_MESSAGE))
+ {
+ dwFlags|=MESSAGE_FLAG_RTF;
+ }
+
+ iSendRet=MraSendCommand_MessageW(bSlowSend,hContact,ACKTYPE_MESSAGE,dwFlags,szEMail,dwEMailSize,gch->ptszText,dwMessageSize,NULL,0);
+ if (bSlowSend==FALSE)
+ {
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,ACKTYPE_MESSAGE,ACKRESULT_SUCCESS,(HANDLE)iSendRet,(LPARAM)NULL,0);
+ }
+
+ MraChatSessionEventSendByHandle(hContact,GC_EVENT_MESSAGE,GCEF_ADDTOLOG,NULL,0,NULL,gch->ptszText,0,(DWORD)_time32(NULL));
+ }
+ break;
+ case GC_USER_PRIVMESS:
+ MraChatSendPrivateMessage(gch->ptszUID);
+ break;
+ case GC_USER_LOGMENU:
+ //sttLogListHook( this, item, gch );
+ break;
+ case GC_USER_NICKLISTMENU:
+ //sttNickListHook( this, item, gch );
+ break;
+ case GC_USER_CHANMGR:
+ //int iqId = SerialNext();
+ //IqAdd( iqId, IQ_PROC_NONE, &CJabberProto::OnIqResultGetMuc );
+ //m_ThreadInfo->send( XmlNodeIq( _T("get"), iqId, item->jid ) << XQUERY( xmlnsOwner ));
+ break;
+ }
+ }
+ }
+return(iRet);
+}
+
+
+void MraChatSendPrivateMessage(LPWSTR lpwszEMail)
+{
+ BOOL bAdded;
+ HANDLE hContact;
+ CHAR szEMail[MAX_EMAIL_LEN]={0};
+ SIZE_T dwEMailSize;
+
+ dwEMailSize=(WideCharToMultiByte(MRA_CODE_PAGE,0,lpwszEMail,-1,szEMail,SIZEOF(szEMail),NULL,NULL)-1);
+ hContact=MraHContactFromEmail(szEMail,dwEMailSize,TRUE,TRUE,&bAdded);
+
+ if (bAdded) DBWriteContactSettingByte(hContact,"CList","Hidden",1);
+ CallService(MS_IGNORE_UNIGNORE,(WPARAM)hContact,IGNOREEVENT_ALL);
+ CallService(MS_MSG_SENDMESSAGE,(WPARAM)hContact,0);
+}
+
+
+
+
diff --git a/protocols/MRA/MraChat.h b/protocols/MRA/MraChat.h
new file mode 100644
index 0000000000..540ceeceaa
--- /dev/null
+++ b/protocols/MRA/MraChat.h
@@ -0,0 +1,30 @@
+#if !defined(AFX_MRA_CHAT_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
+#define AFX_MRA_CHAT_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_
+
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+
+void MraChatDllError ();
+BOOL MraChatRegister ();
+INT_PTR MraChatSessionNew (HANDLE hContactChatSession);
+void MraChatSessionDestroy (HANDLE hContactChatSession);
+INT_PTR MraChatSessionEventSendByHandle (HANDLE hContactChatSession,DWORD dwType,DWORD dwFlags,LPSTR lpszUID,SIZE_T dwUIDSize,LPWSTR lpwszStatus,LPWSTR lpwszMessage,DWORD_PTR dwItemData,DWORD dwTime);
+INT_PTR MraChatSessionInvite (HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize,DWORD dwTime);
+INT_PTR MraChatSessionMembersAdd (HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize,DWORD dwTime);
+INT_PTR MraChatSessionJoinUser (HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize,DWORD dwTime);
+INT_PTR MraChatSessionLeftUser (HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize,DWORD dwTime);
+INT_PTR MraChatSessionSetIviter (HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize);
+INT_PTR MraChatSessionSetOwner (HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize);
+INT_PTR MraChatSessionMessageAdd (HANDLE hContactChatSession,LPSTR lpszEMailInMultiChat,SIZE_T dwEMailInMultiChatSize,LPWSTR lpwszMessage,SIZE_T dwMessageSize,DWORD dwTime);
+
+
+
+
+
+
+
+#endif // !defined(AFX_MRA_CHAT_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/MraConstans.h b/protocols/MRA/MraConstans.h
new file mode 100644
index 0000000000..330b8aa872
--- /dev/null
+++ b/protocols/MRA/MraConstans.h
@@ -0,0 +1,667 @@
+#if !defined(AFX_MRA_CONSTANS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
+#define AFX_MRA_CONSTANS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_
+
+
+#include "proto.h"
+
+
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+#define MIN_MIR_VER_VERSION_DWORD PLUGIN_MAKE_VERSION(0,9,0,0)
+
+
+#define PLUGIN_VERSION_DWORD PLUGIN_MAKE_VERSION(PROTO_VERSION_MAJOR,PROTO_VERSION_MINOR,0,1)
+#define PROTOCOL_DISPLAY_NAME_ORIGA "Mail.ru Agent"
+
+#define MIRVER_UNKNOWN ("Mail.ru Agent unknown client")
+
+
+#define PROTOCOL_NAMEA masMraSettings.szModuleName
+#define PROTOCOL_NAMEW masMraSettings.wszModuleName
+#define PROTOCOL_NAME_LEN masMraSettings.dwModuleNameLen
+#define PROTOCOL_NAME_SIZE (PROTOCOL_NAME_LEN+1)
+#define PROTOCOL_DISPLAY_NAMEA masMraSettings.szDisplayModuleName
+#define PROTOCOL_DISPLAY_NAMEW masMraSettings.wszDisplayModuleName
+
+
+#define MRA_PLUGIN_UPDATER_ID 2544 //
+#define MRA_SERVER_PORT_STANDART_NLB 2042
+#define MRA_SERVER_PORT_STANDART 2041
+#define MRA_SERVER_PORT_HTTPS 443
+static const LPSTR lpcszMailRuDomains[]=
+{
+ ("mail.ru"),
+ ("list.ru"),
+ ("bk.ru"),
+ ("inbox.ru"),
+ ("corp.mail.ru"),
+ NULL
+};
+#define MAILRU_CHAT_CONF_DOMAIN "chat.agent"
+
+
+#define MAX_EMAIL_LEN 1024
+#define MAX_FILEPATH 32768 //internal
+#define BUFF_SIZE_RCV 65535 //internal
+#define BUFF_SIZE_RCV_MIN_FREE 16384 //internal
+#define BUFF_SIZE_BLOB 16384 //internal
+#define BUFF_SIZE_URL 4096 //internal
+#define NETLIB_SELECT_TIMEOUT 250 //internal //
+#define WAIT_FOR_THREAD_TIMEOUT 15 //internal //
+#define THREAD_SLEEP_TIME 100 //internal
+#define THREAD_MAX_PING_TIME 20 // sec, internal
+#define THREAD_MAX_PING_FAIL_COUNT 3 // internal
+#define SEND_QUEUE_TIMEOUT 600 //internal //
+#define ALLOCATED_COUNT 32 //internal //
+#define EMAILS_MIN_COUNT 16 //internal // email
+#define PHONES_MIN_COUNT 4 //internal // email
+
+
+
+#define MRA_ALARM_MESSAGE L"Your contact wakes you"
+
+#define MRA_GOTO_INBOX "/GotoInbox"
+#define MRA_GOTO_INBOX_STR L"Display &Inbox"
+#define MRA_SHOW_INBOX_STATUS "/ShowInboxStatus"
+#define MRA_SHOW_INBOX_STATUS_STR L"Display &Inbox status"
+#define MRA_EDIT_PROFILE "/EditProfile"
+#define MRA_EDIT_PROFILE_STR L"Edit &Profile"
+#define MRA_MY_ALBUM "/MyAlbum"
+#define MRA_MY_ALBUM_STR L"My Album"
+#define MRA_MY_BLOG "/MyBlog"
+#define MRA_MY_BLOG_STR L"My Blog"
+#define MRA_MY_BLOGSTATUS "/MyBlogStatus"
+#define MRA_MY_BLOGSTATUS_STR L"My Blog Status"
+#define MRA_MY_VIDEO "/MyVideo"
+#define MRA_MY_VIDEO_STR L"My Video"
+#define MRA_MY_ANSWERS "/MyAnswers"
+#define MRA_MY_ANSWERS_STR L"My Answers"
+#define MRA_MY_WORLD "/MyWorld"
+#define MRA_MY_WORLD_STR L"My World"
+#define MRA_ZHUKI "/Zhuki"
+#define MRA_ZHUKI_STR L"Zhuki"
+#define MRA_CHAT "/Chat"
+#define MRA_CHAT_STR L"Chat"
+#define MRA_WEB_SEARCH "/WebSearch"
+#define MRA_WEB_SEARCH_STR L"Web search"
+#define MRA_UPD_ALL_USERS_INFO "/UpdateAllUsersInfo"
+#define MRA_UPD_ALL_USERS_INFO_STR L"Update all users info"
+#define MRA_CHK_UPDATES_USERS_AVATARS "/CheckUpdatesUsersAvatars"
+#define MRA_CHK_UPDATES_USERS_AVATARS_STR L"Check updates users avatars"
+#define MRA_REQ_AUTH_FOR_ALL "/ReqAuthForAll"
+#define MRA_REQ_AUTH_FOR_ALL_STR L"Request authorization for all"
+
+
+#define MRA_MPOP_AUTH_URL "http://swa.mail.ru/cgi-bin/auth?Login=%s&agent=%s&page=%s"
+
+#define MRA_WIN_INBOX_URL "http://win.mail.ru/cgi-bin/start"
+#define MRA_PDA_INBOX_URL "http://pda.mail.ru/cgi-bin/start"
+#define MRA_EDIT_PROFILE_URL "http://win.mail.ru/cgi-bin/userinfo?mra=1"
+#define MRA_CHAT_URL "http://chat.mail.ru"
+#define MRA_ZHUKI_URL "http://zhuki.mail.ru"
+#define MRA_SEARCH_URL "http://go.mail.ru"
+
+// used spesialy! added: /domain/user
+#define MRA_BLOGS_URL "http://blogs.mail.ru"
+#define MRA_FOTO_URL "http://foto.mail.ru"
+#define MRA_VIDEO_URL "http://video.mail.ru"
+#define MRA_ANSWERS_URL "http://otvet.mail.ru"
+#define MRA_WORLD_URL "http://my.mail.ru"
+
+
+// without auth
+#define MRA_REGISTER_URL "http://win.mail.ru/cgi-bin/signup"
+#define MRA_FORGOT_PASSWORD_URL "http://win.mail.ru/cgi-bin/passremind"
+
+
+// wParam=(WPARAM)hContact
+#define MRA_REQ_AUTH "/ReqAuth"
+#define MRA_REQ_AUTH_STR L"Request authorization"
+#define MRA_GRANT_AUTH "/GrantAuth"
+#define MRA_GRANT_AUTH_STR L"Grant authorization"
+#define MRA_SEND_POSTCARD "/SendPostcard"
+#define MRA_SEND_POSTCARD_STR L"&Send postcard"
+#define MRA_VIEW_ALBUM "/ViewAlbum"
+#define MRA_VIEW_ALBUM_STR L"&View Album"
+#define MRA_READ_BLOG "/ReadBlog"
+#define MRA_READ_BLOG_STR L"&Read Blog"
+#define MRA_REPLY_BLOG_STATUS "/ReplyBlogStatus"
+#define MRA_REPLY_BLOG_STATUS_STR L"Reply Blog Status"
+#define MRA_VIEW_VIDEO "/ViewVideo"
+#define MRA_VIEW_VIDEO_STR L"View Video"
+#define MRA_ANSWERS "/Answers"
+#define MRA_ANSWERS_STR L"Answers"
+#define MRA_WORLD "/World"
+#define MRA_WORLD_STR L"World"
+#define MRA_SEND_NUDGE "/SendNudge"
+#define MS_NUDGE "/Nudge"
+#define MRA_SENDNUDGE_STR L"Send &Nudge"
+
+
+#define ADV_ICON_DELETED 0
+#define ADV_ICON_DELETED_ID "ADV_ICON_DELETED"
+#define ADV_ICON_DELETED_STR L"Mail box deleted"
+#define ADV_ICON_NOT_ON_SERVER 1
+#define ADV_ICON_NOT_ON_SERVER_ID "ADV_ICON_NOT_ON_SERVER"
+#define ADV_ICON_NOT_ON_SERVER_STR L"Contact not on server"
+#define ADV_ICON_NOT_AUTHORIZED 2
+#define ADV_ICON_NOT_AUTHORIZED_ID "ADV_ICON_NOT_AUTHORIZED"
+#define ADV_ICON_NOT_AUTHORIZED_STR L"Not authorized"
+#define ADV_ICON_PHONE 3
+#define ADV_ICON_PHONE_ID "ADV_ICON_PHONE"
+#define ADV_ICON_PHONE_STR L"Phone/SMS only contact"
+#define ADV_ICON_BLOGSTATUS 4
+#define ADV_ICON_BLOGSTATUS_ID "ADV_ICON_BLOGSTATUS"
+#define ADV_ICON_BLOGSTATUS_STR L"Blog status message"
+#define ADV_ICON_MAX 5
+
+static const GUI_DISPLAY_ITEM gdiExtraStatusIconsItems[] =
+{
+ { ADV_ICON_DELETED_ID, ADV_ICON_DELETED_STR, (INT_PTR)IDI_ERROR, NULL },
+ { ADV_ICON_NOT_ON_SERVER_ID, ADV_ICON_NOT_ON_SERVER_STR, IDI_AUTHGRANT, NULL },
+ { ADV_ICON_NOT_AUTHORIZED_ID, ADV_ICON_NOT_AUTHORIZED_STR, IDI_AUTHRUGUEST, NULL },
+ { ADV_ICON_PHONE_ID, ADV_ICON_PHONE_STR, IDI_MRA_PHONE, NULL },
+ { ADV_ICON_BLOGSTATUS_ID, ADV_ICON_BLOGSTATUS_STR, IDI_BLOGSTATUS, NULL },
+};
+
+
+
+
+#define MRA_SOUND_NEW_EMAIL "New E-mail available in Inbox"
+
+
+#define MAILRU_SERVER_TIME_ZONE -180 //internal // +0300
+#define MAILRU_CONTACTISTYPING_TIMEOUT 10 //internal
+#define MRA_DEFAULT_SERVER "mrim.mail.ru"
+#define MRA_DEFAULT_SERVER_PORT MRA_SERVER_PORT_STANDART_NLB
+#define MRA_MAX_MRIM_SERVER 46
+#define MRA_DEFAULT_TIMEOUT_CONN_MRIM 20
+#define MRA_DEFAULT_CONN_RETRY_COUNT_MRIM 2
+#define MRA_DEFAULT_TIMEOUT_CONN_NLB 20
+#define MRA_DEFAULT_CONN_RETRY_COUNT_NLB 3
+#define MRA_DEFAULT_TIMEOUT_RECV_NLB 20
+#define MRA_DEFAULT_CONN_RETRY_COUNT_FILES 2
+#define MRA_DEFAULT_CONN_RETRY_COUNT_MRIMPROXY 3
+#define MRA_TIMEOUT_DIRECT_CONN 30 //internal;
+#define MRA_TIMEOUT_CONN_MIN 2 //internal;
+#define MRA_TIMEOUT_CONN_ 16 //internal;
+#define MRA_MAXLENOFMESSAGE 32768 //internal
+#define MRA_MAXCONTACTSPERPACKET 256 //internal
+#define MRA_CODE_PAGE 1251 //internal
+#define MRA_FEATURE_FLAGS (FEATURE_FLAG_BASE_SMILES|FEATURE_FLAG_ADVANCED_SMILES|FEATURE_FLAG_CONTACTS_EXCH|FEATURE_FLAG_WAKEUP|FEATURE_FLAG_MULTS|FEATURE_FLAG_FILE_TRANSFER|FEATURE_FLAG_GAMES)
+
+
+
+#define MRA_DEFAULT_POPUPS_ENABLED TRUE
+#define MRA_DEFAULT_POPUPS_EVENT_FILTER -1
+#define MRA_DEFAULT_POPUP_TIMEOUT 8
+#define MRA_DEFAULT_POPUP_USE_WIN_COLORS TRUE
+#define MRA_DEFAULT_POPUP_COLOR_BACK RGB(191,0,0) //Red
+#define MRA_DEFAULT_POPUP_COLOR_TEXT RGB(255,245,225) //Yellow
+
+
+
+#define MRA_DEFAULT_NLB_FAIL_DIRECT_CONNECT FALSE // hidden option
+#define MRA_DEFAULT_AUTO_ADD_CONTACTS_TO_SERVER TRUE
+#define MRA_DEFAULT_AUTO_AUTH_REQ_ON_LOGON FALSE
+#define MRA_DEFAULT_AUTO_AUTH_GRAND_IN_CLIST FALSE
+#define MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS FALSE
+#define MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK FALSE
+#define MRA_DEFAULT_SLOW_SEND TRUE
+#define MRA_DEFAULT_CVT_SMILES_TO_TAGS TRUE
+#define MRA_DEFAULT_MIRVER_RAW FALSE // hidden option
+#define MRA_DEFAULT_AUTH_MESSAGE L"Please authorize me"
+
+#define MRA_DEFAULT_RTF_RECEIVE_ENABLE FALSE
+#define MRA_DEFAULT_RTF_SEND_ENABLE TRUE
+#define MRA_DEFAULT_RTF_SEND_SMART TRUE
+#define MRA_DEFAULT_RTF_BACKGROUND_COLOUR RGB(255,255,255)
+#define MRA_DEFAULT_RTF_FONT_COLOUR RGB(255,0,0)
+#define MRA_DEFAULT_RTF_FONT_SIZE 12
+#define MRA_DEFAULT_RTF_FONT_CHARSET RUSSIAN_CHARSET
+#define MRA_DEFAULT_RTF_FONT_NAME L"Tahoma"
+
+#define MRA_DEFAULT_SEARCH_REMEMBER TRUE
+#define MRA_DEFAULT_LAST_SEARCH_COUTRY 0
+
+
+#define MRA_DEFAULT_FILE_SEND_BLOCK_SIZE 8192 //hidden,
+
+#define MRA_DEFAULT_HIDE_MENU_ITEMS_FOR_NON_MRA FALSE
+
+#define MRA_DEFAULT_INC_NEW_MAIL_NOTIFY FALSE
+#define MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY FALSE
+#define MRA_DEFAULT_TRAYICON_NEW_MAIL_CLK_TO_INBOX FALSE
+
+
+
+#define MRA_ANTISPAM_DEFAULT_ENABLE TRUE
+#define MRA_ANTISPAM_DEFAULT_CHK_TEMP_CONTACTS TRUE
+#define MRA_ANTISPAM_DEFAULT_DELETE_SPAMBOT_CONTACT FALSE
+#define MRA_ANTISPAM_DEFAULT_CLN_NON_ALPHNUM TRUE
+#define MRA_ANTISPAM_DEFAULT_MAX_LNG_CHANGES 5
+#define MRA_ANTISPAM_DEFAULT_SHOWPOP TRUE
+#define MRA_ANTISPAM_DEFAULT_WRITETOSYSTEMHISTORY TRUE
+#define MRA_ANTISPAM_DEFAULT_SEND_SPAM_REPORT_TO_SERVER TRUE
+
+
+#define MRA_AVT_DEFAULT_ENABLE TRUE
+#define MRA_AVT_DEFAULT_WRK_THREAD_COUNTS 4 // hidden
+#define MRA_AVT_DEFAULT_SERVER "obraz.foto.mail.ru"
+#define MRA_AVT_DEFAULT_SERVER_PORT 80
+#define MRA_AVT_DEFAULT_TIMEOUT_CONN 10
+#define MRA_AVT_DEFAULT_CONN_RETRY_COUNT 3
+#define MRA_AVT_DEFAULT_TIMEOUT_RECV 30
+#define MRA_AVT_DEFAULT_USE_KEEPALIVE_CONN TRUE
+#define MRA_AVT_DEFAULT_CHK_INTERVAL 60
+#define MRA_AVT_DEFAULT_AVT_FILENAME "_default.jpg"
+#define MRA_AVT_DEFAULT_RET_ABC_PATH TRUE
+#define MRA_DELETE_AVT_ON_CONTACT_DELETE TRUE
+#define MRA_AVT_DEFAULT_QE_CHK_INTERVAL 1000 //internal
+
+
+#define MRA_FILES_QUEUE_PROGRESS_INTERVAL 250 //internal
+#define MRA_FILES_NULL_ADDRR "192.168.0.1:26666;"
+#define MRA_DEF_FS_TIMEOUT_RECV 600
+#define MRA_DEF_FS_ENABLE_DIRECT_CONN TRUE
+#define MRA_DEF_FS_NO_OUT_CONN_ON_RCV FALSE
+#define MRA_DEF_FS_NO_OUT_CONN_ON_SEND FALSE
+#define MRA_DEF_FS_IGNORY_ADDITIONAL_PORTS FALSE
+#define MRA_DEF_FS_HIDE_MY_ADDRESSES FALSE
+#define MRA_DEF_FS_ADD_EXTRA_ADDRESSES FALSE
+#define MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS TRUE
+
+
+
+#define PS_GETMYAVATAR "/GetMyAvatar"
+//wParam=(char *)Buffer to file name
+//lParam=(int)Buffer size
+//return=0 for sucess
+
+
+
+#define ICQACKTYPE_SMS 1001
+#define ICQEVENTTYPE_SMS 2001 //database event type
+#define MS_ICQ_SENDSMS "/SendSMS"
+
+
+// Database setting names
+#define DBSETTING_CAPABILITIES "caps"
+#define DBSETTING_XSTATUSID "XStatusId"
+#define DBSETTING_XSTATUSNAME "XStatusName"
+#define DBSETTING_XSTATUSMSG "XStatusMsg"
+#define DBSETTING_BLOGSTATUSTIME "BlogStatusTime"
+#define DBSETTING_BLOGSTATUSID "BlogStatusID"
+#define DBSETTING_BLOGSTATUS "BlogStatus"
+#define DBSETTING_BLOGSTATUSMUSIC "ListeningTo"
+
+#define PS_ICQ_SETCUSTOMSTATUS "/SetXStatus"
+#define PS_ICQ_SETCUSTOMSTATUSEX "/SetXStatusEx"
+#define PS_ICQ_GETCUSTOMSTATUS "/GetXStatus"
+#define PS_ICQ_GETCUSTOMSTATUSEX "/GetXStatusEx"
+#define PS_ICQ_GETCUSTOMSTATUSICON "/GetXStatusIcon"
+
+
+#define CSSF_MASK_STATUS 0x0001 // status member valid for set/get
+#define CSSF_MASK_NAME 0x0002 // pszName member valid for set/get
+#define CSSF_MASK_MESSAGE 0x0004 // pszMessage member valid for set/get
+#define CSSF_DISABLE_UI 0x0040 // disable default custom status UI, wParam = bEnable
+#define CSSF_DEFAULT_NAME 0x0080 // only with CSSF_MASK_NAME and get API to get default custom status name (wParam = status)
+#define CSSF_STATUSES_COUNT 0x0100 // returns number of custom statuses in wParam, only get API
+#define CSSF_STR_SIZES 0x0200 // returns sizes of custom status name & message (wParam & lParam members) in chars
+#define CSSF_UNICODE 0x1000 // strings are in UCS-2
+
+
+
+typedef struct {
+ int cbSize; // size of the structure
+ int flags; // combination of CSSF_*
+ int *status; // custom status id
+ union {
+ char *pszName; // buffer for custom status name
+ TCHAR *ptszName;
+ WCHAR *pwszName;
+ };
+ union {
+ char *pszMessage; // buffer for custom status message
+ TCHAR *ptszMessage;
+ WCHAR *pwszMessage;
+ };
+ WPARAM *wParam; // extra params, see flags
+ LPARAM *lParam;
+} ICQ_CUSTOM_STATUS;
+
+
+
+
+
+
+
+
+
+
+
+INT_PTR MraGetCaps (WPARAM wParam,LPARAM lParam);
+INT_PTR MraGetName (WPARAM wParam,LPARAM lParam);
+INT_PTR MraLoadIcon (WPARAM wParam,LPARAM lParam);
+INT_PTR MraSetStatus (WPARAM wParam,LPARAM lParam);
+INT_PTR MraGetStatus (WPARAM wParam,LPARAM lParam);
+
+INT_PTR MraSetXStatus (WPARAM wParam,LPARAM lParam);
+INT_PTR MraSetXStatusEx (WPARAM wParam,LPARAM lParam);
+INT_PTR MraGetXStatus (WPARAM wParam,LPARAM lParam);
+INT_PTR MraGetXStatusEx (WPARAM wParam,LPARAM lParam);
+INT_PTR MraGetXStatusIcon (WPARAM wParam,LPARAM lParam);
+
+INT_PTR MraSetListeningTo (WPARAM wParam,LPARAM lParam);
+
+INT_PTR MraSetAwayMsgA (WPARAM wParam,LPARAM lParam);
+INT_PTR MraSetAwayMsg (WPARAM wParam,LPARAM lParam);
+INT_PTR MraGetAwayMsg (WPARAM wParam,LPARAM lParam);
+
+INT_PTR MraAuthAllow (WPARAM wParam,LPARAM lParam);
+INT_PTR MraAuthDeny (WPARAM wParam,LPARAM lParam);
+INT_PTR MraAddToList (WPARAM wParam,LPARAM lParam);
+INT_PTR MraAddToListByEvent (WPARAM wParam,LPARAM lParam);
+
+INT_PTR MraRecvMessage (WPARAM wParam,LPARAM lParam);
+INT_PTR MraRecvContacts (WPARAM wParam,LPARAM lParam);
+INT_PTR MraRecvFile (WPARAM wParam,LPARAM lParam);
+INT_PTR MraRecvAuth (WPARAM wParam,LPARAM lParam);
+
+INT_PTR MraSendAuthRequest (WPARAM wParam,LPARAM lParam);
+INT_PTR MraSendMessage (WPARAM wParam,LPARAM lParam);
+INT_PTR MraSendContacts (WPARAM wParam,LPARAM lParam);
+INT_PTR MraSendUserIsTyping (WPARAM wParam,LPARAM lParam);
+INT_PTR MraSendNudge (WPARAM wParam,LPARAM lParam);
+INT_PTR MraSetApparentMode (WPARAM wParam,LPARAM lParam);
+INT_PTR MraGetInfo (WPARAM wParam,LPARAM lParam);
+
+INT_PTR MraBasicSearch (WPARAM wParam,LPARAM lParam);
+INT_PTR MraSearchByEmail (WPARAM wParam,LPARAM lParam);
+INT_PTR MraSearchByName (WPARAM wParam,LPARAM lParam);
+INT_PTR MraCreateAdvSearchUI (WPARAM wParam,LPARAM lParam);
+INT_PTR MraSearchByAdvanced (WPARAM wParam,LPARAM lParam);
+
+INT_PTR MraGetAvatarCaps (WPARAM wParam,LPARAM lParam);
+INT_PTR MraGetAvatarInfo (WPARAM wParam,LPARAM lParam);
+INT_PTR MraGetMyAvatar (WPARAM wParam,LPARAM lParam);
+
+INT_PTR MraFileResume (WPARAM wParam,LPARAM lParam);
+INT_PTR MraFileAllow (WPARAM wParam,LPARAM lParam);
+INT_PTR MraFileDenyCancel (WPARAM wParam,LPARAM lParam);
+INT_PTR MraFileSend (WPARAM wParam,LPARAM lParam);
+
+
+INT_PTR MraSendSMS (WPARAM wParam,LPARAM lParam);
+
+
+static const SERVICE_ITEM siPluginServices[] =
+{
+ { PS_GETCAPS, MraGetCaps },
+ { PS_GETNAME, MraGetName },
+ { PS_LOADICON, MraLoadIcon },
+ { PS_SETSTATUS, MraSetStatus },
+ { PS_GETSTATUS, MraGetStatus },
+
+ { PS_ICQ_SETCUSTOMSTATUS, MraSetXStatus },
+ { PS_ICQ_SETCUSTOMSTATUSEX, MraSetXStatusEx },
+ { PS_ICQ_GETCUSTOMSTATUS, MraGetXStatus },
+ { PS_ICQ_GETCUSTOMSTATUSEX, MraGetXStatusEx },
+ { PS_ICQ_GETCUSTOMSTATUSICON, MraGetXStatusIcon },
+
+ { PS_SET_LISTENINGTO, MraSetListeningTo },
+
+ { PS_SETAWAYMSG, MraSetAwayMsgA },
+ { PS_SETAWAYMSGW, MraSetAwayMsg },
+ { PSS_GETAWAYMSG, MraGetAwayMsg },
+
+ { PS_AUTHALLOW, MraAuthAllow },
+ { PS_AUTHDENYW, MraAuthDeny },
+
+ { PS_ADDTOLIST, MraAddToList },
+ { PS_ADDTOLISTBYEVENT, MraAddToListByEvent },
+
+ { PSR_MESSAGE, MraRecvMessage },
+ { PSR_CONTACTS, MraRecvContacts },
+ { PSR_FILE, MraRecvFile },
+ { PSR_AUTH, MraRecvAuth },
+
+ { PSS_AUTHREQUESTW, MraSendAuthRequest },
+ { PSS_MESSAGE, MraSendMessage },
+ //{ PSS_MESSAGE"W", MraSendMessage },
+ { PSS_CONTACTS, MraSendContacts },
+ { PSS_USERISTYPING, MraSendUserIsTyping },
+ { PSS_SETAPPARENTMODE, MraSetApparentMode },
+ { PSS_GETINFO, MraGetInfo },
+
+ { PS_GETAVATARCAPS, MraGetAvatarCaps },
+ { PS_GETAVATARINFO, MraGetAvatarInfo },
+ { PS_GETMYAVATAR, MraGetMyAvatar },
+
+ { PS_BASICSEARCHW, MraBasicSearch },
+ { PS_SEARCHBYEMAILW, MraSearchByEmail },
+ { PS_SEARCHBYNAMEW, MraSearchByName },
+ { PS_CREATEADVSEARCHUI, MraCreateAdvSearchUI },
+ { PS_SEARCHBYADVANCED, MraSearchByAdvanced },
+
+ { PS_FILERESUMEW, MraFileResume },
+ { PSS_FILEALLOWW, MraFileAllow },
+ { PSS_FILEDENYW, MraFileDenyCancel },
+ { PSS_FILECANCEL, MraFileDenyCancel },
+ { PSS_FILEW, MraFileSend },
+
+ { MS_ICQ_SENDSMS, MraSendSMS },
+ { MRA_SEND_NUDGE, MraSendNudge },
+};
+
+
+
+
+INT_PTR MraGotoInbox(WPARAM wParam,LPARAM lParam);
+INT_PTR MraShowInboxStatus(WPARAM wParam,LPARAM lParam);
+INT_PTR MraEditProfile(WPARAM wParam,LPARAM lParam);
+INT_PTR MyAlbum(WPARAM wParam,LPARAM lParam);
+INT_PTR MyBlog(WPARAM wParam,LPARAM lParam);
+INT_PTR MyBlogStatus(WPARAM wParam,LPARAM lParam);
+INT_PTR MyVideo(WPARAM wParam,LPARAM lParam);
+INT_PTR MyAnswers(WPARAM wParam,LPARAM lParam);
+INT_PTR MyWorld(WPARAM wParam,LPARAM lParam);
+INT_PTR MraZhuki(WPARAM wParam,LPARAM lParam);
+INT_PTR MraChat(WPARAM wParam,LPARAM lParam);
+INT_PTR MraWebSearch(WPARAM wParam,LPARAM lParam);
+INT_PTR MraUpdateAllUsersInfo(WPARAM wParam,LPARAM lParam);
+INT_PTR MraCheckUpdatesUsersAvt(WPARAM wParam,LPARAM lParam);
+INT_PTR MraRequestAuthForAll(WPARAM wParam,LPARAM lParam);
+
+static const GUI_DISPLAY_ITEM gdiMenuItems[] =
+{
+ { MRA_GOTO_INBOX, MRA_GOTO_INBOX_STR, IDI_INBOX, MraGotoInbox },
+ { MRA_SHOW_INBOX_STATUS, MRA_SHOW_INBOX_STATUS_STR, IDI_MAIL_NOTIFY, MraShowInboxStatus },
+ { MRA_EDIT_PROFILE, MRA_EDIT_PROFILE_STR, IDI_PROFILE, MraEditProfile },
+ { MRA_MY_ALBUM, MRA_MY_ALBUM_STR, IDI_MRA_PHOTO, MyAlbum },
+ { MRA_MY_BLOG, MRA_MY_BLOG_STR, IDI_MRA_BLOGS, MyBlog },
+ { MRA_MY_BLOGSTATUS, MRA_MY_BLOGSTATUS_STR, IDI_BLOGSTATUS, MyBlogStatus },
+ { MRA_MY_VIDEO, MRA_MY_VIDEO_STR, IDI_MRA_VIDEO, MyVideo },
+ { MRA_MY_ANSWERS, MRA_MY_ANSWERS_STR, IDI_MRA_ANSWERS, MyAnswers },
+ { MRA_MY_WORLD, MRA_MY_WORLD_STR, IDI_MRA_WORLD, MyWorld },
+ { MRA_ZHUKI, MRA_ZHUKI_STR, IDI_MRA_ZHUKI, MraZhuki },
+ { MRA_CHAT, MRA_CHAT_STR, IDI_MRA_CHAT, MraChat },
+ { MRA_WEB_SEARCH, MRA_WEB_SEARCH_STR, IDI_MRA_WEB_SEARCH, MraWebSearch },
+ { MRA_UPD_ALL_USERS_INFO, MRA_UPD_ALL_USERS_INFO_STR, IDI_PROFILE, MraUpdateAllUsersInfo },
+ { MRA_CHK_UPDATES_USERS_AVATARS, MRA_CHK_UPDATES_USERS_AVATARS_STR, IDI_PROFILE, MraCheckUpdatesUsersAvt },
+ { MRA_REQ_AUTH_FOR_ALL, MRA_REQ_AUTH_FOR_ALL_STR, IDI_AUTHRUGUEST, MraRequestAuthForAll }
+};
+
+
+
+INT_PTR MraRequestAuthorization(WPARAM wParam,LPARAM lParam);
+INT_PTR MraGrantAuthorization(WPARAM wParam,LPARAM lParam);
+INT_PTR MraSendPostcard(WPARAM wParam,LPARAM lParam);
+INT_PTR MraViewAlbum(WPARAM wParam,LPARAM lParam);
+INT_PTR MraReadBlog(WPARAM wParam,LPARAM lParam);
+INT_PTR MraReplyBlogStatus(WPARAM wParam,LPARAM lParam);
+INT_PTR MraViewVideo(WPARAM wParam,LPARAM lParam);
+INT_PTR MraAnswers(WPARAM wParam,LPARAM lParam);
+INT_PTR MraWorld(WPARAM wParam,LPARAM lParam);
+
+static const GUI_DISPLAY_ITEM gdiContactMenuItems[] =
+{
+ { MRA_REQ_AUTH, MRA_REQ_AUTH_STR, IDI_AUTHRUGUEST, MraRequestAuthorization },
+ { MRA_GRANT_AUTH, MRA_GRANT_AUTH_STR, IDI_AUTHGRANT, MraGrantAuthorization },
+ { MRA_SEND_POSTCARD, MRA_SEND_POSTCARD_STR, IDI_MRA_POSTCARD, MraSendPostcard },
+ { MRA_VIEW_ALBUM, MRA_VIEW_ALBUM_STR, IDI_MRA_PHOTO, MraViewAlbum },
+ { MRA_READ_BLOG, MRA_READ_BLOG_STR, IDI_MRA_BLOGS, MraReadBlog },
+ { MRA_REPLY_BLOG_STATUS,MRA_REPLY_BLOG_STATUS_STR,IDI_BLOGSTATUS, MraReplyBlogStatus },
+ { MRA_VIEW_VIDEO, MRA_VIEW_VIDEO_STR, IDI_MRA_VIDEO, MraViewVideo },
+ { MRA_ANSWERS, MRA_ANSWERS_STR, IDI_MRA_ANSWERS, MraAnswers },
+ { MRA_WORLD, MRA_WORLD_STR, IDI_MRA_WORLD, MraWorld },
+ { MRA_SEND_NUDGE, MRA_SENDNUDGE_STR, IDI_MRA_ALARM, NULL }
+};
+
+
+
+
+
+
+
+static const LPSTR lpcszStatusUri[]=
+{
+ "",// offline // "status_0",
+ "STATUS_ONLINE",// "status_1",
+ "STATUS_AWAY", // "status_2",
+ "STATUS_INVISIBLE",// "status_3",
+ "status_dnd",
+ "status_chat",
+ "status_4",
+ "status_5",
+ "status_6",
+ "status_7",
+ "status_8",
+ "status_9",
+ "status_10",
+ "status_11",
+ "status_12",
+ "status_13",
+ "status_14",
+ "status_15",
+ "status_16",
+ "status_17",
+ "status_18",
+ "status_19",
+ "status_20",
+ "status_21",
+ "status_22",
+ "status_23",
+ "status_24",
+ //"status_25", // chat/dnd
+ "status_26",
+ "status_27",
+ "status_28",
+ "status_29",
+ "status_30",
+ //"status_31", // chat/dnd
+ "status_32",
+ "status_33",
+ "status_34",
+ "status_35",
+ "status_36",
+ "status_37",
+ "status_38",
+ "status_39",
+ "status_40",
+ "status_41",
+ "status_42",
+ "status_43",
+ "status_44",
+ "status_45",
+ "status_46",
+ "status_47",
+ "status_48",
+ "status_49",
+ "status_50",
+ "status_51",
+ "status_52",
+ "status_53",
+ "status_dating",
+ //"status_127",145,154
+ NULL
+};
+
+static const LPWSTR lpcszXStatusNameDef[]=
+{
+ L"None",
+ L"Sick",
+ L"Home",
+ L"Eating",
+ L"Compass",
+ L"On WC",
+ L"Cooking",
+ L"Walking",
+ L"Alien",
+ L"Shrimp",
+ L"Got lost",
+ L"Crazy",
+ L"Duck",
+ L"Playing",
+ L"Smoking",
+ L"Office",
+ L"Meeting",
+ L"Beer",
+ L"Coffee",
+ L"Working",
+ L"Relaxing",
+ L"On the phone",
+ L"In institute",
+ L"At school",
+ L"Wrong number",
+ L"Laughing",
+ L"Malicious",
+ L"Imp",
+ L"Blind",
+ L"Disappointed",
+ L"Almost crying",
+ L"Fearful",
+ L"Angry",
+ L"Vampire",
+ L"Ass",
+ L"Love",
+ L"Sleeping",
+ L"Cool!",
+ L"Peace!",
+ L"Cock a snook",
+ L"Get out",
+ L"Death",
+ L"Rocket",
+ L"Devil-fish",
+ L"Heavy metal",
+ L"Things look bad",
+ L"Squirrel",
+ L"Star",
+ L"Music",
+ L"Dating",
+ NULL
+};
+
+#define MRA_XSTATUS_MENU "/menuXStatus"
+#define MRA_XSTATUS_COUNT 50
+#define MRA_MIR_XSTATUS_NONE 0
+#define MRA_MIR_XSTATUS_UNKNOWN MRA_XSTATUS_COUNT
+
+#define MRA_XSTATUS_OFFLINE 0
+#define MRA_XSTATUS_ONLINE 1
+#define MRA_XSTATUS_AWAY 2
+#define MRA_XSTATUS_INVISIBLE 3
+#define MRA_XSTATUS_DND 4
+#define MRA_XSTATUS_CHAT 5
+#define MRA_XSTATUS_UNKNOWN 55
+
+#define MRA_XSTATUS_INDEX_OFFSET 6
+
+
+
+#endif // !defined(AFX_MRA_CONSTANS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/MraFilesQueue.cpp b/protocols/MRA/MraFilesQueue.cpp
new file mode 100644
index 0000000000..3dd2055501
--- /dev/null
+++ b/protocols/MRA/MraFilesQueue.cpp
@@ -0,0 +1,1443 @@
+#include "Mra.h"
+#include "MraFilesQueue.h"
+#include "proto.h"
+
+
+
+
+#define MRA_FT_HELLO "MRA_FT_HELLO"
+#define MRA_FT_GET_FILE "MRA_FT_GET_FILE"
+
+
+
+typedef struct
+{
+ LIST_MT lmtListMT;
+ DWORD dwSendTimeOutInterval;
+} MRA_FILES_QUEUE;
+
+
+
+struct MRA_FILES_QUEUE_FILE
+{
+ LPWSTR lpwszName;
+ SIZE_T dwNameLen;
+ DWORDLONG dwSize;
+};
+
+
+
+
+typedef struct
+{
+ // internal
+ LIST_MT_ITEM lmtListMTItem;
+ BOOL bIsWorking;
+ DWORD dwSendTime;
+ // external
+ DWORD dwIDRequest;
+ DWORD dwFlags;
+ HANDLE hContact;
+ DWORDLONG dwFilesCount;
+ DWORDLONG dwFilesTotalSize;
+ MRA_FILES_QUEUE_FILE *pmfqfFiles;
+ LPWSTR pwszFilesList;
+ LPWSTR pwszDescription;
+ MRA_ADDR_LIST malAddrList;
+ LPWSTR lpwszPath;
+ SIZE_T dwPathSize;
+ BOOL bSending;
+ HANDLE hConnection;
+ HANDLE hListen;
+ HANDLE hThread;
+ HANDLE hWaitHandle;
+ HANDLE hMraMrimProxyData;
+
+} MRA_FILES_QUEUE_ITEM;
+
+
+
+struct MRA_FILES_THREADPROC_PARAMS
+{
+ HANDLE hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+};
+
+
+
+//#define MEMALLOC(Size) HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,(Size+sizeof(SIZE_T)))
+//#define MEMREALLOC(Mem,Size) HeapReAlloc(GetProcessHeap(),(HEAP_ZERO_MEMORY),(LPVOID)Mem,(Size+sizeof(SIZE_T)))
+//#define MEMFREE(Mem) if (Mem) {HeapFree(GetProcessHeap(),0,(LPVOID)Mem);Mem=NULL;}
+
+
+DWORD MraFilesQueueItemFindByID (HANDLE hFilesQueueHandle,DWORD dwIDRequest,MRA_FILES_QUEUE_ITEM **ppmrafqFilesQueueItem);
+//DWORD MraFilesQueueItemFindByEMail (HANDLE hFilesQueueHandle,LPSTR lpszEMail,SIZE_T dwEMailSize,MRA_FILES_QUEUE_ITEM **ppmrafqFilesQueueItem);
+void MraFilesQueueItemFree (MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem);
+SIZE_T MraFilesQueueGetLocalAddressesList (LPSTR lpszBuff,SIZE_T dwBuffSize,DWORD dwPort);
+
+BOOL MraFilesQueueHandCheck (HANDLE hConnection,MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem);
+void MraFilesQueueConnectionReceived (HANDLE hNewConnection,DWORD dwRemoteIP,void *pExtra);
+
+void MraFilesQueueRecvThreadProc (LPVOID lpParameter);
+void MraFilesQueueSendThreadProc (LPVOID lpParameter);
+
+
+
+void MraFilesQueueDlgEnableDirectConsControls(HWND hWndDlg,BOOL bEnabled)
+{
+ WORD wMraFilesControlsList[]={
+ IDC_FILE_SEND_NOOUTCONNECTIONONRECEIVE,
+ IDC_FILE_SEND_NOOUTCONNECTIONONSEND,
+ IDC_FILE_SEND_IGNORYADDITIONALPORTS,
+ IDC_FILE_SEND_HIDE_MY_ADDRESSES,
+ IDC_FILE_SEND_ADD_EXTRA_ADDRESS,
+ IDC_FILE_SEND_EXTRA_ADDRESS
+ };
+ EnableControlsArray(hWndDlg,(WORD*)&wMraFilesControlsList,SIZEOF(wMraFilesControlsList),bEnabled);
+ EnableWindow(GetDlgItem(hWndDlg,IDC_FILE_SEND_EXTRA_ADDRESS),(bEnabled && IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_FILE_SEND_ADD_EXTRA_ADDRESS)));
+}
+
+INT_PTR CALLBACK MraFilesQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch(msg){
+ case WM_INITDIALOG:
+ {
+ WCHAR szBuff[MAX_PATH];
+
+ TranslateDialogDefault(hWndDlg);
+
+ CHECK_DLG_BUTTON(hWndDlg,IDC_FILE_SEND_ENABLE_DIRECT_CONN,DB_Mra_GetByte(NULL,"FileSendEnableDirectConn",MRA_DEF_FS_ENABLE_DIRECT_CONN));
+ CHECK_DLG_BUTTON(hWndDlg,IDC_FILE_SEND_NOOUTCONNECTIONONRECEIVE,DB_Mra_GetByte(NULL,"FileSendNoOutConnOnRcv",MRA_DEF_FS_NO_OUT_CONN_ON_RCV));
+ CHECK_DLG_BUTTON(hWndDlg,IDC_FILE_SEND_NOOUTCONNECTIONONSEND,DB_Mra_GetByte(NULL,"FileSendNoOutConnOnSend",MRA_DEF_FS_NO_OUT_CONN_ON_SEND));
+ CHECK_DLG_BUTTON(hWndDlg,IDC_FILE_SEND_IGNORYADDITIONALPORTS,DB_Mra_GetByte(NULL,"FileSendIgnoryAdditionalPorts",MRA_DEF_FS_IGNORY_ADDITIONAL_PORTS));
+ CHECK_DLG_BUTTON(hWndDlg,IDC_FILE_SEND_HIDE_MY_ADDRESSES,DB_Mra_GetByte(NULL,"FileSendHideMyAddresses",MRA_DEF_FS_HIDE_MY_ADDRESSES));
+ CHECK_DLG_BUTTON(hWndDlg,IDC_FILE_SEND_ADD_EXTRA_ADDRESS,DB_Mra_GetByte(NULL,"FileSendAddExtraAddresses",MRA_DEF_FS_ADD_EXTRA_ADDRESSES));
+ if (DB_Mra_GetStaticStringW(NULL,"FileSendExtraAddresses",szBuff,SIZEOF(szBuff),NULL))
+ {
+ SET_DLG_ITEM_TEXT(hWndDlg,IDC_FILE_SEND_EXTRA_ADDRESS,szBuff);
+ }
+
+ CHECK_DLG_BUTTON(hWndDlg,IDC_FILE_SEND_ENABLE_MRIMPROXY_CONS,DB_Mra_GetByte(NULL,"FileSendEnableMRIMProxyCons",MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS));
+
+ SetDlgItemInt(hWndDlg,IDC_FILE_SEND_BLOCK_SIZE,DB_Mra_GetDword(NULL,"FileSendBlockSize",MRA_DEFAULT_FILE_SEND_BLOCK_SIZE),FALSE);
+
+ MraFilesQueueDlgEnableDirectConsControls(hWndDlg,IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_FILE_SEND_ENABLE_DIRECT_CONN));
+ }
+ return(TRUE);
+ case WM_COMMAND:
+ if (LOWORD(wParam)==IDC_FILE_SEND_ENABLE_DIRECT_CONN)
+ {
+ MraFilesQueueDlgEnableDirectConsControls(hWndDlg,IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_FILE_SEND_ENABLE_DIRECT_CONN));
+ }
+
+ if (LOWORD(wParam)==IDC_FILE_SEND_ADD_EXTRA_ADDRESS)
+ {
+ EnableWindow(GetDlgItem(hWndDlg,IDC_FILE_SEND_EXTRA_ADDRESS),IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_FILE_SEND_ADD_EXTRA_ADDRESS));
+ }
+
+ if ((LOWORD(wParam)==IDC_FILE_SEND_EXTRA_ADDRESS || LOWORD(wParam)==IDC_FILE_SEND_BLOCK_SIZE) && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus()) ) return(FALSE);
+ SendMessage(GetParent(hWndDlg),PSM_CHANGED,0,0);
+ break;
+ case WM_NOTIFY:
+ switch (((LPNMHDR)lParam)->code){
+ case PSN_APPLY:
+ {
+ WCHAR szBuff[MAX_PATH];
+
+ DB_Mra_SetByte(NULL,"FileSendEnableDirectConn",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_FILE_SEND_ENABLE_DIRECT_CONN));
+ DB_Mra_SetByte(NULL,"FileSendNoOutConnOnRcv",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_FILE_SEND_NOOUTCONNECTIONONRECEIVE));
+ DB_Mra_SetByte(NULL,"FileSendNoOutConnOnSend",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_FILE_SEND_NOOUTCONNECTIONONSEND));
+ DB_Mra_SetByte(NULL,"FileSendIgnoryAdditionalPorts",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_FILE_SEND_IGNORYADDITIONALPORTS));
+ DB_Mra_SetByte(NULL,"FileSendHideMyAddresses",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_FILE_SEND_HIDE_MY_ADDRESSES));
+ DB_Mra_SetByte(NULL,"FileSendAddExtraAddresses",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_FILE_SEND_ADD_EXTRA_ADDRESS));
+ GET_DLG_ITEM_TEXT(hWndDlg,IDC_FILE_SEND_EXTRA_ADDRESS,szBuff,SIZEOF(szBuff));
+ DB_Mra_SetStringW(NULL,"FileSendExtraAddresses",szBuff);
+ DB_Mra_SetDword(NULL,"FileSendBlockSize",(DWORD)GetDlgItemInt(hWndDlg,IDC_FILE_SEND_BLOCK_SIZE,NULL,FALSE));
+ DB_Mra_SetByte(NULL,"FileSendEnableMRIMProxyCons",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_FILE_SEND_ENABLE_MRIMPROXY_CONS));
+ }
+ return(TRUE);
+ }
+ break;
+ }
+return(FALSE);
+}
+
+
+
+DWORD MraFilesQueueInitialize(DWORD dwSendTimeOutInterval,HANDLE *phFilesQueueHandle)
+{
+ DWORD dwRetErrorCode;
+
+ if (phFilesQueueHandle)
+ {
+ MRA_FILES_QUEUE *pmrafqFilesQueue;
+
+ pmrafqFilesQueue=(MRA_FILES_QUEUE*)MEMALLOC(sizeof(MRA_FILES_QUEUE));
+ if (pmrafqFilesQueue)
+ {
+ dwRetErrorCode=ListMTInitialize(&pmrafqFilesQueue->lmtListMT,0);
+ if (dwRetErrorCode==NO_ERROR)
+ {
+ pmrafqFilesQueue->dwSendTimeOutInterval=dwSendTimeOutInterval;
+ (*phFilesQueueHandle)=(HANDLE)pmrafqFilesQueue;
+ }else{
+ MEMFREE(pmrafqFilesQueue);
+ }
+ }else{
+ dwRetErrorCode=GetLastError();
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+void MraFilesQueueDestroy(HANDLE hFilesQueueHandle)
+{
+ if (hFilesQueueHandle)
+ {
+ MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+
+ ListMTLock(&pmrafqFilesQueue->lmtListMT);
+ while(ListMTItemGetFirst(&pmrafqFilesQueue->lmtListMT,NULL,(LPVOID*)&pmrafqFilesQueueItem)==NO_ERROR)
+ {
+ MraFilesQueueItemFree(pmrafqFilesQueueItem);
+ }
+ ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+
+ ListMTDestroy(&pmrafqFilesQueue->lmtListMT);
+ MEMFREE(pmrafqFilesQueue);
+ }
+}
+
+
+DWORD MraFilesQueueItemFindByID(HANDLE hFilesQueueHandle,DWORD dwIDRequest,MRA_FILES_QUEUE_ITEM **ppmrafqFilesQueueItem)
+{
+ DWORD dwRetErrorCode;
+
+ if (hFilesQueueHandle)
+ {
+ MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+ LIST_MT_ITERATOR lmtiIterator;
+
+ dwRetErrorCode=ERROR_NOT_FOUND;
+ ListMTLock(&pmrafqFilesQueue->lmtListMT);
+ ListMTIteratorMoveFirst(&pmrafqFilesQueue->lmtListMT,&lmtiIterator);
+ do
+ {//
+ if (ListMTIteratorGet(&lmtiIterator,NULL,(LPVOID*)&pmrafqFilesQueueItem)==NO_ERROR)
+ if (pmrafqFilesQueueItem->dwIDRequest==dwIDRequest)
+ {
+ if (ppmrafqFilesQueueItem) (*ppmrafqFilesQueueItem)=pmrafqFilesQueueItem;
+ dwRetErrorCode=NO_ERROR;
+ break;
+ }
+ }while(ListMTIteratorMoveNext(&lmtiIterator));
+ ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+HANDLE MraFilesQueueItemProxyByID(HANDLE hFilesQueueHandle,DWORD dwIDRequest)
+{
+ HANDLE hRet=NULL;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+
+ if (MraFilesQueueItemFindByID(hFilesQueueHandle,dwIDRequest,&pmrafqFilesQueueItem)==NO_ERROR)
+ {
+ hRet=pmrafqFilesQueueItem->hMraMrimProxyData;
+ }
+return(hRet);
+}
+
+
+/*DWORD MraFilesQueueItemFindByEMail(HANDLE hFilesQueueHandle,LPSTR lpszEMail,SIZE_T dwEMailSize,MRA_FILES_QUEUE_ITEM **ppmrafqFilesQueueItem)
+{
+ DWORD dwRetErrorCode;
+
+ if (hFilesQueueHandle)
+ {
+ CHAR szEMailLocal[MAX_EMAIL_LEN];
+ SIZE_T dwEMailLocalSize;
+ MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+ LIST_MT_ITERATOR lmtiIterator;
+
+ dwRetErrorCode=ERROR_NOT_FOUND;
+ ListMTLock(&pmrafqFilesQueue->lmtListMT);
+ ListMTIteratorMoveFirst(&pmrafqFilesQueue->lmtListMT,&lmtiIterator);
+ do
+ {//
+ if (ListMTIteratorGet(&lmtiIterator,NULL,(LPVOID*)&pmrafqFilesQueueItem)==NO_ERROR)
+ if (DB_Mra_GetStaticStringA(pmrafqFilesQueueItem->hContact,"e-mail",szEMailLocal,SIZEOF(szEMailLocal),&dwEMailLocalSize))
+ if (dwEMailSize==dwEMailLocalSize)
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszEMail,dwEMailSize,szEMailLocal,dwEMailLocalSize)==CSTR_EQUAL)
+ {
+ if (ppmrafqFilesQueueItem) (*ppmrafqFilesQueueItem)=pmrafqFilesQueueItem;
+ dwRetErrorCode=NO_ERROR;
+ break;
+ }
+ }while(ListMTIteratorMoveNext(&lmtiIterator));
+ ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}*/
+
+
+void MraFilesQueueItemFree(MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem)
+{
+ LIST_MT *plmtListMT=(LIST_MT*)pmrafqFilesQueueItem->lmtListMTItem.lpListMT;
+
+ for(SIZE_T i=0;i<pmrafqFilesQueueItem->dwFilesCount;i++)
+ {
+ MEMFREE(pmrafqFilesQueueItem->pmfqfFiles[i].lpwszName);
+ }
+ MEMFREE(pmrafqFilesQueueItem->pmfqfFiles);
+ MEMFREE(pmrafqFilesQueueItem->pwszFilesList);
+ MEMFREE(pmrafqFilesQueueItem->pwszDescription);
+ MraAddrListFree(&pmrafqFilesQueueItem->malAddrList);
+ MraMrimProxyFree(pmrafqFilesQueueItem->hMraMrimProxyData);
+ MEMFREE(pmrafqFilesQueueItem->lpwszPath);
+ ListMTLock(plmtListMT);
+ ListMTItemDelete(plmtListMT,&pmrafqFilesQueueItem->lmtListMTItem);
+ ListMTUnLock(plmtListMT);
+ MEMFREE(pmrafqFilesQueueItem);
+}
+
+
+
+
+
+SIZE_T MraFilesQueueGetLocalAddressesList(LPSTR lpszBuff,SIZE_T dwBuffSize,DWORD dwPort)
+{
+ CHAR szHostName[MAX_PATH]={0};
+ LPSTR lpszCurPos=lpszBuff;
+
+ if (DB_Mra_GetByte(NULL,"FileSendHideMyAddresses",MRA_DEF_FS_HIDE_MY_ADDRESSES))
+ {// IP !!! :)
+ if (DB_Mra_GetByte(NULL,"FileSendAddExtraAddresses",MRA_DEF_FS_ADD_EXTRA_ADDRESSES)==FALSE)
+ {//
+ lpszCurPos+=mir_snprintf(lpszCurPos,(dwBuffSize-((SIZE_T)lpszCurPos-(SIZE_T)lpszBuff)),MRA_FILES_NULL_ADDRR);
+ }
+ }else{// IP
+ BYTE btAddress[32];
+ DWORD dwSelfExternalIP;
+ SIZE_T dwAdapter=0;
+ hostent *sh;
+
+ dwSelfExternalIP=NTOHL(DB_Mra_GetDword(NULL,"IP",0));
+ if (dwSelfExternalIP)
+ {
+ memmove(&btAddress,&dwSelfExternalIP,sizeof(DWORD));
+ lpszCurPos+=mir_snprintf(lpszCurPos,(dwBuffSize-((SIZE_T)lpszCurPos-(SIZE_T)lpszBuff)),"%lu.%lu.%lu.%lu:%lu;",btAddress[0],btAddress[1],btAddress[2],btAddress[3],dwPort);
+ }
+
+ if (gethostname(szHostName,SIZEOF(szHostName))==0)
+ if ((sh=gethostbyname((LPSTR)&szHostName)))
+ {
+ while(sh->h_addr_list[dwAdapter])
+ {
+ lpszCurPos+=mir_snprintf(lpszCurPos,(dwBuffSize-((SIZE_T)lpszCurPos-(SIZE_T)lpszBuff)),"%s:%lu;",inet_ntoa(*((struct in_addr*)sh->h_addr_list[dwAdapter])),dwPort);
+ dwAdapter++;
+ }
+ }
+ }
+
+ if (DB_Mra_GetByte(NULL,"FileSendAddExtraAddresses",MRA_DEF_FS_ADD_EXTRA_ADDRESSES))//
+ if (DB_Mra_GetStaticStringA(NULL,"FileSendExtraAddresses",szHostName,SIZEOF(szHostName),NULL))
+ {
+ lpszCurPos+=mir_snprintf(lpszCurPos,(dwBuffSize-((SIZE_T)lpszCurPos-(SIZE_T)lpszBuff)),"%s:%lu;",szHostName,dwPort);
+ }
+return((lpszCurPos-lpszBuff));
+}
+
+
+
+
+DWORD MraFilesQueueAddReceive(HANDLE hFilesQueueHandle,DWORD dwFlags,HANDLE hContact,DWORD dwIDRequest,LPWSTR lpwszFiles,SIZE_T dwFilesSize,LPSTR lpszAddreses,SIZE_T dwAddresesSize)
+{
+ DWORD dwRetErrorCode;
+
+ if (hFilesQueueHandle && dwIDRequest)
+ {
+ MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+
+ pmrafqFilesQueueItem=(MRA_FILES_QUEUE_ITEM*)MEMALLOC(sizeof(MRA_FILES_QUEUE_ITEM)+sizeof(LPSTR)+64);
+ if (pmrafqFilesQueueItem)
+ {
+ WCHAR szBuff[MAX_PATH];
+ LPWSTR lpwszCurrentItem,lpwszDelimiter,lpwszEndItem;
+ SIZE_T dwMemSize,dwAllocatedCount,dwFileNameTotalSize;
+ CCSDATA ccs;
+ PROTORECVFILET prf;
+
+ //pmrafqFilesQueueItem->lmtListMTItem;
+ pmrafqFilesQueueItem->bIsWorking=TRUE;
+ pmrafqFilesQueueItem->dwSendTime=GetTickCount();
+ pmrafqFilesQueueItem->dwIDRequest=dwIDRequest;
+ pmrafqFilesQueueItem->dwFlags=dwFlags;
+ pmrafqFilesQueueItem->hContact=hContact;
+ if (DB_Mra_GetByte(NULL,"FileSendEnableMRIMProxyCons",MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS)) pmrafqFilesQueueItem->hMraMrimProxyData=MraMrimProxyCreate();
+
+
+ dwFileNameTotalSize=0;
+ dwAllocatedCount=ALLOCATED_COUNT;
+ pmrafqFilesQueueItem->dwFilesCount=0;
+ pmrafqFilesQueueItem->dwFilesTotalSize=0;
+ pmrafqFilesQueueItem->pmfqfFiles=(MRA_FILES_QUEUE_FILE*)MEMALLOC((sizeof(MRA_FILES_QUEUE_FILE)*dwAllocatedCount));
+ lpwszCurrentItem=lpwszFiles;
+ while(TRUE)
+ {
+ lpwszDelimiter=(LPWSTR)MemoryFind(((SIZE_T)lpwszCurrentItem-(SIZE_T)lpwszFiles),lpwszFiles,(dwFilesSize*sizeof(WCHAR)),";",2);
+ if (lpwszDelimiter)
+ {
+ lpwszEndItem=(LPWSTR)MemoryFind((((SIZE_T)lpwszDelimiter+2)-(SIZE_T)lpwszFiles),lpwszFiles,(dwFilesSize*sizeof(WCHAR)),";",2);
+ if (lpwszEndItem)
+ {
+ if (pmrafqFilesQueueItem->dwFilesCount==dwAllocatedCount)
+ {
+ dwAllocatedCount*=2;
+ pmrafqFilesQueueItem->pmfqfFiles=(MRA_FILES_QUEUE_FILE*)MEMREALLOC(pmrafqFilesQueueItem->pmfqfFiles,(sizeof(MRA_FILES_QUEUE_FILE)*dwAllocatedCount));
+ }
+
+ dwMemSize=((SIZE_T)lpwszDelimiter-(SIZE_T)lpwszCurrentItem);
+ pmrafqFilesQueueItem->pmfqfFiles[pmrafqFilesQueueItem->dwFilesCount].lpwszName=(LPWSTR)MEMALLOC(dwMemSize);
+ memmove(pmrafqFilesQueueItem->pmfqfFiles[pmrafqFilesQueueItem->dwFilesCount].lpwszName,lpwszCurrentItem,dwMemSize);
+ pmrafqFilesQueueItem->pmfqfFiles[pmrafqFilesQueueItem->dwFilesCount].dwSize=StrToUNum64((LPSTR)((SIZE_T)lpwszDelimiter+1),((SIZE_T)lpwszEndItem-((SIZE_T)lpwszDelimiter+1)));
+ pmrafqFilesQueueItem->dwFilesTotalSize+=pmrafqFilesQueueItem->pmfqfFiles[pmrafqFilesQueueItem->dwFilesCount].dwSize;
+ pmrafqFilesQueueItem->pmfqfFiles[pmrafqFilesQueueItem->dwFilesCount].dwNameLen=(dwMemSize/sizeof(WCHAR));
+ dwFileNameTotalSize+=dwMemSize;
+
+ pmrafqFilesQueueItem->dwFilesCount++;
+ lpwszCurrentItem=(lpwszEndItem+1);
+ }else{
+ break;
+ }
+ }else{
+ break;
+ }
+ }
+ pmrafqFilesQueueItem->pmfqfFiles=(MRA_FILES_QUEUE_FILE*)MEMREALLOC(pmrafqFilesQueueItem->pmfqfFiles,(sizeof(MRA_FILES_QUEUE_FILE)*(pmrafqFilesQueueItem->dwFilesCount+4)));
+
+ dwMemSize=(((pmrafqFilesQueueItem->dwFilesCount+4)*64)+(dwFileNameTotalSize*sizeof(WCHAR))+(dwAddresesSize*sizeof(WCHAR))+128);
+ pmrafqFilesQueueItem->pwszFilesList=(LPWSTR)MEMALLOC(dwMemSize);
+ pmrafqFilesQueueItem->pwszDescription=(LPWSTR)MEMALLOC(dwMemSize);
+
+
+ lpwszDelimiter=pmrafqFilesQueueItem->pwszFilesList;
+ lpwszCurrentItem=pmrafqFilesQueueItem->pwszDescription;
+ StrFormatByteSizeW(pmrafqFilesQueueItem->dwFilesTotalSize,szBuff,SIZEOF(szBuff));
+ lpwszCurrentItem+=mir_sntprintf(lpwszCurrentItem,((dwMemSize-((SIZE_T)lpwszCurrentItem-(SIZE_T)pmrafqFilesQueueItem->pwszDescription))/sizeof(WCHAR)),L"%I64u Files (%s)\r\n",pmrafqFilesQueueItem->dwFilesCount,szBuff);
+
+ // description + filesnames
+ for(SIZE_T i=0;i<pmrafqFilesQueueItem->dwFilesCount;i++)
+ {
+ lpwszDelimiter+=mir_sntprintf(lpwszDelimiter,((dwMemSize-((SIZE_T)lpwszDelimiter-(SIZE_T)pmrafqFilesQueueItem->pwszFilesList))/sizeof(WCHAR)),L"%s; ",pmrafqFilesQueueItem->pmfqfFiles[i].lpwszName);
+ StrFormatByteSizeW(pmrafqFilesQueueItem->pmfqfFiles[i].dwSize,szBuff,SIZEOF(szBuff));
+ lpwszCurrentItem+=mir_sntprintf(lpwszCurrentItem,((dwMemSize-((SIZE_T)lpwszCurrentItem-(SIZE_T)pmrafqFilesQueueItem->pwszDescription))/sizeof(WCHAR)),L"%s - %s\r\n",pmrafqFilesQueueItem->pmfqfFiles[i].lpwszName,szBuff);
+ }
+
+ lpwszCurrentItem+=MultiByteToWideChar(MRA_CODE_PAGE,0,lpszAddreses,dwAddresesSize,lpwszCurrentItem,((dwMemSize-((SIZE_T)lpwszCurrentItem-(SIZE_T)pmrafqFilesQueueItem->pwszDescription))/sizeof(WCHAR)));
+ (*lpwszCurrentItem)=0;
+ //lpwszCurrentItem++;
+
+
+ MraAddrListGetFromBuff(lpszAddreses,dwAddresesSize,&pmrafqFilesQueueItem->malAddrList);
+ MraAddrListStoreToContact(pmrafqFilesQueueItem->hContact,&pmrafqFilesQueueItem->malAddrList);
+
+ ListMTLock(&pmrafqFilesQueue->lmtListMT);
+ ListMTItemAdd(&pmrafqFilesQueue->lmtListMT,&pmrafqFilesQueueItem->lmtListMTItem,pmrafqFilesQueueItem);
+ ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+
+
+ // Send chain event
+
+ ccs.szProtoService=PSR_FILE;
+ ccs.hContact=hContact;
+ ccs.wParam=0;
+ ccs.lParam=(LPARAM)&prf;
+ prf.flags=PREF_UNICODE;
+ prf.timestamp=_time32(NULL);
+ prf.tszDescription=pmrafqFilesQueueItem->pwszDescription;
+ prf.fileCount=1;//pmrafqFilesQueueItem->dwFilesCount;
+ prf.ptszFiles=&pmrafqFilesQueueItem->pwszFilesList;
+ prf.lParam=dwIDRequest;
+
+ CallService(MS_PROTO_CHAINRECV,0,(LPARAM)&ccs);
+
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ dwRetErrorCode=GetLastError();
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+
+DWORD MraFilesQueueAddSend(HANDLE hFilesQueueHandle,DWORD dwFlags,HANDLE hContact,LPWSTR *plpwszFiles,SIZE_T dwFilesCount,DWORD *pdwIDRequest)
+{
+ DWORD dwRetErrorCode;
+
+ if (hFilesQueueHandle)
+ {
+ MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+
+
+ pmrafqFilesQueueItem=(MRA_FILES_QUEUE_ITEM*)MEMALLOC(sizeof(MRA_FILES_QUEUE_ITEM)+sizeof(LPSTR)+64);
+ if (pmrafqFilesQueueItem)
+ {
+ SIZE_T i;
+ ULARGE_INTEGER uliFileSize;
+ WIN32_FILE_ATTRIBUTE_DATA wfad;
+
+ //pmrafqFilesQueueItem->lmtListMTItem;
+ pmrafqFilesQueueItem->bIsWorking=TRUE;
+ pmrafqFilesQueueItem->dwSendTime=GetTickCount();
+ pmrafqFilesQueueItem->dwIDRequest=InterlockedIncrement((LONG volatile*)&masMraSettings.dwCMDNum);// ,
+ pmrafqFilesQueueItem->dwFlags=dwFlags;
+ pmrafqFilesQueueItem->hContact=hContact;
+ if (DB_Mra_GetByte(NULL,"FileSendEnableMRIMProxyCons",MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS)) pmrafqFilesQueueItem->hMraMrimProxyData=MraMrimProxyCreate();
+ pmrafqFilesQueueItem->dwFilesCount=dwFilesCount;
+ pmrafqFilesQueueItem->pmfqfFiles=(MRA_FILES_QUEUE_FILE*)MEMALLOC((sizeof(MRA_FILES_QUEUE_FILE)*(pmrafqFilesQueueItem->dwFilesCount+1)));
+ pmrafqFilesQueueItem->dwFilesTotalSize=0;
+
+ for(i=0;i<pmrafqFilesQueueItem->dwFilesCount;i++)
+ {
+ if (GetFileAttributesExW(plpwszFiles[i],GetFileExInfoStandard,&wfad))
+ {
+ uliFileSize.LowPart=wfad.nFileSizeLow;
+ uliFileSize.HighPart=wfad.nFileSizeHigh;
+ pmrafqFilesQueueItem->pmfqfFiles[i].dwSize=uliFileSize.QuadPart;
+ pmrafqFilesQueueItem->dwFilesTotalSize+=uliFileSize.QuadPart;
+ }else{
+ pmrafqFilesQueueItem->pmfqfFiles[i].dwSize=0;
+ }
+ pmrafqFilesQueueItem->pmfqfFiles[i].dwNameLen=lstrlenW(plpwszFiles[i]);
+ pmrafqFilesQueueItem->pmfqfFiles[i].lpwszName=(LPWSTR)MEMALLOC((pmrafqFilesQueueItem->pmfqfFiles[i].dwNameLen*sizeof(WCHAR)));
+ if (pmrafqFilesQueueItem->pmfqfFiles[i].lpwszName)
+ {
+ memmove(pmrafqFilesQueueItem->pmfqfFiles[i].lpwszName,plpwszFiles[i],(pmrafqFilesQueueItem->pmfqfFiles[i].dwNameLen*sizeof(WCHAR)));
+ }
+ }
+ //pmrafqFilesQueueItem->malAddrList.dwAddrCount=0;
+ //pmrafqFilesQueueItem->pmfqaAddreses=NULL;
+ pmrafqFilesQueueItem->bSending=TRUE;
+ if (pdwIDRequest) (*pdwIDRequest)=pmrafqFilesQueueItem->dwIDRequest;
+
+ ListMTLock(&pmrafqFilesQueue->lmtListMT);
+ ListMTItemAdd(&pmrafqFilesQueue->lmtListMT,&pmrafqFilesQueueItem->lmtListMTItem,pmrafqFilesQueueItem);
+ ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+
+ {
+ MRA_FILES_THREADPROC_PARAMS *pmftpp=(MRA_FILES_THREADPROC_PARAMS*)MEMALLOC(sizeof(MRA_FILES_THREADPROC_PARAMS));
+ pmftpp->hFilesQueueHandle=hFilesQueueHandle;
+ pmftpp->pmrafqFilesQueueItem=pmrafqFilesQueueItem;
+
+ pmrafqFilesQueueItem->hThread=(HANDLE)mir_forkthread((pThreadFunc)MraFilesQueueSendThreadProc,pmftpp);
+ }
+
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ dwRetErrorCode=GetLastError();
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+
+DWORD MraFilesQueueAccept(HANDLE hFilesQueueHandle,DWORD dwIDRequest,LPWSTR lpwszPath,SIZE_T dwPathSize)
+{
+ DWORD dwRetErrorCode;
+
+ if (hFilesQueueHandle && lpwszPath && dwPathSize)
+ {
+ MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+
+ ListMTLock(&pmrafqFilesQueue->lmtListMT);
+ if ((dwRetErrorCode=MraFilesQueueItemFindByID(hFilesQueueHandle,dwIDRequest,&pmrafqFilesQueueItem))==NO_ERROR)
+ {
+ MRA_FILES_THREADPROC_PARAMS *pmftpp=(MRA_FILES_THREADPROC_PARAMS*)MEMALLOC(sizeof(MRA_FILES_THREADPROC_PARAMS));
+ pmrafqFilesQueueItem->lpwszPath=(LPWSTR)MEMALLOC((dwPathSize*sizeof(WCHAR)));
+ pmrafqFilesQueueItem->dwPathSize=dwPathSize;
+ memmove(pmrafqFilesQueueItem->lpwszPath,lpwszPath,(dwPathSize*sizeof(WCHAR)));
+
+ if ( (*(WCHAR*)(pmrafqFilesQueueItem->lpwszPath+(pmrafqFilesQueueItem->dwPathSize-1)))!='\\')
+ {// add slash at the end if needed
+ (*(WCHAR*)(pmrafqFilesQueueItem->lpwszPath+pmrafqFilesQueueItem->dwPathSize))='\\';
+ pmrafqFilesQueueItem->dwPathSize++;
+ (*(WCHAR*)(pmrafqFilesQueueItem->lpwszPath+pmrafqFilesQueueItem->dwPathSize))=0;
+ }
+
+ pmftpp->hFilesQueueHandle=hFilesQueueHandle;
+ pmftpp->pmrafqFilesQueueItem=pmrafqFilesQueueItem;
+
+ pmrafqFilesQueueItem->hThread=(HANDLE)mir_forkthread((pThreadFunc)MraFilesQueueRecvThreadProc,pmftpp);
+ }
+ ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD MraFilesQueueCancel(HANDLE hFilesQueueHandle,DWORD dwIDRequest,BOOL bSendDecline)
+{
+ DWORD dwRetErrorCode;
+
+ if (hFilesQueueHandle)
+ {
+ MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+
+ ListMTLock(&pmrafqFilesQueue->lmtListMT);
+ if ((dwRetErrorCode=MraFilesQueueItemFindByID(hFilesQueueHandle,dwIDRequest,&pmrafqFilesQueueItem))==NO_ERROR)
+ {//***deb closesocket, send message to thread
+ InterlockedExchange((volatile LONG*)&pmrafqFilesQueueItem->bIsWorking,FALSE);
+
+ if (bSendDecline)
+ {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ SIZE_T dwEMailSize;
+
+ if (DB_Mra_GetStaticStringA(pmrafqFilesQueueItem->hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ MraSendCommand_FileTransferAck(FILE_TRANSFER_STATUS_DECLINE,szEMail,dwEMailSize,dwIDRequest,NULL,0);
+ }
+ }
+
+ MraMrimProxyCloseConnection(pmrafqFilesQueueItem->hMraMrimProxyData);
+
+ Netlib_CloseHandle(pmrafqFilesQueueItem->hListen);
+ pmrafqFilesQueueItem->hListen=NULL;
+
+ Netlib_CloseHandle(pmrafqFilesQueueItem->hConnection);
+ pmrafqFilesQueueItem->hConnection=NULL;
+
+ SetEvent(pmrafqFilesQueueItem->hWaitHandle);
+
+ if (pmrafqFilesQueueItem->hThread==NULL)
+ {
+ MraFilesQueueItemFree(pmrafqFilesQueueItem);
+ }
+ }
+ ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD MraFilesQueueStartMrimProxy(HANDLE hFilesQueueHandle,DWORD dwIDRequest)
+{
+ DWORD dwRetErrorCode;
+
+ if (hFilesQueueHandle && DB_Mra_GetByte(NULL,"FileSendEnableMRIMProxyCons",MRA_DEF_FS_ENABLE_MRIM_PROXY_CONS))
+ {
+ MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+
+ ListMTLock(&pmrafqFilesQueue->lmtListMT);
+ if ((dwRetErrorCode=MraFilesQueueItemFindByID(hFilesQueueHandle,dwIDRequest,&pmrafqFilesQueueItem))==NO_ERROR)
+ {//***deb
+ if (pmrafqFilesQueueItem->bSending==FALSE)
+ {// receiving
+ SetEvent(pmrafqFilesQueueItem->hWaitHandle);// cancel wait incomming connection
+ }else{// sending
+
+ }
+ }
+ ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD MraFilesQueueFree(HANDLE hFilesQueueHandle,DWORD dwIDRequest)
+{
+ DWORD dwRetErrorCode;
+
+ if (hFilesQueueHandle)
+ {
+ MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+ LIST_MT_ITERATOR lmtiIterator;
+
+ dwRetErrorCode=ERROR_NOT_FOUND;
+ ListMTLock(&pmrafqFilesQueue->lmtListMT);
+ ListMTIteratorMoveFirst(&pmrafqFilesQueue->lmtListMT,&lmtiIterator);
+ do
+ {//
+ if (ListMTIteratorGet(&lmtiIterator,NULL,(LPVOID*)&pmrafqFilesQueueItem)==NO_ERROR)
+ if (pmrafqFilesQueueItem->dwIDRequest==dwIDRequest)
+ {
+ MraFilesQueueItemFree(pmrafqFilesQueueItem);
+ dwRetErrorCode=NO_ERROR;
+ break;
+ }
+ }while(ListMTIteratorMoveNext(&lmtiIterator));
+ ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD MraFilesQueueSendMirror(HANDLE hFilesQueueHandle,DWORD dwIDRequest,LPSTR lpszAddreses,SIZE_T dwAddresesSize)
+{
+ DWORD dwRetErrorCode;
+
+ if (hFilesQueueHandle)
+ {
+ MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+
+ ListMTLock(&pmrafqFilesQueue->lmtListMT);
+ if ((dwRetErrorCode=MraFilesQueueItemFindByID(hFilesQueueHandle,dwIDRequest,&pmrafqFilesQueueItem))==NO_ERROR)
+ {//
+ MraAddrListGetFromBuff(lpszAddreses,dwAddresesSize,&pmrafqFilesQueueItem->malAddrList);
+ MraAddrListStoreToContact(pmrafqFilesQueueItem->hContact,&pmrafqFilesQueueItem->malAddrList);
+
+ pmrafqFilesQueueItem->hConnection=NULL;
+ SetEvent(pmrafqFilesQueueItem->hWaitHandle);
+ }
+ ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+
+BOOL MraFilesQueueHandCheck(HANDLE hConnection,MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem)
+{
+ BOOL bRet=FALSE;
+
+ if (hConnection && pmrafqFilesQueueItem)
+ {
+ CHAR szEMail[MAX_EMAIL_LEN]={0},szEMailMy[MAX_EMAIL_LEN]={0};
+ BYTE btBuff[((MAX_EMAIL_LEN*2)+(sizeof(MRA_FT_HELLO)*2)+8)]={0};
+ SIZE_T dwEMailSize,dwEMailMySize,dwBuffSize;
+
+ DB_Mra_GetStaticStringA(NULL,"e-mail",szEMailMy,SIZEOF(szEMailMy),&dwEMailMySize);BuffToLowerCase(szEMailMy,szEMailMy,dwEMailMySize);
+ DB_Mra_GetStaticStringA(pmrafqFilesQueueItem->hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize);BuffToLowerCase(szEMail,szEMail,dwEMailSize);
+
+ if (pmrafqFilesQueueItem->bSending==FALSE)
+ {// receiving
+ dwBuffSize=(mir_snprintf((LPSTR)btBuff,SIZEOF(btBuff),"%s %s",MRA_FT_HELLO,szEMailMy)+1);
+ if (dwBuffSize==Netlib_Send(hConnection,(LPSTR)btBuff,dwBuffSize,0))
+ {// my email sended
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_INITIALISING,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ dwBuffSize=Netlib_Recv(hConnection,(LPSTR)btBuff,sizeof(btBuff),0);
+ if ((dwEMailSize+sizeof(MRA_FT_HELLO)+1)==dwBuffSize)
+ {// email received
+ mir_snprintf(((LPSTR)btBuff+dwBuffSize),(SIZEOF(btBuff)-dwBuffSize),"%s %s",MRA_FT_HELLO,szEMail);
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,(LPSTR)btBuff,dwBuffSize,((LPSTR)btBuff+dwBuffSize),dwBuffSize)==CSTR_EQUAL)
+ {// email verifyed
+ bRet=TRUE;
+ }
+ }
+ }
+ }else{// sending
+ dwBuffSize=Netlib_Recv(hConnection,(LPSTR)btBuff,sizeof(btBuff),0);
+ if ((dwEMailSize+sizeof(MRA_FT_HELLO)+1)==dwBuffSize)
+ {// email received
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_INITIALISING,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ mir_snprintf(((LPSTR)btBuff+dwBuffSize),(SIZEOF(btBuff)-dwBuffSize),"%s %s",MRA_FT_HELLO,szEMail);
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,(LPSTR)btBuff,dwBuffSize,((LPSTR)btBuff+dwBuffSize),dwBuffSize)==CSTR_EQUAL)
+ {// email verifyed
+ dwBuffSize=(mir_snprintf((LPSTR)btBuff,SIZEOF(btBuff),"%s %s",MRA_FT_HELLO,szEMailMy)+1);
+ if (dwBuffSize==Netlib_Send(hConnection,(LPSTR)btBuff,dwBuffSize,0))
+ {// my email sended
+ bRet=TRUE;
+ }
+ }
+ }
+ }
+ }
+return(bRet);
+}
+
+
+HANDLE MraFilesQueueConnectOut(MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem)
+{
+ HANDLE hRet;
+
+ if (pmrafqFilesQueueItem)
+ {
+ if (DB_Mra_GetByte(NULL,"FileSendEnableDirectConn",MRA_DEF_FS_ENABLE_DIRECT_CONN) && InterlockedExchangeAdd((volatile LONG*)&pmrafqFilesQueueItem->bIsWorking,0) && ((pmrafqFilesQueueItem->bSending==FALSE && DB_Mra_GetByte(NULL,"FileSendNoOutConnOnRcv",MRA_DEF_FS_NO_OUT_CONN_ON_RCV)==FALSE) || (pmrafqFilesQueueItem->bSending==TRUE && DB_Mra_GetByte(NULL,"FileSendNoOutConnOnSend",MRA_DEF_FS_NO_OUT_CONN_ON_SEND)==FALSE)))
+ {
+ BOOL bFiltering=FALSE,bIsHTTPSProxyUsed=IsHTTPSProxyUsed(masMraSettings.hNetlibUser);
+ DWORD dwLocalPort,dwConnectReTryCount,dwCurConnectReTryCount;
+ SIZE_T i,dwAddrCount;
+ NETLIBOPENCONNECTION nloc={0};
+
+ dwLocalPort=0;
+
+ if (DB_Mra_GetByte(NULL,"FileSendIgnoryAdditionalPorts",MRA_DEF_FS_IGNORY_ADDITIONAL_PORTS) || bIsHTTPSProxyUsed)
+ {// IP, 3
+ if (bIsHTTPSProxyUsed)
+ {// https 443
+ dwLocalPort=MRA_SERVER_PORT_HTTPS;
+ }else{
+ if ((dwLocalPort=DB_Mra_GetWord(NULL,"ServerPort",MRA_DEFAULT_SERVER_PORT))==MRA_SERVER_PORT_STANDART_NLB) dwLocalPort=MRA_SERVER_PORT_STANDART;
+ }
+
+ dwAddrCount=0;
+ for(i=0;i<pmrafqFilesQueueItem->malAddrList.dwAddrCount;i++)
+ {
+ if (dwLocalPort==pmrafqFilesQueueItem->malAddrList.pmaliAddress[i].dwPort)
+ {
+ bFiltering=TRUE;
+ dwAddrCount++;
+ }
+ }
+ }
+ if (bFiltering==FALSE) dwAddrCount=pmrafqFilesQueueItem->malAddrList.dwAddrCount;
+
+ if (dwAddrCount)
+ {
+ pmrafqFilesQueueItem->hConnection=NULL;
+ dwConnectReTryCount=DB_Mra_GetDword(NULL,"ConnectReTryCountFileSend",MRA_DEFAULT_CONN_RETRY_COUNT_FILES);
+ nloc.cbSize=sizeof(nloc);
+ nloc.flags=NLOCF_V2;
+ nloc.timeout=DB_Mra_GetDword(NULL,"TimeOutConnectFileSend",((MRA_TIMEOUT_DIRECT_CONN-1)/(dwAddrCount*dwConnectReTryCount)));// -1
+ if (nloc.timeout<MRA_TIMEOUT_CONN_MIN) nloc.timeout=MRA_TIMEOUT_CONN_MIN;
+ if (nloc.timeout>MRA_TIMEOUT_CONN_) nloc.timeout=MRA_TIMEOUT_CONN_;
+
+ for(i=0;i<pmrafqFilesQueueItem->malAddrList.dwAddrCount;i++)
+ {// Set up the sockaddr structure
+ if (dwLocalPort==pmrafqFilesQueueItem->malAddrList.pmaliAddress[i].dwPort || bFiltering==FALSE)
+ {
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_CONNECTING,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+
+ nloc.szHost=inet_ntoa((*((in_addr*)&pmrafqFilesQueueItem->malAddrList.pmaliAddress[i].dwAddr)));
+ nloc.wPort=(WORD)pmrafqFilesQueueItem->malAddrList.pmaliAddress[i].dwPort;
+
+ dwCurConnectReTryCount=dwConnectReTryCount;
+ do{
+ pmrafqFilesQueueItem->hConnection=(HANDLE)CallService(MS_NETLIB_OPENCONNECTION,(WPARAM)masMraSettings.hNetlibUser,(LPARAM)&nloc);
+ }while(--dwCurConnectReTryCount && pmrafqFilesQueueItem->hConnection==NULL);
+
+ if (pmrafqFilesQueueItem->hConnection)
+ {
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_CONNECTED,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ if (MraFilesQueueHandCheck(pmrafqFilesQueueItem->hConnection,pmrafqFilesQueueItem))
+ {//
+ DB_Mra_SetDword(pmrafqFilesQueueItem->hContact,"OldIP",DB_Mra_GetDword(pmrafqFilesQueueItem->hContact,"IP",0));
+ DB_Mra_SetDword(pmrafqFilesQueueItem->hContact,"IP",HTONL(pmrafqFilesQueueItem->malAddrList.pmaliAddress[i].dwAddr));
+ break;
+ }else{// :)
+ Netlib_CloseHandle(pmrafqFilesQueueItem->hConnection);
+ pmrafqFilesQueueItem->hConnection=NULL;
+ }
+ }
+ }
+ }
+ }
+ }
+ hRet=pmrafqFilesQueueItem->hConnection;
+ }else{
+ hRet=NULL;
+ }
+return(hRet);
+}
+
+
+LPWSTR GetFileNameFromFullPathW(LPWSTR lpwszFullPath,SIZE_T dwFullPathSize)
+{
+ LPWSTR lpwszFileName=lpwszFullPath,lpwszCurPos;
+
+ lpwszCurPos=(lpwszFullPath+dwFullPathSize);
+ for(;lpwszCurPos>lpwszFullPath;lpwszCurPos--)
+ {
+ if ((*lpwszCurPos)=='\\')
+ {
+ lpwszFileName=(lpwszCurPos+1);
+ break;
+ }
+ }
+return(lpwszFileName);
+}
+
+
+
+HANDLE MraFilesQueueConnectIn(MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem)
+{
+ HANDLE hRet=NULL;
+
+ if (pmrafqFilesQueueItem)
+ if (InterlockedExchangeAdd((volatile LONG*)&pmrafqFilesQueueItem->bIsWorking,0))
+ {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ SIZE_T dwEMailSize;
+
+ if (DB_Mra_GetStaticStringA(pmrafqFilesQueueItem->hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ CHAR szAddrList[2048]={0};
+ SIZE_T dwAddrListSize;
+
+ if (DB_Mra_GetByte(NULL,"FileSendEnableDirectConn",MRA_DEF_FS_ENABLE_DIRECT_CONN))
+ {//
+ NETLIBBIND nlbBind={0};
+
+ nlbBind.cbSize=sizeof(nlbBind);
+ nlbBind.pfnNewConnectionV2=MraFilesQueueConnectionReceived;
+ nlbBind.wPort=0;
+ nlbBind.pExtra=(LPVOID)pmrafqFilesQueueItem;
+
+ pmrafqFilesQueueItem->hListen=(HANDLE)CallService(MS_NETLIB_BINDPORT,(WPARAM)masMraSettings.hNetlibUser,(LPARAM)&nlbBind);
+ if (pmrafqFilesQueueItem->hListen)
+ {
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_LISTENING,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ dwAddrListSize=MraFilesQueueGetLocalAddressesList(szAddrList,sizeof(szAddrList),nlbBind.wPort);
+ }else{// , .
+ ShowFormatedErrorMessage(L"Files exchange: cant create listen soscket, will try connect to remonte host. Error",GetLastError());
+
+ //dwAddrListSize=0;
+ memmove(szAddrList,MRA_FILES_NULL_ADDRR,sizeof(MRA_FILES_NULL_ADDRR));
+ dwAddrListSize=(sizeof(MRA_FILES_NULL_ADDRR)-1);
+ }
+ }else{// ,
+ memmove(szAddrList,MRA_FILES_NULL_ADDRR,sizeof(MRA_FILES_NULL_ADDRR));
+ dwAddrListSize=(sizeof(MRA_FILES_NULL_ADDRR)-1);
+ }
+
+ if (dwAddrListSize)
+ {
+ pmrafqFilesQueueItem->hWaitHandle=CreateEvent(NULL,TRUE,FALSE,NULL);
+ if (pmrafqFilesQueueItem->bSending==FALSE)
+ {// ,
+ MraSendCommand_FileTransferAck(FILE_TRANSFER_MIRROR,szEMail,dwEMailSize,pmrafqFilesQueueItem->dwIDRequest,(LPBYTE)szAddrList,dwAddrListSize);
+ }else{// ( )
+ //
+ LPWSTR lpwszFiles,lpwszCurPos;
+ SIZE_T dwFilesSize;
+
+ dwFilesSize=((MAX_PATH*2)*pmrafqFilesQueueItem->dwFilesCount);
+ lpwszFiles=(LPWSTR)MEMALLOC((dwFilesSize*sizeof(WCHAR)));
+ if (lpwszFiles)
+ {
+ lpwszCurPos=lpwszFiles;
+ for(SIZE_T i=0;i<pmrafqFilesQueueItem->dwFilesCount;i++)
+ {
+ lpwszCurPos+=mir_sntprintf(lpwszCurPos,(dwFilesSize-((SIZE_T)lpwszCurPos-(SIZE_T)lpwszFiles)),L"%s;%I64u;",GetFileNameFromFullPathW(pmrafqFilesQueueItem->pmfqfFiles[i].lpwszName,pmrafqFilesQueueItem->pmfqfFiles[i].dwNameLen),pmrafqFilesQueueItem->pmfqfFiles[i].dwSize);
+ }
+ dwFilesSize=(lpwszCurPos-lpwszFiles);// size in WCHARs
+
+ if (pmrafqFilesQueueItem->hMraMrimProxyData)
+ {// ,
+ LPSTR lpszFiles;
+ SIZE_T dwFilesSizeA;
+
+ dwFilesSizeA=WideCharToMultiByte(MRA_CODE_PAGE,0,lpwszFiles,dwFilesSize,NULL,0,NULL,NULL);
+ lpszFiles=(LPSTR)MEMALLOC((dwFilesSizeA+MAX_PATH));
+ if (lpszFiles)
+ {
+ dwFilesSizeA=WideCharToMultiByte(MRA_CODE_PAGE,0,lpwszFiles,dwFilesSize,lpszFiles,(dwFilesSizeA+MAX_PATH),NULL,NULL);
+ MraMrimProxySetData(pmrafqFilesQueueItem->hMraMrimProxyData,szEMail,dwEMailSize,pmrafqFilesQueueItem->dwIDRequest,MRIM_PROXY_TYPE_FILES,lpszFiles,dwFilesSizeA,NULL,0,NULL);
+ MEMFREE(lpszFiles);
+ }
+ //MraMrimProxySetData(pmrafqFilesQueueItem->hMraMrimProxyData,szEMail,dwEMailSize,pmrafqFilesQueueItem->dwIDRequest,MRIM_PROXY_TYPE_FILES,(LPSTR)lpwszFiles,dwFilesSize,NULL,0,NULL);
+ }
+ MraSendCommand_FileTransfer(szEMail,dwEMailSize,pmrafqFilesQueueItem->dwIDRequest,pmrafqFilesQueueItem->dwFilesTotalSize,lpwszFiles,dwFilesSize,szAddrList,dwAddrListSize);
+
+ MEMFREE(lpwszFiles);
+ }
+ }
+ WaitForSingleObjectEx(pmrafqFilesQueueItem->hWaitHandle,INFINITE,FALSE);
+ CloseHandle(pmrafqFilesQueueItem->hWaitHandle);
+ pmrafqFilesQueueItem->hWaitHandle=NULL;
+ }
+ }
+ hRet=pmrafqFilesQueueItem->hConnection;
+ }
+return(hRet);
+}
+
+// This function is called from the Netlib when someone is connecting to
+// one of our incomming DC ports
+void MraFilesQueueConnectionReceived(HANDLE hNewConnection,DWORD dwRemoteIP,void *pExtra)
+{
+ if (pExtra)
+ {
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem=(MRA_FILES_QUEUE_ITEM*)pExtra;
+
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_CONNECTED,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ if (MraFilesQueueHandCheck(hNewConnection,pmrafqFilesQueueItem))
+ {//
+ pmrafqFilesQueueItem->hConnection=hNewConnection;
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_CONNECTED,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ DB_Mra_SetDword(pmrafqFilesQueueItem->hContact,"OldIP",DB_Mra_GetDword(pmrafqFilesQueueItem->hContact,"IP",0));
+ DB_Mra_SetDword(pmrafqFilesQueueItem->hContact,"IP",dwRemoteIP);
+ SetEvent(pmrafqFilesQueueItem->hWaitHandle);
+ }else{// :)
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_LISTENING,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ Netlib_CloseHandle(hNewConnection);
+ }
+ }else{
+ Netlib_CloseHandle(hNewConnection);
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG,0,TranslateW(L"MraFilesQueueConnectionReceived: connection accepted, but pExtra=NULL, this is miranda bug."));
+ DebugBreak();
+ }
+}
+
+
+
+void MraFilesQueueRecvThreadProc(LPVOID lpParameter)
+{
+ DWORD dwRetErrorCode=NO_ERROR;
+
+ if (lpParameter)
+ {
+ MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)((MRA_FILES_THREADPROC_PARAMS*)lpParameter)->hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem=((MRA_FILES_THREADPROC_PARAMS*)lpParameter)->pmrafqFilesQueueItem;
+
+ WCHAR wszFileName[MAX_FILEPATH]={0};
+ WCHAR szErrorText[2048];
+ BYTE btBuff[BUFF_SIZE_RCV];
+ BOOL bContinue,bFailed,bOK,bConnected;
+ DWORD dwReceived,dwUpdateTimeNext,dwUpdateTimeCur;
+ HANDLE hFile;
+ SIZE_T i,dwBuffSizeUsed;
+ LARGE_INTEGER liFileSize;
+ NETLIBSELECT nls={0};
+ PROTOFILETRANSFERSTATUS pfts={0};
+
+ MEMFREE(lpParameter);
+
+ bFailed=TRUE;
+ bConnected=FALSE;
+ nls.cbSize=sizeof(nls);
+ pfts.cbSize=sizeof(pfts);
+ pfts.hContact=pmrafqFilesQueueItem->hContact;
+ pfts.flags=(PFTS_RECEIVING|PFTS_UNICODE);// pfts.sending=pmrafqFilesQueueItem->bSending; //true if sending, false if receiving
+ //pfts.files;
+ pfts.totalFiles=pmrafqFilesQueueItem->dwFilesCount;
+ //pfts.currentFileNumber=0;
+ pfts.totalBytes=pmrafqFilesQueueItem->dwFilesTotalSize;
+ //pfts.totalProgress=0;
+ pfts.wszWorkingDir=pmrafqFilesQueueItem->lpwszPath;
+ //pfts.currentFile;
+ //pfts.currentFileSize;
+ //pfts.currentFileProgress;
+ //pfts.currentFileTime; //as seconds since 1970
+
+ if (MraFilesQueueConnectOut(pmrafqFilesQueueItem))
+ {
+ bConnected=TRUE;
+ }else{
+ if (MraFilesQueueConnectIn(pmrafqFilesQueueItem))
+ {
+ bConnected=TRUE;
+ }else{
+ if (InterlockedExchangeAdd((volatile LONG*)&pmrafqFilesQueueItem->bIsWorking,0))
+ {
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKRESULT_CONNECTPROXY,ACKRESULT_CONNECTED,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ if (MraMrimProxyConnect(pmrafqFilesQueueItem->hMraMrimProxyData,&pmrafqFilesQueueItem->hConnection)==NO_ERROR)
+ {// , ( , )
+ if (MraFilesQueueHandCheck(pmrafqFilesQueueItem->hConnection,pmrafqFilesQueueItem))
+ {// // pmrafqFilesQueueItem->bSending
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_CONNECTED,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ bConnected=TRUE;
+ }
+ }
+ }
+ }
+ }
+
+ if (bConnected)
+ {// email verifyed
+ bFailed=FALSE;
+ for(i=0;i<pmrafqFilesQueueItem->dwFilesCount;i++)
+ {// receiving files
+ pfts.currentFileNumber=i;
+ pfts.wszCurrentFile=wszFileName;
+ pfts.currentFileSize=pmrafqFilesQueueItem->pmfqfFiles[i].dwSize;
+ pfts.currentFileProgress=0;
+ //pfts.currentFileTime; //as seconds since 1970
+
+ if ((pmrafqFilesQueueItem->dwPathSize+pmrafqFilesQueueItem->pmfqfFiles[i].dwNameLen)<SIZEOF(wszFileName))
+ {
+ memmove(wszFileName,pmrafqFilesQueueItem->lpwszPath,(pmrafqFilesQueueItem->dwPathSize*sizeof(WCHAR)));
+ memmove((wszFileName+pmrafqFilesQueueItem->dwPathSize),pmrafqFilesQueueItem->pmfqfFiles[i].lpwszName,((pmrafqFilesQueueItem->pmfqfFiles[i].dwNameLen+1)*sizeof(WCHAR)));
+ wszFileName[pmrafqFilesQueueItem->dwPathSize+pmrafqFilesQueueItem->pmfqfFiles[i].dwNameLen]=0;
+ }else{
+ dwRetErrorCode=ERROR_BAD_PATHNAME;
+ ShowFormatedErrorMessage(L"Receive files: error",dwRetErrorCode);
+ bFailed=TRUE;
+ break;
+ }
+
+ //***deb add
+ //dwBuffSizeUsed=ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_FILERESUME,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,(LPARAM)&pfts);
+
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_NEXTFILE,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+
+ //dwBuffSizeUsed=(mir_snprintf((LPSTR)btBuff,SIZEOF(btBuff),"%s %S",MRA_FT_GET_FILE,pmrafqFilesQueueItem->pmfqfFiles[i].lpwszName)+1);
+ memmove(btBuff,MRA_FT_GET_FILE,sizeof(MRA_FT_GET_FILE));
+ btBuff[(sizeof(MRA_FT_GET_FILE)-1)]=' ';
+ dwBuffSizeUsed=sizeof(MRA_FT_GET_FILE)+WideCharToMultiByte(MRA_CODE_PAGE,0,pmrafqFilesQueueItem->pmfqfFiles[i].lpwszName,pmrafqFilesQueueItem->pmfqfFiles[i].dwNameLen,(LPSTR)(btBuff+sizeof(MRA_FT_GET_FILE)),(SIZEOF(btBuff)-sizeof(MRA_FT_GET_FILE)),NULL,NULL);
+ btBuff[dwBuffSizeUsed]=0;
+ dwBuffSizeUsed++;
+
+ if (dwBuffSizeUsed==Netlib_Send(pmrafqFilesQueueItem->hConnection,(LPSTR)btBuff,dwBuffSizeUsed,0))
+ {// file request sended
+ hFile=CreateFileW(wszFileName,GENERIC_WRITE,FILE_SHARE_READ,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
+ if (hFile!=INVALID_HANDLE_VALUE)
+ {// file opened/created, pre allocating disk space, for best perfomance
+ bOK=FALSE;
+
+ liFileSize.QuadPart=(LONGLONG)pmrafqFilesQueueItem->pmfqfFiles[i].dwSize;
+ if (SetFilePointerEx(hFile,liFileSize,NULL,FILE_BEGIN))
+ if (SetEndOfFile(hFile))
+ {
+ liFileSize.QuadPart=0;
+ bOK=SetFilePointerEx(hFile,liFileSize,NULL,FILE_BEGIN);
+ }
+
+ if (bOK)
+ {// disk space pre allocated
+ bOK=FALSE;
+ bContinue=TRUE;
+ dwUpdateTimeNext=GetTickCount();
+ nls.dwTimeout=(1000*DB_Mra_GetDword(NULL,"TimeOutReceiveFileData",MRA_DEF_FS_TIMEOUT_RECV));
+ nls.hReadConns[0]=pmrafqFilesQueueItem->hConnection;
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_DATA,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,(LPARAM)&pfts);
+
+ while(bContinue)
+ {
+ switch(CallService(MS_NETLIB_SELECT,0,(LPARAM)&nls)){
+ case SOCKET_ERROR:
+ case 0:// Time out
+ dwRetErrorCode=GetLastError();
+ ShowFormatedErrorMessage(L"Receive files: error on receive file data",dwRetErrorCode);
+ bContinue=FALSE;
+ break;
+ case 1:
+ dwReceived=Netlib_Recv(pmrafqFilesQueueItem->hConnection,(LPSTR)&btBuff,SIZEOF(btBuff),0);
+ if (dwReceived==0 || dwReceived==SOCKET_ERROR)
+ {
+ dwRetErrorCode=GetLastError();
+ ShowFormatedErrorMessage(L"Receive files: error on receive file data",dwRetErrorCode);
+ bContinue=FALSE;
+ }else{
+ if (WriteFile(hFile,(LPVOID)&btBuff,dwReceived,&dwReceived,NULL))
+ {
+ pfts.currentFileProgress+=dwReceived;
+ pfts.totalProgress+=dwReceived;
+
+ // progress updates
+ dwUpdateTimeCur=GetTickCount();
+ if (dwUpdateTimeNext<=dwUpdateTimeCur || pfts.currentFileProgress>=pmrafqFilesQueueItem->pmfqfFiles[i].dwSize)
+ {// we update it
+ dwUpdateTimeNext=dwUpdateTimeCur+MRA_FILES_QUEUE_PROGRESS_INTERVAL;
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_DATA,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,(LPARAM)&pfts);
+
+ if (pfts.currentFileProgress>=pmrafqFilesQueueItem->pmfqfFiles[i].dwSize)
+ {// file received
+ bOK=TRUE;
+ bContinue=FALSE;
+ }
+ }
+ }else{// err on write file
+ dwRetErrorCode=GetLastError();
+ ShowFormatedErrorMessage(L"Receive files: cant write file data, error",dwRetErrorCode);
+ bContinue=FALSE;
+ }
+ }
+ break;
+ }
+ }// end while
+ }else{// err allocating file disk space
+ dwRetErrorCode=GetLastError();
+ mir_sntprintf(szErrorText,SIZEOF(szErrorText),TranslateW(L"Receive files: cant allocate disk space for file, size %lu bytes, error"),pmrafqFilesQueueItem->pmfqfFiles[i].dwSize);
+ ShowFormatedErrorMessage(szErrorText,dwRetErrorCode);
+ }
+ CloseHandle(hFile);
+
+ if (bOK==FALSE)
+ {// file recv failed
+ DeleteFileW(wszFileName);
+ bFailed=TRUE;
+ break;
+ }
+ }else{// err on open file
+ dwRetErrorCode=GetLastError();
+ mir_sntprintf(szErrorText,SIZEOF(szErrorText),TranslateW(L"Receive files: cant open file %s, error"),wszFileName);
+ ShowFormatedErrorMessage(szErrorText,dwRetErrorCode);
+ bFailed=TRUE;
+ break;
+ }
+ }else{// err on send request for file
+ dwRetErrorCode=GetLastError();
+ mir_sntprintf(szErrorText,SIZEOF(szErrorText),TranslateW(L"Receive files: request for file %s not sended, error"),pmrafqFilesQueueItem->pmfqfFiles[i].lpwszName);
+ ShowFormatedErrorMessage(szErrorText,NO_ERROR);
+ bFailed=TRUE;
+ break;
+ }
+ }// end for
+
+ Netlib_CloseHandle(pmrafqFilesQueueItem->hConnection);
+ pmrafqFilesQueueItem->hConnection=NULL;
+ }
+
+ if (bFailed)
+ {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ SIZE_T dwEMailSize;
+
+ if (DB_Mra_GetStaticStringA(pmrafqFilesQueueItem->hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ MraSendCommand_FileTransferAck(FILE_TRANSFER_STATUS_ERROR,szEMail,dwEMailSize,pmrafqFilesQueueItem->dwIDRequest,NULL,0);
+ }
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_FAILED,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ }else{
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_SUCCESS,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ }
+
+ ListMTLock(&pmrafqFilesQueue->lmtListMT);
+ MraFilesQueueItemFree(pmrafqFilesQueueItem);
+ ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+ }
+}
+
+
+
+void MraFilesQueueSendThreadProc(LPVOID lpParameter)
+{
+ DWORD dwRetErrorCode=NO_ERROR;
+
+ if (lpParameter)
+ {
+ MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)((MRA_FILES_THREADPROC_PARAMS*)lpParameter)->hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem=((MRA_FILES_THREADPROC_PARAMS*)lpParameter)->pmrafqFilesQueueItem;
+
+ CHAR szFileName[MAX_FILEPATH]={0};
+ WCHAR szErrorText[2048];
+ BYTE btBuff[BUFF_SIZE_RCV];
+ BOOL bFailed=TRUE,bOK,bConnected=FALSE;
+ DWORD dwReceived,dwSendBlockSize,dwUpdateTimeNext,dwUpdateTimeCur;
+ HANDLE hFile;
+ SIZE_T i,j,dwBuffSizeUsed=0;
+ LPWSTR lpwszFileName;
+ PROTOFILETRANSFERSTATUS pfts={0};
+
+ MEMFREE(lpParameter);
+
+ pfts.cbSize=sizeof(pfts);
+ pfts.hContact=pmrafqFilesQueueItem->hContact;
+ pfts.flags=(PFTS_SENDING|PFTS_UNICODE);// pfts.sending=pmrafqFilesQueueItem->bSending; //true if sending, false if receiving
+ //pfts.files;
+ pfts.totalFiles=pmrafqFilesQueueItem->dwFilesCount;
+ //pfts.currentFileNumber=0;
+ pfts.totalBytes=pmrafqFilesQueueItem->dwFilesTotalSize;
+ //pfts.totalProgress=0;
+ pfts.wszWorkingDir=pmrafqFilesQueueItem->lpwszPath;
+ //pfts.currentFile;
+ //pfts.currentFileSize;
+ //pfts.currentFileProgress;
+ //pfts.currentFileTime; //as seconds since 1970
+
+ dwSendBlockSize=DB_Mra_GetDword(NULL,"FileSendBlockSize",MRA_DEFAULT_FILE_SEND_BLOCK_SIZE);
+ if (dwSendBlockSize>SIZEOF(btBuff)) dwSendBlockSize=SIZEOF(btBuff);
+ if (dwSendBlockSize<512) dwSendBlockSize=MRA_DEFAULT_FILE_SEND_BLOCK_SIZE;
+
+ if (MraFilesQueueConnectIn(pmrafqFilesQueueItem))
+ {
+ bConnected=TRUE;
+ }else{
+ if (MraFilesQueueConnectOut(pmrafqFilesQueueItem))
+ {
+ bConnected=TRUE;
+ }else{
+ if (InterlockedExchangeAdd((volatile LONG*)&pmrafqFilesQueueItem->bIsWorking,0))
+ {
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKRESULT_CONNECTPROXY,ACKRESULT_CONNECTED,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ if (MraMrimProxyConnect(pmrafqFilesQueueItem->hMraMrimProxyData,&pmrafqFilesQueueItem->hConnection)==NO_ERROR)
+ {// , ( , )
+ if (MraFilesQueueHandCheck(pmrafqFilesQueueItem->hConnection,pmrafqFilesQueueItem))
+ {// // pmrafqFilesQueueItem->bSending
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_CONNECTED,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ bConnected=TRUE;
+ }
+ }
+ }
+ }
+ }
+
+ if (bConnected)
+ {// email verifyed
+ bFailed=FALSE;
+ for(i=0;i<pmrafqFilesQueueItem->dwFilesCount;i++)
+ {// sending files
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_NEXTFILE,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+
+ dwBuffSizeUsed=0;
+ while(TRUE)
+ {
+ dwReceived=Netlib_Recv(pmrafqFilesQueueItem->hConnection,((LPSTR)btBuff+dwBuffSizeUsed),(SIZEOF(btBuff)-dwBuffSizeUsed),0);
+ if (dwReceived==0 || dwReceived==SOCKET_ERROR)
+ {// err on receive file name to send
+ dwRetErrorCode=GetLastError();
+ ShowFormatedErrorMessage(L"Send files: file send request not received, error",dwRetErrorCode);
+ bFailed=TRUE;
+ break;
+ }else{
+ dwBuffSizeUsed+=dwReceived;
+ if (MemoryFindByte((dwBuffSizeUsed-dwReceived),btBuff,dwBuffSizeUsed,0)) break;
+ }
+ }// end while (file name passible received)*/
+
+
+ if (bFailed==FALSE)
+ {// ...received
+ if (dwBuffSizeUsed>(sizeof(MRA_FT_GET_FILE)+1))
+ {// file name received
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,(LPSTR)btBuff,(sizeof(MRA_FT_GET_FILE)-1),MRA_FT_GET_FILE,(sizeof(MRA_FT_GET_FILE)-1))==CSTR_EQUAL)
+ {// MRA_FT_GET_FILE verifyed
+ bFailed=TRUE;
+ for(j=0;j<pmrafqFilesQueueItem->dwFilesCount;j++)
+ {
+ lpwszFileName=GetFileNameFromFullPathW(pmrafqFilesQueueItem->pmfqfFiles[j].lpwszName,pmrafqFilesQueueItem->pmfqfFiles[j].dwNameLen);
+ szFileName[WideCharToMultiByte(MRA_CODE_PAGE,0,lpwszFileName,(pmrafqFilesQueueItem->pmfqfFiles[j].dwNameLen-(lpwszFileName-pmrafqFilesQueueItem->pmfqfFiles[j].lpwszName)),szFileName,SIZEOF(szFileName),NULL,NULL)]=0;
+
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,(((LPSTR)btBuff)+sizeof(MRA_FT_GET_FILE)),(dwBuffSizeUsed-(sizeof(MRA_FT_GET_FILE)+1)),szFileName,-1)==CSTR_EQUAL)
+ {
+ bFailed=FALSE;
+ break;
+ }
+ }
+
+ if (bFailed==FALSE)
+ {
+ hFile=CreateFileW(pmrafqFilesQueueItem->pmfqfFiles[j].lpwszName,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,(FILE_ATTRIBUTE_NORMAL|FILE_FLAG_SEQUENTIAL_SCAN),NULL);
+ if (hFile!=INVALID_HANDLE_VALUE)
+ {
+ bOK=FALSE;
+ dwUpdateTimeNext=GetTickCount();
+ pfts.currentFileNumber=i;
+ pfts.wszCurrentFile=pmrafqFilesQueueItem->pmfqfFiles[j].lpwszName;
+ pfts.currentFileSize=pmrafqFilesQueueItem->pmfqfFiles[j].dwSize;
+ pfts.currentFileProgress=0;
+ //pfts.currentFileTime; //as seconds since 1970
+
+ WideCharToMultiByte(MRA_CODE_PAGE,0,pmrafqFilesQueueItem->pmfqfFiles[j].lpwszName,pmrafqFilesQueueItem->pmfqfFiles[j].dwNameLen,szFileName,SIZEOF(szFileName),NULL,NULL);
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_DATA,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,(LPARAM)&pfts);
+
+ while(TRUE)
+ {// read and sending
+ if (ReadFile(hFile,btBuff,dwSendBlockSize,(DWORD*)&dwBuffSizeUsed,NULL))
+ {
+ dwReceived=Netlib_Send(pmrafqFilesQueueItem->hConnection,(LPSTR)btBuff,dwBuffSizeUsed,0);
+ if (dwBuffSizeUsed==dwReceived)
+ {
+ pfts.currentFileProgress+=dwBuffSizeUsed;
+ pfts.totalProgress+=dwBuffSizeUsed;
+
+ // progress updates
+ dwUpdateTimeCur=GetTickCount();
+ if (dwUpdateTimeNext<=dwUpdateTimeCur || pfts.currentFileProgress>=pmrafqFilesQueueItem->pmfqfFiles[j].dwSize)
+ {// we update it
+ dwUpdateTimeNext=dwUpdateTimeCur+MRA_FILES_QUEUE_PROGRESS_INTERVAL;
+
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_DATA,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,(LPARAM)&pfts);
+
+ if (pfts.currentFileProgress>=pmrafqFilesQueueItem->pmfqfFiles[j].dwSize)
+ {// file received
+ bOK=TRUE;
+ break;
+ }
+ }
+ }else{// err on send file data
+ dwRetErrorCode=GetLastError();
+ ShowFormatedErrorMessage(L"Send files: error on send file data",dwRetErrorCode);
+ break;
+ }
+ }else{// read failure
+ dwRetErrorCode=GetLastError();
+ ShowFormatedErrorMessage(L"Send files: cant read file data, error",dwRetErrorCode);
+ break;
+ }
+ }// end while
+ CloseHandle(hFile);
+
+ if (bOK==FALSE)
+ {// file recv failed
+ bFailed=TRUE;
+ break;
+ }
+ }else{// err on open file
+ dwRetErrorCode=GetLastError();
+
+ mir_sntprintf(szErrorText,SIZEOF(szErrorText),TranslateW(L"Send files: cant open file %s, error"),pmrafqFilesQueueItem->pmfqfFiles[j].lpwszName);
+ ShowFormatedErrorMessage(szErrorText,dwRetErrorCode);
+ bFailed=TRUE;
+ break;
+ }
+ }else{
+ mir_sntprintf(szErrorText,SIZEOF(szErrorText),TranslateW(L"Send files: requested file: %S - not found in send files list."),(((LPSTR)btBuff)+sizeof(MRA_FT_GET_FILE)));
+ ShowFormatedErrorMessage(szErrorText,NO_ERROR);
+ bFailed=TRUE;
+ break;
+ }
+ }else{// err on receive, trash
+ ShowFormatedErrorMessage(L"Send files: bad file send request - invalid header",NO_ERROR);
+ bFailed=TRUE;
+ break;
+ }
+ }else{// bad file name or trash
+ ShowFormatedErrorMessage(L"Send files: bad file send request - to small packet",NO_ERROR);
+ bFailed=TRUE;
+ break;
+ }
+ }else{
+ break;
+ }
+ }// end for
+
+ Netlib_CloseHandle(pmrafqFilesQueueItem->hConnection);
+ pmrafqFilesQueueItem->hConnection=NULL;
+ }
+
+ if (bFailed)
+ {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ SIZE_T dwEMailSize;
+
+ if (DB_Mra_GetStaticStringA(pmrafqFilesQueueItem->hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ MraSendCommand_FileTransferAck(FILE_TRANSFER_STATUS_ERROR,szEMail,dwEMailSize,pmrafqFilesQueueItem->dwIDRequest,NULL,0);
+ }
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_FAILED,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ }else{
+ ProtoBroadcastAck(PROTOCOL_NAMEA,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_SUCCESS,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ }
+
+ ListMTLock(&pmrafqFilesQueue->lmtListMT);
+ MraFilesQueueItemFree(pmrafqFilesQueueItem);
+ ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+ }
+}
diff --git a/protocols/MRA/MraFilesQueue.h b/protocols/MRA/MraFilesQueue.h
new file mode 100644
index 0000000000..2b00405e82
--- /dev/null
+++ b/protocols/MRA/MraFilesQueue.h
@@ -0,0 +1,26 @@
+#if !defined(AFX_MRA_FILESQUEUE_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
+#define AFX_MRA_FILESQUEUE_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_
+
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+INT_PTR CALLBACK MraFilesQueueDlgProcOpts(HWND hWndDlg,UINT msg,WPARAM wParam,LPARAM lParam);
+DWORD MraFilesQueueInitialize (DWORD dwFilesTimeOutInterval,HANDLE *phFilesQueueHandle);
+void MraFilesQueueDestroy (HANDLE hFilesQueueHandle);
+
+HANDLE MraFilesQueueItemProxyByID (HANDLE hFilesQueueHandle,DWORD dwIDRequest);
+DWORD MraFilesQueueAddReceive (HANDLE hFilesQueueHandle,DWORD dwFlags,HANDLE hContact,DWORD dwIDRequest,LPWSTR lpwszFiles,SIZE_T dwFilesSize,LPSTR lpszAddreses,SIZE_T dwAddresesSize);
+DWORD MraFilesQueueAddSend (HANDLE hFilesQueueHandle,DWORD dwFlags,HANDLE hContact,LPWSTR *plpwszFiles,SIZE_T dwFilesCount,DWORD *pdwIDRequest);
+DWORD MraFilesQueueAccept (HANDLE hFilesQueueHandle,DWORD dwIDRequest,LPWSTR lpwszPath,SIZE_T dwPathSize);
+DWORD MraFilesQueueCancel (HANDLE hFilesQueueHandle,DWORD dwIDRequest,BOOL bSendDecline);
+DWORD MraFilesQueueStartMrimProxy (HANDLE hFilesQueueHandle,DWORD dwIDRequest);
+DWORD MraFilesQueueFree (HANDLE hFilesQueueHandle,DWORD dwCMDNum);
+DWORD MraFilesQueueSendMirror (HANDLE hFilesQueueHandle,DWORD dwIDRequest,LPSTR lpszAddreses,SIZE_T dwAddresesSize);
+
+
+
+
+#endif // !defined(AFX_MRA_FILESQUEUE_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/MraFilesQueue_mod.cpp b/protocols/MRA/MraFilesQueue_mod.cpp
new file mode 100644
index 0000000000..23488c9a91
--- /dev/null
+++ b/protocols/MRA/MraFilesQueue_mod.cpp
@@ -0,0 +1,1298 @@
+#include <SystemHeaders.h>
+#include <MemoryFindByte.h>
+#include <MemoryCompare.h>
+#include <BuffToLowerCase.h>
+#include <ListMT.h>
+#include <StrToNum.h>
+#include "MraFilesQueue.h"
+#include "proto.h"
+#include "Mra.h"
+
+
+
+#define MRA_FT_HELLO "MRA_FT_HELLO"
+#define MRA_FT_GET_FILE "MRA_FT_GET_FILE"
+
+
+
+typedef struct
+{
+ LIST_MT lmtListMT;
+ DWORD dwSendTimeOutInterval;
+} MRA_FILES_QUEUE;
+
+
+
+struct MRA_FILES_QUEUE_FILE
+{
+ LPSTR lpszName;
+ SIZE_T dwNameLen;
+ SIZE_T dwSize;
+};
+
+struct MRA_FILES_QUEUE_ADDR
+{
+ DWORD dwIP;
+ DWORD dwPort;
+};
+
+
+typedef struct
+{
+ // internal
+ LIST_MT_ITEM lmtListMTItem;
+ DWORD dwSendTime;
+ // external
+ DWORD dwIDRequest;
+ DWORD dwFlags;
+ HANDLE hContact;
+ DWORD dwFilesCount;
+ DWORD dwFilesTotalSize;
+ DWORD dwAddrCount;
+ LPSTR lpszDescription;
+ SIZE_T dwDescriptionSize;
+ MRA_FILES_QUEUE_FILE *pmfqfFiles;
+ MRA_FILES_QUEUE_ADDR *pmfqaAddreses;
+ LPSTR lpszPath;
+ SIZE_T dwPathSize;
+ BOOL bSending;
+ HANDLE hConnection;
+ HANDLE hListen;
+ HANDLE hThread;
+ HANDLE hWaitHandle;
+
+} MRA_FILES_QUEUE_ITEM;
+
+
+
+struct MRA_FILES_THREADPROC_PARAMS
+{
+ HANDLE hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+};
+
+
+
+//#define MEMALLOC(Size) HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,(Size+sizeof(SIZE_T)))
+//#define MEMREALLOC(Mem,Size) HeapReAlloc(GetProcessHeap(),(HEAP_ZERO_MEMORY),(LPVOID)Mem,(Size+sizeof(SIZE_T)))
+//#define MEMFREE(Mem) if (Mem) {HeapFree(GetProcessHeap(),0,(LPVOID)Mem);Mem=NULL;}
+
+
+DWORD MraFilesQueueItemFindByID (HANDLE hFilesQueueHandle,DWORD dwIDRequest,MRA_FILES_QUEUE_ITEM **ppmrafqFilesQueueItem);
+DWORD MraFilesQueueItemFindByEMail (HANDLE hFilesQueueHandle,LPSTR lpszEMail,SIZE_T dwEMailSize,MRA_FILES_QUEUE_ITEM **ppmrafqFilesQueueItem);
+void MraFilesQueueItemFree (MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem);
+SIZE_T MraFilesQueueGetLocalAddressesList (LPSTR lpszBuff,SIZE_T dwBuffSize,DWORD dwPort);
+
+BOOL MraFilesQueueHandCheck (HANDLE hConnection,MRA_FILES_QUEUE_ITEM **ppmrafqFilesQueueItem);
+void MraFilesQueueConnectionReceived (HANDLE hNewConnection,DWORD dwRemoteIP,void *pExtra);
+
+DWORD WINAPI MraFilesQueueRecvThreadProc (LPVOID lpParameter);
+DWORD WINAPI MraFilesQueueSendThreadProc (LPVOID lpParameter);
+
+
+
+BOOL CALLBACK MraFilesQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch(msg){
+ case WM_INITDIALOG:
+ {
+ DBVARIANT dbv;
+ TranslateDialogDefault(hWndDlg);
+
+ CheckDlgButton(hWndDlg,IDC_FILE_SEND_HIDE_MY_NOOUTCONNECTIONONRECEIVE,DB_Mra_GetByte(NULL,"FileSendNoOutConnOnRcv",MRA_DEF_FS_NO_OUT_CONN_ON_RCV));
+ CheckDlgButton(hWndDlg,IDC_FILE_SEND_HIDE_MY_NOOUTCONNECTIONONSEND,DB_Mra_GetByte(NULL,"FileSendNoOutConnOnSend",MRA_DEF_FS_NO_OUT_CONN_ON_SEND));
+ CheckDlgButton(hWndDlg,IDC_FILE_SEND_IGNORYADDITIONALPORTS,DB_Mra_GetByte(NULL,"FileSendIgnoryAdditionalPorts",MRA_DEF_FS_IGNORY_ADDITIONAL_PORTS));
+ CheckDlgButton(hWndDlg,IDC_FILE_SEND_HIDE_MY_ADDRESSES,DB_Mra_GetByte(NULL,"FileSendHideMyAddresses",MRA_DEF_FS_HIDE_MY_ADDRESSES));
+ CheckDlgButton(hWndDlg,IDC_FILE_SEND_ADD_EXTRA_ADDRESS,DB_Mra_GetByte(NULL,"FileSendAddExtraAddresses",MRA_DEF_FS_ADD_EXTRA_ADDRESSES));
+ if(!DBGetContactSetting(NULL,PROTOCOL_NAME,"FileSendExtraAddresses",&dbv)) {
+ //bit of a security hole here, since it's easy to extract a password from an edit box
+ SetDlgItemText(hWndDlg,IDC_FILE_SEND_EXTRA_ADDRESS,dbv.pszVal);
+ DBFreeVariant(&dbv);
+ }
+ EnableWindow(GetDlgItem(hWndDlg,IDC_FILE_SEND_EXTRA_ADDRESS),IsDlgButtonChecked(hWndDlg,IDC_FILE_SEND_ADD_EXTRA_ADDRESS));
+
+ SetDlgItemInt(hWndDlg,IDC_FILE_SEND_BLOCK_SIZE,DB_Mra_GetDword(NULL,"FileSendBlockSize",MRA_DEFAULT_FILE_SEND_BLOCK_SIZE),FALSE);
+ }
+ return(TRUE);
+ case WM_COMMAND:
+ if (LOWORD(wParam)==IDC_FILE_SEND_ADD_EXTRA_ADDRESS)
+ {
+ EnableWindow(GetDlgItem(hWndDlg,IDC_FILE_SEND_EXTRA_ADDRESS),IsDlgButtonChecked(hWndDlg,IDC_FILE_SEND_ADD_EXTRA_ADDRESS));
+ }
+
+ if ((LOWORD(wParam)==IDC_FILE_SEND_EXTRA_ADDRESS || LOWORD(wParam)==IDC_FILE_SEND_BLOCK_SIZE) && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus()) ) return(0);
+ SendMessage(GetParent(hWndDlg),PSM_CHANGED,0,0);
+ break;
+ case WM_NOTIFY:
+ switch (((LPNMHDR)lParam)->code){
+ case PSN_APPLY:
+ {
+ char szBuff[MAX_PATH];
+
+ DB_Mra_SetByte(NULL,"FileSendNoOutConnOnRcv",IsDlgButtonChecked(hWndDlg,IDC_FILE_SEND_HIDE_MY_NOOUTCONNECTIONONRECEIVE));
+ DB_Mra_SetByte(NULL,"FileSendNoOutConnOnSend",IsDlgButtonChecked(hWndDlg,IDC_FILE_SEND_HIDE_MY_NOOUTCONNECTIONONSEND));
+ DB_Mra_SetByte(NULL,"FileSendIgnoryAdditionalPorts",IsDlgButtonChecked(hWndDlg,IDC_FILE_SEND_IGNORYADDITIONALPORTS));
+ DB_Mra_SetByte(NULL,"FileSendHideMyAddresses",IsDlgButtonChecked(hWndDlg,IDC_FILE_SEND_HIDE_MY_ADDRESSES));
+ DB_Mra_SetByte(NULL,"FileSendAddExtraAddresses",IsDlgButtonChecked(hWndDlg,IDC_FILE_SEND_ADD_EXTRA_ADDRESS));
+ GetDlgItemText(hWndDlg,IDC_FILE_SEND_EXTRA_ADDRESS,szBuff,sizeof(szBuff));
+ DBWriteContactSettingString(NULL,PROTOCOL_NAME,"FileSendExtraAddresses",szBuff);
+ DB_Mra_SetDword(NULL,"FileSendBlockSize",(DWORD)GetDlgItemInt(hWndDlg,IDC_FILE_SEND_BLOCK_SIZE,NULL,FALSE));
+ }
+ return(TRUE);
+ }
+ break;
+ }
+return(FALSE);
+}
+
+
+
+DWORD MraFilesQueueInitialize(DWORD dwSendTimeOutInterval,HANDLE *phFilesQueueHandle)
+{
+ DWORD dwRetErrorCode;
+
+ if (phFilesQueueHandle)
+ {
+ MRA_FILES_QUEUE *pmrafqFilesQueue;
+
+ pmrafqFilesQueue=(MRA_FILES_QUEUE*)MEMALLOC(sizeof(MRA_FILES_QUEUE));
+ if (pmrafqFilesQueue)
+ {
+ dwRetErrorCode=ListMTInitialize(&pmrafqFilesQueue->lmtListMT,0);
+ if (dwRetErrorCode==NO_ERROR)
+ {
+ pmrafqFilesQueue->dwSendTimeOutInterval=dwSendTimeOutInterval;
+ (*phFilesQueueHandle)=(HANDLE)pmrafqFilesQueue;
+ }else{
+ MEMFREE(pmrafqFilesQueue);
+ }
+ }else{
+ dwRetErrorCode=GetLastError();
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+void MraFilesQueueDestroy(HANDLE hFilesQueueHandle)
+{
+ if (hFilesQueueHandle)
+ {
+ MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+
+ ListMTLock(&pmrafqFilesQueue->lmtListMT);
+ while(ListMTItemGetFirst(&pmrafqFilesQueue->lmtListMT,NULL,(LPVOID*)&pmrafqFilesQueueItem)==NO_ERROR)
+ {
+ ListMTItemDelete(&pmrafqFilesQueue->lmtListMT,&pmrafqFilesQueueItem->lmtListMTItem);
+ MraFilesQueueItemFree(pmrafqFilesQueueItem);
+ }
+ ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+
+ ListMTDestroy(&pmrafqFilesQueue->lmtListMT);
+ MEMFREE(pmrafqFilesQueue);
+ }
+}
+
+
+DWORD MraFilesQueueItemFindByID(HANDLE hFilesQueueHandle,DWORD dwIDRequest,MRA_FILES_QUEUE_ITEM **ppmrafqFilesQueueItem)
+{
+ DWORD dwRetErrorCode;
+
+ if (hFilesQueueHandle)
+ {
+ MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+ LIST_MT_ITERATOR lmtiIterator;
+
+ dwRetErrorCode=ERROR_NOT_FOUND;
+ ListMTLock(&pmrafqFilesQueue->lmtListMT);
+ ListMTIteratorMoveFirst(&pmrafqFilesQueue->lmtListMT,&lmtiIterator);
+ do
+ {//
+ if (ListMTIteratorGet(&lmtiIterator,NULL,(LPVOID*)&pmrafqFilesQueueItem)==NO_ERROR)
+ if (pmrafqFilesQueueItem->dwIDRequest==dwIDRequest)
+ {
+ if (ppmrafqFilesQueueItem) (*ppmrafqFilesQueueItem)=pmrafqFilesQueueItem;
+ dwRetErrorCode=NO_ERROR;
+ break;
+ }
+ }while(ListMTIteratorMoveNext(&lmtiIterator));
+ ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD MraFilesQueueItemFindByEMail(HANDLE hFilesQueueHandle,LPSTR lpszEMail,SIZE_T dwEMailSize,MRA_FILES_QUEUE_ITEM **ppmrafqFilesQueueItem)
+{
+ DWORD dwRetErrorCode;
+
+ if (hFilesQueueHandle)
+ {
+ char szEMailLocal[MAX_EMAIL_LEN];
+ SIZE_T dwEMailLocalSize;
+ MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+ LIST_MT_ITERATOR lmtiIterator;
+
+ dwRetErrorCode=ERROR_NOT_FOUND;
+ ListMTLock(&pmrafqFilesQueue->lmtListMT);
+ ListMTIteratorMoveFirst(&pmrafqFilesQueue->lmtListMT,&lmtiIterator);
+ do
+ {//
+ if (ListMTIteratorGet(&lmtiIterator,NULL,(LPVOID*)&pmrafqFilesQueueItem)==NO_ERROR)
+ if (DB_Mra_GetStaticString(pmrafqFilesQueueItem->hContact,"e-mail",szEMailLocal,sizeof(szEMailLocal),&dwEMailLocalSize))
+ if (dwEMailSize==dwEMailLocalSize)
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszEMail,dwEMailSize,szEMailLocal,dwEMailLocalSize)==CSTR_EQUAL)
+ {
+ if (ppmrafqFilesQueueItem) (*ppmrafqFilesQueueItem)=pmrafqFilesQueueItem;
+ dwRetErrorCode=NO_ERROR;
+ break;
+ }
+ }while(ListMTIteratorMoveNext(&lmtiIterator));
+ ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+void MraFilesQueueItemFree(MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem)
+{
+
+ for(SIZE_T i=0;i<pmrafqFilesQueueItem->dwFilesCount;i++)
+ {
+ MEMFREE(pmrafqFilesQueueItem->pmfqfFiles[i].lpszName);
+ }
+ MEMFREE(pmrafqFilesQueueItem->pmfqfFiles);
+ MEMFREE(pmrafqFilesQueueItem->pmfqaAddreses);
+ MEMFREE(pmrafqFilesQueueItem->lpszPath);
+ //MEMFREE(pmrafqFilesQueueItem->lpszDescription); //placed after pmrafqFilesQueueItem
+ MEMFREE(pmrafqFilesQueueItem);
+}
+
+
+
+
+
+SIZE_T MraFilesQueueGetLocalAddressesList(LPSTR lpszBuff,SIZE_T dwBuffSize,DWORD dwPort)
+{
+ char szHostName[MAX_PATH]={0};
+ LPSTR lpszCurPos=lpszBuff;
+ SIZE_T dwAdapter=0;
+ hostent *sh;
+
+ if (DB_Mra_GetByte(NULL,"FileSendHideMyAddresses",MRA_DEF_FS_HIDE_MY_ADDRESSES))
+ {// IP !!! :)
+ lpszCurPos+=mir_snprintf(lpszCurPos,(dwBuffSize-(lpszCurPos-lpszBuff)),"192.168.0.1:26775;");
+ }else{// IP
+ if (gethostname(szHostName,sizeof(szHostName))==0)
+ if ((sh=gethostbyname((LPSTR)&szHostName)))
+ {
+ while(sh->h_addr_list[dwAdapter])
+ {
+ lpszCurPos+=mir_snprintf(lpszCurPos,(dwBuffSize-(lpszCurPos-lpszBuff)),"%s:%ld;",inet_ntoa(*((struct in_addr*)sh->h_addr_list[dwAdapter])),dwPort);
+ dwAdapter++;
+ }
+ }
+ }
+
+ if (DB_Mra_GetByte(NULL,"FileSendAddExtraAddresses",MRA_DEF_FS_ADD_EXTRA_ADDRESSES))//
+ if (DB_Mra_GetStaticString(NULL,"FileSendExtraAddresses",szHostName,sizeof(szHostName),NULL))
+ {
+ lpszCurPos+=mir_snprintf(lpszCurPos,(dwBuffSize-(lpszCurPos-lpszBuff)),"%s:%ld;",szHostName,dwPort);
+ }
+return((lpszCurPos-lpszBuff));
+}
+
+
+
+
+DWORD MraFilesQueueAddReceive(HANDLE hFilesQueueHandle,DWORD dwFlags,HANDLE hContact,DWORD dwIDRequest,DWORD dwFilesTotalSize,LPSTR lpszFiles,SIZE_T dwFilesSize,LPSTR lpszDescription,SIZE_T dwDescriptionSize,LPSTR lpszAddreses,SIZE_T dwAddresesSize)
+{
+ DWORD dwRetErrorCode;
+
+ if (hFilesQueueHandle && dwIDRequest)
+ {
+ MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+
+ if (!lpszDescription || dwDescriptionSize==0)
+ {
+ lpszDescription=Translate("No description given");
+ dwDescriptionSize=lstrlenA(lpszDescription);
+ }
+
+ pmrafqFilesQueueItem=(MRA_FILES_QUEUE_ITEM*)MEMALLOC(sizeof(MRA_FILES_QUEUE_ITEM)+sizeof(LPSTR)+dwDescriptionSize+64);
+ if (pmrafqFilesQueueItem)
+ {
+ char szBuff[MAX_PATH];
+ LPSTR lpszCurrentItem,lpszDelimiter,lpszEndItem,lpszBlob;
+ SIZE_T dwMemSize,dwAllocatedCount;
+ CCSDATA ccs;
+ PROTORECVEVENT pre;
+
+ //pmrafqFilesQueueItem->lmtListMTItem;
+ pmrafqFilesQueueItem->dwSendTime=GetTickCount();
+ pmrafqFilesQueueItem->dwIDRequest=dwIDRequest;
+ pmrafqFilesQueueItem->dwFlags=dwFlags;
+ pmrafqFilesQueueItem->hContact=hContact;
+ pmrafqFilesQueueItem->lpszDescription=(LPSTR)(pmrafqFilesQueueItem+1);
+ pmrafqFilesQueueItem->dwDescriptionSize=dwDescriptionSize;
+ CopyMemory(pmrafqFilesQueueItem->lpszDescription,lpszDescription,dwDescriptionSize);
+
+
+ dwAllocatedCount=ALLOCATED_COUNT;
+ pmrafqFilesQueueItem->dwFilesCount=0;
+ pmrafqFilesQueueItem->dwFilesTotalSize=dwFilesTotalSize;
+ pmrafqFilesQueueItem->pmfqfFiles=(MRA_FILES_QUEUE_FILE*)MEMALLOC((sizeof(MRA_FILES_QUEUE_FILE)*dwAllocatedCount));
+ lpszCurrentItem=lpszFiles;
+ while(TRUE)
+ {
+ lpszDelimiter=(LPSTR)MemoryFindByte((lpszCurrentItem-lpszFiles),lpszFiles,dwFilesSize,';');
+ if (lpszDelimiter)
+ {
+ lpszEndItem=(LPSTR)MemoryFindByte(((lpszDelimiter+1)-lpszFiles),lpszFiles,dwFilesSize,';');
+ if (lpszEndItem)
+ {
+ if (pmrafqFilesQueueItem->dwFilesCount==dwAllocatedCount)
+ {
+ dwAllocatedCount*=2;
+ pmrafqFilesQueueItem->pmfqfFiles=(MRA_FILES_QUEUE_FILE*)MEMREALLOC(pmrafqFilesQueueItem->pmfqfFiles,(sizeof(MRA_FILES_QUEUE_FILE)*dwAllocatedCount));
+ }
+
+ dwMemSize=(lpszDelimiter-lpszCurrentItem);
+ pmrafqFilesQueueItem->pmfqfFiles[pmrafqFilesQueueItem->dwFilesCount].lpszName=(LPSTR)MEMALLOC(dwMemSize);
+ CopyMemory(pmrafqFilesQueueItem->pmfqfFiles[pmrafqFilesQueueItem->dwFilesCount].lpszName,lpszCurrentItem,dwMemSize);
+ pmrafqFilesQueueItem->pmfqfFiles[pmrafqFilesQueueItem->dwFilesCount].dwNameLen=dwMemSize;
+ pmrafqFilesQueueItem->pmfqfFiles[pmrafqFilesQueueItem->dwFilesCount].dwSize=StrToUNum32((lpszDelimiter+1),(lpszEndItem-(lpszDelimiter+1)));
+
+ pmrafqFilesQueueItem->dwFilesCount++;
+ lpszCurrentItem=(lpszEndItem+1);
+ }else{
+ break;
+ }
+ }else{
+ break;
+ }
+ }
+ pmrafqFilesQueueItem->pmfqfFiles=(MRA_FILES_QUEUE_FILE*)MEMREALLOC(pmrafqFilesQueueItem->pmfqfFiles,(sizeof(MRA_FILES_QUEUE_FILE)*pmrafqFilesQueueItem->dwFilesCount));
+
+
+ dwAllocatedCount=ALLOCATED_COUNT;
+ pmrafqFilesQueueItem->dwAddrCount=0;
+ pmrafqFilesQueueItem->pmfqaAddreses=(MRA_FILES_QUEUE_ADDR*)MEMALLOC(sizeof(MRA_FILES_QUEUE_ADDR)*dwAllocatedCount);
+ lpszCurrentItem=lpszAddreses;
+ while(TRUE)
+ {
+ lpszEndItem=(LPSTR)MemoryFindByte((lpszCurrentItem-lpszAddreses),lpszAddreses,dwAddresesSize,';');
+ if (lpszEndItem)
+ {
+ lpszDelimiter=(LPSTR)MemoryFindByte((lpszCurrentItem-lpszAddreses),lpszAddreses,dwAddresesSize,':');
+ if (lpszDelimiter)
+ {
+ if (pmrafqFilesQueueItem->dwAddrCount==dwAllocatedCount)
+ {
+ dwAllocatedCount*=2;
+ pmrafqFilesQueueItem->pmfqaAddreses=(MRA_FILES_QUEUE_ADDR*)MEMREALLOC(pmrafqFilesQueueItem->pmfqaAddreses,(sizeof(MRA_FILES_QUEUE_ADDR)*dwAllocatedCount));
+ }
+
+ (*lpszDelimiter)=0;
+ pmrafqFilesQueueItem->pmfqaAddreses[pmrafqFilesQueueItem->dwAddrCount].dwIP=inet_addr(lpszCurrentItem);
+ pmrafqFilesQueueItem->pmfqaAddreses[pmrafqFilesQueueItem->dwAddrCount].dwPort=StrToUNum32((lpszDelimiter+1),(lpszEndItem-(lpszDelimiter+1)));
+ (*lpszDelimiter)=':';
+
+ switch(pmrafqFilesQueueItem->dwAddrCount){
+ case 0:
+ DB_Mra_SetDword(pmrafqFilesQueueItem->hContact,"OldIP",DB_Mra_GetDword(pmrafqFilesQueueItem->hContact,"IP",0));DB_Mra_SetDword(pmrafqFilesQueueItem->hContact,"IP",htonl(pmrafqFilesQueueItem->pmfqaAddreses[pmrafqFilesQueueItem->dwAddrCount].dwIP));
+ break;
+ case 1:
+ DB_Mra_SetDword(pmrafqFilesQueueItem->hContact,"OldRealIP",DB_Mra_GetDword(pmrafqFilesQueueItem->hContact,"RealIP",0));DB_Mra_SetDword(pmrafqFilesQueueItem->hContact,"RealIP",htonl(pmrafqFilesQueueItem->pmfqaAddreses[pmrafqFilesQueueItem->dwAddrCount].dwIP));
+ break;
+ }
+ pmrafqFilesQueueItem->dwAddrCount++;
+ lpszCurrentItem=(lpszEndItem+1);
+ }else{
+ break;
+ }
+ }else{
+ break;
+ }
+ }
+ pmrafqFilesQueueItem->pmfqaAddreses=(MRA_FILES_QUEUE_ADDR*)MEMREALLOC(pmrafqFilesQueueItem->pmfqaAddreses,(sizeof(MRA_FILES_QUEUE_ADDR)*pmrafqFilesQueueItem->dwAddrCount));
+
+ ListMTLock(&pmrafqFilesQueue->lmtListMT);
+ ListMTItemAdd(&pmrafqFilesQueue->lmtListMT,&pmrafqFilesQueueItem->lmtListMTItem,pmrafqFilesQueueItem);
+ ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+
+
+ // Send chain event
+ dwMemSize=(sizeof(DWORD)+dwDescriptionSize+dwAddresesSize+sizeof(SIZE_T));
+ for(SIZE_T i=0;i<pmrafqFilesQueueItem->dwFilesCount;i++)
+ {
+ dwMemSize+=(pmrafqFilesQueueItem->pmfqfFiles[i].dwNameLen+64);
+ }
+ lpszBlob=(LPSTR)MEMALLOC(dwMemSize);
+ lpszCurrentItem=lpszBlob;
+ // user data
+ (*((DWORD*)lpszCurrentItem))=dwIDRequest;lpszCurrentItem+=sizeof(DWORD);
+ // file name
+ StrFormatByteSizeA(pmrafqFilesQueueItem->dwFilesTotalSize,szBuff,sizeof(szBuff));
+ lpszCurrentItem+=(mir_snprintf(lpszCurrentItem,(dwMemSize-(lpszCurrentItem-lpszBlob)),"%ld Files (%s)",pmrafqFilesQueueItem->dwFilesCount,szBuff)+1);
+ // description
+ for(SIZE_T i=0;i<pmrafqFilesQueueItem->dwFilesCount;i++)
+ {
+ StrFormatByteSizeA(pmrafqFilesQueueItem->pmfqfFiles[i].dwSize,szBuff,sizeof(szBuff));
+ lpszCurrentItem+=mir_snprintf(lpszCurrentItem,(dwMemSize-(lpszCurrentItem-lpszBlob)),"%s - %s\r\n",pmrafqFilesQueueItem->pmfqfFiles[i].lpszName,szBuff);
+ }
+ CopyMemory(lpszCurrentItem,lpszAddreses,dwAddresesSize);lpszCurrentItem+=dwAddresesSize;
+ lpszCurrentItem+=(mir_snprintf(lpszCurrentItem,(dwMemSize-(lpszCurrentItem-lpszBlob)),"\r\n%s",lpszDescription)+1);
+
+ ccs.szProtoService=PSR_FILE;
+ ccs.hContact=hContact;
+ ccs.wParam=0;
+ ccs.lParam=(LPARAM)&pre;
+ pre.flags=0;
+ pre.timestamp=time(NULL);
+ pre.szMessage=lpszBlob;
+ pre.lParam=(lpszCurrentItem-lpszBlob);
+
+ CallService(MS_PROTO_CHAINRECV,0,(LPARAM)&ccs);
+ MEMFREE(lpszBlob);
+
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ dwRetErrorCode=GetLastError();
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+
+DWORD MraFilesQueueAddSend(HANDLE hFilesQueueHandle,DWORD dwFlags,HANDLE hContact,LPSTR *plpszFiles,LPSTR lpszDescription,SIZE_T dwDescriptionSize,DWORD *pdwIDRequest)
+{
+ DWORD dwRetErrorCode;
+
+ if (hFilesQueueHandle)
+ {
+ MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+
+
+ pmrafqFilesQueueItem=(MRA_FILES_QUEUE_ITEM*)MEMALLOC(sizeof(MRA_FILES_QUEUE_ITEM)+sizeof(LPSTR)+dwDescriptionSize+64);
+ if (pmrafqFilesQueueItem)
+ {
+ SIZE_T i;
+ WIN32_FILE_ATTRIBUTE_DATA wfad;
+
+ //pmrafqFilesQueueItem->lmtListMTItem;
+ pmrafqFilesQueueItem->dwSendTime=GetTickCount();
+ pmrafqFilesQueueItem->dwIDRequest=InterlockedIncrement((LONG volatile*)&masMraSettings.dwCMDNum);// ,
+ pmrafqFilesQueueItem->dwFlags=dwFlags;
+ pmrafqFilesQueueItem->hContact=hContact;
+ pmrafqFilesQueueItem->lpszDescription=(LPSTR)(pmrafqFilesQueueItem+1);
+ pmrafqFilesQueueItem->dwDescriptionSize=dwDescriptionSize;
+ CopyMemory(pmrafqFilesQueueItem->lpszDescription,lpszDescription,dwDescriptionSize);
+
+
+ for(pmrafqFilesQueueItem->dwFilesCount=0;plpszFiles[pmrafqFilesQueueItem->dwFilesCount];pmrafqFilesQueueItem->dwFilesCount++);
+ pmrafqFilesQueueItem->pmfqfFiles=(MRA_FILES_QUEUE_FILE*)MEMALLOC((sizeof(MRA_FILES_QUEUE_FILE)*(pmrafqFilesQueueItem->dwFilesCount+1)));
+ pmrafqFilesQueueItem->dwFilesTotalSize=0;
+
+ for(i=0;i<pmrafqFilesQueueItem->dwFilesCount;i++)
+ {
+ if (GetFileAttributesExA(plpszFiles[i],GetFileExInfoStandard,&wfad))
+ {
+ pmrafqFilesQueueItem->pmfqfFiles[i].dwSize=wfad.nFileSizeLow;
+ pmrafqFilesQueueItem->dwFilesTotalSize+=wfad.nFileSizeLow;
+ }else{
+ pmrafqFilesQueueItem->pmfqfFiles[i].dwSize=0;
+ }
+ pmrafqFilesQueueItem->pmfqfFiles[i].dwNameLen=lstrlenA(plpszFiles[i]);
+ pmrafqFilesQueueItem->pmfqfFiles[i].lpszName=(LPSTR)MEMALLOC(pmrafqFilesQueueItem->pmfqfFiles[i].dwNameLen);
+ CopyMemory(pmrafqFilesQueueItem->pmfqfFiles[i].lpszName,plpszFiles[i],pmrafqFilesQueueItem->pmfqfFiles[i].dwNameLen);
+ }
+ //pmrafqFilesQueueItem->dwAddrCount=0;
+ //pmrafqFilesQueueItem->pmfqaAddreses=NULL;
+ pmrafqFilesQueueItem->bSending=TRUE;
+ if (pdwIDRequest) (*pdwIDRequest)=pmrafqFilesQueueItem->dwIDRequest;
+
+ ListMTLock(&pmrafqFilesQueue->lmtListMT);
+ ListMTItemAdd(&pmrafqFilesQueue->lmtListMT,&pmrafqFilesQueueItem->lmtListMTItem,pmrafqFilesQueueItem);
+ ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+
+ {
+ MRA_FILES_THREADPROC_PARAMS *pmftpp=(MRA_FILES_THREADPROC_PARAMS*)MEMALLOC(sizeof(MRA_FILES_THREADPROC_PARAMS));
+ pmftpp->hFilesQueueHandle=hFilesQueueHandle;
+ pmftpp->pmrafqFilesQueueItem=pmrafqFilesQueueItem;
+
+ pmrafqFilesQueueItem->hThread=CreateThread(0,0,MraFilesQueueSendThreadProc,pmftpp,0,NULL);
+ }
+
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ dwRetErrorCode=GetLastError();
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+
+DWORD MraFilesQueueAccept(HANDLE hFilesQueueHandle,DWORD dwIDRequest,LPSTR lpszPath,SIZE_T dwPathSize)
+{
+ DWORD dwRetErrorCode;
+
+ if (hFilesQueueHandle)
+ {
+ MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+
+ ListMTLock(&pmrafqFilesQueue->lmtListMT);
+ if ((dwRetErrorCode=MraFilesQueueItemFindByID(hFilesQueueHandle,dwIDRequest,&pmrafqFilesQueueItem))==NO_ERROR)
+ {
+ MRA_FILES_THREADPROC_PARAMS *pmftpp=(MRA_FILES_THREADPROC_PARAMS*)MEMALLOC(sizeof(MRA_FILES_THREADPROC_PARAMS));
+ pmrafqFilesQueueItem->lpszPath=(LPSTR)MEMALLOC(dwPathSize);
+ pmrafqFilesQueueItem->dwPathSize=dwPathSize;
+ CopyMemory(pmrafqFilesQueueItem->lpszPath,lpszPath,dwPathSize);
+
+ pmftpp->hFilesQueueHandle=hFilesQueueHandle;
+ pmftpp->pmrafqFilesQueueItem=pmrafqFilesQueueItem;
+
+ pmrafqFilesQueueItem->hThread=CreateThread(0,0,MraFilesQueueRecvThreadProc,pmftpp,0,NULL);
+ }
+ ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD MraFilesQueueDecline(HANDLE hFilesQueueHandle,DWORD dwIDRequest,LPSTR lpszDescription,SIZE_T dwDescriptionSize)
+{
+ DWORD dwRetErrorCode;
+
+ if (hFilesQueueHandle)
+ {
+ MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+
+ ListMTLock(&pmrafqFilesQueue->lmtListMT);
+ if ((dwRetErrorCode=MraFilesQueueItemFindByID(hFilesQueueHandle,dwIDRequest,&pmrafqFilesQueueItem))==NO_ERROR)
+ {
+ char szEMail[MAX_EMAIL_LEN];
+ SIZE_T dwEMailSize;
+ if (DB_Mra_GetStaticString(pmrafqFilesQueueItem->hContact,"e-mail",szEMail,sizeof(szEMail),&dwEMailSize))
+ {
+ MraSendCommand_FileTransferAck(FILE_TRANSFER_STATUS_DECLINE,szEMail,dwEMailSize,dwIDRequest,lpszDescription,dwDescriptionSize);
+ }
+ ListMTItemDelete(&pmrafqFilesQueue->lmtListMT,&pmrafqFilesQueueItem->lmtListMTItem);
+ MraFilesQueueItemFree(pmrafqFilesQueueItem);
+ }
+ ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD MraFilesQueueCancel(HANDLE hFilesQueueHandle,DWORD dwIDRequest,BOOL bSendDecline)
+{
+ DWORD dwRetErrorCode;
+
+ if (hFilesQueueHandle)
+ {
+ MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+
+ ListMTLock(&pmrafqFilesQueue->lmtListMT);
+ if ((dwRetErrorCode=MraFilesQueueItemFindByID(hFilesQueueHandle,dwIDRequest,&pmrafqFilesQueueItem))==NO_ERROR)
+ {//***deb closesocket, send message to thread
+ if (bSendDecline)
+ {
+ char szEMail[MAX_EMAIL_LEN];
+ SIZE_T dwEMailSize;
+ if (DB_Mra_GetStaticString(pmrafqFilesQueueItem->hContact,"e-mail",szEMail,sizeof(szEMail),&dwEMailSize))
+ {
+ MraSendCommand_FileTransferAck(FILE_TRANSFER_STATUS_DECLINE,szEMail,dwEMailSize,dwIDRequest,NULL,0);
+ }
+ }
+ Netlib_CloseHandle(pmrafqFilesQueueItem->hConnection);
+ pmrafqFilesQueueItem->hConnection=NULL;
+
+ Netlib_CloseHandle(pmrafqFilesQueueItem->hListen);
+ pmrafqFilesQueueItem->hListen=NULL;
+
+ SetEvent(pmrafqFilesQueueItem->hWaitHandle);
+
+ if (pmrafqFilesQueueItem->hThread==NULL)
+ {
+ ListMTItemDelete(&pmrafqFilesQueue->lmtListMT,&pmrafqFilesQueueItem->lmtListMTItem);
+ MraFilesQueueItemFree(pmrafqFilesQueueItem);
+ }
+ }
+ ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD MraFilesQueueFree(HANDLE hFilesQueueHandle,DWORD dwIDRequest)
+{
+ DWORD dwRetErrorCode;
+
+ if (hFilesQueueHandle)
+ {
+ MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+ LIST_MT_ITERATOR lmtiIterator;
+
+ dwRetErrorCode=ERROR_NOT_FOUND;
+ ListMTLock(&pmrafqFilesQueue->lmtListMT);
+ ListMTIteratorMoveFirst(&pmrafqFilesQueue->lmtListMT,&lmtiIterator);
+ do
+ {//
+ if (ListMTIteratorGet(&lmtiIterator,NULL,(LPVOID*)&pmrafqFilesQueueItem)==NO_ERROR)
+ if (pmrafqFilesQueueItem->dwIDRequest==dwIDRequest)
+ {
+ ListMTItemDelete(&pmrafqFilesQueue->lmtListMT,&pmrafqFilesQueueItem->lmtListMTItem);
+ MraFilesQueueItemFree(pmrafqFilesQueueItem);
+ dwRetErrorCode=NO_ERROR;
+ break;
+ }
+ }while(ListMTIteratorMoveNext(&lmtiIterator));
+ ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD MraFilesQueueSendMirror(HANDLE hFilesQueueHandle,DWORD dwIDRequest,LPSTR lpszAddreses,SIZE_T dwAddresesSize)
+{
+ DWORD dwRetErrorCode;
+
+ if (hFilesQueueHandle)
+ {
+ MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem;
+
+ ListMTLock(&pmrafqFilesQueue->lmtListMT);
+ if ((dwRetErrorCode=MraFilesQueueItemFindByID(hFilesQueueHandle,dwIDRequest,&pmrafqFilesQueueItem))==NO_ERROR)
+ {//
+ LPSTR lpszCurrentItem,lpszDelimiter,lpszEndItem;
+ SIZE_T dwAllocatedCount;
+
+ dwAllocatedCount=ALLOCATED_COUNT;
+ pmrafqFilesQueueItem->dwAddrCount=0;
+ pmrafqFilesQueueItem->pmfqaAddreses=(MRA_FILES_QUEUE_ADDR*)MEMALLOC(sizeof(MRA_FILES_QUEUE_ADDR)*dwAllocatedCount);
+ lpszCurrentItem=lpszAddreses;
+ while(TRUE)
+ {
+ lpszEndItem=(LPSTR)MemoryFindByte((lpszCurrentItem-lpszAddreses),lpszAddreses,dwAddresesSize,';');
+ if (lpszEndItem)
+ {
+ lpszDelimiter=(LPSTR)MemoryFindByte((lpszCurrentItem-lpszAddreses),lpszAddreses,dwAddresesSize,':');
+ if (lpszDelimiter)
+ {
+ if (pmrafqFilesQueueItem->dwAddrCount==dwAllocatedCount)
+ {
+ dwAllocatedCount*=2;
+ pmrafqFilesQueueItem->pmfqaAddreses=(MRA_FILES_QUEUE_ADDR*)MEMREALLOC(pmrafqFilesQueueItem->pmfqaAddreses,(sizeof(MRA_FILES_QUEUE_ADDR)*dwAllocatedCount));
+ }
+
+ (*lpszDelimiter)=0;
+ pmrafqFilesQueueItem->pmfqaAddreses[pmrafqFilesQueueItem->dwAddrCount].dwIP=inet_addr(lpszCurrentItem);
+ pmrafqFilesQueueItem->pmfqaAddreses[pmrafqFilesQueueItem->dwAddrCount].dwPort=StrToUNum32((lpszDelimiter+1),(lpszEndItem-(lpszDelimiter+1)));
+ (*lpszDelimiter)=':';
+
+ switch(pmrafqFilesQueueItem->dwAddrCount){
+ case 0:
+ DB_Mra_SetDword(pmrafqFilesQueueItem->hContact,"OldIP",DB_Mra_GetDword(pmrafqFilesQueueItem->hContact,"IP",0));
+ DB_Mra_SetDword(pmrafqFilesQueueItem->hContact,"IP",htonl(pmrafqFilesQueueItem->pmfqaAddreses[pmrafqFilesQueueItem->dwAddrCount].dwIP));
+ break;
+ case 1:
+ DB_Mra_SetDword(pmrafqFilesQueueItem->hContact,"OldRealIP",DB_Mra_GetDword(pmrafqFilesQueueItem->hContact,"RealIP",0));
+ DB_Mra_SetDword(pmrafqFilesQueueItem->hContact,"RealIP",htonl(pmrafqFilesQueueItem->pmfqaAddreses[pmrafqFilesQueueItem->dwAddrCount].dwIP));
+ break;
+ }
+ pmrafqFilesQueueItem->dwAddrCount++;
+ lpszCurrentItem=(lpszEndItem+1);
+ }else{
+ break;
+ }
+ }else{
+ break;
+ }
+ }
+ pmrafqFilesQueueItem->pmfqaAddreses=(MRA_FILES_QUEUE_ADDR*)MEMREALLOC(pmrafqFilesQueueItem->pmfqaAddreses,(sizeof(MRA_FILES_QUEUE_ADDR)*pmrafqFilesQueueItem->dwAddrCount));
+
+ pmrafqFilesQueueItem->hConnection=NULL;
+ SetEvent(pmrafqFilesQueueItem->hWaitHandle);
+ }
+ ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+
+BOOL MraFilesQueueHandCheck(HANDLE hConnection,MRA_FILES_QUEUE_ITEM **ppmrafqFilesQueueItem)
+{
+ BOOL bRet=FALSE;
+
+ if (hConnection)
+ {
+ char szEMail[MAX_EMAIL_LEN]={0},szEMailMy[MAX_EMAIL_LEN]={0};
+ BYTE btBuff[((MAX_EMAIL_LEN*2)+(sizeof(MRA_FT_HELLO)*2)+8)]={0};
+ SIZE_T dwEMailSize,dwEMailMySize,dwBuffSize;
+
+ DB_Mra_GetStaticString(NULL,"e-mail",szEMailMy,sizeof(szEMailMy),&dwEMailMySize);BuffToLowerCase(szEMailMy,szEMailMy,dwEMailMySize);
+
+ if (pmrafqFilesQueueItem->bSending==FALSE)
+ {
+ dwBuffSize=(mir_snprintf((LPSTR)btBuff,sizeof(btBuff),"%s %s",MRA_FT_HELLO,szEMailMy)+1);
+ if (dwBuffSize==Netlib_Send(hConnection,(LPSTR)btBuff,dwBuffSize,0))
+ {// my email sended
+ //ProtoBroadcastAck(PROTOCOL_NAME,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_INITIALISING,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ dwBuffSize=Netlib_Recv(hConnection,(LPSTR)btBuff,sizeof(btBuff),0);
+ if (ppmrafqFilesQueueItem && (*ppmrafqFilesQueueItem))
+ {// have context, connecting or some times in receive
+ DB_Mra_GetStaticString((*ppmrafqFilesQueueItem)->hContact,"e-mail",szEMail,sizeof(szEMail),&dwEMailSize);BuffToLowerCase(szEMail,szEMail,dwEMailSize);
+ if ((dwEMailSize+sizeof(MRA_FT_HELLO)+1)==dwBuffSize)
+ {// email received
+ mir_snprintf(((LPSTR)btBuff+dwBuffSize),(sizeof(btBuff)-dwBuffSize),"%s %s",MRA_FT_HELLO,szEMail);
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,(LPSTR)btBuff,dwBuffSize,((LPSTR)btBuff+dwBuffSize),dwBuffSize)==CSTR_EQUAL)
+ {// email verifyed
+ bRet=TRUE;
+ }
+ }
+ }else{// some times on receive pExtra=NULL, and we looking for context
+ if (dwBuffSize!=SOCKET_ERROR && dwBuffSize>sizeof(MRA_FT_HELLO))
+ {// readed
+ if (MraFilesQueueItemFindByEMail(HANDLE hFilesQueueHandle,((LPSTR)btBuff+sizeof(MRA_FT_HELLO)),(dwBuffSize-(sizeof(MRA_FT_HELLO)+1)),ppmrafqFilesQueueItem)==NO_ERROR)
+ {// email verifyed
+ bRet=TRUE;
+ }
+ }
+ }
+ }
+ }else{
+ dwBuffSize=Netlib_Recv(hConnection,(LPSTR)btBuff,sizeof(btBuff),0);
+ if (ppmrafqFilesQueueItem && (*ppmrafqFilesQueueItem))
+ {// have context, connecting or some times in receive
+ DB_Mra_GetStaticString((*ppmrafqFilesQueueItem)->hContact,"e-mail",szEMail,sizeof(szEMail),&dwEMailSize);BuffToLowerCase(szEMail,szEMail,dwEMailSize);
+ if ((dwEMailSize+sizeof(MRA_FT_HELLO)+1)==dwBuffSize)
+ {// email received
+ ProtoBroadcastAck(PROTOCOL_NAME,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_INITIALISING,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ mir_snprintf(((LPSTR)btBuff+dwBuffSize),(sizeof(btBuff)-dwBuffSize),"%s %s",MRA_FT_HELLO,szEMail);
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,(LPSTR)btBuff,dwBuffSize,((LPSTR)btBuff+dwBuffSize),dwBuffSize)==CSTR_EQUAL)
+ {// email verifyed
+ dwBuffSize=(mir_snprintf((LPSTR)btBuff,sizeof(btBuff),"%s %s",MRA_FT_HELLO,szEMailMy)+1);
+ if (dwBuffSize==Netlib_Send(hConnection,(LPSTR)btBuff,dwBuffSize,0))
+ {// my email sended
+ bRet=TRUE;
+ }
+ }
+ }
+ }else{// some times on receive pExtra=NULL, and we looking for context
+ if (dwBuffSize!=SOCKET_ERROR && dwBuffSize>sizeof(MRA_FT_HELLO))
+ {// readed
+ if (MraFilesQueueItemFindByEMail(HANDLE hFilesQueueHandle,((LPSTR)btBuff+sizeof(MRA_FT_HELLO)),(dwBuffSize-(sizeof(MRA_FT_HELLO)+1)),ppmrafqFilesQueueItem)==NO_ERROR)
+ {// email verifyed
+ ProtoBroadcastAck(PROTOCOL_NAME,(*ppmrafqFilesQueueItem)->hContact,ACKTYPE_FILE,ACKRESULT_INITIALISING,(HANDLE)(*ppmrafqFilesQueueItem)->dwIDRequest,0);
+ dwBuffSize=(mir_snprintf((LPSTR)btBuff,sizeof(btBuff),"%s %s",MRA_FT_HELLO,szEMailMy)+1);
+ if (dwBuffSize==Netlib_Send(hConnection,(LPSTR)btBuff,dwBuffSize,0))
+ {// my email sended
+ bRet=TRUE;
+ }
+ }
+ }
+ }
+ }
+ }
+return(bRet);
+}
+
+
+HANDLE MraFilesQueueConnectOut(MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem)
+{
+ if ((pmrafqFilesQueueItem->bSending==FALSE && DB_Mra_GetByte(NULL,"FileSendNoOutConnOnRcv",MRA_DEF_FS_NO_OUT_CONN_ON_RCV)==FALSE) || (pmrafqFilesQueueItem->bSending==TRUE && DB_Mra_GetByte(NULL,"FileSendNoOutConnOnSend",MRA_DEF_FS_NO_OUT_CONN_ON_SEND)==FALSE))
+ {
+ BOOL bFiltering=FALSE;
+ DWORD dwLocalPort=0;
+ SIZE_T i;
+ NETLIBOPENCONNECTION nloc={0};
+
+ nloc.cbSize=sizeof(nloc);
+ nloc.flags=NLOCF_V2;
+ if (DB_Mra_GetByte(NULL,"FileSendIgnoryAdditionalPorts",MRA_DEF_FS_IGNORY_ADDITIONAL_PORTS))
+ {// IP, 3
+ switch(DB_Mra_GetWord(NULL,"ServerPort",MRA_DEFAULT_SERVER_PORT)){
+ case MRA_SERVER_PORT_STANDART_NLB:
+ dwLocalPort=MRA_SERVER_PORT_STANDART;
+ break;
+ case MRA_SERVER_PORT_HTTPS:
+ dwLocalPort=MRA_SERVER_PORT_HTTPS;
+ break;
+ default:
+ dwLocalPort=DB_Mra_GetWord(NULL,"ServerPort",MRA_DEFAULT_SERVER_PORT);
+ break;
+ }
+
+ for(i=0;i<pmrafqFilesQueueItem->dwAddrCount;i++)
+ {// Set up the sockaddr structure
+ if (dwLocalPort==pmrafqFilesQueueItem->pmfqaAddreses[i].dwPort)
+ {
+ bFiltering=TRUE;
+ break;
+ }
+ }
+ }
+
+ for(i=0;i<pmrafqFilesQueueItem->dwAddrCount;i++)
+ {// Set up the sockaddr structure
+ if (dwLocalPort==pmrafqFilesQueueItem->pmfqaAddreses[i].dwPort || bFiltering==FALSE)
+ {
+ nloc.szHost=inet_ntoa((*((in_addr*)&pmrafqFilesQueueItem->pmfqaAddreses[i].dwIP)));
+ nloc.wPort=(WORD)pmrafqFilesQueueItem->pmfqaAddreses[i].dwPort;
+
+ ProtoBroadcastAck(PROTOCOL_NAME,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_CONNECTING,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ if ((pmrafqFilesQueueItem->hConnection=(HANDLE)CallService(MS_NETLIB_OPENCONNECTION,(WPARAM)masMraSettings.hNetlibUser,(LPARAM)&nloc)))
+ {
+ ProtoBroadcastAck(PROTOCOL_NAME,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_CONNECTED,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ if (MraFilesQueueHandCheck(pmrafqFilesQueueItem->hConnection,&pmrafqFilesQueueItem))
+ {//
+ break;
+ }else{// :)
+ ProtoBroadcastAck(PROTOCOL_NAME,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_CONNECTING,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ Netlib_CloseHandle(pmrafqFilesQueueItem->hConnection);
+ pmrafqFilesQueueItem->hConnection=NULL;
+ }
+ }
+ }
+ }
+ }
+return(pmrafqFilesQueueItem->hConnection);
+}
+
+
+HANDLE MraFilesQueueConnectIn(MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem)
+{
+ char szEMail[MAX_EMAIL_LEN],szAddrList[2048]={0};
+ SIZE_T dwEMailSize,dwAddrListSize;
+ NETLIBBIND nlbBind={0};
+
+ nlbBind.cbSize=sizeof(nlbBind);
+ nlbBind.pfnNewConnectionV2=MraFilesQueueConnectionReceived;
+ nlbBind.wPort=0;
+ nlbBind.pExtra=(LPVOID)pmrafqFilesQueueItem;
+
+ if (DB_Mra_GetStaticString(pmrafqFilesQueueItem->hContact,"e-mail",szEMail,sizeof(szEMail),&dwEMailSize))
+ if ((pmrafqFilesQueueItem->hListen=(HANDLE)CallService(MS_NETLIB_BINDPORT,(WPARAM)masMraSettings.hNetlibUser,(LPARAM)&nlbBind)))
+ {
+ dwAddrListSize=MraFilesQueueGetLocalAddressesList(szAddrList,sizeof(szAddrList),nlbBind.wPort);
+ if (dwAddrListSize)
+ {
+ pmrafqFilesQueueItem->hWaitHandle=CreateEvent(NULL,TRUE,FALSE,NULL);
+ if (pmrafqFilesQueueItem->bSending==FALSE)
+ {//
+ MraSendCommand_FileTransferAck(FILE_TRANSFER_MIRROR,szEMail,dwEMailSize,pmrafqFilesQueueItem->dwIDRequest,szAddrList,dwAddrListSize);
+ }else{// ( )
+ LPSTR lpszFiles,lpszFileName,lpszCurPos;
+ SIZE_T i,dwFilesSize=((MAX_PATH*2)*pmrafqFilesQueueItem->dwFilesCount);
+
+ lpszFiles=(LPSTR)MEMALLOC(dwFilesSize);
+ if (lpszFiles)
+ {
+ lpszCurPos=lpszFiles;
+ for(i=0;i<pmrafqFilesQueueItem->dwFilesCount;i++)
+ {
+ GetFullPathName(pmrafqFilesQueueItem->pmfqfFiles[i].lpszName,MAX_PATH,pmrafqFilesQueueItem->pmfqfFiles[i].lpszName,&lpszFileName);
+ lpszCurPos+=mir_snprintf(lpszCurPos,(dwFilesSize-(lpszCurPos-lpszFiles)),"%s;%ld;",lpszFileName,pmrafqFilesQueueItem->pmfqfFiles[i].dwSize);
+ }
+ MraSendCommand_FileTransfer(szEMail,dwEMailSize,pmrafqFilesQueueItem->dwIDRequest,pmrafqFilesQueueItem->dwFilesTotalSize,lpszFiles,(lpszCurPos-lpszFiles),pmrafqFilesQueueItem->lpszDescription,pmrafqFilesQueueItem->dwDescriptionSize,szAddrList,dwAddrListSize);
+ MEMFREE(lpszFiles);
+ }
+ }
+
+ WaitForSingleObject(pmrafqFilesQueueItem->hWaitHandle,INFINITE);
+ CloseHandle(pmrafqFilesQueueItem->hWaitHandle);
+ pmrafqFilesQueueItem->hWaitHandle=NULL;
+ Netlib_CloseHandle(pmrafqFilesQueueItem->hListen);
+ pmrafqFilesQueueItem->hListen=NULL;
+ }
+ }
+return(pmrafqFilesQueueItem->hConnection);
+}
+
+// This function is called from the Netlib when someone is connecting to
+// one of our incomming DC ports
+void MraFilesQueueConnectionReceived(HANDLE hNewConnection,DWORD dwRemoteIP,void *pExtra)
+{
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem=(MRA_FILES_QUEUE_ITEM*)pExtra;
+
+ if (MraFilesQueueHandCheck(hNewConnection,&pmrafqFilesQueueItem))
+ {//
+ pmrafqFilesQueueItem->hConnection=hNewConnection;
+ ProtoBroadcastAck(PROTOCOL_NAME,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_CONNECTED,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ DB_Mra_SetDword(pmrafqFilesQueueItem->hContact,"OldIP",DB_Mra_GetDword(pmrafqFilesQueueItem->hContact,"IP",0));
+ DB_Mra_SetDword(pmrafqFilesQueueItem->hContact,"IP",dwRemoteIP);
+ SetEvent(pmrafqFilesQueueItem->hWaitHandle);
+ }else{// :)
+ if (pmrafqFilesQueueItem) ProtoBroadcastAck(PROTOCOL_NAME,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_CONNECTING,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ Netlib_CloseHandle(hNewConnection);
+ }
+
+ if (pExtra==NULL)
+ {
+ MraPopupShowFromAgent(MRA_POPUP_TYPE_DEBUG,0,"MraFilesQueueConnectionReceived: connection accepted, but pExtra=NULL, this is miranda bug.");
+ DebugBreak();
+ }
+}
+
+
+
+DWORD WINAPI MraFilesQueueRecvThreadProc(LPVOID lpParameter)
+{
+ MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)((MRA_FILES_THREADPROC_PARAMS*)lpParameter)->hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem=((MRA_FILES_THREADPROC_PARAMS*)lpParameter)->pmrafqFilesQueueItem;
+
+ char szFileName[MAX_FILEPATH]={0};
+ BYTE btBuff[65536];
+ BOOL bFailed=TRUE,bOK,bConnected=FALSE;
+ DWORD dwWritten,dwReceived,dwUpdateTimeNext,dwUpdateTimeCur;
+ HANDLE hFile;
+ SIZE_T i,dwBuffSize;
+ PROTOFILETRANSFERSTATUS pfts={0};
+
+
+ MEMFREE(lpParameter);
+ pfts.cbSize=sizeof(pfts);
+ pfts.hContact=pmrafqFilesQueueItem->hContact;
+ pfts.sending=pmrafqFilesQueueItem->bSending; //true if sending, false if receiving
+ //pfts.files;
+ pfts.totalFiles=pmrafqFilesQueueItem->dwFilesCount;
+ pfts.currentFileNumber=0;
+ pfts.totalBytes=pmrafqFilesQueueItem->dwFilesTotalSize;
+ pfts.totalProgress=0;
+ pfts.workingDir=pmrafqFilesQueueItem->lpszPath;
+ //pfts.currentFile;
+ //pfts.currentFileSize;
+ //pfts.currentFileProgress;
+ //pfts.currentFileTime; //as seconds since 1970
+
+
+ CallService(MS_SYSTEM_THREAD_PUSH,0,0);
+ //ProtoBroadcastAck(PROTOCOL_NAME,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_CONNECTING,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+
+ if (MraFilesQueueConnectOut(pmrafqFilesQueueItem))
+ {
+ bConnected=TRUE;
+ }else{
+ if (MraFilesQueueConnectIn(pmrafqFilesQueueItem)) bConnected=TRUE;
+ }
+
+ if (bConnected)
+ {// email verifyed
+ bFailed=FALSE;
+ for(i=0;i<pmrafqFilesQueueItem->dwFilesCount;i++)
+ {// receiving files
+ ProtoBroadcastAck(PROTOCOL_NAME,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_NEXTFILE,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ dwBuffSize=(mir_snprintf((LPSTR)btBuff,sizeof(btBuff),"%s %s",MRA_FT_GET_FILE,pmrafqFilesQueueItem->pmfqfFiles[i].lpszName)+1);
+ if (dwBuffSize==Netlib_Send(pmrafqFilesQueueItem->hConnection,(LPSTR)btBuff,dwBuffSize,0))
+ {// file request sended
+ mir_snprintf(szFileName,sizeof(szFileName),"%s%s",pmrafqFilesQueueItem->lpszPath,pmrafqFilesQueueItem->pmfqfFiles[i].lpszName);
+ hFile=CreateFile(szFileName,GENERIC_WRITE,FILE_SHARE_READ,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
+ if (hFile!=INVALID_HANDLE_VALUE)
+ {
+ bOK=FALSE;
+ dwWritten=0;
+ dwUpdateTimeNext=GetTickCount();
+ pfts.currentFileNumber=i;
+ pfts.currentFile=pmrafqFilesQueueItem->pmfqfFiles[i].lpszName;
+ pfts.currentFileSize=pmrafqFilesQueueItem->pmfqfFiles[i].dwSize;
+ pfts.currentFileProgress=0;
+ //pfts.currentFileTime; //as seconds since 1970
+ ProtoBroadcastAck(PROTOCOL_NAME,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_DATA,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,(LPARAM)&pfts);
+
+ // pre allocating disk space, best perfomance
+ SetFilePointer(hFile,pmrafqFilesQueueItem->pmfqfFiles[i].dwSize,NULL,FILE_BEGIN);
+ SetEndOfFile(hFile);
+ SetFilePointer(hFile,0,NULL,FILE_BEGIN);
+
+ while(TRUE)
+ {
+ dwReceived=Netlib_Recv(pmrafqFilesQueueItem->hConnection,(LPSTR)&btBuff,sizeof(btBuff),0);
+ if (dwReceived==0 || dwReceived==SOCKET_ERROR)
+ {
+ dwWritten=0;
+ break;
+ }else{
+ WriteFile(hFile,(LPVOID)&btBuff,dwReceived,&dwReceived,NULL);
+ dwWritten+=dwReceived;
+ pfts.totalProgress+=dwReceived;
+ if (dwWritten>=pmrafqFilesQueueItem->pmfqfFiles[i].dwSize)
+ {
+ dwUpdateTimeNext=GetTickCount();// force stat update
+ bOK=TRUE;
+ break;
+ }
+
+ // progress updates
+ dwUpdateTimeCur=GetTickCount();
+ if (dwUpdateTimeNext<=dwUpdateTimeCur)
+ {// we update it
+ dwUpdateTimeNext=dwUpdateTimeCur+MRA_FILES_QUEUE_PROGRESS_INTERVAL;
+ pfts.currentFileProgress=dwWritten;
+ ProtoBroadcastAck(PROTOCOL_NAME,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_DATA,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,(LPARAM)&pfts);
+ }
+ }
+ }// end while
+ CloseHandle(hFile);
+
+ if (bOK==FALSE)
+ {// file recv failed
+ DeleteFile(szFileName);
+ bFailed=TRUE;
+ break;
+ }
+ }else{// err on write file
+ bFailed=TRUE;
+ break;
+ }
+ }else{//err
+ break;
+ }
+ }// end for
+
+ Netlib_CloseHandle(pmrafqFilesQueueItem->hConnection);
+ pmrafqFilesQueueItem->hConnection=NULL;
+ }
+
+ if (bFailed)
+ {
+ char szEMail[MAX_EMAIL_LEN];
+ SIZE_T dwEMailSize;
+ if (DB_Mra_GetStaticString(pmrafqFilesQueueItem->hContact,"e-mail",szEMail,sizeof(szEMail),&dwEMailSize))
+ {
+ MraSendCommand_FileTransferAck(FILE_TRANSFER_STATUS_DECLINE,szEMail,dwEMailSize,pmrafqFilesQueueItem->dwIDRequest,NULL,0);
+ }
+ ProtoBroadcastAck(PROTOCOL_NAME,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_FAILED,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ }else{
+ ProtoBroadcastAck(PROTOCOL_NAME,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_SUCCESS,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ }
+
+ ListMTLock(&pmrafqFilesQueue->lmtListMT);
+ ListMTItemDelete(&pmrafqFilesQueue->lmtListMT,&pmrafqFilesQueueItem->lmtListMTItem);
+ CloseHandle(pmrafqFilesQueueItem->hThread);
+ MraFilesQueueItemFree(pmrafqFilesQueueItem);
+ ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+
+ CallService(MS_SYSTEM_THREAD_POP,0,0);
+ ExitThread(NO_ERROR);
+return(0);
+}
+
+
+
+DWORD WINAPI MraFilesQueueSendThreadProc(LPVOID lpParameter)
+{
+ MRA_FILES_QUEUE *pmrafqFilesQueue=(MRA_FILES_QUEUE*)((MRA_FILES_THREADPROC_PARAMS*)lpParameter)->hFilesQueueHandle;
+ MRA_FILES_QUEUE_ITEM *pmrafqFilesQueueItem=((MRA_FILES_THREADPROC_PARAMS*)lpParameter)->pmrafqFilesQueueItem;
+
+ BYTE btBuff[65536];
+ BOOL bFailed=TRUE,bOK,bConnected=FALSE;
+ DWORD dwReceived,dwSended,dwSendBlockSize,dwUpdateTimeNext,dwUpdateTimeCur;
+ HANDLE hFile;
+ SIZE_T i,j,dwBuffSize=0;
+ LPSTR lpszFileName;
+ PROTOFILETRANSFERSTATUS pfts={0};
+
+
+ MEMFREE(lpParameter);
+ pfts.cbSize=sizeof(pfts);
+ pfts.hContact=pmrafqFilesQueueItem->hContact;
+ pfts.sending=pmrafqFilesQueueItem->bSending; //true if sending, false if receiving
+ //pfts.files;
+ pfts.totalFiles=pmrafqFilesQueueItem->dwFilesCount;
+ pfts.currentFileNumber=0;
+ pfts.totalBytes=pmrafqFilesQueueItem->dwFilesTotalSize;
+ pfts.totalProgress=0;
+ pfts.workingDir=pmrafqFilesQueueItem->lpszPath;
+ //pfts.currentFile;
+ //pfts.currentFileSize;
+ //pfts.currentFileProgress;
+ //pfts.currentFileTime; //as seconds since 1970
+ dwSendBlockSize=DB_Mra_GetDword(NULL,"FileSendBlockSize",MRA_DEFAULT_FILE_SEND_BLOCK_SIZE);
+ if (dwSendBlockSize>sizeof(btBuff)) dwSendBlockSize=sizeof(btBuff);
+ if (dwSendBlockSize<512) dwSendBlockSize=MRA_DEFAULT_FILE_SEND_BLOCK_SIZE;
+
+
+ CallService(MS_SYSTEM_THREAD_PUSH,0,0);
+ //ProtoBroadcastAck(PROTOCOL_NAME,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_SENTREQUEST,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+
+ if (MraFilesQueueConnectIn(pmrafqFilesQueueItem))
+ {
+ bConnected=TRUE;
+ }else{
+ if (MraFilesQueueConnectOut(pmrafqFilesQueueItem)) bConnected=TRUE;
+ }
+
+ if (bConnected)
+ {// email verifyed
+ bFailed=FALSE;
+ for(i=0;i<pmrafqFilesQueueItem->dwFilesCount;i++)
+ {// seiding files
+ ProtoBroadcastAck(PROTOCOL_NAME,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_NEXTFILE,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+
+ dwBuffSize=0;
+ while(TRUE)
+ {
+ dwReceived=Netlib_Recv(pmrafqFilesQueueItem->hConnection,((LPSTR)btBuff+dwBuffSize),(sizeof(btBuff)-dwBuffSize),0);
+ if (dwReceived==0 || dwReceived==SOCKET_ERROR)
+ {
+ bFailed=TRUE;
+ break;
+ }else{
+ dwBuffSize+=dwReceived;
+ if (MemoryFindByte((dwBuffSize-dwReceived),btBuff,dwBuffSize,0)) break;
+ }
+ }// end while (file name passible received)*/
+
+ if (bFailed==FALSE)
+ {// ...received
+ if (dwBuffSize>(sizeof(MRA_FT_GET_FILE)+1))
+ {// file name received
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,(LPSTR)btBuff,(sizeof(MRA_FT_GET_FILE)-1),MRA_FT_GET_FILE,(sizeof(MRA_FT_GET_FILE)-1))==CSTR_EQUAL)
+ {// MRA_FT_GET_FILE verifyed
+ bFailed=TRUE;
+ for(j=0;j<pmrafqFilesQueueItem->dwFilesCount;j++)
+ {
+ if (GetFullPathName(pmrafqFilesQueueItem->pmfqfFiles[j].lpszName,(pmrafqFilesQueueItem->pmfqfFiles[j].dwNameLen+1),pmrafqFilesQueueItem->pmfqfFiles[j].lpszName,&lpszFileName))
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,(((LPSTR)btBuff)+sizeof(MRA_FT_GET_FILE)),(dwBuffSize-(sizeof(MRA_FT_GET_FILE)+1)),lpszFileName,-1)==CSTR_EQUAL)
+ {
+ bFailed=FALSE;
+ break;
+ }
+ }
+
+ if (bFailed==FALSE)
+ {
+ hFile=CreateFile(pmrafqFilesQueueItem->pmfqfFiles[j].lpszName,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,(FILE_ATTRIBUTE_NORMAL|FILE_FLAG_SEQUENTIAL_SCAN),NULL);
+ if (hFile!=INVALID_HANDLE_VALUE)
+ {
+ bOK=FALSE;
+ dwUpdateTimeNext=GetTickCount();
+ pfts.currentFileNumber=i;
+ pfts.currentFile=pmrafqFilesQueueItem->pmfqfFiles[j].lpszName;
+ pfts.currentFileSize=pmrafqFilesQueueItem->pmfqfFiles[j].dwSize;
+ pfts.currentFileProgress=0;
+ //pfts.currentFileTime; //as seconds since 1970
+ ProtoBroadcastAck(PROTOCOL_NAME,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_DATA,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,(LPARAM)&pfts);
+
+ while(TRUE)
+ {// read and sending
+ if (ReadFile(hFile,btBuff,dwSendBlockSize,&dwBuffSize,NULL))
+ {
+ dwSended=Netlib_Send(pmrafqFilesQueueItem->hConnection,(LPSTR)btBuff,dwBuffSize,0);
+ if (dwSended==0 || dwSended==SOCKET_ERROR)
+ {
+ break;
+ }else{
+ pfts.currentFileProgress+=dwSended;
+ pfts.totalProgress+=dwSended;
+ if (pfts.currentFileProgress>=pmrafqFilesQueueItem->pmfqfFiles[j].dwSize)
+ {
+ dwUpdateTimeNext=GetTickCount();// force stat update
+ bOK=TRUE;
+ break;
+ }
+
+ // progress updates
+ dwUpdateTimeCur=GetTickCount();
+ if (dwUpdateTimeNext<=dwUpdateTimeCur)
+ {// we update it
+ dwUpdateTimeNext=dwUpdateTimeCur+MRA_FILES_QUEUE_PROGRESS_INTERVAL;
+ //pfts.currentFileProgress=dwSended;
+ ProtoBroadcastAck(PROTOCOL_NAME,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_DATA,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,(LPARAM)&pfts);
+ }
+ }
+ }else{// read failure
+ break;
+ }
+ }// end while
+ CloseHandle(hFile);
+
+ if (bOK==FALSE)
+ {// file recv failed
+ bFailed=TRUE;
+ break;
+ }
+ ProtoBroadcastAck(PROTOCOL_NAME,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_DATA,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,(LPARAM)&pfts);
+ }else{// err on read file
+ bFailed=TRUE;
+ break;
+ }
+ }else{
+ break;
+ }
+ }else{// err on receive, trash
+ bFailed=TRUE;
+ break;
+ }
+ }else{// bad file name or trash
+ bFailed=TRUE;
+ break;
+ }
+ }else{// err on receive
+ bFailed=TRUE;
+ break;
+ }
+ }// end for
+
+ Netlib_CloseHandle(pmrafqFilesQueueItem->hConnection);
+ pmrafqFilesQueueItem->hConnection=NULL;
+ }
+
+ if (bFailed)
+ {
+ char szEMail[MAX_EMAIL_LEN];
+ SIZE_T dwEMailSize;
+ if (DB_Mra_GetStaticString(pmrafqFilesQueueItem->hContact,"e-mail",szEMail,sizeof(szEMail),&dwEMailSize))
+ {
+ MraSendCommand_FileTransferAck(FILE_TRANSFER_STATUS_DECLINE,szEMail,dwEMailSize,pmrafqFilesQueueItem->dwIDRequest,NULL,0);
+ }
+ ProtoBroadcastAck(PROTOCOL_NAME,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_FAILED,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ }else{
+ ProtoBroadcastAck(PROTOCOL_NAME,pmrafqFilesQueueItem->hContact,ACKTYPE_FILE,ACKRESULT_SUCCESS,(HANDLE)pmrafqFilesQueueItem->dwIDRequest,0);
+ }
+
+ ListMTLock(&pmrafqFilesQueue->lmtListMT);
+ ListMTItemDelete(&pmrafqFilesQueue->lmtListMT,&pmrafqFilesQueueItem->lmtListMTItem);
+ CloseHandle(pmrafqFilesQueueItem->hThread);
+ MraFilesQueueItemFree(pmrafqFilesQueueItem);
+ ListMTUnLock(&pmrafqFilesQueue->lmtListMT);
+
+ CallService(MS_SYSTEM_THREAD_POP,0,0);
+ ExitThread(NO_ERROR);
+return(0);
+}
diff --git a/protocols/MRA/MraIcons.cpp b/protocols/MRA/MraIcons.cpp
new file mode 100644
index 0000000000..18b8f8c5f5
--- /dev/null
+++ b/protocols/MRA/MraIcons.cpp
@@ -0,0 +1,151 @@
+#include "Mra.h"
+#include "MraIcons.h"
+
+
+
+
+void AddIcoLibItems(LPWSTR lpwszRootSectionName,LPWSTR lpwszSubSectionName,const GUI_DISPLAY_ITEM *pgdiItems,SIZE_T dwCount,HANDLE *hResult)
+{
+ char szBuff[MAX_PATH];
+ WCHAR wszSection[MAX_PATH],wszPath[MAX_FILEPATH];
+ SKINICONDESC sid={0};
+
+
+ sid.cbSize=SKINICONDESC_SIZE;
+ sid.pwszSection=wszSection;
+ sid.pwszDefaultFile=wszPath;
+ sid.cx=sid.cy=16;
+ sid.flags=SIDF_ALL_UNICODE;
+
+ if (lpwszSubSectionName==NULL) lpwszSubSectionName=L"";
+ GetModuleFileName(masMraSettings.hInstance,wszPath,SIZEOF(wszPath));
+ mir_sntprintf(wszSection,SIZEOF(wszSection),L"%s%s%s",lpwszRootSectionName,PROTOCOL_NAMEW,lpwszSubSectionName);
+
+ for (SIZE_T i=0;i<dwCount;i++)
+ {
+ mir_snprintf(szBuff,SIZEOF(szBuff),"%s_%s",PROTOCOL_NAMEA,pgdiItems[i].lpszName);
+ sid.pszName=szBuff;
+ sid.pwszDescription=pgdiItems[i].lpwszDescr;
+ sid.iDefaultIndex=-pgdiItems[i].defIcon;
+ sid.hDefaultIcon=(HICON)LoadImage(masMraSettings.hInstance,MAKEINTRESOURCE(pgdiItems[i].defIcon),IMAGE_ICON,0,0,LR_SHARED);
+ if (sid.hDefaultIcon==NULL) sid.hDefaultIcon=(HICON)LoadImage(NULL,MAKEINTRESOURCE(pgdiItems[i].defIcon),IMAGE_ICON,0,0,LR_SHARED);
+ hResult[i]=(HANDLE)CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid);
+ }
+}
+
+void RemoveIcoLibItems(const GUI_DISPLAY_ITEM *pgdiItems,SIZE_T dwCount)
+{
+ char szBuff[MAX_PATH];
+
+ for (SIZE_T i=0;i<dwCount;i++)
+ {
+ mir_snprintf(szBuff,SIZEOF(szBuff),"%s_%s",PROTOCOL_NAMEA,pgdiItems[i].lpszName);
+ //***deb until 08 release
+ //CallService(MS_SKIN2_REMOVEICON,0,(LPARAM)szBuff);
+ }
+}
+
+
+HICON IconLibGetIcon(HANDLE hIcon)
+{
+return(IconLibGetIconEx(hIcon,LR_SHARED));
+}
+
+
+HICON IconLibGetIconEx(HANDLE hIcon,DWORD dwFlags)
+{
+ HICON hiIcon=NULL;
+
+ if (hIcon)
+ {
+ hiIcon=(HICON)CallService(MS_SKIN2_GETICONBYHANDLE,0,(LPARAM)hIcon);
+ if ((dwFlags&LR_SHARED)==0)
+ {
+ hiIcon=CopyIcon(hiIcon);
+ }
+ }
+return(hiIcon);
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+void IconsLoad()
+{
+ AddIcoLibItems(L"Protocols/",L"/MainMenu",gdiMenuItems,SIZEOF(gdiMenuItems),masMraSettings.hMainMenuIcons);
+ AddIcoLibItems(L"Protocols/",L"/ContactMenu",gdiContactMenuItems,SIZEOF(gdiContactMenuItems),masMraSettings.hContactMenuIcons);
+ // Advanced Status Icons initialization
+ AddIcoLibItems(L"Protocols/",L"/Extra status",gdiExtraStatusIconsItems,SIZEOF(gdiExtraStatusIconsItems),masMraSettings.hAdvancedStatusIcons);
+}
+
+
+void IconsUnLoad()
+{
+ RemoveIcoLibItems(gdiMenuItems,SIZEOF(gdiMenuItems));
+ memset(masMraSettings.hMainMenuIcons, 0, sizeof(masMraSettings.hMainMenuIcons));
+
+ RemoveIcoLibItems(gdiContactMenuItems,SIZEOF(gdiContactMenuItems));
+ memset(masMraSettings.hContactMenuIcons, 0, sizeof(masMraSettings.hContactMenuIcons));
+
+ // Advanced Status Icons initialization
+ RemoveIcoLibItems(gdiExtraStatusIconsItems,SIZEOF(gdiExtraStatusIconsItems));
+ memset(masMraSettings.hAdvancedStatusIcons, 0, sizeof(masMraSettings.hAdvancedStatusIcons));
+ memset(masMraSettings.hAdvancedStatusItems,0, sizeof(masMraSettings.hAdvancedStatusItems));
+}
+
+
+
+
+void InitXStatusIcons()
+{
+ int iCurIndex;
+ char szBuff[MAX_PATH];
+ WCHAR wszSection[MAX_PATH],wszPath[MAX_FILEPATH];
+ SKINICONDESC sid={0};
+
+ sid.cbSize=SKINICONDESC_SIZE;
+ sid.pwszSection=wszSection;
+ sid.pwszDefaultFile=wszPath;
+ sid.cx=sid.cy=16;
+ sid.flags=SIDF_ALL_UNICODE;
+
+ if (masMraSettings.hDLLXStatusIcons)
+ {
+ GetModuleFileName(masMraSettings.hDLLXStatusIcons,wszPath,SIZEOF(wszPath));
+ }else{
+ memset(wszPath, 0, sizeof(wszPath));
+ }
+ mir_sntprintf(wszSection,SIZEOF(wszSection),L"Status Icons/%s/Custom Status",PROTOCOL_NAMEW);
+
+ masMraSettings.hXStatusAdvancedStatusIcons[0]=NULL;
+ for (SIZE_T i=1;i<(MRA_XSTATUS_COUNT+1);i++)
+ {
+ mir_snprintf(szBuff,SIZEOF(szBuff),"%s_xstatus%ld",PROTOCOL_NAMEA,i);
+ iCurIndex=(IDI_XSTATUS1-1+i);
+ sid.pszName=szBuff;
+ sid.pwszDescription=lpcszXStatusNameDef[i];
+ sid.iDefaultIndex=-iCurIndex;
+ if (masMraSettings.hDLLXStatusIcons)
+ {
+ sid.hDefaultIcon=(HICON)LoadImage(masMraSettings.hDLLXStatusIcons,MAKEINTRESOURCE(iCurIndex),IMAGE_ICON,0,0,LR_SHARED);
+ }else{
+ sid.hDefaultIcon=NULL;
+ }
+ masMraSettings.hXStatusAdvancedStatusIcons[i]=(HANDLE)CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid);
+ }
+}
+
+void DestroyXStatusIcons()
+{
+ char szBuff[MAX_PATH];
+
+ for (SIZE_T i=1;i<(MRA_XSTATUS_COUNT+1);i++)
+ {
+ mir_snprintf(szBuff,SIZEOF(szBuff),"xstatus%ld",i);
+ //***deb until 08 release
+ //CallService(MS_SKIN2_REMOVEICON,0,(LPARAM)szBuff);
+ }
+ memset(masMraSettings.hXStatusAdvancedStatusIcons, 0, sizeof(masMraSettings.hXStatusAdvancedStatusIcons));
+ memset(masMraSettings.hXStatusAdvancedStatusItems, 0, sizeof(masMraSettings.hXStatusAdvancedStatusItems));
+}
+
+
diff --git a/protocols/MRA/MraIcons.h b/protocols/MRA/MraIcons.h
new file mode 100644
index 0000000000..7d6523c80d
--- /dev/null
+++ b/protocols/MRA/MraIcons.h
@@ -0,0 +1,20 @@
+#if !defined(AFX_MRA_ICONS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
+#define AFX_MRA_ICONS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_
+
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+HICON IconLibGetIcon(HANDLE hIcon);
+HICON IconLibGetIconEx(HANDLE hIcon,DWORD dwFlags);
+
+void IconsLoad();
+void IconsUnLoad();
+
+void InitXStatusIcons();
+void DestroyXStatusIcons();
+
+
+#endif // !defined(AFX_MRA_ICONS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_) \ No newline at end of file
diff --git a/protocols/MRA/MraMPop.cpp b/protocols/MRA/MraMPop.cpp
new file mode 100644
index 0000000000..ad510184e8
--- /dev/null
+++ b/protocols/MRA/MraMPop.cpp
@@ -0,0 +1,241 @@
+#include "Mra.h"
+#include "MraMPop.h"
+
+
+
+
+// MPOP_SESSION
+typedef struct
+{
+ FIFO_MT ffmtQueueToQuery;
+ BOOL bKeyValid;
+ LPSTR lpszMPOPKey;
+ SIZE_T dwMPOPKeySize;
+} MRA_MPOP_SESSION_QUEUE;
+
+
+typedef struct
+{
+ FIFO_MT_ITEM ffmtiFifoItem;
+ LPSTR lpszUrl;
+ SIZE_T dwUrlSize;
+} MRA_MPOP_SESSION_QUEUE_ITEM;
+
+
+
+void MraMPopSessionQueueClear (HANDLE hMPopSessionQueue);
+
+
+
+
+DWORD MraMPopSessionQueueInitialize(HANDLE *phMPopSessionQueue)
+{
+ DWORD dwRetErrorCode;
+
+ if (phMPopSessionQueue)
+ {
+ MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue;
+
+ pmpsqMPopSessionQueue=(MRA_MPOP_SESSION_QUEUE*)MEMALLOC(sizeof(MRA_MPOP_SESSION_QUEUE));
+ if (pmpsqMPopSessionQueue)
+ {
+ pmpsqMPopSessionQueue->bKeyValid=FALSE;
+ pmpsqMPopSessionQueue->lpszMPOPKey=NULL;
+ pmpsqMPopSessionQueue->dwMPOPKeySize=0;
+ FifoMTInitialize(&pmpsqMPopSessionQueue->ffmtQueueToQuery,0);
+
+ (*phMPopSessionQueue)=(HANDLE)pmpsqMPopSessionQueue;
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ dwRetErrorCode=GetLastError();
+ }
+ }else{
+ dwRetErrorCode=ERROR_ALREADY_INITIALIZED;
+ }
+return(dwRetErrorCode);
+}
+
+
+void MraMPopSessionQueueClear(HANDLE hMPopSessionQueue)
+{
+ if (hMPopSessionQueue)
+ {
+ MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue=(MRA_MPOP_SESSION_QUEUE*)hMPopSessionQueue;
+ MRA_MPOP_SESSION_QUEUE_ITEM *pmpsqi;
+
+ pmpsqMPopSessionQueue->bKeyValid=FALSE;
+ MEMFREE(pmpsqMPopSessionQueue->lpszMPOPKey);
+ pmpsqMPopSessionQueue->dwMPOPKeySize=0;
+ while(FifoMTItemPop(&pmpsqMPopSessionQueue->ffmtQueueToQuery,NULL,(LPVOID*)&pmpsqi)==NO_ERROR) MEMFREE(pmpsqi);
+ }
+}
+
+
+void MraMPopSessionQueueFlush(HANDLE hMPopSessionQueue)
+{
+ if (hMPopSessionQueue)
+ {
+ MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue=(MRA_MPOP_SESSION_QUEUE*)hMPopSessionQueue;
+
+ while(FifoMTGetCount(&pmpsqMPopSessionQueue->ffmtQueueToQuery))
+ {
+ MraMPopSessionQueueSetNewMPopKey(hMPopSessionQueue,NULL,0);
+ MraMPopSessionQueueStart(hMPopSessionQueue);
+ }
+ }
+}
+
+
+void MraMPopSessionQueueDestroy(HANDLE hMPopSessionQueue)
+{
+ if (hMPopSessionQueue)
+ {
+ MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue=(MRA_MPOP_SESSION_QUEUE*)hMPopSessionQueue;
+ MraMPopSessionQueueClear(hMPopSessionQueue);
+ FifoMTDestroy(&pmpsqMPopSessionQueue->ffmtQueueToQuery);
+ MEMFREE(pmpsqMPopSessionQueue);
+ }
+}
+
+
+DWORD MraMPopSessionQueueAddUrl(HANDLE hMPopSessionQueue,LPSTR lpszUrl,SIZE_T dwUrlSize)
+{
+ DWORD dwRetErrorCode;
+
+ if (hMPopSessionQueue && lpszUrl && dwUrlSize)
+ {
+ MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue=(MRA_MPOP_SESSION_QUEUE*)hMPopSessionQueue;
+ MRA_MPOP_SESSION_QUEUE_ITEM *pmpsqi=(MRA_MPOP_SESSION_QUEUE_ITEM*)MEMALLOC((sizeof(MRA_MPOP_SESSION_QUEUE_ITEM)+dwUrlSize+sizeof(SIZE_T)));
+
+ if (pmpsqi)
+ {
+ pmpsqi->dwUrlSize=dwUrlSize;
+ pmpsqi->lpszUrl=(LPSTR)(pmpsqi+1);
+ memmove(pmpsqi->lpszUrl,lpszUrl,dwUrlSize);
+ FifoMTItemPush(&pmpsqMPopSessionQueue->ffmtQueueToQuery,&pmpsqi->ffmtiFifoItem,(LPVOID)pmpsqi);
+ if (pmpsqMPopSessionQueue->bKeyValid)
+ {
+ dwRetErrorCode=MraMPopSessionQueueStart(hMPopSessionQueue);
+ }else{
+ if (masMraSettings.bLoggedIn)
+ {
+ MraSendCMD(MRIM_CS_GET_MPOP_SESSION,NULL,0);
+ }else{
+ MraMPopSessionQueueFlush(hMPopSessionQueue);
+ }
+ dwRetErrorCode=NO_ERROR;
+ }
+ }else{
+ dwRetErrorCode=GetLastError();
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD MraMPopSessionQueueAddUrlAndEMail(HANDLE hMPopSessionQueue,LPSTR lpszUrl,SIZE_T dwUrlSize,LPSTR lpszEMail,SIZE_T dwEMailSize)
+{
+ DWORD dwRetErrorCode;
+
+ if (hMPopSessionQueue && lpszUrl && dwUrlSize && lpszEMail && dwEMailSize)
+ {
+ char szUrl[BUFF_SIZE_URL],szEMail[MAX_EMAIL_LEN];
+ LPSTR lpszUser,lpszDomain;
+
+ dwRetErrorCode=ERROR_INVALID_DATA;
+ BuffToLowerCase(szEMail,lpszEMail,dwEMailSize);
+ lpszDomain=(LPSTR)MemoryFindByte(0,szEMail,dwEMailSize,'@');
+ if (lpszDomain)
+ if (lpszUser=(LPSTR)MemoryFindByte((lpszDomain-szEMail),szEMail,dwEMailSize,'.'))
+ {
+ (*lpszUser)=0;
+ lpszUser=szEMail;
+ (*lpszDomain)=0;
+ lpszDomain++;
+
+ dwUrlSize=mir_snprintf(szUrl,SIZEOF(szUrl),"%s/%s/%s",lpszUrl,lpszDomain,lpszUser);
+ dwRetErrorCode=MraMPopSessionQueueAddUrl(hMPopSessionQueue,szUrl,dwUrlSize);
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+DWORD MraMPopSessionQueueStart(HANDLE hMPopSessionQueue)
+{
+ DWORD dwRetErrorCode;
+
+ if (hMPopSessionQueue)
+ {
+ MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue=(MRA_MPOP_SESSION_QUEUE*)hMPopSessionQueue;
+ MRA_MPOP_SESSION_QUEUE_ITEM *pmpsqi;
+
+ dwRetErrorCode=NO_ERROR;
+ if (pmpsqMPopSessionQueue->bKeyValid==TRUE)
+ if (FifoMTItemPop(&pmpsqMPopSessionQueue->ffmtQueueToQuery,NULL,(LPVOID*)&pmpsqi)==NO_ERROR)
+ {
+ char szUrl[BUFF_SIZE_URL],szEMail[MAX_EMAIL_LEN];
+ SIZE_T dwUrlSize,dwEMailSize;
+
+ if (DB_Mra_GetStaticStringA(NULL,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ pmpsqMPopSessionQueue->bKeyValid=FALSE;
+ BuffToLowerCase(szEMail,szEMail,dwEMailSize);
+ dwUrlSize=mir_snprintf(szUrl,SIZEOF(szUrl),MRA_MPOP_AUTH_URL,szEMail,pmpsqMPopSessionQueue->lpszMPOPKey,pmpsqi->lpszUrl);
+
+ CallService(MS_UTILS_OPENURL,TRUE,(LPARAM)szUrl);
+ DebugPrint(L"Opening URL: ");DebugPrintCRLFA(szUrl);
+ //MraSendCMD(MRIM_CS_GET_MPOP_SESSION,NULL,0);
+ }
+ MEMFREE(pmpsqi);
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD MraMPopSessionQueueSetNewMPopKey(HANDLE hMPopSessionQueue,LPSTR lpszKey,SIZE_T dwKeySize)
+{
+ DWORD dwRetErrorCode;
+
+ if (hMPopSessionQueue)
+ {
+ MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue=(MRA_MPOP_SESSION_QUEUE*)hMPopSessionQueue;
+
+ if (lpszKey==NULL) dwKeySize=0;
+ if (pmpsqMPopSessionQueue->dwMPOPKeySize<dwKeySize || dwKeySize==0)
+ {
+ MEMFREE(pmpsqMPopSessionQueue->lpszMPOPKey);
+ pmpsqMPopSessionQueue->lpszMPOPKey=(LPSTR)MEMALLOC(dwKeySize+sizeof(SIZE_T));
+ }
+
+ if (pmpsqMPopSessionQueue->lpszMPOPKey)
+ {
+ pmpsqMPopSessionQueue->bKeyValid=TRUE;
+ pmpsqMPopSessionQueue->dwMPOPKeySize=dwKeySize;
+ memmove(pmpsqMPopSessionQueue->lpszMPOPKey,lpszKey,dwKeySize);
+ (*(pmpsqMPopSessionQueue->lpszMPOPKey+dwKeySize))=0;
+
+ DebugPrint(L"New MPOP session key: ");DebugPrintCRLFA(pmpsqMPopSessionQueue->lpszMPOPKey);
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ pmpsqMPopSessionQueue->bKeyValid=FALSE;
+ pmpsqMPopSessionQueue->lpszMPOPKey=NULL;
+ pmpsqMPopSessionQueue->dwMPOPKeySize=0;
+ dwRetErrorCode=GetLastError();
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+
+
+
diff --git a/protocols/MRA/MraMPop.h b/protocols/MRA/MraMPop.h
new file mode 100644
index 0000000000..8d04e067ad
--- /dev/null
+++ b/protocols/MRA/MraMPop.h
@@ -0,0 +1,26 @@
+#if !defined(AFX_MRA_MPOP_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
+#define AFX_MRA_MPOP_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_
+
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+
+
+DWORD MraMPopSessionQueueInitialize (HANDLE *phMPopSessionQueue);
+void MraMPopSessionQueueDestroy (HANDLE hMPopSessionQueue);
+void MraMPopSessionQueueFlush (HANDLE hMPopSessionQueue);
+DWORD MraMPopSessionQueueAddUrl (HANDLE hMPopSessionQueue,LPSTR lpszUrl,SIZE_T dwUrlSize);
+DWORD MraMPopSessionQueueAddUrlAndEMail (HANDLE hMPopSessionQueue,LPSTR lpszUrl,SIZE_T dwUrlSize,LPSTR lpszEMail,SIZE_T dwEMailSize);
+DWORD MraMPopSessionQueueStart (HANDLE hMPopSessionQueue);
+DWORD MraMPopSessionQueueSetNewMPopKey (HANDLE hMPopSessionQueue,LPSTR lpszKey,SIZE_T dwKeySize);
+
+
+
+
+
+
+
+#endif // !defined(AFX_MRA_MPOP_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/MraMRIMProxy.cpp b/protocols/MRA/MraMRIMProxy.cpp
new file mode 100644
index 0000000000..296cd5f4de
--- /dev/null
+++ b/protocols/MRA/MraMRIMProxy.cpp
@@ -0,0 +1,239 @@
+#include "Mra.h"
+#include "MraMRIMProxy.h"
+#include "proto.h"
+
+
+
+typedef struct
+{
+ LPSTR lpszEMail; // LPS to
+ SIZE_T dwEMailSize;
+ DWORD dwIDRequest; // DWORD id_request
+ DWORD dwDataType; // DWORD data_type
+ LPSTR lpszUserData; // LPS user_data
+ SIZE_T dwUserDataSize;
+ MRA_ADDR_LIST malAddrList; // LPS lps_ip_port
+ MRA_GUID mguidSessionID; // DWORD session_id[4]
+ HANDLE hConnection;
+ HANDLE hWaitHandle; // internal
+} MRA_MRIMPROXY_DATA;
+
+
+
+HANDLE MraMrimProxyCreate()
+{
+ MRA_MRIMPROXY_DATA *pmmpd=(MRA_MRIMPROXY_DATA*)MEMALLOC(sizeof(MRA_MRIMPROXY_DATA));
+return((HANDLE)pmmpd);
+}
+
+
+DWORD MraMrimProxySetData(HANDLE hMraMrimProxyData,LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwIDRequest,DWORD dwDataType,LPSTR lpszUserData,SIZE_T dwUserDataSize,LPSTR lpszAddreses,SIZE_T dwAddresesSize,MRA_GUID *pmguidSessionID)
+{
+ DWORD dwRetErrorCode;
+
+ if (hMraMrimProxyData)
+ {
+ MRA_MRIMPROXY_DATA *pmmpd=(MRA_MRIMPROXY_DATA*)hMraMrimProxyData;
+
+ if (lpszEMail && dwEMailSize)
+ {
+ MEMFREE(pmmpd->lpszEMail);
+ pmmpd->lpszEMail=(LPSTR)MEMALLOC(dwEMailSize);
+ memmove(pmmpd->lpszEMail,lpszEMail,dwEMailSize);
+ pmmpd->dwEMailSize=dwEMailSize;
+ }
+ if (dwIDRequest) pmmpd->dwIDRequest=dwIDRequest;
+ if (dwDataType) pmmpd->dwDataType=dwDataType;
+ if (lpszUserData)
+ {
+ MEMFREE(pmmpd->lpszUserData);
+ pmmpd->lpszUserData=(LPSTR)MEMALLOC(dwUserDataSize);
+ memmove(pmmpd->lpszUserData,lpszUserData,dwUserDataSize);
+ pmmpd->dwUserDataSize=dwUserDataSize;
+ }
+ if (lpszAddreses && dwAddresesSize) MraAddrListGetFromBuff(lpszAddreses,dwAddresesSize,&pmmpd->malAddrList);
+ if (pmguidSessionID) memmove(&pmmpd->mguidSessionID,pmguidSessionID,sizeof(MRA_GUID));
+
+ SetEvent(pmmpd->hWaitHandle);
+
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+
+void MraMrimProxyFree(HANDLE hMraMrimProxyData)
+{
+ if (hMraMrimProxyData)
+ {
+ MRA_MRIMPROXY_DATA *pmmpd=(MRA_MRIMPROXY_DATA*)hMraMrimProxyData;
+
+ CloseHandle(pmmpd->hWaitHandle);
+ Netlib_CloseHandle(pmmpd->hConnection);
+ MEMFREE(pmmpd->lpszEMail);
+ MEMFREE(pmmpd->lpszUserData);
+ MraAddrListFree(&pmmpd->malAddrList);
+ MEMFREE(hMraMrimProxyData);
+ }
+}
+
+
+void MraMrimProxyCloseConnection(HANDLE hMraMrimProxyData)
+{
+ if (hMraMrimProxyData)
+ {
+ MRA_MRIMPROXY_DATA *pmmpd=(MRA_MRIMPROXY_DATA*)hMraMrimProxyData;
+
+ SetEvent(pmmpd->hWaitHandle);
+ Netlib_CloseHandle(pmmpd->hConnection);
+ }
+}
+
+
+DWORD MraMrimProxyConnect(HANDLE hMraMrimProxyData,HANDLE *phConnection)
+{
+ DWORD dwRetErrorCode;
+
+ if (hMraMrimProxyData && phConnection)
+ {
+ BOOL bIsHTTPSProxyUsed,bContinue;
+ BYTE lpbBufferRcv[BUFF_SIZE_RCV_MIN_FREE];
+ DWORD dwBytesReceived,dwConnectReTryCount,dwCurConnectReTryCount;
+ SIZE_T dwRcvBuffSize=BUFF_SIZE_RCV_MIN_FREE,dwRcvBuffSizeUsed;
+ NETLIBSELECT nls={0};
+ MRA_MRIMPROXY_DATA *pmmpd=(MRA_MRIMPROXY_DATA*)hMraMrimProxyData;
+ NETLIBOPENCONNECTION nloc={0};
+
+
+ if (pmmpd->malAddrList.dwAddrCount)
+ {// ,
+ MraAddrListGetToBuff(&pmmpd->malAddrList,(LPSTR)lpbBufferRcv,SIZEOF(lpbBufferRcv),&dwRcvBuffSizeUsed);
+ MraSendCommand_ProxyAck(PROXY_STATUS_OK,pmmpd->lpszEMail,pmmpd->dwEMailSize,pmmpd->dwIDRequest,pmmpd->dwDataType,pmmpd->lpszUserData,pmmpd->dwUserDataSize,(LPSTR)lpbBufferRcv,dwRcvBuffSizeUsed,pmmpd->mguidSessionID);
+ }else{//
+ pmmpd->hWaitHandle=CreateEvent(NULL,TRUE,FALSE,NULL);
+ if (pmmpd->lpszEMail && pmmpd->dwEMailSize)
+ if (MraSendCommand_Proxy(pmmpd->lpszEMail,pmmpd->dwEMailSize,pmmpd->dwIDRequest,pmmpd->dwDataType,pmmpd->lpszUserData,pmmpd->dwUserDataSize,NULL,0,pmmpd->mguidSessionID))
+ {
+ WaitForSingleObjectEx(pmmpd->hWaitHandle,INFINITE,FALSE);
+ }
+ CloseHandle(pmmpd->hWaitHandle);
+ pmmpd->hWaitHandle=NULL;
+ }
+
+ dwRetErrorCode=ERROR_NO_NETWORK;
+ if (pmmpd->malAddrList.dwAddrCount)
+ {
+ pmmpd->hConnection=NULL;
+ bIsHTTPSProxyUsed=IsHTTPSProxyUsed(masMraSettings.hNetlibUser);
+ dwConnectReTryCount=DB_Mra_GetDword(NULL,"ConnectReTryCountMRIMProxy",MRA_DEFAULT_CONN_RETRY_COUNT_MRIMPROXY);
+ nloc.cbSize=sizeof(nloc);
+ nloc.flags=NLOCF_V2;
+ nloc.timeout=((MRA_TIMEOUT_DIRECT_CONN-1)/(pmmpd->malAddrList.dwAddrCount*dwConnectReTryCount));// -1
+ if (nloc.timeout<MRA_TIMEOUT_CONN_MIN) nloc.timeout=MRA_TIMEOUT_CONN_MIN;
+ if (nloc.timeout>MRA_TIMEOUT_CONN_) nloc.timeout=MRA_TIMEOUT_CONN_;
+
+ for(SIZE_T i=0;(i<pmmpd->malAddrList.dwAddrCount && dwRetErrorCode!=NO_ERROR);i++)
+ {// Set up the sockaddr structure
+ if ((pmmpd->malAddrList.pmaliAddress[i].dwPort==MRA_SERVER_PORT_HTTPS && bIsHTTPSProxyUsed) || bIsHTTPSProxyUsed==FALSE)
+ {// https 443
+ if (pmmpd->dwDataType==MRIM_PROXY_TYPE_FILES) ProtoBroadcastAck(PROTOCOL_NAMEA,MraHContactFromEmail(pmmpd->lpszEMail,pmmpd->dwEMailSize,FALSE,TRUE,NULL),ACKTYPE_FILE,ACKRESULT_CONNECTING,(HANDLE)pmmpd->dwIDRequest,0);
+
+ nloc.szHost=inet_ntoa((*((in_addr*)&pmmpd->malAddrList.pmaliAddress[i].dwAddr)));
+ nloc.wPort=(WORD)pmmpd->malAddrList.pmaliAddress[i].dwPort;
+
+ dwCurConnectReTryCount=dwConnectReTryCount;
+ do{
+ pmmpd->hConnection=(HANDLE)CallService(MS_NETLIB_OPENCONNECTION,(WPARAM)masMraSettings.hNetlibUser,(LPARAM)&nloc);
+ }while(--dwCurConnectReTryCount && pmmpd->hConnection==NULL);
+
+ if (pmmpd->hConnection)
+ {
+ nls.cbSize=sizeof(nls);
+ nls.dwTimeout=(MRA_TIMEOUT_DIRECT_CONN*1000*2);
+ nls.hReadConns[0]=pmmpd->hConnection;
+ bContinue=TRUE;
+ dwRcvBuffSizeUsed=0;
+
+ if (pmmpd->dwDataType==MRIM_PROXY_TYPE_FILES) ProtoBroadcastAck(PROTOCOL_NAMEA,MraHContactFromEmail(pmmpd->lpszEMail,pmmpd->dwEMailSize,FALSE,TRUE,NULL),ACKTYPE_FILE,ACKRESULT_CONNECTED,(HANDLE)pmmpd->dwIDRequest,0);
+ MraSendPacket(nls.hReadConns[0],0,MRIM_CS_PROXY_HELLO,&pmmpd->mguidSessionID,sizeof(MRA_GUID));
+
+ while(bContinue)
+ {
+ switch(CallService(MS_NETLIB_SELECT,0,(LPARAM)&nls)){
+ case SOCKET_ERROR:
+ case 0:// Time out
+ dwRetErrorCode=GetLastError();
+ ShowFormatedErrorMessage(L"Disconnected, socket error",dwRetErrorCode);
+ bContinue=FALSE;
+ break;
+ case 1:
+ if (dwRcvBuffSizeUsed==BUFF_SIZE_RCV_MIN_FREE)
+ {// bad packet
+ bContinue=FALSE;
+ DebugBreak();
+ }else{
+ dwBytesReceived=Netlib_Recv(nls.hReadConns[0],(LPSTR)(lpbBufferRcv+dwRcvBuffSizeUsed),(dwRcvBuffSize-dwRcvBuffSizeUsed),0);
+ if (dwBytesReceived && dwBytesReceived!=SOCKET_ERROR)
+ {// connected
+ dwRcvBuffSizeUsed+=dwBytesReceived;
+ if (dwRcvBuffSizeUsed>=sizeof(mrim_packet_header_t))
+ {// packet header received
+ if (((mrim_packet_header_t*)lpbBufferRcv)->magic==CS_MAGIC)
+ {// packet OK
+ if ((dwRcvBuffSizeUsed-sizeof(mrim_packet_header_t))>=((mrim_packet_header_t*)lpbBufferRcv)->dlen)
+ {// full packet received, may be more than one
+ if (((mrim_packet_header_t*)lpbBufferRcv)->msg=MRIM_CS_PROXY_HELLO_ACK)
+ {// connect OK!
+ dwRetErrorCode=NO_ERROR;
+ }else{// bad/wrong
+ DebugBreak();
+ }
+ bContinue=FALSE;
+ }else{// not all packet received, continue receiving
+ DebugPrintCRLF(L"Not all packet received, continue receiving");
+ }
+ }else{// bad packet
+ DebugPrintCRLF(L"Bad packet");
+ DebugBreak();
+ bContinue=FALSE;
+ }
+ }else{// packet to small, continue receiving
+ DebugPrintCRLF(L"Packet to small, continue receiving");
+ }
+ }else{// disconnected
+ dwRetErrorCode=GetLastError();
+ ShowFormatedErrorMessage(L"Disconnected, socket read error",dwRetErrorCode);
+ bContinue=FALSE;
+ }
+ }
+ break;
+ }// end switch
+ }// end while
+ }else{// cant connect
+ dwRetErrorCode=GetLastError();
+ }
+ }// filtered
+ }// end for
+
+
+ if (dwRetErrorCode!=NO_ERROR)
+ {// :)
+ Netlib_CloseHandle(pmmpd->hConnection);
+ pmmpd->hConnection=NULL;
+ }
+ }
+ (*phConnection)=pmmpd->hConnection;
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+
+
+
+
diff --git a/protocols/MRA/MraMRIMProxy.h b/protocols/MRA/MraMRIMProxy.h
new file mode 100644
index 0000000000..f0c2f70880
--- /dev/null
+++ b/protocols/MRA/MraMRIMProxy.h
@@ -0,0 +1,21 @@
+#if !defined(AFX_MRA_MRIMPROXY_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
+#define AFX_MRA_MRIMPROXY_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_
+
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+
+
+
+HANDLE MraMrimProxyCreate ();
+DWORD MraMrimProxySetData (HANDLE hMraMrimProxyData,LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwIDRequest,DWORD dwDataType,LPSTR lpszUserData,SIZE_T dwUserDataSize,LPSTR lpszAddreses,SIZE_T dwAddresesSize,MRA_GUID *pmguidSessionID);
+void MraMrimProxyFree (HANDLE hMraMrimProxyData);
+void MraMrimProxyCloseConnection (HANDLE hMraMrimProxyData);
+DWORD MraMrimProxyConnect (HANDLE hMraMrimProxyData,HANDLE *phConnection);
+
+
+
+#endif // !defined(AFX_MRA_MRIMPROXY_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/MraOfflineMsg.cpp b/protocols/MRA/MraOfflineMsg.cpp
new file mode 100644
index 0000000000..514e34af30
--- /dev/null
+++ b/protocols/MRA/MraOfflineMsg.cpp
@@ -0,0 +1,432 @@
+#include "Mra.h"
+#include "MraOfflineMsg.h"
+#include "MraConstans.h"
+
+
+#define LF "\n"
+#define LFLF "\n\n"
+#define CRLF "\r\n"
+#define CRLFCRLF "\r\n\r\n"
+
+
+DWORD MraOfflineMessageGetMIMEHeadAndBody (LPSTR lpszMessage,SIZE_T dwMessageSize,LPSTR *plpszHeader,SIZE_T *pdwHeaderSize,LPSTR *plpszBody,SIZE_T *pdwBodySize);
+DWORD MraOfflineMessageGetNextMIMEPart (LPSTR lpszBody,SIZE_T dwBodySize,LPSTR lpszBoundary,SIZE_T dwBoundarySize,LPSTR *plpszCurMIMEPos,LPSTR *plpszMIMEPart,SIZE_T *pdwMIMEPartSize);
+DWORD MraOfflineMessageGetHeaderValue (LPSTR lpszHeader,LPSTR lpszHeaderLow,SIZE_T dwHeaderSize,LPSTR lpszValueName,SIZE_T dwValueNameSize,LPSTR *plpszValue,SIZE_T *pdwValueSize);
+DWORD MraOfflineMessageGetHeaderValueLow (LPSTR lpszHeaderLow,SIZE_T dwHeaderSize,LPSTR lpszValueName,SIZE_T dwValueNameSize,LPSTR *plpszValue,SIZE_T *pdwValueSize);
+DWORD MraOfflineMessageConvertTime (INTERNET_TIME *pitTime);
+
+
+
+
+DWORD MraOfflineMessageGet(MRA_LPS *plpsMsg,DWORD *pdwTime,DWORD *pdwFlags,MRA_LPS *plpsEMail,MRA_LPS *plpsText,MRA_LPS *plpsRTFText,MRA_LPS *plpsMultiChatData,LPBYTE *plpbBuff)
+{//
+ DWORD dwRetErrorCode=ERROR_INVALID_HANDLE;
+
+
+ if (plpsMsg)
+ if (plpsMsg->lpszData && plpsMsg->dwSize)
+ {
+ LPSTR lpszHeader,lpszHeaderLow,lpszBody,lpszContentTypeLow,lpszTemp;
+ SIZE_T dwHeaderSize,dwBodySize,dwContentTypeSize,dwTempSize;
+ DWORD dwMultichatType;
+
+ #ifdef _DEBUG
+ DebugPrintCRLFA(plpsMsg->lpszData);
+ #endif
+
+ if (MraOfflineMessageGetMIMEHeadAndBody(plpsMsg->lpszData,plpsMsg->dwSize,&lpszHeader,&dwHeaderSize,&lpszBody,&dwBodySize)==NO_ERROR)
+ {
+ lpszHeaderLow=(LPSTR)MEMALLOC(dwHeaderSize);
+ if (lpszHeaderLow) BuffToLowerCase(lpszHeaderLow,lpszHeader,dwHeaderSize);
+
+ if (pdwTime)
+ if (MraOfflineMessageGetHeaderValue(lpszHeader,lpszHeaderLow,dwHeaderSize,"date",4,&lpszTemp,&dwTempSize)==NO_ERROR)
+ {
+ INTERNET_TIME itTime;
+ InternetTimeGetTime(lpszTemp,dwTempSize,&itTime);
+ (*pdwTime)=MraOfflineMessageConvertTime(&itTime);
+ }else{
+ (*pdwTime)=0;
+ }
+
+ if (pdwFlags)
+ if (MraOfflineMessageGetHeaderValue(lpszHeader,lpszHeaderLow,dwHeaderSize,"x-mrim-flags",12,&lpszTemp,&dwTempSize)==NO_ERROR)
+ {
+ (*pdwFlags)=StrHexToUNum32(lpszTemp,dwTempSize);
+ }else{
+ (*pdwFlags)=0;
+ }
+
+ if (MraOfflineMessageGetHeaderValue(lpszHeader,lpszHeaderLow,dwHeaderSize,"x-mrim-multichat-type",21,&lpszTemp,&dwTempSize)==NO_ERROR)
+ {
+ dwMultichatType=StrHexToUNum32(lpszTemp,dwTempSize);
+ }else{
+ dwMultichatType=0;
+ }
+
+
+ if (plpsEMail)
+ if (MraOfflineMessageGetHeaderValue(lpszHeader,lpszHeaderLow,dwHeaderSize,"from",4,&plpsEMail->lpszData,&plpsEMail->dwSize)!=NO_ERROR)
+ {
+ plpsEMail->lpszData=NULL;
+ plpsEMail->dwSize=0;
+ }
+
+
+ if (plpsText)
+ {
+ plpsText->lpszData=NULL;
+ plpsText->dwSize=0;
+ }
+ if (plpsRTFText)
+ {
+ plpsRTFText->lpszData=NULL;
+ plpsRTFText->dwSize=0;
+ }
+ if (plpsMultiChatData)
+ {
+ plpsMultiChatData->lpszData=NULL;
+ plpsMultiChatData->dwSize=0;
+ }
+ if (plpbBuff) (*plpbBuff)=NULL;
+
+ if (plpsText || plpsRTFText)
+ if (MraOfflineMessageGetHeaderValueLow(lpszHeaderLow,dwHeaderSize,"content-type",12,&lpszContentTypeLow,&dwContentTypeSize)==NO_ERROR)
+ {
+
+ if (MemoryFind(0,lpszContentTypeLow,dwContentTypeSize,"multipart/alternative",21))
+ {// Content-Type: multipart/alternative; boundary=1217508709J3777283291217508709T31197726
+ LPSTR lpszBoundary,lpszMIMEPart,lpszCurMIMEPos,lpszMIMEHeader,lpszMIMEHeaderLow,lpszMIMEBody,lpszMIMEContentType;
+ SIZE_T i,dwBoundarySize,dwMIMEPartSize,dwMIMEHeaderSize,dwMIMEBodySize,dwMIMEContentTypeSize;
+
+ lpszBoundary=(LPSTR)MemoryFind(0,lpszContentTypeLow,dwContentTypeSize,"boundary=",9);
+ if (lpszBoundary)
+ {
+ dwBoundarySize=((dwContentTypeSize-(lpszBoundary-lpszContentTypeLow))-9);
+ lpszBoundary=(lpszHeader+((lpszBoundary+9)-lpszHeaderLow));
+
+ i=0;
+ lpszCurMIMEPos=lpszBody;
+ while(MraOfflineMessageGetNextMIMEPart(lpszBody,dwBodySize,lpszBoundary,dwBoundarySize,&lpszCurMIMEPos,&lpszMIMEPart,&dwMIMEPartSize)==NO_ERROR)
+ {
+ if (MraOfflineMessageGetMIMEHeadAndBody(lpszMIMEPart,dwMIMEPartSize,&lpszMIMEHeader,&dwMIMEHeaderSize,&lpszMIMEBody,&dwMIMEBodySize)==NO_ERROR)
+ {
+ lpszMIMEHeaderLow=(LPSTR)MEMALLOC(dwMIMEHeaderSize);
+ if (lpszMIMEHeaderLow)
+ {
+ BuffToLowerCase(lpszMIMEHeaderLow,lpszMIMEHeader,dwMIMEHeaderSize);
+ if (MraOfflineMessageGetHeaderValueLow(lpszMIMEHeaderLow,dwMIMEHeaderSize,"content-type",12,&lpszMIMEContentType,&dwMIMEContentTypeSize)==NO_ERROR)
+ {
+ if (MemoryFind(0,lpszMIMEContentType,dwMIMEContentTypeSize,"text/plain",10))
+ {// this is simple text part: text/plain
+ if (plpsText)
+ {
+ if (MemoryFind(0,lpszMIMEContentType,dwMIMEContentTypeSize,"utf-16le",8))
+ {// charset=UTF-16LE// base64
+ if (plpbBuff)
+ {//
+ LPWSTR lpwszText;
+ SIZE_T dwTextSize;
+
+ lpwszText=(LPWSTR)MEMALLOC(dwMIMEBodySize);
+ if (lpwszText)
+ {
+ BASE64DecodeFormated(lpszMIMEBody,dwMIMEBodySize,lpwszText,dwMIMEBodySize,&dwTextSize);
+ plpsText->lpwszData=lpwszText;
+ plpsText->dwSize=dwTextSize;
+ if (pdwFlags)
+ {
+ (*pdwFlags)|=MESSAGE_FLAG_v1p16; // set unocode flag if not exist
+ (*pdwFlags)&=~MESSAGE_FLAG_CP1251; // reset ansi flag if exist
+ }
+ (*plpbBuff)=(LPBYTE)lpwszText;
+ dwRetErrorCode=NO_ERROR;
+ }
+ }
+ }else
+ if (MemoryFind(0,lpszMIMEContentType,dwMIMEContentTypeSize,"cp-1251",7))
+ {// charset=CP-1251
+ plpsText->lpszData=lpszMIMEBody;
+ plpsText->dwSize=dwMIMEBodySize;
+ if (pdwFlags)
+ {
+ (*pdwFlags)&=~MESSAGE_FLAG_v1p16; // reset unocode flag if exist
+ (*pdwFlags)|=MESSAGE_FLAG_CP1251; // set ansi flag
+ }
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ DebugBreak();
+ }
+ }
+ }else
+ if (MemoryFind(0,lpszMIMEContentType,dwMIMEContentTypeSize,"application/x-mrim-rtf",22))
+ {
+ if (plpsRTFText)
+ {
+ plpsRTFText->lpszData=lpszMIMEBody;
+ plpsRTFText->dwSize=dwMIMEBodySize;
+ if (pdwFlags) (*pdwFlags)|=MESSAGE_FLAG_RTF; // set RTF flag if not exist
+ dwRetErrorCode=NO_ERROR;
+ }
+ }else
+ if (MemoryFind(0,lpszMIMEContentType,dwMIMEContentTypeSize,"application/x-mrim+xml",22))
+ {
+ if (plpsMultiChatData)
+ {
+ plpsMultiChatData->lpszData=lpszMIMEBody;
+ plpsMultiChatData->dwSize=dwMIMEBodySize;
+ if (pdwFlags) (*pdwFlags)|=MESSAGE_FLAG_MULTICHAT; // set MESSAGE_FLAG_MULTICHAT flag if not exist
+ dwRetErrorCode=NO_ERROR;
+ }
+ }else{
+ DebugBreak();
+ }
+ }
+ MEMFREE(lpszMIMEHeaderLow);
+ }
+ }
+ i++;
+ }
+
+ DebugBreakIf((i>3 || i==0));
+ }else{// boundary not found
+ DebugBreak();
+ }
+ }else
+ if (MemoryFind(0,lpszContentTypeLow,dwContentTypeSize,"text/plain",10))
+ {// Content-Type: text/plain; charset=CP-1251
+ if (MemoryFind(0,lpszContentTypeLow,dwContentTypeSize,"utf-16le",8))
+ {// charset=UTF-16LE// base64
+ if (plpbBuff)
+ {//
+ LPWSTR lpwszText;
+ SIZE_T dwTextSize;
+
+ lpwszText=(LPWSTR)MEMALLOC(dwBodySize);
+ if (lpwszText)
+ {
+ BASE64DecodeFormated(lpszBody,dwBodySize,lpwszText,dwBodySize,&dwTextSize);
+ plpsText->lpwszData=lpwszText;
+ plpsText->dwSize=dwTextSize;
+ if (pdwFlags)
+ {
+ (*pdwFlags)|=MESSAGE_FLAG_v1p16; // set unocode flag if not exist
+ (*pdwFlags)&=~MESSAGE_FLAG_CP1251; // reset ansi flag if exist
+ }
+ (*plpbBuff)=(LPBYTE)lpwszText;
+ dwRetErrorCode=NO_ERROR;
+ }
+ }
+ }else
+ if (MemoryFind(0,lpszContentTypeLow,dwContentTypeSize,"cp-1251",7))
+ {// charset=CP-1251
+ plpsText->lpszData=lpszBody;
+ plpsText->dwSize=dwBodySize;
+ if (pdwFlags)
+ {
+ (*pdwFlags)&=~MESSAGE_FLAG_v1p16; // reset unocode flag if exist
+ (*pdwFlags)|=MESSAGE_FLAG_CP1251; // set ansi flag
+ }
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ DebugBreak();
+ }
+ }else
+ if (MemoryFind(0,lpszContentTypeLow,dwContentTypeSize,"application/x-mrim-auth-req",27))
+ {// Content-Type: application/x-mrim-auth-req
+ if (plpsText)
+ {
+ plpsText->lpszData=lpszBody;
+ plpsText->dwSize=dwBodySize;
+ }
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ DebugBreak();
+ }
+ }else{
+ DebugBreak();
+ }
+
+ MEMFREE(lpszHeaderLow);
+ }
+ }
+
+return(dwRetErrorCode);
+}
+
+
+DWORD MraOfflineMessageGetMIMEHeadAndBody(LPSTR lpszMessage,SIZE_T dwMessageSize,LPSTR *plpszHeader,SIZE_T *pdwHeaderSize,LPSTR *plpszBody,SIZE_T *pdwBodySize)
+{
+ DWORD dwRetErrorCode=ERROR_NOT_FOUND;
+
+ if (lpszMessage && dwMessageSize)
+ {
+ LPSTR lpszBody;
+ SIZE_T dwBodySize;
+
+ // : RFC CRLFCRLF LFLF MIME ,
+ lpszBody=(LPSTR)MemoryFind(0,lpszMessage,dwMessageSize,CRLFCRLF,(sizeof(CRLFCRLF)-1));
+ if (lpszBody)
+ {
+ lpszBody+=(sizeof(CRLFCRLF)-1);
+ }else{
+ lpszBody=(LPSTR)MemoryFind(0,lpszMessage,dwMessageSize,LFLF,(sizeof(LFLF)-1));
+ if (lpszBody) lpszBody+=(sizeof(LFLF)-1);
+ }
+
+ if (lpszBody)
+ {//
+ dwBodySize=(dwMessageSize-(lpszBody-lpszMessage));
+
+ if (plpszHeader) (*plpszHeader)=lpszMessage;
+ if (pdwHeaderSize) (*pdwHeaderSize)=((lpszBody-(sizeof(LFLF)-1))-lpszMessage);
+ if (plpszBody) (*plpszBody)=lpszBody;
+ if (pdwBodySize) (*pdwBodySize)=dwBodySize;
+
+ dwRetErrorCode=NO_ERROR;
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD MraOfflineMessageGetNextMIMEPart(LPSTR lpszBody,SIZE_T dwBodySize,LPSTR lpszBoundary,SIZE_T dwBoundarySize,LPSTR *plpszCurMIMEPos,LPSTR *plpszMIMEPart,SIZE_T *pdwMIMEPartSize)
+{
+ DWORD dwRetErrorCode=ERROR_NOT_FOUND;
+
+ if (lpszBody && dwBodySize)
+ {
+ LPSTR lpszMIMEPart,lpszCurMIMEPos,lpszTemp;
+ SIZE_T dwMIMEPartSize;
+
+ if (plpszCurMIMEPos) lpszCurMIMEPos=(*plpszCurMIMEPos);
+ lpszMIMEPart=(LPSTR)MemoryFind((lpszCurMIMEPos-lpszBody),lpszBody,dwBodySize,lpszBoundary,dwBoundarySize);
+ if (lpszMIMEPart)
+ {//
+ lpszMIMEPart+=dwBoundarySize;
+
+ // : RFC CRLF LF MIME ,
+ if ((*((WORD*)lpszMIMEPart))==(*((WORD*)CRLF)))
+ {
+ lpszMIMEPart+=(sizeof(CRLF)-1);
+ }else
+ if ((*((BYTE*)lpszMIMEPart))==(*((BYTE*)LF)))
+ {
+ lpszMIMEPart+=(sizeof(LF)-1);
+ }else
+ if ((*((WORD*)lpszMIMEPart))=='--')
+ {
+ lpszMIMEPart=NULL;
+ }else{
+ DebugBreak();
+ }
+
+ if (lpszMIMEPart)
+ {
+ lpszTemp=(LPSTR)MemoryFind((lpszMIMEPart-lpszBody),lpszBody,dwBodySize,lpszBoundary,dwBoundarySize);
+ if (lpszTemp)
+ {//
+ dwMIMEPartSize=(lpszTemp-lpszMIMEPart);// 4=CRLF"--"Boundary / 3=LF"--"Boundary
+ // : RFC CRLF LF MIME ,
+ if ((*((WORD*)(lpszTemp-4)))==(*((WORD*)CRLF)))
+ {
+ dwMIMEPartSize-=4;
+ }else
+ if ((*((BYTE*)(lpszTemp-3)))==(*((BYTE*)LF)))
+ {
+ dwMIMEPartSize-=3;
+ }else{
+ DebugBreak();
+ }
+
+ if (plpszMIMEPart) (*plpszMIMEPart)=lpszMIMEPart;
+ if (pdwMIMEPartSize) (*pdwMIMEPartSize)=dwMIMEPartSize;
+ if (plpszCurMIMEPos) (*plpszCurMIMEPos)=lpszTemp;
+ dwRetErrorCode=NO_ERROR;
+ }
+ }else{
+ dwRetErrorCode=ERROR_NO_MORE_ITEMS;
+ }
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD MraOfflineMessageGetHeaderValue(LPSTR lpszHeader,LPSTR lpszHeaderLow,SIZE_T dwHeaderSize,LPSTR lpszValueName,SIZE_T dwValueNameSize,LPSTR *plpszValue,SIZE_T *pdwValueSize)
+{
+ DWORD dwRetErrorCode=ERROR_NOT_FOUND;
+ LPSTR lpszValue,lpszValueEnd;
+ SIZE_T dwValueSize;
+
+ lpszValue=(LPSTR)MemoryFind(0,lpszHeaderLow,dwHeaderSize,lpszValueName,dwValueNameSize);
+ if (lpszValue)
+ {
+ lpszValue+=dwValueNameSize;
+ lpszValueEnd=(LPSTR)MemoryFind((lpszValue-lpszHeaderLow),lpszHeaderLow,dwHeaderSize,CRLF,(sizeof(CRLF)-1));
+ if (lpszValueEnd==NULL) lpszValueEnd=(LPSTR)MemoryFind((lpszValue-lpszHeaderLow),lpszHeaderLow,dwHeaderSize,LF,(sizeof(LF)-1));
+ if (lpszValueEnd==NULL) lpszValueEnd=(LPSTR)(lpszHeaderLow+dwHeaderSize);
+
+ lpszValue=(LPSTR)MemoryFind((lpszValue-lpszHeaderLow),lpszHeaderLow,(lpszValueEnd-lpszHeaderLow),":",1);
+ if (lpszValue)
+ {
+ lpszValue++;
+ dwValueSize=(lpszValueEnd-lpszValue);
+ SkeepSPWSP((lpszHeader+(lpszValue-lpszHeaderLow)),dwValueSize,plpszValue,pdwValueSize);
+ dwRetErrorCode=NO_ERROR;
+ }
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD MraOfflineMessageGetHeaderValueLow(LPSTR lpszHeaderLow,SIZE_T dwHeaderSize,LPSTR lpszValueName,SIZE_T dwValueNameSize,LPSTR *plpszValue,SIZE_T *pdwValueSize)
+{
+ DWORD dwRetErrorCode=ERROR_NOT_FOUND;
+ LPSTR lpszValue,lpszValueEnd;
+ SIZE_T dwValueSize;
+
+ lpszValue=(LPSTR)MemoryFind(0,lpszHeaderLow,dwHeaderSize,lpszValueName,dwValueNameSize);
+ if (lpszValue)
+ {
+ lpszValue+=dwValueNameSize;
+ lpszValueEnd=(LPSTR)MemoryFind((lpszValue-lpszHeaderLow),lpszHeaderLow,dwHeaderSize,CRLF,(sizeof(CRLF)-1));
+ if (lpszValueEnd==NULL) lpszValueEnd=(LPSTR)MemoryFind((lpszValue-lpszHeaderLow),lpszHeaderLow,dwHeaderSize,LF,(sizeof(LF)-1));
+ if (lpszValueEnd==NULL) lpszValueEnd=(LPSTR)(lpszHeaderLow+dwHeaderSize);
+
+ lpszValue=(LPSTR)MemoryFind((lpszValue-lpszHeaderLow),lpszHeaderLow,(lpszValueEnd-lpszHeaderLow),":",1);
+ if (lpszValue)
+ {
+ lpszValue++;
+ dwValueSize=(lpszValueEnd-lpszValue);
+ SkeepSPWSP(lpszValue,dwValueSize,plpszValue,pdwValueSize);
+ dwRetErrorCode=NO_ERROR;
+ }
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD MraOfflineMessageConvertTime(INTERNET_TIME *pitTime)
+{
+ SYSTEMTIME stTime,stUniversalTime;
+ TIME_ZONE_INFORMATION tziTimeZoneMailRu={0},tziTimeZoneLocal;
+
+ GetTimeZoneInformation(&tziTimeZoneLocal);
+ if (GetTimeZoneInformation(&tziTimeZoneMailRu)==TIME_ZONE_ID_DAYLIGHT) tziTimeZoneMailRu.DaylightBias*=2;
+ tziTimeZoneMailRu.Bias=MAILRU_SERVER_TIME_ZONE;
+
+ //TzSpecificLocalTimeToSystemTime(&tziTimeZoneMailRu,&pitTime->stTime,&stUniversalTime);
+ {// for win 2000 compatible
+ tziTimeZoneMailRu.Bias=-tziTimeZoneMailRu.Bias;
+ tziTimeZoneMailRu.DaylightBias=-tziTimeZoneMailRu.DaylightBias;
+ SystemTimeToTzSpecificLocalTime(&tziTimeZoneMailRu,&pitTime->stTime,&stUniversalTime);
+ }//*/
+ SystemTimeToTzSpecificLocalTime(&tziTimeZoneLocal,&stUniversalTime,&stTime);
+
+return((DWORD)MakeTime32FromLocalSystemTime(&stTime));
+}
diff --git a/protocols/MRA/MraOfflineMsg.h b/protocols/MRA/MraOfflineMsg.h
new file mode 100644
index 0000000000..657a1a0412
--- /dev/null
+++ b/protocols/MRA/MraOfflineMsg.h
@@ -0,0 +1,19 @@
+#if !defined(AFX_MRA_OFFLINEMSG_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
+#define AFX_MRA_OFFLINEMSG_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_
+
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+
+
+
+DWORD MraOfflineMessageGet(MRA_LPS *plpsMsg,DWORD *pdwTime,DWORD *pdwFlags,MRA_LPS *plpsEMail,MRA_LPS *plpsText,MRA_LPS *plpsRTFText,MRA_LPS *plpsMultiChatData,LPBYTE *plpbBuff);
+
+
+
+
+
+#endif // !defined(AFX_MRA_OFFLINEMSG_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/MraPlaces.h b/protocols/MRA/MraPlaces.h
new file mode 100644
index 0000000000..255dd3ac72
--- /dev/null
+++ b/protocols/MRA/MraPlaces.h
@@ -0,0 +1,5959 @@
+#if !defined(AFX_MRA_PLACES_H__INCLUDED_)
+#define AFX_MRA_PLACES_H__INCLUDED_
+
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+#define lpwszOther TEXT("")
+//static LPWSTR lpwszOther=TEXT("");
+
+
+typedef struct
+{
+ WORD dwCountryID;
+ LPWSTR lpszData;
+} MRA_COUNTRY;
+
+
+typedef struct
+{
+ WORD dwCountryID;
+ WORD dwCityID;
+ LPWSTR lpszData;
+} MRA_CITY;
+
+
+
+
+typedef struct
+{
+ WORD dwCountryID;
+ WORD dwCityID;
+ WORD dwPlaceID;
+ LPWSTR lpszData;
+} MRA_PLACE;
+
+
+/* WCHAR szBuff[MAX_FILEPATH];
+
+ DebugPrintCRLFA("static const MRA_COUNTRY mracCountrys[]=\r\n{");
+ for(SIZE_T i=0;mrapPlaces[i].lpszData;i++)
+ {
+ if (mrapPlaces[i].dwCityID==0 && mrapPlaces[i].dwPlaceID==0)
+ {
+ mir_sntprintf(szBuff,SIZEOF(szBuff),L" {%ld, TEXT(\"%s\")},",mrapPlaces[i].dwCountryID,mrapPlaces[i].lpszData);
+ DebugPrintCRLFW(szBuff);
+ }
+ }
+ DebugPrintCRLFA(" {0, NULL}\r\n};");
+
+
+ DebugPrintCRLFA("static const MRA_CITY mracCitys[]=\r\n{");
+ for(SIZE_T i=0;mrapPlaces[i].lpszData;i++)
+ {
+ if (mrapPlaces[i].dwCityID && mrapPlaces[i].dwPlaceID==0)
+ {
+ mir_sntprintf(szBuff,SIZEOF(szBuff),L" {%ld, %ld, TEXT(\"%s\")},",mrapPlaces[i].dwCountryID,mrapPlaces[i].dwCityID,mrapPlaces[i].lpszData);
+ DebugPrintCRLFW(szBuff);
+ }
+ }
+ DebugPrintCRLFA(" {0, NULL}\r\n};");
+
+
+
+static const MRA_PLACE mrapPlaces[]=
+{
+ {24, 0, 0, TEXT("")},
+ {81, 0, 0, TEXT("")},
+ {82, 0, 0, TEXT("")},
+ {97, 0, 0, TEXT("")},
+ {96, 0, 0, TEXT("")},
+ {99, 0, 0, TEXT("")},
+ {100, 0, 0, TEXT("-")},
+ {101, 0, 0, TEXT("")},
+ {102, 0, 0, TEXT("")},
+ {83, 0, 0, TEXT("")},
+ {86, 0, 0, TEXT("")},
+ {95, 0, 0, TEXT("")},
+ {103, 0, 0, TEXT("")},
+ {79, 0, 0, TEXT("")},
+ {85, 0, 0, TEXT("")},
+ {87, 0, 0, TEXT("")},
+ {104, 0, 0, TEXT("")},
+ {84, 0, 0, TEXT("")},
+ {105, 0, 0, TEXT("")},
+ {106, 0, 0, TEXT("")},
+ {107, 0, 0, TEXT("")},
+ {92, 0, 0, TEXT(" ()")},
+ {76, 0, 0, TEXT("")},
+ {3215, 0, 0, TEXT(" (.)")},
+ {29, 0, 0, TEXT(" ()")},
+ {108, 0, 0, TEXT("")},
+ {88, 0, 0, TEXT("")},
+ {109, 0, 0, TEXT("")},
+ {110, 0, 0, TEXT("")},
+ {111, 0, 0, TEXT("")},
+ {112, 0, 0, TEXT("")},
+ {113, 0, 0, TEXT("")},
+ {114, 0, 0, TEXT("")},
+ {115, 0, 0, TEXT("")},
+ {116, 0, 0, TEXT(" ")},
+ {117, 0, 0, TEXT("")},
+ {3216, 0, 0, TEXT(" (.)")},
+ {122, 0, 0, TEXT("")},
+ {89, 0, 0, TEXT("")},
+ {94, 0, 0, TEXT(" ")},
+ {118, 0, 0, TEXT("")},
+ {78, 0, 0, TEXT("")},
+ {91, 0, 0, TEXT("")},
+ {119, 0, 0, TEXT("")},
+ {120, 0, 0, TEXT("")},
+ {132, 0, 0, TEXT("")},
+ {90, 0, 0, TEXT("")},
+ {77, 0, 0, TEXT("")},
+ {93, 0, 0, TEXT("")},
+ {121, 0, 0, TEXT("")},
+ {98, 0, 0, TEXT(" ")},
+ {75, 0, 0, TEXT("")},
+ {123, 0, 0, TEXT("")},
+ {454, 0, 0, TEXT(" ")},
+ {124, 0, 0, TEXT("")},
+ {453, 0, 0, TEXT(" ()")},
+ {126, 0, 0, TEXT("")},
+ {127, 0, 0, TEXT(" ")},
+ {128, 0, 0, TEXT(" ( )")},
+ {129, 0, 0, TEXT("")},
+ {3220, 0, 0, TEXT(" (..)")},
+ {130, 0, 0, TEXT(" ")},
+ {3218, 0, 0, TEXT(" (.)")},
+ {3221, 0, 0, TEXT(" (..)")},
+ {3230, 0, 0, TEXT(" (.)")},
+ {131, 0, 0, TEXT("")},
+ {133, 0, 0, TEXT(" - ")},
+ {3222, 0, 0, TEXT(" (.)")},
+ {125, 0, 0, TEXT("")},
+ {3219, 0, 0, TEXT(". ()")},
+ {134, 0, 0, TEXT(" ")},
+ {3223, 0, 0, TEXT(" (..)")},
+ {135, 0, 0, TEXT("")},
+ {136, 0, 0, TEXT("")},
+ {3224, 0, 0, TEXT(" (.)")},
+ {137, 0, 0, TEXT("")},
+ {3226, 0, 0, TEXT(" ")},
+ {3225, 0, 0, TEXT(" ")},
+ {138, 0, 0, TEXT("")},
+ {139, 0, 0, TEXT("")},
+ {3200, 0, 0, TEXT(" (.)")},
+ {140, 0, 0, TEXT(" ")},
+ {141, 0, 0, TEXT("")},
+ {3202, 0, 0, TEXT(" (.)")},
+ {142, 0, 0, TEXT("")},
+ {143, 0, 0, TEXT("")},
+ {146, 0, 0, TEXT("")},
+ {3203, 0, 0, TEXT(" (.)")},
+ {144, 0, 0, TEXT("")},
+ {145, 0, 0, TEXT("")},
+ {147, 0, 0, TEXT("")},
+ {3204, 0, 0, TEXT(" (.)")},
+ {452, 0, 0, TEXT(" ()")},
+ {149, 0, 0, TEXT("")},
+ {148, 0, 0, TEXT("")},
+ {3205, 0, 0, TEXT(" (.)")},
+ {173, 0, 0, TEXT("")},
+ {150, 0, 0, TEXT("")},
+ {151, 0, 0, TEXT("")},
+ {152, 0, 0, TEXT(" (.)")},
+ {153, 0, 0, TEXT("")},
+ {154, 0, 0, TEXT(" ")},
+ {155, 0, 0, TEXT("")},
+ {156, 0, 0, TEXT("-")},
+ {157, 0, 0, TEXT("")},
+ {3208, 0, 0, TEXT(" (.)")},
+ {158, 0, 0, TEXT("")},
+ {3209, 0, 0, TEXT(" ()")},
+ {3201, 0, 0, TEXT(" ")},
+ {159, 0, 0, TEXT("")},
+ {3207, 0, 0, TEXT(" (.)")},
+ {3211, 0, 0, TEXT(" (.)")},
+ {160, 0, 0, TEXT("")},
+ {161, 0, 0, TEXT("")},
+ {162, 0, 0, TEXT("")},
+ {163, 0, 0, TEXT("")},
+ {164, 0, 0, TEXT("- ")},
+ {165, 0, 0, TEXT("- ")},
+ {166, 0, 0, TEXT("-")},
+ {3210, 0, 0, TEXT("- (.)")},
+ {167, 0, 0, TEXT("")},
+ {168, 0, 0, TEXT(" ")},
+ {169, 0, 0, TEXT("")},
+ {3212, 0, 0, TEXT(" (.)")},
+ {3206, 0, 0, TEXT(" ")},
+ {170, 0, 0, TEXT("")},
+ {171, 0, 0, TEXT("")},
+ {3213, 0, 0, TEXT(". . - (.)")},
+ {172, 0, 0, TEXT("")},
+ {174, 0, 0, TEXT("")},
+ {175, 0, 0, TEXT("")},
+ {176, 0, 0, TEXT("")},
+ {177, 0, 0, TEXT("")},
+ {3228, 0, 0, TEXT(" ")},
+ {178, 0, 0, TEXT("-")},
+ {179, 0, 0, TEXT("")},
+ {180, 0, 0, TEXT("")},
+ {181, 0, 0, TEXT("")},
+ {182, 0, 0, TEXT("")},
+ {183, 0, 0, TEXT("")},
+ {184, 0, 0, TEXT("-")},
+ {185, 0, 0, TEXT("")},
+ {186, 0, 0, TEXT("")},
+ {187, 0, 0, TEXT("")},
+ {3198, 0, 0, TEXT(". ")},
+ {23, 0, 0, TEXT("")},
+ {188, 0, 0, TEXT("-")},
+ {189, 0, 0, TEXT("")},
+ {190, 0, 0, TEXT("")},
+ {191, 0, 0, TEXT("")},
+ {193, 0, 0, TEXT(" ()")},
+ {192, 0, 0, TEXT("")},
+ {194, 0, 0, TEXT("-`")},
+ {195, 0, 0, TEXT("")},
+ {196, 0, 0, TEXT("")},
+ {197, 0, 0, TEXT("")},
+ {198, 0, 0, TEXT("")},
+ {199, 0, 0, TEXT("")},
+ {200, 0, 0, TEXT("")},
+ {3229, 0, 0, TEXT(" (.)")},
+ {201, 0, 0, TEXT("")},
+ {202, 0, 0, TEXT("")},
+ {203, 0, 0, TEXT("")},
+ {204, 0, 0, TEXT("")},
+ {205, 0, 0, TEXT("")},
+ {206, 0, 0, TEXT("")},
+ {207, 0, 0, TEXT("")},
+ {3227, 0, 0, TEXT(" (.)")},
+ {3197, 0, 0, TEXT(" (.)")},
+ {208, 0, 0, TEXT("")},
+ {209, 0, 0, TEXT("- ")},
+ {210, 0, 0, TEXT("")},
+ {3199, 0, 0, TEXT(" (.)")},
+ {211, 0, 0, TEXT("")},
+ {212, 0, 0, TEXT("")},
+ {213, 0, 0, TEXT("")},
+ {214, 0, 0, TEXT("")},
+ {215, 0, 0, TEXT("-")},
+ {216, 0, 0, TEXT("")},
+ {217, 0, 0, TEXT("")},
+ {218, 0, 0, TEXT("")},
+ {219, 0, 0, TEXT("")},
+ {220, 0, 0, TEXT(" ")},
+ {222, 0, 0, TEXT("")},
+ {223, 0, 0, TEXT(" ")},
+ {221, 0, 0, TEXT("")},
+ {224, 0, 0, TEXT("")},
+ {225, 0, 0, TEXT("- ()")},
+ {39, 0, 0, TEXT("")},
+ {40, 0, 0, TEXT("")},
+ {32, 0, 0, TEXT("")},
+ {33, 0, 0, TEXT("")},
+ {340, 0, 0, TEXT("")},
+ {38, 0, 0, TEXT("")},
+ {41, 0, 0, TEXT("")},
+ {42, 0, 0, TEXT(" ")},
+ {43, 0, 0, TEXT("")},
+ {45, 0, 0, TEXT("")},
+ {44, 0, 0, TEXT("")},
+ {46, 0, 0, TEXT("")},
+ {3193, 0, 0, TEXT(" (.)")},
+ {47, 0, 0, TEXT(" (.)")},
+ {48, 0, 0, TEXT("")},
+ {49, 0, 0, TEXT("")},
+ {3194, 0, 0, TEXT(" (.)")},
+ {50, 0, 0, TEXT("")},
+ {51, 0, 0, TEXT("")},
+ {34, 0, 0, TEXT("")},
+ {52, 0, 0, TEXT("")},
+ {53, 0, 0, TEXT("")},
+ {54, 0, 0, TEXT("")},
+ {55, 0, 0, TEXT("")},
+ {56, 0, 0, TEXT("")},
+ {57, 0, 0, TEXT("")},
+ {58, 0, 0, TEXT("")},
+ {59, 0, 0, TEXT("")},
+ {36, 0, 0, TEXT("")},
+ {60, 0, 0, TEXT("")},
+ {61, 0, 0, TEXT("")},
+ {3195, 0, 0, TEXT(" (.)")},
+ {62, 0, 0, TEXT("")},
+ {35, 0, 0, TEXT("")},
+ {63, 0, 0, TEXT("")},
+ {64, 0, 0, TEXT("-")},
+ {74, 0, 0, TEXT(" ")},
+ {65, 0, 0, TEXT("")},
+ {66, 0, 0, TEXT("")},
+ {67, 0, 0, TEXT(" - ()")},
+ {68, 0, 0, TEXT("")},
+ {37, 0, 0, TEXT("")},
+ {69, 0, 0, TEXT("")},
+ {70, 0, 0, TEXT("")},
+ {71, 0, 0, TEXT("")},
+ {72, 0, 0, TEXT("")},
+ {3196, 0, 0, TEXT(" (.)")},
+ {73, 0, 0, TEXT("")},
+ {24, 25, 0, TEXT("")},
+ {24, 226, 0, TEXT("-")},
+ {24, 233, 0, TEXT(" ()")},
+ {24, 232, 0, TEXT(" ")},
+ {24, 235, 0, TEXT(" ")},
+ {24, 227, 0, TEXT(" .")},
+ {24, 229, 0, TEXT(" .")},
+ {24, 231, 0, TEXT(" .")},
+ {24, 234, 0, TEXT(" .")},
+ {24, 228, 0, TEXT(" ")},
+ {24, 230, 0, TEXT(" ")},
+ {24, 236, 0, TEXT(" ")},
+ {24, 237, 0, TEXT("")},
+ {24, 240, 0, TEXT("-")},
+ {24, 241, 0, TEXT("")},
+ {24, 248, 0, TEXT("")},
+ {24, 249, 0, TEXT("")},
+ {24, 251, 0, TEXT("")},
+ {24, 238, 0, TEXT(" .")},
+ {24, 242, 0, TEXT(" .")},
+ {24, 243, 0, TEXT(" .")},
+ {24, 244, 0, TEXT(" .")},
+ {24, 245, 0, TEXT(" .")},
+ {24, 246, 0, TEXT(" .")},
+ {24, 247, 0, TEXT(" .")},
+ {24, 250, 0, TEXT(" .")},
+ {24, 239, 0, TEXT("- ")},
+ {24, 255, 0, TEXT("")},
+ {24, 256, 0, TEXT("")},
+ {24, 252, 0, TEXT(" .")},
+ {24, 253, 0, TEXT(" .")},
+ {24, 254, 0, TEXT(" .")},
+ {24, 257, 0, TEXT(" .")},
+ {24, 258, 0, TEXT(" .")},
+ {24, 260, 0, TEXT(" .")},
+ {24, 261, 0, TEXT(" .")},
+ {24, 259, 0, TEXT(" ")},
+ {24, 265, 0, TEXT("")},
+ {24, 263, 0, TEXT(" ")},
+ {24, 273, 0, TEXT("")},
+ {24, 275, 0, TEXT("")},
+ {24, 264, 0, TEXT(" ")},
+ {24, 268, 0, TEXT(" ")},
+ {24, 266, 0, TEXT(" .")},
+ {24, 267, 0, TEXT(" .")},
+ {24, 269, 0, TEXT(" .")},
+ {24, 270, 0, TEXT(" .")},
+ {24, 272, 0, TEXT(" .")},
+ {24, 276, 0, TEXT(" .")},
+ {24, 262, 0, TEXT(" ")},
+ {24, 271, 0, TEXT(" ")},
+ {24, 274, 0, TEXT("- ")},
+ {24, 277, 0, TEXT(" ")},
+ {24, 278, 0, TEXT(" .")},
+ {24, 279, 0, TEXT(" .")},
+ {24, 280, 0, TEXT(" .")},
+ {24, 282, 0, TEXT(" .")},
+ {24, 281, 0, TEXT("- - ")},
+ {24, 283, 0, TEXT("- ")},
+ {24, 284, 0, TEXT(" .")},
+ {24, 285, 0, TEXT(" .")},
+ {24, 286, 0, TEXT(" .")},
+ {24, 287, 0, TEXT(" .")},
+ {24, 288, 0, TEXT(" .")},
+ {24, 289, 0, TEXT(" .")},
+ {24, 290, 0, TEXT(" .")},
+ {24, 291, 0, TEXT(" .")},
+ {24, 292, 0, TEXT(" .")},
+ {24, 293, 0, TEXT(" .")},
+ {24, 294, 0, TEXT(" .")},
+ {24, 295, 0, TEXT(" .")},
+ {24, 296, 0, TEXT(" .")},
+ {24, 297, 0, TEXT(" .")},
+ {24, 298, 0, TEXT(" .")},
+ {24, 299, 0, TEXT(" .")},
+ {24, 300, 0, TEXT(" .")},
+ {24, 301, 0, TEXT("")},
+ {24, 304, 0, TEXT("")},
+ {24, 305, 0, TEXT("")},
+ {24, 306, 0, TEXT("-")},
+ {24, 307, 0, TEXT("")},
+ {24, 308, 0, TEXT("-")},
+ {24, 311, 0, TEXT(" - ")},
+ {24, 313, 0, TEXT("")},
+ {24, 309, 0, TEXT(" ")},
+ {24, 312, 0, TEXT(" ")},
+ {24, 302, 0, TEXT(" .")},
+ {24, 303, 0, TEXT(" .")},
+ {24, 310, 0, TEXT(" .")},
+ {81, 1055, 0, TEXT("")},
+ {81, 1058, 0, TEXT("")},
+ {81, 1056, 0, TEXT("")},
+ {81, 1057, 0, TEXT("")},
+ {81, 3153, 0, TEXT("")},
+ {81, 2291, 0, lpwszOther},
+ {82, 2932, 0, TEXT("")},
+ {82, 1060, 0, TEXT("")},
+ {82, 3084, 0, TEXT("")},
+ {82, 3011, 0, TEXT("")},
+ {82, 3306, 0, TEXT("")},
+ {82, 1059, 0, TEXT("")},
+ {82, 3145, 0, TEXT("")},
+ {82, 2292, 0, lpwszOther},
+ {97, 1061, 0, TEXT("")},
+ {97, 2293, 0, lpwszOther},
+ {96, 1062, 0, TEXT("")},
+ {96, 2294, 0, lpwszOther},
+ {99, 1063, 0, TEXT("")},
+ {99, 2295, 0, lpwszOther},
+ {100, 1064, 0, TEXT("--")},
+ {100, 2296, 0, lpwszOther},
+ {101, 1065, 0, TEXT("")},
+ {101, 2297, 0, lpwszOther},
+ {102, 1066, 0, TEXT("")},
+ {102, 2298, 0, lpwszOther},
+ {83, 1067, 0, TEXT("")},
+ {83, 3158, 0, TEXT("")},
+ {83, 1068, 0, TEXT("")},
+ {83, 3129, 0, TEXT("")},
+ {83, 1069, 0, TEXT("")},
+ {83, 1070, 0, TEXT("")},
+ {83, 2299, 0, lpwszOther},
+ {86, 3345, 0, TEXT("")},
+ {86, 1071, 0, TEXT("")},
+ {86, 2992, 0, TEXT("")},
+ {86, 3175, 0, TEXT("")},
+ {86, 3363, 0, TEXT("-")},
+ {86, 2884, 0, TEXT("-")},
+ {86, 3243, 0, TEXT("-")},
+ {86, 1074, 0, TEXT("-")},
+ {86, 3348, 0, TEXT("")},
+ {86, 3241, 0, TEXT("")},
+ {86, 1075, 0, TEXT("")},
+ {86, 3350, 0, TEXT("-")},
+ {86, 2982, 0, TEXT("")},
+ {86, 2971, 0, TEXT("-")},
+ {86, 3136, 0, TEXT("")},
+ {86, 1080, 0, TEXT("")},
+ {86, 3303, 0, TEXT("")},
+ {86, 3050, 0, TEXT("")},
+ {86, 3151, 0, TEXT(" ")},
+ {86, 3141, 0, TEXT("")},
+ {86, 3012, 0, TEXT(" ")},
+ {86, 1081, 0, TEXT("")},
+ {86, 1077, 0, TEXT("-")},
+ {86, 1079, 0, TEXT("")},
+ {86, 1078, 0, TEXT("")},
+ {86, 1076, 0, TEXT("")},
+ {86, 2929, 0, TEXT("")},
+ {86, 2928, 0, TEXT("")},
+ {86, 2300, 0, lpwszOther},
+ {95, 3315, 0, TEXT("")},
+ {95, 1082, 0, TEXT("")},
+ {95, 1083, 0, TEXT("")},
+ {95, 3144, 0, TEXT("")},
+ {95, 3025, 0, TEXT("")},
+ {95, 3277, 0, TEXT("")},
+ {95, 1084, 0, TEXT("")},
+ {95, 2301, 0, lpwszOther},
+ {103, 1085, 0, TEXT("")},
+ {103, 2302, 0, lpwszOther},
+ {79, 1086, 0, TEXT("")},
+ {79, 2303, 0, lpwszOther},
+ {85, 1087, 0, TEXT("")},
+ {85, 2304, 0, lpwszOther},
+ {87, 1088, 0, TEXT("")},
+ {87, 2305, 0, lpwszOther},
+ {104, 1089, 0, TEXT("")},
+ {104, 2306, 0, lpwszOther},
+ {84, 1090, 0, TEXT("")},
+ {84, 1091, 0, TEXT("")},
+ {84, 1092, 0, TEXT("-")},
+ {84, 3242, 0, TEXT("")},
+ {84, 1093, 0, TEXT("")},
+ {84, 1094, 0, TEXT(" ()")},
+ {84, 1095, 0, TEXT("")},
+ {84, 3245, 0, TEXT("")},
+ {84, 3083, 0, TEXT("")},
+ {84, 1096, 0, TEXT("")},
+ {84, 1097, 0, TEXT("")},
+ {84, 1098, 0, TEXT("")},
+ {84, 1099, 0, TEXT("")},
+ {84, 2868, 0, TEXT("")},
+ {84, 1100, 0, TEXT("")},
+ {84, 1101, 0, TEXT(" (.-. .)")},
+ {84, 1102, 0, TEXT("")},
+ {84, 1103, 0, TEXT("")},
+ {84, 1104, 0, TEXT("")},
+ {84, 3166, 0, TEXT("")},
+ {84, 1105, 0, TEXT("-")},
+ {84, 2927, 0, TEXT("")},
+ {84, 1106, 0, TEXT("")},
+ {84, 1107, 0, TEXT("")},
+ {84, 1108, 0, TEXT("-")},
+ {84, 1109, 0, TEXT("")},
+ {84, 1110, 0, TEXT("")},
+ {84, 2307, 0, lpwszOther},
+ {105, 1111, 0, TEXT("")},
+ {105, 2308, 0, lpwszOther},
+ {106, 1112, 0, TEXT("")},
+ {106, 2309, 0, lpwszOther},
+ {107, 1113, 0, TEXT("")},
+ {107, 1114, 0, TEXT("")},
+ {107, 1115, 0, TEXT("")},
+ {107, 2954, 0, TEXT("")},
+ {107, 2310, 0, lpwszOther},
+ {92, 1116, 0, TEXT("")},
+ {92, 1117, 0, TEXT("-")},
+ {92, 3027, 0, TEXT("-")},
+ {92, 1118, 0, TEXT("")},
+ {92, 1119, 0, TEXT("")},
+ {92, 1120, 0, TEXT("")},
+ {92, 2933, 0, TEXT("")},
+ {92, 2311, 0, lpwszOther},
+ {76, 3214, 0, TEXT(" ()")},
+ {76, 1121, 0, TEXT("")},
+ {76, 2869, 0, TEXT("")},
+ {76, 3262, 0, TEXT("")},
+ {76, 1122, 0, TEXT("")},
+ {76, 1123, 0, TEXT("")},
+ {76, 1124, 0, TEXT("")},
+ {76, 3043, 0, TEXT("")},
+ {76, 2312, 0, lpwszOther},
+ {29, 1125, 0, TEXT("")},
+ {29, 2313, 0, lpwszOther},
+ {108, 1126, 0, TEXT("")},
+ {108, 3240, 0, TEXT("")},
+ {108, 2314, 0, lpwszOther},
+ {88, 1127, 0, TEXT("-")},
+ {88, 2315, 0, lpwszOther},
+ {109, 1128, 0, TEXT("")},
+ {109, 2316, 0, lpwszOther},
+ {110, 1129, 0, TEXT("")},
+ {110, 2317, 0, lpwszOther},
+ {111, 1130, 0, TEXT("-")},
+ {111, 1131, 0, TEXT("-")},
+ {111, 2318, 0, lpwszOther},
+ {112, 1132, 0, TEXT("")},
+ {112, 2319, 0, lpwszOther},
+ {113, 1133, 0, TEXT("-")},
+ {113, 1134, 0, TEXT("")},
+ {113, 2320, 0, lpwszOther},
+ {114, 1135, 0, TEXT("")},
+ {114, 2321, 0, lpwszOther},
+ {115, 1136, 0, TEXT("")},
+ {115, 2322, 0, lpwszOther},
+ {116, 1137, 0, TEXT("-")},
+ {116, 1138, 0, TEXT("")},
+ {116, 1139, 0, TEXT("")},
+ {116, 2323, 0, lpwszOther},
+ {117, 1140, 0, TEXT("")},
+ {117, 2324, 0, lpwszOther},
+ {122, 1141, 0, TEXT("")},
+ {122, 2325, 0, lpwszOther},
+ {89, 1072, 0, TEXT("")},
+ {89, 1073, 0, TEXT("")},
+ {89, 1142, 0, TEXT("")},
+ {89, 2326, 0, lpwszOther},
+ {94, 3250, 0, TEXT("")},
+ {94, 1143, 0, TEXT("-")},
+ {94, 2327, 0, lpwszOther},
+ {78, 1144, 0, TEXT("")},
+ {78, 2328, 0, lpwszOther},
+ {91, 1145, 0, TEXT("")},
+ {91, 3307, 0, TEXT("")},
+ {91, 3308, 0, TEXT("")},
+ {91, 2329, 0, lpwszOther},
+ {119, 1146, 0, TEXT("")},
+ {119, 1147, 0, TEXT("")},
+ {119, 2330, 0, lpwszOther},
+ {120, 1148, 0, TEXT("")},
+ {120, 2331, 0, lpwszOther},
+ {132, 1149, 0, TEXT("")},
+ {132, 2332, 0, lpwszOther},
+ {90, 1150, 0, TEXT("")},
+ {90, 3079, 0, TEXT("")},
+ {90, 2333, 0, lpwszOther},
+ {77, 1152, 0, TEXT("")},
+ {77, 1153, 0, TEXT("")},
+ {77, 3080, 0, TEXT("")},
+ {77, 1151, 0, TEXT("")},
+ {77, 1154, 0, TEXT("")},
+ {77, 1155, 0, TEXT("")},
+ {77, 2334, 0, lpwszOther},
+ {93, 3362, 0, TEXT("")},
+ {93, 3137, 0, TEXT("")},
+ {93, 3273, 0, TEXT("")},
+ {93, 1156, 0, TEXT("")},
+ {93, 1157, 0, TEXT("")},
+ {93, 3167, 0, TEXT("")},
+ {93, 3347, 0, TEXT("")},
+ {93, 1158, 0, TEXT("")},
+ {93, 1159, 0, TEXT("")},
+ {93, 1160, 0, TEXT("")},
+ {93, 1161, 0, TEXT("")},
+ {93, 1162, 0, TEXT("")},
+ {93, 1163, 0, TEXT("")},
+ {93, 1164, 0, TEXT("")},
+ {93, 2335, 0, lpwszOther},
+ {121, 1165, 0, TEXT("")},
+ {121, 3319, 0, TEXT("")},
+ {121, 2336, 0, lpwszOther},
+ {98, 1166, 0, TEXT("")},
+ {98, 2337, 0, lpwszOther},
+ {75, 3176, 0, TEXT("")},
+ {75, 3339, 0, TEXT("")},
+ {75, 1167, 0, TEXT("")},
+ {75, 1168, 0, TEXT("")},
+ {75, 2338, 0, lpwszOther},
+ {123, 1914, 0, TEXT("")},
+ {123, 2957, 0, TEXT(" ")},
+ {123, 1915, 0, TEXT("")},
+ {123, 3331, 0, TEXT("")},
+ {123, 1916, 0, TEXT("")},
+ {123, 3001, 0, TEXT("")},
+ {123, 1917, 0, TEXT("")},
+ {123, 3217, 0, TEXT("")},
+ {123, 3064, 0, TEXT("")},
+ {123, 3020, 0, TEXT(" ")},
+ {123, 1918, 0, TEXT("")},
+ {123, 3238, 0, TEXT("")},
+ {123, 2339, 0, lpwszOther},
+ {454, 1192, 0, TEXT("-")},
+ {454, 2366, 0, lpwszOther},
+ {124, 1919, 0, TEXT("-")},
+ {124, 2340, 0, lpwszOther},
+ {453, 1193, 0, TEXT("")},
+ {453, 2368, 0, lpwszOther},
+ {126, 1921, 0, TEXT("")},
+ {126, 2342, 0, lpwszOther},
+ {127, 1922, 0, TEXT("")},
+ {127, 2343, 0, lpwszOther},
+ {128, 1923, 0, TEXT("")},
+ {128, 2344, 0, lpwszOther},
+ {129, 1924, 0, TEXT("")},
+ {129, 2345, 0, lpwszOther},
+ {130, 1925, 0, TEXT("")},
+ {130, 1926, 0, TEXT("")},
+ {130, 1928, 0, TEXT("")},
+ {130, 1929, 0, TEXT("")},
+ {130, 3235, 0, TEXT("")},
+ {130, 1927, 0, TEXT("")},
+ {130, 3323, 0, TEXT("")},
+ {130, 2346, 0, lpwszOther},
+ {131, 1930, 0, TEXT("")},
+ {131, 2347, 0, lpwszOther},
+ {133, 1931, 0, TEXT("-")},
+ {133, 2348, 0, lpwszOther},
+ {125, 1920, 0, TEXT("")},
+ {125, 2341, 0, lpwszOther},
+ {134, 1932, 0, TEXT("")},
+ {134, 2349, 0, lpwszOther},
+ {135, 1933, 0, TEXT("")},
+ {135, 2350, 0, lpwszOther},
+ {136, 1934, 0, TEXT("")},
+ {136, 2351, 0, lpwszOther},
+ {137, 1935, 0, TEXT("")},
+ {137, 2352, 0, lpwszOther},
+ {138, 3055, 0, TEXT("")},
+ {138, 3049, 0, TEXT("")},
+ {138, 3330, 0, TEXT("")},
+ {138, 1169, 0, TEXT("")},
+ {138, 3106, 0, TEXT("")},
+ {138, 1170, 0, TEXT("")},
+ {138, 1171, 0, TEXT("")},
+ {138, 1172, 0, TEXT("")},
+ {138, 3365, 0, TEXT("")},
+ {138, 1173, 0, TEXT("")},
+ {138, 3104, 0, TEXT("")},
+ {138, 3366, 0, TEXT("")},
+ {138, 1174, 0, TEXT("")},
+ {138, 2964, 0, TEXT("")},
+ {138, 3113, 0, TEXT("")},
+ {138, 1175, 0, TEXT("")},
+ {138, 2920, 0, TEXT("-")},
+ {138, 2889, 0, TEXT("-")},
+ {138, 1176, 0, TEXT("")},
+ {138, 2903, 0, TEXT(" ")},
+ {138, 1177, 0, TEXT("")},
+ {138, 1178, 0, TEXT("")},
+ {138, 2946, 0, TEXT("")},
+ {138, 1179, 0, TEXT("")},
+ {138, 1180, 0, TEXT("")},
+ {138, 2353, 0, lpwszOther},
+ {139, 407, 0, TEXT("")},
+ {139, 426, 0, TEXT("")},
+ {139, 378, 0, TEXT("")},
+ {139, 412, 0, TEXT("")},
+ {139, 446, 0, TEXT("")},
+ {139, 434, 0, TEXT("")},
+ {139, 416, 0, TEXT("")},
+ {139, 428, 0, TEXT("")},
+ {139, 440, 0, TEXT("")},
+ {139, 352, 0, TEXT("")},
+ {139, 394, 0, TEXT("")},
+ {139, 374, 0, TEXT("")},
+ {139, 448, 0, TEXT("")},
+ {139, 390, 0, TEXT("")},
+ {139, 402, 0, TEXT("")},
+ {139, 396, 0, TEXT(" ")},
+ {139, 370, 0, TEXT("")},
+ {139, 368, 0, TEXT("")},
+ {139, 444, 0, TEXT("")},
+ {139, 388, 0, TEXT("")},
+ {139, 408, 0, TEXT("")},
+ {139, 430, 0, TEXT("")},
+ {139, 358, 0, TEXT("")},
+ {139, 418, 0, TEXT("")},
+ {139, 354, 0, TEXT("")},
+ {139, 376, 0, TEXT("")},
+ {139, 414, 0, TEXT("")},
+ {139, 380, 0, TEXT("")},
+ {139, 372, 0, TEXT("")},
+ {139, 424, 0, TEXT("")},
+ {139, 348, 0, TEXT("")},
+ {139, 392, 0, TEXT("")},
+ {139, 386, 0, TEXT("")},
+ {139, 438, 0, TEXT("")},
+ {139, 362, 0, TEXT("-")},
+ {139, 360, 0, TEXT("-")},
+ {139, 432, 0, TEXT("-")},
+ {139, 350, 0, TEXT("-")},
+ {139, 366, 0, TEXT("")},
+ {139, 420, 0, TEXT("")},
+ {139, 442, 0, TEXT("")},
+ {139, 364, 0, TEXT("")},
+ {139, 450, 0, TEXT("-")},
+ {139, 356, 0, TEXT("-")},
+ {139, 382, 0, TEXT(" ")},
+ {139, 398, 0, TEXT(" ")},
+ {139, 410, 0, TEXT("")},
+ {139, 422, 0, TEXT("")},
+ {139, 406, 0, TEXT(" ")},
+ {139, 404, 0, TEXT("")},
+ {139, 384, 0, TEXT(" ")},
+ {139, 400, 0, TEXT(" ")},
+ {139, 436, 0, TEXT("")},
+ {140, 1238, 0, TEXT("-")},
+ {140, 2442, 0, lpwszOther},
+ {141, 1239, 0, TEXT("-")},
+ {141, 2441, 0, lpwszOther},
+ {142, 1240, 0, TEXT("")},
+ {142, 2440, 0, lpwszOther},
+ {143, 1241, 0, TEXT("")},
+ {143, 2439, 0, lpwszOther},
+ {146, 1242, 0, TEXT("")},
+ {146, 2438, 0, lpwszOther},
+ {144, 1243, 0, TEXT("-")},
+ {144, 2437, 0, lpwszOther},
+ {145, 1244, 0, TEXT("")},
+ {145, 3094, 0, TEXT(" ")},
+ {145, 1245, 0, TEXT("--")},
+ {145, 1246, 0, TEXT("-")},
+ {145, 2436, 0, lpwszOther},
+ {147, 1247, 0, TEXT("")},
+ {147, 2435, 0, lpwszOther},
+ {452, 1190, 0, TEXT("-")},
+ {452, 2364, 0, lpwszOther},
+ {149, 1248, 0, TEXT("--")},
+ {149, 2434, 0, lpwszOther},
+ {148, 1249, 0, TEXT("")},
+ {148, 2433, 0, lpwszOther},
+ {173, 1250, 0, TEXT("")},
+ {173, 2432, 0, lpwszOther},
+ {150, 1251, 0, TEXT("")},
+ {150, 2431, 0, lpwszOther},
+ {151, 1252, 0, TEXT("-")},
+ {151, 2430, 0, lpwszOther},
+ {152, 1253, 0, TEXT("")},
+ {152, 2429, 0, lpwszOther},
+ {153, 1254, 0, TEXT("")},
+ {153, 2428, 0, lpwszOther},
+ {154, 1255, 0, TEXT("-")},
+ {154, 2427, 0, lpwszOther},
+ {155, 1256, 0, TEXT("")},
+ {155, 2426, 0, lpwszOther},
+ {156, 1257, 0, TEXT("-")},
+ {156, 2425, 0, lpwszOther},
+ {157, 1258, 0, TEXT("")},
+ {157, 2424, 0, lpwszOther},
+ {158, 1259, 0, TEXT("")},
+ {158, 1260, 0, TEXT("")},
+ {158, 2423, 0, lpwszOther},
+ {159, 1261, 0, TEXT("")},
+ {159, 2422, 0, lpwszOther},
+ {160, 1262, 0, TEXT("")},
+ {160, 2421, 0, lpwszOther},
+ {161, 1263, 0, TEXT("")},
+ {161, 2420, 0, lpwszOther},
+ {162, 1264, 0, TEXT("")},
+ {162, 2419, 0, lpwszOther},
+ {163, 1265, 0, TEXT("-")},
+ {163, 2418, 0, lpwszOther},
+ {164, 1266, 0, TEXT("")},
+ {164, 2417, 0, lpwszOther},
+ {165, 1267, 0, TEXT("")},
+ {165, 2416, 0, lpwszOther},
+ {166, 1268, 0, TEXT("")},
+ {166, 2415, 0, lpwszOther},
+ {167, 1269, 0, TEXT("")},
+ {167, 2414, 0, lpwszOther},
+ {168, 1270, 0, TEXT("--")},
+ {168, 2413, 0, lpwszOther},
+ {169, 1271, 0, TEXT("")},
+ {169, 2412, 0, lpwszOther},
+ {170, 1272, 0, TEXT("")},
+ {170, 2411, 0, lpwszOther},
+ {171, 1273, 0, TEXT("")},
+ {171, 1274, 0, TEXT("")},
+ {171, 2410, 0, lpwszOther},
+ {172, 1275, 0, TEXT("")},
+ {172, 2409, 0, lpwszOther},
+ {174, 1854, 0, TEXT("")},
+ {174, 2495, 0, lpwszOther},
+ {175, 1855, 0, TEXT("")},
+ {175, 2494, 0, lpwszOther},
+ {176, 1856, 0, TEXT("")},
+ {176, 1857, 0, TEXT("-")},
+ {176, 2493, 0, lpwszOther},
+ {177, 1858, 0, TEXT("")},
+ {177, 2492, 0, lpwszOther},
+ {178, 1859, 0, TEXT("")},
+ {178, 2491, 0, lpwszOther},
+ {179, 1860, 0, TEXT("")},
+ {179, 2490, 0, lpwszOther},
+ {180, 1861, 0, TEXT("")},
+ {180, 2489, 0, lpwszOther},
+ {181, 1862, 0, TEXT("")},
+ {181, 2488, 0, lpwszOther},
+ {182, 1863, 0, TEXT("")},
+ {182, 2487, 0, lpwszOther},
+ {183, 1864, 0, TEXT("")},
+ {183, 2486, 0, lpwszOther},
+ {184, 1865, 0, TEXT("")},
+ {184, 2485, 0, lpwszOther},
+ {185, 1866, 0, TEXT("")},
+ {185, 2484, 0, lpwszOther},
+ {186, 3312, 0, TEXT("")},
+ {186, 1867, 0, TEXT("")},
+ {186, 1868, 0, TEXT("")},
+ {186, 2483, 0, lpwszOther},
+ {187, 1869, 0, TEXT("")},
+ {187, 2482, 0, lpwszOther},
+ {23, 1870, 0, TEXT("")},
+ {23, 2481, 0, lpwszOther},
+ {188, 1871, 0, TEXT("")},
+ {188, 2480, 0, lpwszOther},
+ {189, 1872, 0, TEXT("")},
+ {189, 2479, 0, lpwszOther},
+ {190, 1873, 0, TEXT("")},
+ {190, 2478, 0, lpwszOther},
+ {191, 1874, 0, TEXT("")},
+ {191, 2477, 0, lpwszOther},
+ {193, 1875, 0, TEXT("")},
+ {193, 2476, 0, lpwszOther},
+ {192, 1876, 0, TEXT("")},
+ {192, 2475, 0, lpwszOther},
+ {194, 1877, 0, TEXT("")},
+ {194, 2474, 0, lpwszOther},
+ {195, 1878, 0, TEXT("")},
+ {195, 2473, 0, lpwszOther},
+ {196, 1879, 0, TEXT("")},
+ {196, 2472, 0, lpwszOther},
+ {197, 1880, 0, TEXT("")},
+ {197, 2471, 0, lpwszOther},
+ {198, 1881, 0, TEXT("-")},
+ {198, 2470, 0, lpwszOther},
+ {199, 1882, 0, TEXT("")},
+ {199, 2469, 0, lpwszOther},
+ {200, 1883, 0, TEXT("")},
+ {200, 2468, 0, lpwszOther},
+ {201, 1884, 0, TEXT("")},
+ {201, 2467, 0, lpwszOther},
+ {202, 1885, 0, TEXT("")},
+ {202, 2466, 0, lpwszOther},
+ {203, 1886, 0, TEXT("")},
+ {203, 1887, 0, TEXT("")},
+ {203, 2465, 0, lpwszOther},
+ {204, 1888, 0, TEXT("")},
+ {204, 2464, 0, lpwszOther},
+ {205, 1889, 0, TEXT("")},
+ {205, 2463, 0, lpwszOther},
+ {206, 1890, 0, TEXT("")},
+ {206, 2462, 0, lpwszOther},
+ {207, 1891, 0, TEXT("")},
+ {207, 2461, 0, lpwszOther},
+ {208, 1892, 0, TEXT("")},
+ {208, 2460, 0, lpwszOther},
+ {209, 1893, 0, TEXT("-")},
+ {209, 2459, 0, lpwszOther},
+ {210, 1894, 0, TEXT("")},
+ {210, 2458, 0, lpwszOther},
+ {211, 1895, 0, TEXT("")},
+ {211, 2457, 0, lpwszOther},
+ {212, 1896, 0, TEXT("")},
+ {212, 2456, 0, lpwszOther},
+ {213, 1897, 0, TEXT("")},
+ {213, 2455, 0, lpwszOther},
+ {214, 1898, 0, TEXT("")},
+ {214, 2454, 0, lpwszOther},
+ {215, 1899, 0, TEXT("")},
+ {215, 2453, 0, lpwszOther},
+ {216, 1900, 0, TEXT("--")},
+ {216, 1901, 0, TEXT("")},
+ {216, 2452, 0, lpwszOther},
+ {217, 1902, 0, TEXT("")},
+ {217, 2451, 0, lpwszOther},
+ {218, 1903, 0, TEXT("")},
+ {218, 2450, 0, lpwszOther},
+ {219, 1904, 0, TEXT("")},
+ {219, 2449, 0, lpwszOther},
+ {220, 1905, 0, TEXT("")},
+ {220, 2448, 0, lpwszOther},
+ {222, 1906, 0, TEXT("")},
+ {222, 2447, 0, lpwszOther},
+ {223, 1907, 0, TEXT("")},
+ {223, 2446, 0, lpwszOther},
+ {221, 1908, 0, TEXT("")},
+ {221, 2445, 0, lpwszOther},
+ {224, 1909, 0, TEXT("-")},
+ {224, 2444, 0, lpwszOther},
+ {225, 1910, 0, TEXT("")},
+ {225, 1913, 0, TEXT("")},
+ {225, 1912, 0, TEXT("")},
+ {225, 3033, 0, TEXT("")},
+ {225, 1911, 0, TEXT("")},
+ {225, 2443, 0, lpwszOther},
+ {39, 314, 0, TEXT("")},
+ {39, 315, 0, TEXT(" .")},
+ {39, 316, 0, TEXT(" .")},
+ {39, 317, 0, TEXT(" .")},
+ {39, 318, 0, TEXT(" .")},
+ {39, 319, 0, TEXT(" .")},
+ {39, 320, 0, TEXT(" .")},
+ {39, 321, 0, TEXT(" .")},
+ {39, 322, 0, TEXT("- .")},
+ {39, 323, 0, TEXT(" .")},
+ {39, 324, 0, TEXT(" .")},
+ {39, 325, 0, TEXT("")},
+ {39, 326, 0, TEXT(" .")},
+ {39, 327, 0, TEXT(" .")},
+ {39, 328, 0, TEXT(" .")},
+ {39, 329, 0, TEXT(" .")},
+ {39, 330, 0, TEXT(" .")},
+ {39, 331, 0, TEXT(" .")},
+ {39, 332, 0, TEXT(" .")},
+ {39, 333, 0, TEXT(" .")},
+ {39, 334, 0, TEXT(" .")},
+ {39, 335, 0, TEXT(" .")},
+ {39, 336, 0, TEXT(" .")},
+ {39, 337, 0, TEXT(" .")},
+ {39, 338, 0, TEXT(" .")},
+ {39, 339, 0, TEXT(" .")},
+ {40, 602, 0, TEXT(" ")},
+ {40, 604, 0, TEXT("")},
+ {40, 603, 0, TEXT("")},
+ {40, 608, 0, TEXT("")},
+ {40, 606, 0, TEXT("")},
+ {40, 3099, 0, TEXT("--")},
+ {40, 605, 0, TEXT("")},
+ {40, 3174, 0, TEXT("")},
+ {40, 609, 0, TEXT("")},
+ {40, 607, 0, TEXT("")},
+ {40, 610, 0, TEXT("")},
+ {40, 611, 0, TEXT("")},
+ {40, 2541, 0, lpwszOther},
+ {32, 612, 0, TEXT("")},
+ {32, 2540, 0, lpwszOther},
+ {33, 613, 0, TEXT("--")},
+ {33, 2539, 0, lpwszOther},
+ {340, 341, 0, TEXT("")},
+ {340, 342, 0, TEXT(" .")},
+ {340, 343, 0, TEXT(" .")},
+ {340, 344, 0, TEXT(" .")},
+ {340, 345, 0, TEXT(" .")},
+ {340, 346, 0, TEXT(" .")},
+ {340, 347, 0, TEXT(" .")},
+ {38, 760, 0, TEXT("")},
+ {38, 767, 0, TEXT("")},
+ {38, 762, 0, TEXT("")},
+ {38, 761, 0, TEXT("")},
+ {38, 763, 0, TEXT("")},
+ {38, 769, 0, TEXT("")},
+ {38, 765, 0, TEXT("")},
+ {38, 764, 0, TEXT("")},
+ {38, 3117, 0, TEXT("")},
+ {38, 766, 0, TEXT("")},
+ {38, 768, 0, TEXT("")},
+ {38, 2532, 0, lpwszOther},
+ {41, 3098, 0, TEXT("")},
+ {41, 792, 0, TEXT("")},
+ {41, 770, 0, TEXT("")},
+ {41, 771, 0, TEXT("")},
+ {41, 773, 0, TEXT("")},
+ {41, 776, 0, TEXT("-")},
+ {41, 788, 0, TEXT("")},
+ {41, 789, 0, TEXT("")},
+ {41, 796, 0, TEXT("")},
+ {41, 777, 0, TEXT("")},
+ {41, 781, 0, TEXT("")},
+ {41, 786, 0, TEXT("")},
+ {41, 791, 0, TEXT("")},
+ {41, 793, 0, TEXT("")},
+ {41, 795, 0, TEXT("")},
+ {41, 787, 0, TEXT("")},
+ {41, 790, 0, TEXT("")},
+ {41, 3133, 0, TEXT("")},
+ {41, 794, 0, TEXT("")},
+ {41, 782, 0, TEXT("")},
+ {41, 780, 0, TEXT("")},
+ {41, 779, 0, TEXT("")},
+ {41, 774, 0, TEXT("")},
+ {41, 784, 0, TEXT("")},
+ {41, 772, 0, TEXT("")},
+ {41, 775, 0, TEXT("")},
+ {41, 3116, 0, TEXT("")},
+ {41, 785, 0, TEXT("")},
+ {41, 778, 0, TEXT("")},
+ {41, 783, 0, TEXT("")},
+ {41, 2531, 0, lpwszOther},
+ {42, 797, 0, TEXT("-")},
+ {42, 799, 0, TEXT("")},
+ {42, 798, 0, TEXT("")},
+ {42, 800, 0, TEXT("")},
+ {42, 2530, 0, lpwszOther},
+ {45, 802, 0, TEXT("")},
+ {45, 3075, 0, TEXT("")},
+ {45, 801, 0, TEXT("")},
+ {45, 804, 0, TEXT("")},
+ {45, 803, 0, TEXT("")},
+ {45, 805, 0, TEXT("")},
+ {45, 3168, 0, TEXT("")},
+ {45, 806, 0, TEXT("")},
+ {45, 807, 0, TEXT("")},
+ {45, 808, 0, TEXT("")},
+ {45, 809, 0, TEXT("")},
+ {45, 3131, 0, TEXT("")},
+ {45, 810, 0, TEXT("")},
+ {45, 3342, 0, TEXT("")},
+ {45, 811, 0, TEXT("")},
+ {45, 812, 0, TEXT("")},
+ {45, 813, 0, TEXT("")},
+ {45, 814, 0, TEXT("")},
+ {45, 3089, 0, TEXT("")},
+ {45, 815, 0, TEXT("")},
+ {45, 816, 0, TEXT("")},
+ {45, 817, 0, TEXT("")},
+ {45, 818, 0, TEXT("")},
+ {45, 819, 0, TEXT("")},
+ {45, 820, 0, TEXT("")},
+ {45, 2976, 0, TEXT("")},
+ {45, 2988, 0, TEXT("")},
+ {45, 821, 0, TEXT("")},
+ {45, 3088, 0, TEXT("")},
+ {45, 822, 0, TEXT("")},
+ {45, 823, 0, TEXT("")},
+ {45, 824, 0, TEXT("")},
+ {45, 825, 0, TEXT("")},
+ {45, 3343, 0, TEXT("")},
+ {45, 2867, 0, TEXT("")},
+ {45, 2986, 0, TEXT("-")},
+ {45, 826, 0, TEXT("")},
+ {45, 3063, 0, TEXT("")},
+ {45, 827, 0, TEXT("")},
+ {45, 3140, 0, TEXT("")},
+ {45, 828, 0, TEXT("")},
+ {45, 829, 0, TEXT("")},
+ {45, 830, 0, TEXT("")},
+ {45, 2529, 0, lpwszOther},
+ {44, 831, 0, TEXT("")},
+ {44, 832, 0, TEXT("")},
+ {44, 836, 0, TEXT("")},
+ {44, 835, 0, TEXT("")},
+ {44, 834, 0, TEXT("")},
+ {44, 833, 0, TEXT("")},
+ {44, 2528, 0, lpwszOther},
+ {46, 3007, 0, TEXT("")},
+ {46, 837, 0, TEXT("")},
+ {46, 838, 0, TEXT("-")},
+ {46, 3371, 0, TEXT("")},
+ {46, 839, 0, TEXT("-")},
+ {46, 840, 0, TEXT("")},
+ {46, 841, 0, TEXT("")},
+ {46, 3163, 0, TEXT("")},
+ {46, 842, 0, TEXT("")},
+ {46, 843, 0, TEXT("")},
+ {46, 3015, 0, TEXT("")},
+ {46, 844, 0, TEXT("")},
+ {46, 2921, 0, TEXT("")},
+ {46, 845, 0, TEXT("")},
+ {46, 846, 0, TEXT("")},
+ {46, 847, 0, TEXT("")},
+ {46, 848, 0, TEXT("")},
+ {46, 849, 0, TEXT("")},
+ {46, 3010, 0, TEXT("")},
+ {46, 850, 0, TEXT("")},
+ {46, 851, 0, TEXT("")},
+ {46, 3072, 0, TEXT("")},
+ {46, 852, 0, TEXT("")},
+ {46, 853, 0, TEXT("")},
+ {46, 854, 0, TEXT("")},
+ {46, 855, 0, TEXT("")},
+ {46, 3082, 0, TEXT("")},
+ {46, 3309, 0, TEXT("")},
+ {46, 856, 0, TEXT("")},
+ {46, 857, 0, TEXT("")},
+ {46, 3138, 0, TEXT("")},
+ {46, 858, 0, TEXT("")},
+ {46, 859, 0, TEXT("")},
+ {46, 2872, 0, TEXT("")},
+ {46, 2965, 0, TEXT("")},
+ {46, 3135, 0, TEXT("")},
+ {46, 3156, 0, TEXT("")},
+ {46, 3192, 0, TEXT("")},
+ {46, 860, 0, TEXT("")},
+ {46, 861, 0, TEXT("")},
+ {46, 2864, 0, TEXT("")},
+ {46, 862, 0, TEXT("")},
+ {46, 3009, 0, TEXT("")},
+ {46, 2993, 0, TEXT("")},
+ {46, 863, 0, TEXT("")},
+ {46, 864, 0, TEXT("")},
+ {46, 865, 0, TEXT("")},
+ {46, 866, 0, TEXT("")},
+ {46, 3191, 0, TEXT("")},
+ {46, 2974, 0, TEXT("-")},
+ {46, 3127, 0, TEXT("")},
+ {46, 867, 0, TEXT("")},
+ {46, 868, 0, TEXT("")},
+ {46, 869, 0, TEXT("--")},
+ {46, 3373, 0, TEXT("")},
+ {46, 3313, 0, TEXT("")},
+ {46, 870, 0, TEXT("")},
+ {46, 3045, 0, TEXT("")},
+ {46, 2906, 0, TEXT("")},
+ {46, 2527, 0, lpwszOther},
+ {48, 871, 0, TEXT("")},
+ {48, 873, 0, TEXT("")},
+ {48, 3147, 0, TEXT("")},
+ {48, 872, 0, TEXT("")},
+ {48, 3178, 0, TEXT("")},
+ {48, 2526, 0, lpwszOther},
+ {49, 3006, 0, TEXT("")},
+ {49, 874, 0, TEXT("")},
+ {49, 875, 0, TEXT("")},
+ {49, 3285, 0, TEXT("")},
+ {49, 876, 0, TEXT("")},
+ {49, 3126, 0, TEXT("")},
+ {49, 2525, 0, lpwszOther},
+ {50, 3377, 0, TEXT("")},
+ {50, 3067, 0, TEXT("")},
+ {50, 877, 0, TEXT("")},
+ {50, 3065, 0, TEXT("")},
+ {50, 3066, 0, TEXT("")},
+ {50, 878, 0, TEXT("")},
+ {50, 3069, 0, TEXT("")},
+ {50, 3068, 0, TEXT("")},
+ {50, 2524, 0, lpwszOther},
+ {51, 879, 0, TEXT("")},
+ {51, 2523, 0, lpwszOther},
+ {34, 880, 0, TEXT("")},
+ {34, 3125, 0, TEXT("")},
+ {34, 881, 0, TEXT("")},
+ {34, 890, 0, TEXT("")},
+ {34, 3076, 0, TEXT("")},
+ {34, 882, 0, TEXT("")},
+ {34, 3070, 0, TEXT("")},
+ {34, 888, 0, TEXT("")},
+ {34, 886, 0, TEXT("")},
+ {34, 891, 0, TEXT("-")},
+ {34, 3310, 0, TEXT(" ")},
+ {34, 883, 0, TEXT("")},
+ {34, 884, 0, TEXT("")},
+ {34, 885, 0, TEXT("")},
+ {34, 892, 0, TEXT("")},
+ {34, 3179, 0, TEXT(" ")},
+ {34, 3177, 0, TEXT("-")},
+ {34, 3289, 0, TEXT("---")},
+ {34, 889, 0, TEXT("")},
+ {34, 887, 0, TEXT("")},
+ {34, 893, 0, TEXT("")},
+ {34, 2522, 0, lpwszOther},
+ {52, 3318, 0, TEXT("")},
+ {52, 3278, 0, TEXT("")},
+ {52, 906, 0, TEXT("")},
+ {52, 894, 0, TEXT("")},
+ {52, 895, 0, TEXT("")},
+ {52, 905, 0, TEXT("")},
+ {52, 896, 0, TEXT("")},
+ {52, 897, 0, TEXT("")},
+ {52, 3369, 0, TEXT("")},
+ {52, 3327, 0, TEXT("")},
+ {52, 898, 0, TEXT("")},
+ {52, 899, 0, TEXT("")},
+ {52, 907, 0, TEXT("")},
+ {52, 908, 0, TEXT("")},
+ {52, 900, 0, TEXT("")},
+ {52, 901, 0, TEXT("")},
+ {52, 3368, 0, TEXT("-")},
+ {52, 3384, 0, TEXT("")},
+ {52, 3252, 0, TEXT("")},
+ {52, 902, 0, TEXT("")},
+ {52, 903, 0, TEXT("")},
+ {52, 3130, 0, TEXT("")},
+ {52, 904, 0, TEXT("")},
+ {52, 2521, 0, lpwszOther},
+ {53, 2939, 0, TEXT("")},
+ {53, 3054, 0, TEXT("")},
+ {53, 909, 0, TEXT("")},
+ {53, 2934, 0, TEXT("")},
+ {53, 913, 0, TEXT("")},
+ {53, 2935, 0, TEXT("")},
+ {53, 912, 0, TEXT("")},
+ {53, 2905, 0, TEXT("")},
+ {53, 911, 0, TEXT("")},
+ {53, 2936, 0, TEXT("")},
+ {53, 2937, 0, TEXT("")},
+ {53, 910, 0, TEXT("")},
+ {53, 2520, 0, lpwszOther},
+ {54, 914, 0, TEXT("")},
+ {54, 915, 0, TEXT("")},
+ {54, 916, 0, TEXT("")},
+ {54, 918, 0, TEXT("")},
+ {54, 919, 0, TEXT("")},
+ {54, 3173, 0, TEXT("")},
+ {54, 917, 0, TEXT("")},
+ {54, 2519, 0, lpwszOther},
+ {55, 920, 0, TEXT("")},
+ {55, 2518, 0, lpwszOther},
+ {56, 3376, 0, TEXT("")},
+ {56, 921, 0, TEXT("")},
+ {56, 2517, 0, lpwszOther},
+ {57, 3142, 0, TEXT("")},
+ {57, 922, 0, TEXT("")},
+ {57, 2516, 0, lpwszOther},
+ {58, 923, 0, TEXT("")},
+ {58, 3154, 0, TEXT("")},
+ {58, 924, 0, TEXT("")},
+ {58, 2515, 0, lpwszOther},
+ {59, 925, 0, TEXT("")},
+ {59, 926, 0, TEXT("")},
+ {59, 3234, 0, TEXT("")},
+ {59, 3275, 0, TEXT("")},
+ {59, 927, 0, TEXT("")},
+ {59, 3321, 0, TEXT("")},
+ {59, 928, 0, TEXT("")},
+ {59, 929, 0, TEXT("")},
+ {59, 3281, 0, TEXT("-")},
+ {59, 2514, 0, lpwszOther},
+ {36, 930, 0, TEXT("-")},
+ {36, 2513, 0, lpwszOther},
+ {60, 931, 0, TEXT("")},
+ {60, 933, 0, TEXT("")},
+ {60, 932, 0, TEXT("")},
+ {60, 934, 0, TEXT("")},
+ {60, 935, 0, TEXT("")},
+ {60, 2977, 0, TEXT("")},
+ {60, 3030, 0, TEXT("")},
+ {60, 3091, 0, TEXT("")},
+ {60, 936, 0, TEXT("")},
+ {60, 937, 0, TEXT("")},
+ {60, 3044, 0, TEXT("")},
+ {60, 3380, 0, TEXT("")},
+ {60, 2512, 0, lpwszOther},
+ {61, 3190, 0, TEXT("")},
+ {61, 2857, 0, TEXT("")},
+ {61, 938, 0, TEXT("")},
+ {61, 3355, 0, TEXT("")},
+ {61, 939, 0, TEXT("")},
+ {61, 2511, 0, lpwszOther},
+ {62, 940, 0, TEXT("")},
+ {62, 941, 0, TEXT("")},
+ {62, 3164, 0, TEXT("")},
+ {62, 942, 0, TEXT("")},
+ {62, 943, 0, TEXT("")},
+ {62, 3237, 0, TEXT("")},
+ {62, 3165, 0, TEXT(" ")},
+ {62, 944, 0, TEXT("")},
+ {62, 945, 0, TEXT("")},
+ {62, 3008, 0, TEXT("")},
+ {62, 3150, 0, TEXT("")},
+ {62, 946, 0, TEXT("")},
+ {62, 947, 0, TEXT("")},
+ {62, 948, 0, TEXT("")},
+ {62, 2958, 0, TEXT("")},
+ {62, 2510, 0, lpwszOther},
+ {35, 949, 0, TEXT("")},
+ {35, 950, 0, TEXT("")},
+ {35, 2509, 0, lpwszOther},
+ {63, 952, 0, TEXT("")},
+ {63, 951, 0, TEXT("")},
+ {63, 954, 0, TEXT("")},
+ {63, 955, 0, TEXT("")},
+ {63, 953, 0, TEXT("")},
+ {63, 2508, 0, lpwszOther},
+ {64, 956, 0, TEXT("-")},
+ {64, 2507, 0, lpwszOther},
+ {74, 957, 0, TEXT("")},
+ {74, 960, 0, TEXT("")},
+ {74, 958, 0, TEXT("-")},
+ {74, 959, 0, TEXT("")},
+ {74, 2506, 0, lpwszOther},
+ {65, 961, 0, TEXT("")},
+ {65, 962, 0, TEXT("")},
+ {65, 3101, 0, TEXT("")},
+ {65, 963, 0, TEXT("")},
+ {65, 964, 0, TEXT("")},
+ {65, 965, 0, TEXT("")},
+ {65, 966, 0, TEXT("")},
+ {65, 2505, 0, lpwszOther},
+ {66, 968, 0, TEXT("")},
+ {66, 967, 0, TEXT("")},
+ {66, 969, 0, TEXT("")},
+ {66, 2504, 0, lpwszOther},
+ {67, 970, 0, TEXT("")},
+ {67, 2503, 0, lpwszOther},
+ {68, 2888, 0, TEXT("")},
+ {68, 971, 0, TEXT("")},
+ {68, 979, 0, TEXT("")},
+ {68, 972, 0, TEXT("")},
+ {68, 980, 0, TEXT("")},
+ {68, 973, 0, TEXT("")},
+ {68, 3375, 0, TEXT("")},
+ {68, 3159, 0, TEXT("")},
+ {68, 974, 0, TEXT("")},
+ {68, 975, 0, TEXT("")},
+ {68, 976, 0, TEXT("")},
+ {68, 977, 0, TEXT("")},
+ {68, 978, 0, TEXT("")},
+ {68, 2502, 0, lpwszOther},
+ {37, 996, 0, TEXT("")},
+ {37, 983, 0, TEXT("")},
+ {37, 997, 0, TEXT("")},
+ {37, 984, 0, TEXT("")},
+ {37, 998, 0, TEXT("")},
+ {37, 987, 0, TEXT("")},
+ {37, 988, 0, TEXT("")},
+ {37, 993, 0, TEXT("-")},
+ {37, 3037, 0, TEXT("")},
+ {37, 989, 0, TEXT("")},
+ {37, 985, 0, TEXT("")},
+ {37, 991, 0, TEXT("")},
+ {37, 3161, 0, TEXT("")},
+ {37, 990, 0, TEXT("")},
+ {37, 994, 0, TEXT("")},
+ {37, 995, 0, TEXT("")},
+ {37, 999, 0, TEXT("")},
+ {37, 981, 0, TEXT("")},
+ {37, 3374, 0, TEXT("")},
+ {37, 992, 0, TEXT("")},
+ {37, 982, 0, TEXT("")},
+ {37, 986, 0, TEXT("")},
+ {37, 3314, 0, TEXT("")},
+ {37, 2501, 0, lpwszOther},
+ {69, 1003, 0, TEXT("")},
+ {69, 1000, 0, TEXT("")},
+ {69, 1001, 0, TEXT("")},
+ {69, 1004, 0, TEXT("")},
+ {69, 1002, 0, TEXT("")},
+ {69, 2500, 0, lpwszOther},
+ {70, 1005, 0, TEXT("")},
+ {70, 3291, 0, TEXT("-")},
+ {70, 1007, 0, TEXT("-")},
+ {70, 1008, 0, TEXT("-")},
+ {70, 3019, 0, TEXT("")},
+ {70, 1010, 0, TEXT("")},
+ {70, 1009, 0, TEXT("")},
+ {70, 1015, 0, TEXT("")},
+ {70, 3105, 0, TEXT(" ")},
+ {70, 1006, 0, TEXT("")},
+ {70, 3246, 0, TEXT("")},
+ {70, 1011, 0, TEXT("")},
+ {70, 1012, 0, TEXT("--")},
+ {70, 1014, 0, TEXT("-")},
+ {70, 1013, 0, TEXT("--")},
+ {70, 2499, 0, lpwszOther},
+ {71, 1016, 0, TEXT("")},
+ {71, 1019, 0, TEXT("")},
+ {71, 1017, 0, TEXT("")},
+ {71, 1018, 0, TEXT("")},
+ {71, 1020, 0, TEXT("")},
+ {71, 1021, 0, TEXT("")},
+ {71, 1022, 0, TEXT("")},
+ {71, 3189, 0, TEXT("")},
+ {71, 1023, 0, TEXT("")},
+ {71, 1024, 0, TEXT("")},
+ {71, 1025, 0, TEXT("")},
+ {71, 1026, 0, TEXT("")},
+ {71, 1027, 0, TEXT("")},
+ {71, 1028, 0, TEXT("")},
+ {71, 1029, 0, TEXT("")},
+ {71, 1030, 0, TEXT("")},
+ {71, 2498, 0, lpwszOther},
+ {72, 2883, 0, TEXT("")},
+ {72, 1031, 0, TEXT("")},
+ {72, 1032, 0, TEXT("")},
+ {72, 1037, 0, TEXT("")},
+ {72, 1036, 0, TEXT("")},
+ {72, 1042, 0, TEXT("")},
+ {72, 1033, 0, TEXT("")},
+ {72, 1034, 0, TEXT("")},
+ {72, 1041, 0, TEXT("")},
+ {72, 1039, 0, TEXT("")},
+ {72, 1043, 0, TEXT("")},
+ {72, 1040, 0, TEXT("")},
+ {72, 1038, 0, TEXT("")},
+ {72, 2497, 0, lpwszOther},
+ {73, 3013, 0, TEXT("")},
+ {73, 1044, 0, TEXT("")},
+ {73, 1045, 0, TEXT("-")},
+ {73, 1046, 0, TEXT("")},
+ {73, 1047, 0, TEXT("")},
+ {73, 1048, 0, TEXT("")},
+ {73, 1049, 0, TEXT("")},
+ {73, 1050, 0, TEXT("")},
+ {73, 1051, 0, TEXT("")},
+ {73, 1052, 0, TEXT("")},
+ {73, 1053, 0, TEXT("")},
+ {73, 1054, 0, TEXT("")},
+ {0, 0, 0, NULL}
+};//*/
+
+/*
+static const MRA_COUNTRY mracCountrys[]=
+{
+ {24, TEXT("")},
+ {81, TEXT("")},
+ {82, TEXT("")},
+ {97, TEXT("")},
+ {96, TEXT("")},
+ {99, TEXT("")},
+ {100, TEXT("-")},
+ {101, TEXT("")},
+ {102, TEXT("")},
+ {83, TEXT("")},
+ {86, TEXT("")},
+ {95, TEXT("")},
+ {103, TEXT("")},
+ {79, TEXT("")},
+ {85, TEXT("")},
+ {87, TEXT("")},
+ {104, TEXT("")},
+ {84, TEXT("")},
+ {105, TEXT("")},
+ {106, TEXT("")},
+ {107, TEXT("")},
+ {92, TEXT(" ()")},
+ {76, TEXT("")},
+ {3215, TEXT(" (.)")},
+ {29, TEXT(" ()")},
+ {108, TEXT("")},
+ {88, TEXT("")},
+ {109, TEXT("")},
+ {110, TEXT("")},
+ {111, TEXT("")},
+ {112, TEXT("")},
+ {113, TEXT("")},
+ {114, TEXT("")},
+ {115, TEXT("")},
+ {116, TEXT(" ")},
+ {117, TEXT("")},
+ {3216, TEXT(" (.)")},
+ {122, TEXT("")},
+ {89, TEXT("")},
+ {94, TEXT(" ")},
+ {118, TEXT("")},
+ {78, TEXT("")},
+ {91, TEXT("")},
+ {119, TEXT("")},
+ {120, TEXT("")},
+ {132, TEXT("")},
+ {90, TEXT("")},
+ {77, TEXT("")},
+ {93, TEXT("")},
+ {121, TEXT("")},
+ {98, TEXT(" ")},
+ {75, TEXT("")},
+ {123, TEXT("")},
+ {454, TEXT(" ")},
+ {124, TEXT("")},
+ {453, TEXT(" ()")},
+ {126, TEXT("")},
+ {127, TEXT(" ")},
+ {128, TEXT(" ( )")},
+ {129, TEXT("")},
+ {3220, TEXT(" (..)")},
+ {130, TEXT(" ")},
+ {3218, TEXT(" (.)")},
+ {3221, TEXT(" (..)")},
+ {3230, TEXT(" (.)")},
+ {131, TEXT("")},
+ {133, TEXT(" - ")},
+ {3222, TEXT(" (.)")},
+ {125, TEXT("")},
+ {3219, TEXT(". ()")},
+ {134, TEXT(" ")},
+ {3223, TEXT(" (..)")},
+ {135, TEXT("")},
+ {136, TEXT("")},
+ {3224, TEXT(" (.)")},
+ {137, TEXT("")},
+ {3226, TEXT(" ")},
+ {3225, TEXT(" ")},
+ {138, TEXT("")},
+ {139, TEXT("")},
+ {3200, TEXT(" (.)")},
+ {140, TEXT(" ")},
+ {141, TEXT("")},
+ {3202, TEXT(" (.)")},
+ {142, TEXT("")},
+ {143, TEXT("")},
+ {146, TEXT("")},
+ {3203, TEXT(" (.)")},
+ {144, TEXT("")},
+ {145, TEXT("")},
+ {147, TEXT("")},
+ {3204, TEXT(" (.)")},
+ {452, TEXT(" ()")},
+ {149, TEXT("")},
+ {148, TEXT("")},
+ {3205, TEXT(" (.)")},
+ {173, TEXT("")},
+ {150, TEXT("")},
+ {151, TEXT("")},
+ {152, TEXT(" (.)")},
+ {153, TEXT("")},
+ {154, TEXT(" ")},
+ {155, TEXT("")},
+ {156, TEXT("-")},
+ {157, TEXT("")},
+ {3208, TEXT(" (.)")},
+ {158, TEXT("")},
+ {3209, TEXT(" ()")},
+ {3201, TEXT(" ")},
+ {159, TEXT("")},
+ {3207, TEXT(" (.)")},
+ {3211, TEXT(" (.)")},
+ {160, TEXT("")},
+ {161, TEXT("")},
+ {162, TEXT("")},
+ {163, TEXT("")},
+ {164, TEXT("- ")},
+ {165, TEXT("- ")},
+ {166, TEXT("-")},
+ {3210, TEXT("- (.)")},
+ {167, TEXT("")},
+ {168, TEXT(" ")},
+ {169, TEXT("")},
+ {3212, TEXT(" (.)")},
+ {3206, TEXT(" ")},
+ {170, TEXT("")},
+ {171, TEXT("")},
+ {3213, TEXT(". . - (.)")},
+ {172, TEXT("")},
+ {174, TEXT("")},
+ {175, TEXT("")},
+ {176, TEXT("")},
+ {177, TEXT("")},
+ {3228, TEXT(" ")},
+ {178, TEXT("-")},
+ {179, TEXT("")},
+ {180, TEXT("")},
+ {181, TEXT("")},
+ {182, TEXT("")},
+ {183, TEXT("")},
+ {184, TEXT("-")},
+ {185, TEXT("")},
+ {186, TEXT("")},
+ {187, TEXT("")},
+ {3198, TEXT(". ")},
+ {23, TEXT("")},
+ {188, TEXT("-")},
+ {189, TEXT("")},
+ {190, TEXT("")},
+ {191, TEXT("")},
+ {193, TEXT(" ()")},
+ {192, TEXT("")},
+ {194, TEXT("-`")},
+ {195, TEXT("")},
+ {196, TEXT("")},
+ {197, TEXT("")},
+ {198, TEXT("")},
+ {199, TEXT("")},
+ {200, TEXT("")},
+ {3229, TEXT(" (.)")},
+ {201, TEXT("")},
+ {202, TEXT("")},
+ {203, TEXT("")},
+ {204, TEXT("")},
+ {205, TEXT("")},
+ {206, TEXT("")},
+ {207, TEXT("")},
+ {3227, TEXT(" (.)")},
+ {3197, TEXT(" (.)")},
+ {208, TEXT("")},
+ {209, TEXT("- ")},
+ {210, TEXT("")},
+ {3199, TEXT(" (.)")},
+ {211, TEXT("")},
+ {212, TEXT("")},
+ {213, TEXT("")},
+ {214, TEXT("")},
+ {215, TEXT("-")},
+ {216, TEXT("")},
+ {217, TEXT("")},
+ {218, TEXT("")},
+ {219, TEXT("")},
+ {220, TEXT(" ")},
+ {222, TEXT("")},
+ {223, TEXT(" ")},
+ {221, TEXT("")},
+ {224, TEXT("")},
+ {225, TEXT("- ()")},
+ {39, TEXT("")},
+ {40, TEXT("")},
+ {32, TEXT("")},
+ {33, TEXT("")},
+ {340, TEXT("")},
+ {38, TEXT("")},
+ {41, TEXT("")},
+ {42, TEXT(" ")},
+ {43, TEXT("")},
+ {45, TEXT("")},
+ {44, TEXT("")},
+ {46, TEXT("")},
+ {3193, TEXT(" (.)")},
+ {47, TEXT(" (.)")},
+ {48, TEXT("")},
+ {49, TEXT("")},
+ {3194, TEXT(" (.)")},
+ {50, TEXT("")},
+ {51, TEXT("")},
+ {34, TEXT("")},
+ {52, TEXT("")},
+ {53, TEXT("")},
+ {54, TEXT("")},
+ {55, TEXT("")},
+ {56, TEXT("")},
+ {57, TEXT("")},
+ {58, TEXT("")},
+ {59, TEXT("")},
+ {36, TEXT("")},
+ {60, TEXT("")},
+ {61, TEXT("")},
+ {3195, TEXT(" (.)")},
+ {62, TEXT("")},
+ {35, TEXT("")},
+ {63, TEXT("")},
+ {64, TEXT("-")},
+ {74, TEXT(" ")},
+ {65, TEXT("")},
+ {66, TEXT("")},
+ {67, TEXT(" - ()")},
+ {68, TEXT("")},
+ {37, TEXT("")},
+ {69, TEXT("")},
+ {70, TEXT("")},
+ {71, TEXT("")},
+ {72, TEXT("")},
+ {3196, TEXT(" (.)")},
+ {73, TEXT("")},
+ {0, NULL}
+};
+
+
+
+static const MRA_CITY mracCitys[]=
+{
+ {24, 25, TEXT("")},
+ {24, 226, TEXT("-")},
+ {24, 233, TEXT(" ()")},
+ {24, 232, TEXT(" ")},
+ {24, 235, TEXT(" ")},
+ {24, 227, TEXT(" .")},
+ {24, 229, TEXT(" .")},
+ {24, 231, TEXT(" .")},
+ {24, 234, TEXT(" .")},
+ {24, 228, TEXT(" ")},
+ {24, 230, TEXT(" ")},
+ {24, 236, TEXT(" ")},
+ {24, 237, TEXT("")},
+ {24, 240, TEXT("-")},
+ {24, 241, TEXT("")},
+ {24, 248, TEXT("")},
+ {24, 249, TEXT("")},
+ {24, 251, TEXT("")},
+ {24, 238, TEXT(" .")},
+ {24, 242, TEXT(" .")},
+ {24, 243, TEXT(" .")},
+ {24, 244, TEXT(" .")},
+ {24, 245, TEXT(" .")},
+ {24, 246, TEXT(" .")},
+ {24, 247, TEXT(" .")},
+ {24, 250, TEXT(" .")},
+ {24, 239, TEXT("- ")},
+ {24, 255, TEXT("")},
+ {24, 256, TEXT("")},
+ {24, 252, TEXT(" .")},
+ {24, 253, TEXT(" .")},
+ {24, 254, TEXT(" .")},
+ {24, 257, TEXT(" .")},
+ {24, 258, TEXT(" .")},
+ {24, 260, TEXT(" .")},
+ {24, 261, TEXT(" .")},
+ {24, 259, TEXT(" ")},
+ {24, 265, TEXT("")},
+ {24, 263, TEXT(" ")},
+ {24, 273, TEXT("")},
+ {24, 275, TEXT("")},
+ {24, 264, TEXT(" ")},
+ {24, 268, TEXT(" ")},
+ {24, 266, TEXT(" .")},
+ {24, 267, TEXT(" .")},
+ {24, 269, TEXT(" .")},
+ {24, 270, TEXT(" .")},
+ {24, 272, TEXT(" .")},
+ {24, 276, TEXT(" .")},
+ {24, 262, TEXT(" ")},
+ {24, 271, TEXT(" ")},
+ {24, 274, TEXT("- ")},
+ {24, 277, TEXT(" ")},
+ {24, 278, TEXT(" .")},
+ {24, 279, TEXT(" .")},
+ {24, 280, TEXT(" .")},
+ {24, 282, TEXT(" .")},
+ {24, 281, TEXT("- - ")},
+ {24, 283, TEXT("- ")},
+ {24, 284, TEXT(" .")},
+ {24, 285, TEXT(" .")},
+ {24, 286, TEXT(" .")},
+ {24, 287, TEXT(" .")},
+ {24, 288, TEXT(" .")},
+ {24, 289, TEXT(" .")},
+ {24, 290, TEXT(" .")},
+ {24, 291, TEXT(" .")},
+ {24, 292, TEXT(" .")},
+ {24, 293, TEXT(" .")},
+ {24, 294, TEXT(" .")},
+ {24, 295, TEXT(" .")},
+ {24, 296, TEXT(" .")},
+ {24, 297, TEXT(" .")},
+ {24, 298, TEXT(" .")},
+ {24, 299, TEXT(" .")},
+ {24, 300, TEXT(" .")},
+ {24, 301, TEXT("")},
+ {24, 304, TEXT("")},
+ {24, 305, TEXT("")},
+ {24, 306, TEXT("-")},
+ {24, 307, TEXT("")},
+ {24, 308, TEXT("-")},
+ {24, 311, TEXT(" - ")},
+ {24, 313, TEXT("")},
+ {24, 309, TEXT(" ")},
+ {24, 312, TEXT(" ")},
+ {24, 302, TEXT(" .")},
+ {24, 303, TEXT(" .")},
+ {24, 310, TEXT(" .")},
+ {81, 1055, TEXT("")},
+ {81, 1058, TEXT("")},
+ {81, 1056, TEXT("")},
+ {81, 1057, TEXT("")},
+ {81, 3153, TEXT("")},
+ {81, 2291, lpwszOther},
+ {82, 2932, TEXT("")},
+ {82, 1060, TEXT("")},
+ {82, 3084, TEXT("")},
+ {82, 3011, TEXT("")},
+ {82, 3306, TEXT("")},
+ {82, 1059, TEXT("")},
+ {82, 3145, TEXT("")},
+ {82, 2292, lpwszOther},
+ {97, 1061, TEXT("")},
+ {97, 2293, lpwszOther},
+ {96, 1062, TEXT("")},
+ {96, 2294, lpwszOther},
+ {99, 1063, TEXT("")},
+ {99, 2295, lpwszOther},
+ {100, 1064, TEXT("--")},
+ {100, 2296, lpwszOther},
+ {101, 1065, TEXT("")},
+ {101, 2297, lpwszOther},
+ {102, 1066, TEXT("")},
+ {102, 2298, lpwszOther},
+ {83, 1067, TEXT("")},
+ {83, 3158, TEXT("")},
+ {83, 1068, TEXT("")},
+ {83, 3129, TEXT("")},
+ {83, 1069, TEXT("")},
+ {83, 1070, TEXT("")},
+ {83, 2299, lpwszOther},
+ {86, 3345, TEXT("")},
+ {86, 1071, TEXT("")},
+ {86, 2992, TEXT("")},
+ {86, 3175, TEXT("")},
+ {86, 3363, TEXT("-")},
+ {86, 2884, TEXT("-")},
+ {86, 3243, TEXT("-")},
+ {86, 1074, TEXT("-")},
+ {86, 3348, TEXT("")},
+ {86, 3241, TEXT("")},
+ {86, 1075, TEXT("")},
+ {86, 3350, TEXT("-")},
+ {86, 2982, TEXT("")},
+ {86, 2971, TEXT("-")},
+ {86, 3136, TEXT("")},
+ {86, 1080, TEXT("")},
+ {86, 3303, TEXT("")},
+ {86, 3050, TEXT("")},
+ {86, 3151, TEXT(" ")},
+ {86, 3141, TEXT("")},
+ {86, 3012, TEXT(" ")},
+ {86, 1081, TEXT("")},
+ {86, 1077, TEXT("-")},
+ {86, 1079, TEXT("")},
+ {86, 1078, TEXT("")},
+ {86, 1076, TEXT("")},
+ {86, 2929, TEXT("")},
+ {86, 2928, TEXT("")},
+ {86, 2300, lpwszOther},
+ {95, 3315, TEXT("")},
+ {95, 1082, TEXT("")},
+ {95, 1083, TEXT("")},
+ {95, 3144, TEXT("")},
+ {95, 3025, TEXT("")},
+ {95, 3277, TEXT("")},
+ {95, 1084, TEXT("")},
+ {95, 2301, lpwszOther},
+ {103, 1085, TEXT("")},
+ {103, 2302, lpwszOther},
+ {79, 1086, TEXT("")},
+ {79, 2303, lpwszOther},
+ {85, 1087, TEXT("")},
+ {85, 2304, lpwszOther},
+ {87, 1088, TEXT("")},
+ {87, 2305, lpwszOther},
+ {104, 1089, TEXT("")},
+ {104, 2306, lpwszOther},
+ {84, 1090, TEXT("")},
+ {84, 1091, TEXT("")},
+ {84, 1092, TEXT("-")},
+ {84, 3242, TEXT("")},
+ {84, 1093, TEXT("")},
+ {84, 1094, TEXT(" ()")},
+ {84, 1095, TEXT("")},
+ {84, 3245, TEXT("")},
+ {84, 3083, TEXT("")},
+ {84, 1096, TEXT("")},
+ {84, 1097, TEXT("")},
+ {84, 1098, TEXT("")},
+ {84, 1099, TEXT("")},
+ {84, 2868, TEXT("")},
+ {84, 1100, TEXT("")},
+ {84, 1101, TEXT(" (.-. .)")},
+ {84, 1102, TEXT("")},
+ {84, 1103, TEXT("")},
+ {84, 1104, TEXT("")},
+ {84, 3166, TEXT("")},
+ {84, 1105, TEXT("-")},
+ {84, 2927, TEXT("")},
+ {84, 1106, TEXT("")},
+ {84, 1107, TEXT("")},
+ {84, 1108, TEXT("-")},
+ {84, 1109, TEXT("")},
+ {84, 1110, TEXT("")},
+ {84, 2307, lpwszOther},
+ {105, 1111, TEXT("")},
+ {105, 2308, lpwszOther},
+ {106, 1112, TEXT("")},
+ {106, 2309, lpwszOther},
+ {107, 1113, TEXT("")},
+ {107, 1114, TEXT("")},
+ {107, 1115, TEXT("")},
+ {107, 2954, TEXT("")},
+ {107, 2310, lpwszOther},
+ {92, 1116, TEXT("")},
+ {92, 1117, TEXT("-")},
+ {92, 3027, TEXT("-")},
+ {92, 1118, TEXT("")},
+ {92, 1119, TEXT("")},
+ {92, 1120, TEXT("")},
+ {92, 2933, TEXT("")},
+ {92, 2311, lpwszOther},
+ {76, 3214, TEXT(" ()")},
+ {76, 1121, TEXT("")},
+ {76, 2869, TEXT("")},
+ {76, 3262, TEXT("")},
+ {76, 1122, TEXT("")},
+ {76, 1123, TEXT("")},
+ {76, 1124, TEXT("")},
+ {76, 3043, TEXT("")},
+ {76, 2312, lpwszOther},
+ {29, 1125, TEXT("")},
+ {29, 2313, lpwszOther},
+ {108, 1126, TEXT("")},
+ {108, 3240, TEXT("")},
+ {108, 2314, lpwszOther},
+ {88, 1127, TEXT("-")},
+ {88, 2315, lpwszOther},
+ {109, 1128, TEXT("")},
+ {109, 2316, lpwszOther},
+ {110, 1129, TEXT("")},
+ {110, 2317, lpwszOther},
+ {111, 1130, TEXT("-")},
+ {111, 1131, TEXT("-")},
+ {111, 2318, lpwszOther},
+ {112, 1132, TEXT("")},
+ {112, 2319, lpwszOther},
+ {113, 1133, TEXT("-")},
+ {113, 1134, TEXT("")},
+ {113, 2320, lpwszOther},
+ {114, 1135, TEXT("")},
+ {114, 2321, lpwszOther},
+ {115, 1136, TEXT("")},
+ {115, 2322, lpwszOther},
+ {116, 1137, TEXT("-")},
+ {116, 1138, TEXT("")},
+ {116, 1139, TEXT("")},
+ {116, 2323, lpwszOther},
+ {117, 1140, TEXT("")},
+ {117, 2324, lpwszOther},
+ {122, 1141, TEXT("")},
+ {122, 2325, lpwszOther},
+ {89, 1072, TEXT("")},
+ {89, 1073, TEXT("")},
+ {89, 1142, TEXT("")},
+ {89, 2326, lpwszOther},
+ {94, 3250, TEXT("")},
+ {94, 1143, TEXT("-")},
+ {94, 2327, lpwszOther},
+ {78, 1144, TEXT("")},
+ {78, 2328, lpwszOther},
+ {91, 1145, TEXT("")},
+ {91, 3307, TEXT("")},
+ {91, 3308, TEXT("")},
+ {91, 2329, lpwszOther},
+ {119, 1146, TEXT("")},
+ {119, 1147, TEXT("")},
+ {119, 2330, lpwszOther},
+ {120, 1148, TEXT("")},
+ {120, 2331, lpwszOther},
+ {132, 1149, TEXT("")},
+ {132, 2332, lpwszOther},
+ {90, 1150, TEXT("")},
+ {90, 3079, TEXT("")},
+ {90, 2333, lpwszOther},
+ {77, 1152, TEXT("")},
+ {77, 1153, TEXT("")},
+ {77, 3080, TEXT("")},
+ {77, 1151, TEXT("")},
+ {77, 1154, TEXT("")},
+ {77, 1155, TEXT("")},
+ {77, 2334, lpwszOther},
+ {93, 3362, TEXT("")},
+ {93, 3137, TEXT("")},
+ {93, 3273, TEXT("")},
+ {93, 1156, TEXT("")},
+ {93, 1157, TEXT("")},
+ {93, 3167, TEXT("")},
+ {93, 3347, TEXT("")},
+ {93, 1158, TEXT("")},
+ {93, 1159, TEXT("")},
+ {93, 1160, TEXT("")},
+ {93, 1161, TEXT("")},
+ {93, 1162, TEXT("")},
+ {93, 1163, TEXT("")},
+ {93, 1164, TEXT("")},
+ {93, 2335, lpwszOther},
+ {121, 1165, TEXT("")},
+ {121, 3319, TEXT("")},
+ {121, 2336, lpwszOther},
+ {98, 1166, TEXT("")},
+ {98, 2337, lpwszOther},
+ {75, 3176, TEXT("")},
+ {75, 3339, TEXT("")},
+ {75, 1167, TEXT("")},
+ {75, 1168, TEXT("")},
+ {75, 2338, lpwszOther},
+ {123, 1914, TEXT("")},
+ {123, 2957, TEXT(" ")},
+ {123, 1915, TEXT("")},
+ {123, 3331, TEXT("")},
+ {123, 1916, TEXT("")},
+ {123, 3001, TEXT("")},
+ {123, 1917, TEXT("")},
+ {123, 3217, TEXT("")},
+ {123, 3064, TEXT("")},
+ {123, 3020, TEXT(" ")},
+ {123, 1918, TEXT("")},
+ {123, 3238, TEXT("")},
+ {123, 2339, lpwszOther},
+ {454, 1192, TEXT("-")},
+ {454, 2366, lpwszOther},
+ {124, 1919, TEXT("-")},
+ {124, 2340, lpwszOther},
+ {453, 1193, TEXT("")},
+ {453, 2368, lpwszOther},
+ {126, 1921, TEXT("")},
+ {126, 2342, lpwszOther},
+ {127, 1922, TEXT("")},
+ {127, 2343, lpwszOther},
+ {128, 1923, TEXT("")},
+ {128, 2344, lpwszOther},
+ {129, 1924, TEXT("")},
+ {129, 2345, lpwszOther},
+ {130, 1925, TEXT("")},
+ {130, 1926, TEXT("")},
+ {130, 1928, TEXT("")},
+ {130, 1929, TEXT("")},
+ {130, 3235, TEXT("")},
+ {130, 1927, TEXT("")},
+ {130, 3323, TEXT("")},
+ {130, 2346, lpwszOther},
+ {131, 1930, TEXT("")},
+ {131, 2347, lpwszOther},
+ {133, 1931, TEXT("-")},
+ {133, 2348, lpwszOther},
+ {125, 1920, TEXT("")},
+ {125, 2341, lpwszOther},
+ {134, 1932, TEXT("")},
+ {134, 2349, lpwszOther},
+ {135, 1933, TEXT("")},
+ {135, 2350, lpwszOther},
+ {136, 1934, TEXT("")},
+ {136, 2351, lpwszOther},
+ {137, 1935, TEXT("")},
+ {137, 2352, lpwszOther},
+ {138, 3055, TEXT("")},
+ {138, 3049, TEXT("")},
+ {138, 3330, TEXT("")},
+ {138, 1169, TEXT("")},
+ {138, 3106, TEXT("")},
+ {138, 1170, TEXT("")},
+ {138, 1171, TEXT("")},
+ {138, 1172, TEXT("")},
+ {138, 3365, TEXT("")},
+ {138, 1173, TEXT("")},
+ {138, 3104, TEXT("")},
+ {138, 3366, TEXT("")},
+ {138, 1174, TEXT("")},
+ {138, 2964, TEXT("")},
+ {138, 3113, TEXT("")},
+ {138, 1175, TEXT("")},
+ {138, 2920, TEXT("-")},
+ {138, 2889, TEXT("-")},
+ {138, 1176, TEXT("")},
+ {138, 2903, TEXT(" ")},
+ {138, 1177, TEXT("")},
+ {138, 1178, TEXT("")},
+ {138, 2946, TEXT("")},
+ {138, 1179, TEXT("")},
+ {138, 1180, TEXT("")},
+ {138, 2353, lpwszOther},
+ {139, 407, TEXT("")},
+ {139, 426, TEXT("")},
+ {139, 378, TEXT("")},
+ {139, 412, TEXT("")},
+ {139, 446, TEXT("")},
+ {139, 434, TEXT("")},
+ {139, 416, TEXT("")},
+ {139, 428, TEXT("")},
+ {139, 440, TEXT("")},
+ {139, 352, TEXT("")},
+ {139, 394, TEXT("")},
+ {139, 374, TEXT("")},
+ {139, 448, TEXT("")},
+ {139, 390, TEXT("")},
+ {139, 402, TEXT("")},
+ {139, 396, TEXT(" ")},
+ {139, 370, TEXT("")},
+ {139, 368, TEXT("")},
+ {139, 444, TEXT("")},
+ {139, 388, TEXT("")},
+ {139, 408, TEXT("")},
+ {139, 430, TEXT("")},
+ {139, 358, TEXT("")},
+ {139, 418, TEXT("")},
+ {139, 354, TEXT("")},
+ {139, 376, TEXT("")},
+ {139, 414, TEXT("")},
+ {139, 380, TEXT("")},
+ {139, 372, TEXT("")},
+ {139, 424, TEXT("")},
+ {139, 348, TEXT("")},
+ {139, 392, TEXT("")},
+ {139, 386, TEXT("")},
+ {139, 438, TEXT("")},
+ {139, 362, TEXT("-")},
+ {139, 360, TEXT("-")},
+ {139, 432, TEXT("-")},
+ {139, 350, TEXT("-")},
+ {139, 366, TEXT("")},
+ {139, 420, TEXT("")},
+ {139, 442, TEXT("")},
+ {139, 364, TEXT("")},
+ {139, 450, TEXT("-")},
+ {139, 356, TEXT("-")},
+ {139, 382, TEXT(" ")},
+ {139, 398, TEXT(" ")},
+ {139, 410, TEXT("")},
+ {139, 422, TEXT("")},
+ {139, 406, TEXT(" ")},
+ {139, 404, TEXT("")},
+ {139, 384, TEXT(" ")},
+ {139, 400, TEXT(" ")},
+ {139, 436, TEXT("")},
+ {140, 1238, TEXT("-")},
+ {140, 2442, lpwszOther},
+ {141, 1239, TEXT("-")},
+ {141, 2441, lpwszOther},
+ {142, 1240, TEXT("")},
+ {142, 2440, lpwszOther},
+ {143, 1241, TEXT("")},
+ {143, 2439, lpwszOther},
+ {146, 1242, TEXT("")},
+ {146, 2438, lpwszOther},
+ {144, 1243, TEXT("-")},
+ {144, 2437, lpwszOther},
+ {145, 1244, TEXT("")},
+ {145, 3094, TEXT(" ")},
+ {145, 1245, TEXT("--")},
+ {145, 1246, TEXT("-")},
+ {145, 2436, lpwszOther},
+ {147, 1247, TEXT("")},
+ {147, 2435, lpwszOther},
+ {452, 1190, TEXT("-")},
+ {452, 2364, lpwszOther},
+ {149, 1248, TEXT("--")},
+ {149, 2434, lpwszOther},
+ {148, 1249, TEXT("")},
+ {148, 2433, lpwszOther},
+ {173, 1250, TEXT("")},
+ {173, 2432, lpwszOther},
+ {150, 1251, TEXT("")},
+ {150, 2431, lpwszOther},
+ {151, 1252, TEXT("-")},
+ {151, 2430, lpwszOther},
+ {152, 1253, TEXT("")},
+ {152, 2429, lpwszOther},
+ {153, 1254, TEXT("")},
+ {153, 2428, lpwszOther},
+ {154, 1255, TEXT("-")},
+ {154, 2427, lpwszOther},
+ {155, 1256, TEXT("")},
+ {155, 2426, lpwszOther},
+ {156, 1257, TEXT("-")},
+ {156, 2425, lpwszOther},
+ {157, 1258, TEXT("")},
+ {157, 2424, lpwszOther},
+ {158, 1259, TEXT("")},
+ {158, 1260, TEXT("")},
+ {158, 2423, lpwszOther},
+ {159, 1261, TEXT("")},
+ {159, 2422, lpwszOther},
+ {160, 1262, TEXT("")},
+ {160, 2421, lpwszOther},
+ {161, 1263, TEXT("")},
+ {161, 2420, lpwszOther},
+ {162, 1264, TEXT("")},
+ {162, 2419, lpwszOther},
+ {163, 1265, TEXT("-")},
+ {163, 2418, lpwszOther},
+ {164, 1266, TEXT("")},
+ {164, 2417, lpwszOther},
+ {165, 1267, TEXT("")},
+ {165, 2416, lpwszOther},
+ {166, 1268, TEXT("")},
+ {166, 2415, lpwszOther},
+ {167, 1269, TEXT("")},
+ {167, 2414, lpwszOther},
+ {168, 1270, TEXT("--")},
+ {168, 2413, lpwszOther},
+ {169, 1271, TEXT("")},
+ {169, 2412, lpwszOther},
+ {170, 1272, TEXT("")},
+ {170, 2411, lpwszOther},
+ {171, 1273, TEXT("")},
+ {171, 1274, TEXT("")},
+ {171, 2410, lpwszOther},
+ {172, 1275, TEXT("")},
+ {172, 2409, lpwszOther},
+ {174, 1854, TEXT("")},
+ {174, 2495, lpwszOther},
+ {175, 1855, TEXT("")},
+ {175, 2494, lpwszOther},
+ {176, 1856, TEXT("")},
+ {176, 1857, TEXT("-")},
+ {176, 2493, lpwszOther},
+ {177, 1858, TEXT("")},
+ {177, 2492, lpwszOther},
+ {178, 1859, TEXT("")},
+ {178, 2491, lpwszOther},
+ {179, 1860, TEXT("")},
+ {179, 2490, lpwszOther},
+ {180, 1861, TEXT("")},
+ {180, 2489, lpwszOther},
+ {181, 1862, TEXT("")},
+ {181, 2488, lpwszOther},
+ {182, 1863, TEXT("")},
+ {182, 2487, lpwszOther},
+ {183, 1864, TEXT("")},
+ {183, 2486, lpwszOther},
+ {184, 1865, TEXT("")},
+ {184, 2485, lpwszOther},
+ {185, 1866, TEXT("")},
+ {185, 2484, lpwszOther},
+ {186, 3312, TEXT("")},
+ {186, 1867, TEXT("")},
+ {186, 1868, TEXT("")},
+ {186, 2483, lpwszOther},
+ {187, 1869, TEXT("")},
+ {187, 2482, lpwszOther},
+ {23, 1870, TEXT("")},
+ {23, 2481, lpwszOther},
+ {188, 1871, TEXT("")},
+ {188, 2480, lpwszOther},
+ {189, 1872, TEXT("")},
+ {189, 2479, lpwszOther},
+ {190, 1873, TEXT("")},
+ {190, 2478, lpwszOther},
+ {191, 1874, TEXT("")},
+ {191, 2477, lpwszOther},
+ {193, 1875, TEXT("")},
+ {193, 2476, lpwszOther},
+ {192, 1876, TEXT("")},
+ {192, 2475, lpwszOther},
+ {194, 1877, TEXT("")},
+ {194, 2474, lpwszOther},
+ {195, 1878, TEXT("")},
+ {195, 2473, lpwszOther},
+ {196, 1879, TEXT("")},
+ {196, 2472, lpwszOther},
+ {197, 1880, TEXT("")},
+ {197, 2471, lpwszOther},
+ {198, 1881, TEXT("-")},
+ {198, 2470, lpwszOther},
+ {199, 1882, TEXT("")},
+ {199, 2469, lpwszOther},
+ {200, 1883, TEXT("")},
+ {200, 2468, lpwszOther},
+ {201, 1884, TEXT("")},
+ {201, 2467, lpwszOther},
+ {202, 1885, TEXT("")},
+ {202, 2466, lpwszOther},
+ {203, 1886, TEXT("")},
+ {203, 1887, TEXT("")},
+ {203, 2465, lpwszOther},
+ {204, 1888, TEXT("")},
+ {204, 2464, lpwszOther},
+ {205, 1889, TEXT("")},
+ {205, 2463, lpwszOther},
+ {206, 1890, TEXT("")},
+ {206, 2462, lpwszOther},
+ {207, 1891, TEXT("")},
+ {207, 2461, lpwszOther},
+ {208, 1892, TEXT("")},
+ {208, 2460, lpwszOther},
+ {209, 1893, TEXT("-")},
+ {209, 2459, lpwszOther},
+ {210, 1894, TEXT("")},
+ {210, 2458, lpwszOther},
+ {211, 1895, TEXT("")},
+ {211, 2457, lpwszOther},
+ {212, 1896, TEXT("")},
+ {212, 2456, lpwszOther},
+ {213, 1897, TEXT("")},
+ {213, 2455, lpwszOther},
+ {214, 1898, TEXT("")},
+ {214, 2454, lpwszOther},
+ {215, 1899, TEXT("")},
+ {215, 2453, lpwszOther},
+ {216, 1900, TEXT("--")},
+ {216, 1901, TEXT("")},
+ {216, 2452, lpwszOther},
+ {217, 1902, TEXT("")},
+ {217, 2451, lpwszOther},
+ {218, 1903, TEXT("")},
+ {218, 2450, lpwszOther},
+ {219, 1904, TEXT("")},
+ {219, 2449, lpwszOther},
+ {220, 1905, TEXT("")},
+ {220, 2448, lpwszOther},
+ {222, 1906, TEXT("")},
+ {222, 2447, lpwszOther},
+ {223, 1907, TEXT("")},
+ {223, 2446, lpwszOther},
+ {221, 1908, TEXT("")},
+ {221, 2445, lpwszOther},
+ {224, 1909, TEXT("-")},
+ {224, 2444, lpwszOther},
+ {225, 1910, TEXT("")},
+ {225, 1913, TEXT("")},
+ {225, 1912, TEXT("")},
+ {225, 3033, TEXT("")},
+ {225, 1911, TEXT("")},
+ {225, 2443, lpwszOther},
+ {39, 314, TEXT("")},
+ {39, 315, TEXT(" .")},
+ {39, 316, TEXT(" .")},
+ {39, 317, TEXT(" .")},
+ {39, 318, TEXT(" .")},
+ {39, 319, TEXT(" .")},
+ {39, 320, TEXT(" .")},
+ {39, 321, TEXT(" .")},
+ {39, 322, TEXT("- .")},
+ {39, 323, TEXT(" .")},
+ {39, 324, TEXT(" .")},
+ {39, 325, TEXT("")},
+ {39, 326, TEXT(" .")},
+ {39, 327, TEXT(" .")},
+ {39, 328, TEXT(" .")},
+ {39, 329, TEXT(" .")},
+ {39, 330, TEXT(" .")},
+ {39, 331, TEXT(" .")},
+ {39, 332, TEXT(" .")},
+ {39, 333, TEXT(" .")},
+ {39, 334, TEXT(" .")},
+ {39, 335, TEXT(" .")},
+ {39, 336, TEXT(" .")},
+ {39, 337, TEXT(" .")},
+ {39, 338, TEXT(" .")},
+ {39, 339, TEXT(" .")},
+ {40, 602, TEXT(" ")},
+ {40, 604, TEXT("")},
+ {40, 603, TEXT("")},
+ {40, 608, TEXT("")},
+ {40, 606, TEXT("")},
+ {40, 3099, TEXT("--")},
+ {40, 605, TEXT("")},
+ {40, 3174, TEXT("")},
+ {40, 609, TEXT("")},
+ {40, 607, TEXT("")},
+ {40, 610, TEXT("")},
+ {40, 611, TEXT("")},
+ {40, 2541, lpwszOther},
+ {32, 612, TEXT("")},
+ {32, 2540, lpwszOther},
+ {33, 613, TEXT("--")},
+ {33, 2539, lpwszOther},
+ {340, 341, TEXT("")},
+ {340, 342, TEXT(" .")},
+ {340, 343, TEXT(" .")},
+ {340, 344, TEXT(" .")},
+ {340, 345, TEXT(" .")},
+ {340, 346, TEXT(" .")},
+ {340, 347, TEXT(" .")},
+ {38, 760, TEXT("")},
+ {38, 767, TEXT("")},
+ {38, 762, TEXT("")},
+ {38, 761, TEXT("")},
+ {38, 763, TEXT("")},
+ {38, 769, TEXT("")},
+ {38, 765, TEXT("")},
+ {38, 764, TEXT("")},
+ {38, 3117, TEXT("")},
+ {38, 766, TEXT("")},
+ {38, 768, TEXT("")},
+ {38, 2532, lpwszOther},
+ {41, 3098, TEXT("")},
+ {41, 792, TEXT("")},
+ {41, 770, TEXT("")},
+ {41, 771, TEXT("")},
+ {41, 773, TEXT("")},
+ {41, 776, TEXT("-")},
+ {41, 788, TEXT("")},
+ {41, 789, TEXT("")},
+ {41, 796, TEXT("")},
+ {41, 777, TEXT("")},
+ {41, 781, TEXT("")},
+ {41, 786, TEXT("")},
+ {41, 791, TEXT("")},
+ {41, 793, TEXT("")},
+ {41, 795, TEXT("")},
+ {41, 787, TEXT("")},
+ {41, 790, TEXT("")},
+ {41, 3133, TEXT("")},
+ {41, 794, TEXT("")},
+ {41, 782, TEXT("")},
+ {41, 780, TEXT("")},
+ {41, 779, TEXT("")},
+ {41, 774, TEXT("")},
+ {41, 784, TEXT("")},
+ {41, 772, TEXT("")},
+ {41, 775, TEXT("")},
+ {41, 3116, TEXT("")},
+ {41, 785, TEXT("")},
+ {41, 778, TEXT("")},
+ {41, 783, TEXT("")},
+ {41, 2531, lpwszOther},
+ {42, 797, TEXT("-")},
+ {42, 799, TEXT("")},
+ {42, 798, TEXT("")},
+ {42, 800, TEXT("")},
+ {42, 2530, lpwszOther},
+ {45, 802, TEXT("")},
+ {45, 3075, TEXT("")},
+ {45, 801, TEXT("")},
+ {45, 804, TEXT("")},
+ {45, 803, TEXT("")},
+ {45, 805, TEXT("")},
+ {45, 3168, TEXT("")},
+ {45, 806, TEXT("")},
+ {45, 807, TEXT("")},
+ {45, 808, TEXT("")},
+ {45, 809, TEXT("")},
+ {45, 3131, TEXT("")},
+ {45, 810, TEXT("")},
+ {45, 3342, TEXT("")},
+ {45, 811, TEXT("")},
+ {45, 812, TEXT("")},
+ {45, 813, TEXT("")},
+ {45, 814, TEXT("")},
+ {45, 3089, TEXT("")},
+ {45, 815, TEXT("")},
+ {45, 816, TEXT("")},
+ {45, 817, TEXT("")},
+ {45, 818, TEXT("")},
+ {45, 819, TEXT("")},
+ {45, 820, TEXT("")},
+ {45, 2976, TEXT("")},
+ {45, 2988, TEXT("")},
+ {45, 821, TEXT("")},
+ {45, 3088, TEXT("")},
+ {45, 822, TEXT("")},
+ {45, 823, TEXT("")},
+ {45, 824, TEXT("")},
+ {45, 825, TEXT("")},
+ {45, 3343, TEXT("")},
+ {45, 2867, TEXT("")},
+ {45, 2986, TEXT("-")},
+ {45, 826, TEXT("")},
+ {45, 3063, TEXT("")},
+ {45, 827, TEXT("")},
+ {45, 3140, TEXT("")},
+ {45, 828, TEXT("")},
+ {45, 829, TEXT("")},
+ {45, 830, TEXT("")},
+ {45, 2529, lpwszOther},
+ {44, 831, TEXT("")},
+ {44, 832, TEXT("")},
+ {44, 836, TEXT("")},
+ {44, 835, TEXT("")},
+ {44, 834, TEXT("")},
+ {44, 833, TEXT("")},
+ {44, 2528, lpwszOther},
+ {46, 3007, TEXT("")},
+ {46, 837, TEXT("")},
+ {46, 838, TEXT("-")},
+ {46, 3371, TEXT("")},
+ {46, 839, TEXT("-")},
+ {46, 840, TEXT("")},
+ {46, 841, TEXT("")},
+ {46, 3163, TEXT("")},
+ {46, 842, TEXT("")},
+ {46, 843, TEXT("")},
+ {46, 3015, TEXT("")},
+ {46, 844, TEXT("")},
+ {46, 2921, TEXT("")},
+ {46, 845, TEXT("")},
+ {46, 846, TEXT("")},
+ {46, 847, TEXT("")},
+ {46, 848, TEXT("")},
+ {46, 849, TEXT("")},
+ {46, 3010, TEXT("")},
+ {46, 850, TEXT("")},
+ {46, 851, TEXT("")},
+ {46, 3072, TEXT("")},
+ {46, 852, TEXT("")},
+ {46, 853, TEXT("")},
+ {46, 854, TEXT("")},
+ {46, 855, TEXT("")},
+ {46, 3082, TEXT("")},
+ {46, 3309, TEXT("")},
+ {46, 856, TEXT("")},
+ {46, 857, TEXT("")},
+ {46, 3138, TEXT("")},
+ {46, 858, TEXT("")},
+ {46, 859, TEXT("")},
+ {46, 2872, TEXT("")},
+ {46, 2965, TEXT("")},
+ {46, 3135, TEXT("")},
+ {46, 3156, TEXT("")},
+ {46, 3192, TEXT("")},
+ {46, 860, TEXT("")},
+ {46, 861, TEXT("")},
+ {46, 2864, TEXT("")},
+ {46, 862, TEXT("")},
+ {46, 3009, TEXT("")},
+ {46, 2993, TEXT("")},
+ {46, 863, TEXT("")},
+ {46, 864, TEXT("")},
+ {46, 865, TEXT("")},
+ {46, 866, TEXT("")},
+ {46, 3191, TEXT("")},
+ {46, 2974, TEXT("-")},
+ {46, 3127, TEXT("")},
+ {46, 867, TEXT("")},
+ {46, 868, TEXT("")},
+ {46, 869, TEXT("--")},
+ {46, 3373, TEXT("")},
+ {46, 3313, TEXT("")},
+ {46, 870, TEXT("")},
+ {46, 3045, TEXT("")},
+ {46, 2906, TEXT("")},
+ {46, 2527, lpwszOther},
+ {48, 871, TEXT("")},
+ {48, 873, TEXT("")},
+ {48, 3147, TEXT("")},
+ {48, 872, TEXT("")},
+ {48, 3178, TEXT("")},
+ {48, 2526, lpwszOther},
+ {49, 3006, TEXT("")},
+ {49, 874, TEXT("")},
+ {49, 875, TEXT("")},
+ {49, 3285, TEXT("")},
+ {49, 876, TEXT("")},
+ {49, 3126, TEXT("")},
+ {49, 2525, lpwszOther},
+ {50, 3377, TEXT("")},
+ {50, 3067, TEXT("")},
+ {50, 877, TEXT("")},
+ {50, 3065, TEXT("")},
+ {50, 3066, TEXT("")},
+ {50, 878, TEXT("")},
+ {50, 3069, TEXT("")},
+ {50, 3068, TEXT("")},
+ {50, 2524, lpwszOther},
+ {51, 879, TEXT("")},
+ {51, 2523, lpwszOther},
+ {34, 880, TEXT("")},
+ {34, 3125, TEXT("")},
+ {34, 881, TEXT("")},
+ {34, 890, TEXT("")},
+ {34, 3076, TEXT("")},
+ {34, 882, TEXT("")},
+ {34, 3070, TEXT("")},
+ {34, 888, TEXT("")},
+ {34, 886, TEXT("")},
+ {34, 891, TEXT("-")},
+ {34, 3310, TEXT(" ")},
+ {34, 883, TEXT("")},
+ {34, 884, TEXT("")},
+ {34, 885, TEXT("")},
+ {34, 892, TEXT("")},
+ {34, 3179, TEXT(" ")},
+ {34, 3177, TEXT("-")},
+ {34, 3289, TEXT("---")},
+ {34, 889, TEXT("")},
+ {34, 887, TEXT("")},
+ {34, 893, TEXT("")},
+ {34, 2522, lpwszOther},
+ {52, 3318, TEXT("")},
+ {52, 3278, TEXT("")},
+ {52, 906, TEXT("")},
+ {52, 894, TEXT("")},
+ {52, 895, TEXT("")},
+ {52, 905, TEXT("")},
+ {52, 896, TEXT("")},
+ {52, 897, TEXT("")},
+ {52, 3369, TEXT("")},
+ {52, 3327, TEXT("")},
+ {52, 898, TEXT("")},
+ {52, 899, TEXT("")},
+ {52, 907, TEXT("")},
+ {52, 908, TEXT("")},
+ {52, 900, TEXT("")},
+ {52, 901, TEXT("")},
+ {52, 3368, TEXT("-")},
+ {52, 3384, TEXT("")},
+ {52, 3252, TEXT("")},
+ {52, 902, TEXT("")},
+ {52, 903, TEXT("")},
+ {52, 3130, TEXT("")},
+ {52, 904, TEXT("")},
+ {52, 2521, lpwszOther},
+ {53, 2939, TEXT("")},
+ {53, 3054, TEXT("")},
+ {53, 909, TEXT("")},
+ {53, 2934, TEXT("")},
+ {53, 913, TEXT("")},
+ {53, 2935, TEXT("")},
+ {53, 912, TEXT("")},
+ {53, 2905, TEXT("")},
+ {53, 911, TEXT("")},
+ {53, 2936, TEXT("")},
+ {53, 2937, TEXT("")},
+ {53, 910, TEXT("")},
+ {53, 2520, lpwszOther},
+ {54, 914, TEXT("")},
+ {54, 915, TEXT("")},
+ {54, 916, TEXT("")},
+ {54, 918, TEXT("")},
+ {54, 919, TEXT("")},
+ {54, 3173, TEXT("")},
+ {54, 917, TEXT("")},
+ {54, 2519, lpwszOther},
+ {55, 920, TEXT("")},
+ {55, 2518, lpwszOther},
+ {56, 3376, TEXT("")},
+ {56, 921, TEXT("")},
+ {56, 2517, lpwszOther},
+ {57, 3142, TEXT("")},
+ {57, 922, TEXT("")},
+ {57, 2516, lpwszOther},
+ {58, 923, TEXT("")},
+ {58, 3154, TEXT("")},
+ {58, 924, TEXT("")},
+ {58, 2515, lpwszOther},
+ {59, 925, TEXT("")},
+ {59, 926, TEXT("")},
+ {59, 3234, TEXT("")},
+ {59, 3275, TEXT("")},
+ {59, 927, TEXT("")},
+ {59, 3321, TEXT("")},
+ {59, 928, TEXT("")},
+ {59, 929, TEXT("")},
+ {59, 3281, TEXT("-")},
+ {59, 2514, lpwszOther},
+ {36, 930, TEXT("-")},
+ {36, 2513, lpwszOther},
+ {60, 931, TEXT("")},
+ {60, 933, TEXT("")},
+ {60, 932, TEXT("")},
+ {60, 934, TEXT("")},
+ {60, 935, TEXT("")},
+ {60, 2977, TEXT("")},
+ {60, 3030, TEXT("")},
+ {60, 3091, TEXT("")},
+ {60, 936, TEXT("")},
+ {60, 937, TEXT("")},
+ {60, 3044, TEXT("")},
+ {60, 3380, TEXT("")},
+ {60, 2512, lpwszOther},
+ {61, 3190, TEXT("")},
+ {61, 2857, TEXT("")},
+ {61, 938, TEXT("")},
+ {61, 3355, TEXT("")},
+ {61, 939, TEXT("")},
+ {61, 2511, lpwszOther},
+ {62, 940, TEXT("")},
+ {62, 941, TEXT("")},
+ {62, 3164, TEXT("")},
+ {62, 942, TEXT("")},
+ {62, 943, TEXT("")},
+ {62, 3237, TEXT("")},
+ {62, 3165, TEXT(" ")},
+ {62, 944, TEXT("")},
+ {62, 945, TEXT("")},
+ {62, 3008, TEXT("")},
+ {62, 3150, TEXT("")},
+ {62, 946, TEXT("")},
+ {62, 947, TEXT("")},
+ {62, 948, TEXT("")},
+ {62, 2958, TEXT("")},
+ {62, 2510, lpwszOther},
+ {35, 949, TEXT("")},
+ {35, 950, TEXT("")},
+ {35, 2509, lpwszOther},
+ {63, 952, TEXT("")},
+ {63, 951, TEXT("")},
+ {63, 954, TEXT("")},
+ {63, 955, TEXT("")},
+ {63, 953, TEXT("")},
+ {63, 2508, lpwszOther},
+ {64, 956, TEXT("-")},
+ {64, 2507, lpwszOther},
+ {74, 957, TEXT("")},
+ {74, 960, TEXT("")},
+ {74, 958, TEXT("-")},
+ {74, 959, TEXT("")},
+ {74, 2506, lpwszOther},
+ {65, 961, TEXT("")},
+ {65, 962, TEXT("")},
+ {65, 3101, TEXT("")},
+ {65, 963, TEXT("")},
+ {65, 964, TEXT("")},
+ {65, 965, TEXT("")},
+ {65, 966, TEXT("")},
+ {65, 2505, lpwszOther},
+ {66, 968, TEXT("")},
+ {66, 967, TEXT("")},
+ {66, 969, TEXT("")},
+ {66, 2504, lpwszOther},
+ {67, 970, TEXT("")},
+ {67, 2503, lpwszOther},
+ {68, 2888, TEXT("")},
+ {68, 971, TEXT("")},
+ {68, 979, TEXT("")},
+ {68, 972, TEXT("")},
+ {68, 980, TEXT("")},
+ {68, 973, TEXT("")},
+ {68, 3375, TEXT("")},
+ {68, 3159, TEXT("")},
+ {68, 974, TEXT("")},
+ {68, 975, TEXT("")},
+ {68, 976, TEXT("")},
+ {68, 977, TEXT("")},
+ {68, 978, TEXT("")},
+ {68, 2502, lpwszOther},
+ {37, 996, TEXT("")},
+ {37, 983, TEXT("")},
+ {37, 997, TEXT("")},
+ {37, 984, TEXT("")},
+ {37, 998, TEXT("")},
+ {37, 987, TEXT("")},
+ {37, 988, TEXT("")},
+ {37, 993, TEXT("-")},
+ {37, 3037, TEXT("")},
+ {37, 989, TEXT("")},
+ {37, 985, TEXT("")},
+ {37, 991, TEXT("")},
+ {37, 3161, TEXT("")},
+ {37, 990, TEXT("")},
+ {37, 994, TEXT("")},
+ {37, 995, TEXT("")},
+ {37, 999, TEXT("")},
+ {37, 981, TEXT("")},
+ {37, 3374, TEXT("")},
+ {37, 992, TEXT("")},
+ {37, 982, TEXT("")},
+ {37, 986, TEXT("")},
+ {37, 3314, TEXT("")},
+ {37, 2501, lpwszOther},
+ {69, 1003, TEXT("")},
+ {69, 1000, TEXT("")},
+ {69, 1001, TEXT("")},
+ {69, 1004, TEXT("")},
+ {69, 1002, TEXT("")},
+ {69, 2500, lpwszOther},
+ {70, 1005, TEXT("")},
+ {70, 3291, TEXT("-")},
+ {70, 1007, TEXT("-")},
+ {70, 1008, TEXT("-")},
+ {70, 3019, TEXT("")},
+ {70, 1010, TEXT("")},
+ {70, 1009, TEXT("")},
+ {70, 1015, TEXT("")},
+ {70, 3105, TEXT(" ")},
+ {70, 1006, TEXT("")},
+ {70, 3246, TEXT("")},
+ {70, 1011, TEXT("")},
+ {70, 1012, TEXT("--")},
+ {70, 1014, TEXT("-")},
+ {70, 1013, TEXT("--")},
+ {70, 2499, lpwszOther},
+ {71, 1016, TEXT("")},
+ {71, 1019, TEXT("")},
+ {71, 1017, TEXT("")},
+ {71, 1018, TEXT("")},
+ {71, 1020, TEXT("")},
+ {71, 1021, TEXT("")},
+ {71, 1022, TEXT("")},
+ {71, 3189, TEXT("")},
+ {71, 1023, TEXT("")},
+ {71, 1024, TEXT("")},
+ {71, 1025, TEXT("")},
+ {71, 1026, TEXT("")},
+ {71, 1027, TEXT("")},
+ {71, 1028, TEXT("")},
+ {71, 1029, TEXT("")},
+ {71, 1030, TEXT("")},
+ {71, 2498, lpwszOther},
+ {72, 2883, TEXT("")},
+ {72, 1031, TEXT("")},
+ {72, 1032, TEXT("")},
+ {72, 1037, TEXT("")},
+ {72, 1036, TEXT("")},
+ {72, 1042, TEXT("")},
+ {72, 1033, TEXT("")},
+ {72, 1034, TEXT("")},
+ {72, 1041, TEXT("")},
+ {72, 1039, TEXT("")},
+ {72, 1043, TEXT("")},
+ {72, 1040, TEXT("")},
+ {72, 1038, TEXT("")},
+ {72, 2497, lpwszOther},
+ {73, 3013, TEXT("")},
+ {73, 1044, TEXT("")},
+ {73, 1045, TEXT("-")},
+ {73, 1046, TEXT("")},
+ {73, 1047, TEXT("")},
+ {73, 1048, TEXT("")},
+ {73, 1049, TEXT("")},
+ {73, 1050, TEXT("")},
+ {73, 1051, TEXT("")},
+ {73, 1052, TEXT("")},
+ {73, 1053, TEXT("")},
+ {73, 1054, TEXT("")},
+ {0, NULL}
+};//*/
+
+
+
+
+
+
+static const MRA_PLACE mrapPlaces[]=
+{
+ {24, 0, 0, L""},
+ {81, 0, 0, L""},
+ {82, 0, 0, L""},
+ {97, 0, 0, L""},
+ {96, 0, 0, L""},
+ {99, 0, 0, L""},
+ {100, 0, 0, L"-"},
+ {101, 0, 0, L""},
+ {102, 0, 0, L""},
+ {83, 0, 0, L""},
+ {86, 0, 0, L""},
+ {95, 0, 0, L""},
+ {103, 0, 0, L""},
+ {79, 0, 0, L""},
+ {85, 0, 0, L""},
+ {87, 0, 0, L""},
+ {104, 0, 0, L""},
+ {84, 0, 0, L""},
+ {105, 0, 0, L""},
+ {106, 0, 0, L""},
+ {107, 0, 0, L""},
+ {92, 0, 0, L" ()"},
+ {76, 0, 0, L""},
+ {3215, 0, 0, L" (.)"},
+ {29, 0, 0, L" ()"},
+ {108, 0, 0, L""},
+ {88, 0, 0, L""},
+ {109, 0, 0, L""},
+ {110, 0, 0, L""},
+ {111, 0, 0, L""},
+ {112, 0, 0, L""},
+ {113, 0, 0, L""},
+ {114, 0, 0, L""},
+ {115, 0, 0, L""},
+ {116, 0, 0, L" "},
+ {117, 0, 0, L""},
+ {3216, 0, 0, L" (.)"},
+ {122, 0, 0, L""},
+ {89, 0, 0, L""},
+ {94, 0, 0, L" "},
+ {118, 0, 0, L""},
+ {78, 0, 0, L""},
+ {91, 0, 0, L""},
+ {119, 0, 0, L""},
+ {120, 0, 0, L""},
+ {132, 0, 0, L""},
+ {90, 0, 0, L""},
+ {77, 0, 0, L""},
+ {93, 0, 0, L""},
+ {121, 0, 0, L""},
+ {98, 0, 0, L" "},
+ {75, 0, 0, L""},
+ {123, 0, 0, L""},
+ {454, 0, 0, L" "},
+ {124, 0, 0, L""},
+ {453, 0, 0, L" ()"},
+ {126, 0, 0, L""},
+ {127, 0, 0, L" "},
+ {128, 0, 0, L" ( )"},
+ {129, 0, 0, L""},
+ {3220, 0, 0, L" (..)"},
+ {130, 0, 0, L" "},
+ {3218, 0, 0, L" (.)"},
+ {3221, 0, 0, L" (..)"},
+ {3230, 0, 0, L" (.)"},
+ {131, 0, 0, L""},
+ {133, 0, 0, L" - "},
+ {3222, 0, 0, L" (.)"},
+ {125, 0, 0, L""},
+ {3219, 0, 0, L". ()"},
+ {134, 0, 0, L" "},
+ {3223, 0, 0, L" (..)"},
+ {135, 0, 0, L""},
+ {136, 0, 0, L""},
+ {3224, 0, 0, L" (.)"},
+ {137, 0, 0, L""},
+ {3226, 0, 0, L" "},
+ {3225, 0, 0, L" "},
+ {138, 0, 0, L""},
+ {139, 0, 0, L""},
+ {3200, 0, 0, L" (.)"},
+ {140, 0, 0, L" "},
+ {141, 0, 0, L""},
+ {3202, 0, 0, L" (.)"},
+ {142, 0, 0, L""},
+ {143, 0, 0, L""},
+ {146, 0, 0, L""},
+ {3203, 0, 0, L" (.)"},
+ {144, 0, 0, L""},
+ {145, 0, 0, L""},
+ {147, 0, 0, L""},
+ {3204, 0, 0, L" (.)"},
+ {452, 0, 0, L" ()"},
+ {149, 0, 0, L""},
+ {148, 0, 0, L""},
+ {3205, 0, 0, L" (.)"},
+ {173, 0, 0, L""},
+ {150, 0, 0, L""},
+ {151, 0, 0, L""},
+ {152, 0, 0, L" (.)"},
+ {153, 0, 0, L""},
+ {154, 0, 0, L" "},
+ {155, 0, 0, L""},
+ {156, 0, 0, L"-"},
+ {157, 0, 0, L""},
+ {3208, 0, 0, L" (.)"},
+ {158, 0, 0, L""},
+ {3209, 0, 0, L" ()"},
+ {3201, 0, 0, L" "},
+ {159, 0, 0, L""},
+ {3207, 0, 0, L" (.)"},
+ {3211, 0, 0, L" (.)"},
+ {160, 0, 0, L""},
+ {161, 0, 0, L""},
+ {162, 0, 0, L""},
+ {163, 0, 0, L""},
+ {164, 0, 0, L"- "},
+ {165, 0, 0, L"- "},
+ {166, 0, 0, L"-"},
+ {3210, 0, 0, L"- (.)"},
+ {167, 0, 0, L""},
+ {168, 0, 0, L" "},
+ {169, 0, 0, L""},
+ {3212, 0, 0, L" (.)"},
+ {3206, 0, 0, L" "},
+ {170, 0, 0, L""},
+ {171, 0, 0, L""},
+ {3213, 0, 0, L". . - (.)"},
+ {172, 0, 0, L""},
+ {174, 0, 0, L""},
+ {175, 0, 0, L""},
+ {176, 0, 0, L""},
+ {177, 0, 0, L""},
+ {3228, 0, 0, L" "},
+ {178, 0, 0, L"-"},
+ {179, 0, 0, L""},
+ {180, 0, 0, L""},
+ {181, 0, 0, L""},
+ {182, 0, 0, L""},
+ {183, 0, 0, L""},
+ {184, 0, 0, L"-"},
+ {185, 0, 0, L""},
+ {186, 0, 0, L""},
+ {187, 0, 0, L""},
+ {3198, 0, 0, L". "},
+ {23, 0, 0, L""},
+ {188, 0, 0, L"-"},
+ {189, 0, 0, L""},
+ {190, 0, 0, L""},
+ {191, 0, 0, L""},
+ {193, 0, 0, L" ()"},
+ {192, 0, 0, L""},
+ {194, 0, 0, L"-`"},
+ {195, 0, 0, L""},
+ {196, 0, 0, L""},
+ {197, 0, 0, L""},
+ {198, 0, 0, L""},
+ {199, 0, 0, L""},
+ {200, 0, 0, L""},
+ {3229, 0, 0, L" (.)"},
+ {201, 0, 0, L""},
+ {202, 0, 0, L""},
+ {203, 0, 0, L""},
+ {204, 0, 0, L""},
+ {205, 0, 0, L""},
+ {206, 0, 0, L""},
+ {207, 0, 0, L""},
+ {3227, 0, 0, L" (.)"},
+ {3197, 0, 0, L" (.)"},
+ {208, 0, 0, L""},
+ {209, 0, 0, L"- "},
+ {210, 0, 0, L""},
+ {3199, 0, 0, L" (.)"},
+ {211, 0, 0, L""},
+ {212, 0, 0, L""},
+ {213, 0, 0, L""},
+ {214, 0, 0, L""},
+ {215, 0, 0, L"-"},
+ {216, 0, 0, L""},
+ {217, 0, 0, L""},
+ {218, 0, 0, L""},
+ {219, 0, 0, L""},
+ {220, 0, 0, L" "},
+ {222, 0, 0, L""},
+ {223, 0, 0, L" "},
+ {221, 0, 0, L""},
+ {224, 0, 0, L""},
+ {225, 0, 0, L"- ()"},
+ {39, 0, 0, L""},
+ {40, 0, 0, L""},
+ {32, 0, 0, L""},
+ {33, 0, 0, L""},
+ {340, 0, 0, L""},
+ {38, 0, 0, L""},
+ {41, 0, 0, L""},
+ {42, 0, 0, L" "},
+ {43, 0, 0, L""},
+ {45, 0, 0, L""},
+ {44, 0, 0, L""},
+ {46, 0, 0, L""},
+ {3193, 0, 0, L" (.)"},
+ {47, 0, 0, L" (.)"},
+ {48, 0, 0, L""},
+ {49, 0, 0, L""},
+ {3194, 0, 0, L" (.)"},
+ {50, 0, 0, L""},
+ {51, 0, 0, L""},
+ {34, 0, 0, L""},
+ {52, 0, 0, L""},
+ {53, 0, 0, L""},
+ {54, 0, 0, L""},
+ {55, 0, 0, L""},
+ {56, 0, 0, L""},
+ {57, 0, 0, L""},
+ {58, 0, 0, L""},
+ {59, 0, 0, L""},
+ {36, 0, 0, L""},
+ {60, 0, 0, L""},
+ {61, 0, 0, L""},
+ {3195, 0, 0, L" (.)"},
+ {62, 0, 0, L""},
+ {35, 0, 0, L""},
+ {63, 0, 0, L""},
+ {64, 0, 0, L"-"},
+ {74, 0, 0, L" "},
+ {65, 0, 0, L""},
+ {66, 0, 0, L""},
+ {67, 0, 0, L" - ()"},
+ {68, 0, 0, L""},
+ {37, 0, 0, L""},
+ {69, 0, 0, L""},
+ {70, 0, 0, L""},
+ {71, 0, 0, L""},
+ {72, 0, 0, L""},
+ {3196, 0, 0, L" (.)"},
+ {73, 0, 0, L""},
+ {24, 25, 0, L""},
+ {24, 226, 0, L"-"},
+ {24, 233, 0, L" ()"},
+ {24, 232, 0, L" "},
+ {24, 235, 0, L" "},
+ {24, 227, 0, L" ."},
+ {24, 229, 0, L" ."},
+ {24, 231, 0, L" ."},
+ {24, 234, 0, L" ."},
+ {24, 228, 0, L" "},
+ {24, 230, 0, L" "},
+ {24, 236, 0, L" "},
+ {24, 237, 0, L""},
+ {24, 240, 0, L"-"},
+ {24, 241, 0, L""},
+ {24, 248, 0, L""},
+ {24, 249, 0, L""},
+ {24, 251, 0, L""},
+ {24, 238, 0, L" ."},
+ {24, 242, 0, L" ."},
+ {24, 243, 0, L" ."},
+ {24, 244, 0, L" ."},
+ {24, 245, 0, L" ."},
+ {24, 246, 0, L" ."},
+ {24, 247, 0, L" ."},
+ {24, 250, 0, L" ."},
+ {24, 239, 0, L"- "},
+ {24, 255, 0, L""},
+ {24, 256, 0, L""},
+ {24, 252, 0, L" ."},
+ {24, 253, 0, L" ."},
+ {24, 254, 0, L" ."},
+ {24, 257, 0, L" ."},
+ {24, 258, 0, L" ."},
+ {24, 260, 0, L" ."},
+ {24, 261, 0, L" ."},
+ {24, 259, 0, L" "},
+ {24, 265, 0, L""},
+ {24, 263, 0, L" "},
+ {24, 273, 0, L""},
+ {24, 275, 0, L""},
+ {24, 264, 0, L" "},
+ {24, 268, 0, L" "},
+ {24, 266, 0, L" ."},
+ {24, 267, 0, L" ."},
+ {24, 269, 0, L" ."},
+ {24, 270, 0, L" ."},
+ {24, 272, 0, L" ."},
+ {24, 276, 0, L" ."},
+ {24, 262, 0, L" "},
+ {24, 271, 0, L" "},
+ {24, 274, 0, L"- "},
+ {24, 277, 0, L" "},
+ {24, 278, 0, L" ."},
+ {24, 279, 0, L" ."},
+ {24, 280, 0, L" ."},
+ {24, 282, 0, L" ."},
+ {24, 281, 0, L"- - "},
+ {24, 283, 0, L"- "},
+ {24, 284, 0, L" ."},
+ {24, 285, 0, L" ."},
+ {24, 286, 0, L" ."},
+ {24, 287, 0, L" ."},
+ {24, 288, 0, L" ."},
+ {24, 289, 0, L" ."},
+ {24, 290, 0, L" ."},
+ {24, 291, 0, L" ."},
+ {24, 292, 0, L" ."},
+ {24, 293, 0, L" ."},
+ {24, 294, 0, L" ."},
+ {24, 295, 0, L" ."},
+ {24, 296, 0, L" ."},
+ {24, 297, 0, L" ."},
+ {24, 298, 0, L" ."},
+ {24, 299, 0, L" ."},
+ {24, 300, 0, L" ."},
+ {24, 301, 0, L""},
+ {24, 304, 0, L""},
+ {24, 305, 0, L""},
+ {24, 306, 0, L"-"},
+ {24, 307, 0, L""},
+ {24, 308, 0, L"-"},
+ {24, 311, 0, L" - "},
+ {24, 313, 0, L""},
+ {24, 309, 0, L" "},
+ {24, 312, 0, L" "},
+ {24, 302, 0, L" ."},
+ {24, 303, 0, L" ."},
+ {24, 310, 0, L" ."},
+ {81, 1055, 0, L""},
+ {81, 1058, 0, L""},
+ {81, 1056, 0, L""},
+ {81, 1057, 0, L""},
+ {81, 3153, 0, L""},
+ {81, 2291, 0, L""},
+ {82, 2932, 0, L""},
+ {82, 1060, 0, L""},
+ {82, 3084, 0, L""},
+ {82, 3011, 0, L""},
+ {82, 3306, 0, L""},
+ {82, 1059, 0, L""},
+ {82, 3145, 0, L""},
+ {82, 2292, 0, L""},
+ {97, 1061, 0, L""},
+ {97, 2293, 0, L""},
+ {96, 1062, 0, L""},
+ {96, 2294, 0, L""},
+ {99, 1063, 0, L""},
+ {99, 2295, 0, L""},
+ {100, 1064, 0, L"--"},
+ {100, 2296, 0, L""},
+ {101, 1065, 0, L""},
+ {101, 2297, 0, L""},
+ {102, 1066, 0, L""},
+ {102, 2298, 0, L""},
+ {83, 1067, 0, L""},
+ {83, 3158, 0, L""},
+ {83, 1068, 0, L""},
+ {83, 3129, 0, L""},
+ {83, 1069, 0, L""},
+ {83, 1070, 0, L""},
+ {83, 2299, 0, L""},
+ {86, 3345, 0, L""},
+ {86, 1071, 0, L""},
+ {86, 2992, 0, L""},
+ {86, 3175, 0, L""},
+ {86, 3363, 0, L"-"},
+ {86, 2884, 0, L"-"},
+ {86, 3243, 0, L"-"},
+ {86, 1074, 0, L"-"},
+ {86, 3348, 0, L""},
+ {86, 3241, 0, L""},
+ {86, 1075, 0, L""},
+ {86, 3350, 0, L"-"},
+ {86, 2982, 0, L""},
+ {86, 2971, 0, L"-"},
+ {86, 3136, 0, L""},
+ {86, 1080, 0, L""},
+ {86, 3303, 0, L""},
+ {86, 3050, 0, L""},
+ {86, 3151, 0, L" "},
+ {86, 3141, 0, L""},
+ {86, 3012, 0, L" "},
+ {86, 1081, 0, L""},
+ {86, 1077, 0, L"-"},
+ {86, 1079, 0, L""},
+ {86, 1078, 0, L""},
+ {86, 1076, 0, L""},
+ {86, 2929, 0, L""},
+ {86, 2928, 0, L""},
+ {86, 2300, 0, L""},
+ {95, 3315, 0, L""},
+ {95, 1082, 0, L""},
+ {95, 1083, 0, L""},
+ {95, 3144, 0, L""},
+ {95, 3025, 0, L""},
+ {95, 3277, 0, L""},
+ {95, 1084, 0, L""},
+ {95, 2301, 0, L""},
+ {103, 1085, 0, L""},
+ {103, 2302, 0, L""},
+ {79, 1086, 0, L""},
+ {79, 2303, 0, L""},
+ {85, 1087, 0, L""},
+ {85, 2304, 0, L""},
+ {87, 1088, 0, L""},
+ {87, 2305, 0, L""},
+ {104, 1089, 0, L""},
+ {104, 2306, 0, L""},
+ {84, 1090, 0, L""},
+ {84, 1091, 0, L""},
+ {84, 1092, 0, L"-"},
+ {84, 3242, 0, L""},
+ {84, 1093, 0, L""},
+ {84, 1094, 0, L" ()"},
+ {84, 1095, 0, L""},
+ {84, 3245, 0, L""},
+ {84, 3083, 0, L""},
+ {84, 1096, 0, L""},
+ {84, 1097, 0, L""},
+ {84, 1098, 0, L""},
+ {84, 1099, 0, L""},
+ {84, 2868, 0, L""},
+ {84, 1100, 0, L""},
+ {84, 1101, 0, L" (.-. .)"},
+ {84, 1102, 0, L""},
+ {84, 1103, 0, L""},
+ {84, 1104, 0, L""},
+ {84, 3166, 0, L""},
+ {84, 1105, 0, L"-"},
+ {84, 2927, 0, L""},
+ {84, 1106, 0, L""},
+ {84, 1107, 0, L""},
+ {84, 1108, 0, L"-"},
+ {84, 1109, 0, L""},
+ {84, 1110, 0, L""},
+ {84, 2307, 0, L""},
+ {105, 1111, 0, L""},
+ {105, 2308, 0, L""},
+ {106, 1112, 0, L""},
+ {106, 2309, 0, L""},
+ {107, 1113, 0, L""},
+ {107, 1114, 0, L""},
+ {107, 1115, 0, L""},
+ {107, 2954, 0, L""},
+ {107, 2310, 0, L""},
+ {92, 1116, 0, L""},
+ {92, 1117, 0, L"-"},
+ {92, 3027, 0, L"-"},
+ {92, 1118, 0, L""},
+ {92, 1119, 0, L""},
+ {92, 1120, 0, L""},
+ {92, 2933, 0, L""},
+ {92, 2311, 0, L""},
+ {76, 3214, 0, L" ()"},
+ {76, 1121, 0, L""},
+ {76, 2869, 0, L""},
+ {76, 3262, 0, L""},
+ {76, 1122, 0, L""},
+ {76, 1123, 0, L""},
+ {76, 1124, 0, L""},
+ {76, 3043, 0, L""},
+ {76, 2312, 0, L""},
+ {29, 1125, 0, L""},
+ {29, 2313, 0, L""},
+ {108, 1126, 0, L""},
+ {108, 3240, 0, L""},
+ {108, 2314, 0, L""},
+ {88, 1127, 0, L"-"},
+ {88, 2315, 0, L""},
+ {109, 1128, 0, L""},
+ {109, 2316, 0, L""},
+ {110, 1129, 0, L""},
+ {110, 2317, 0, L""},
+ {111, 1130, 0, L"-"},
+ {111, 1131, 0, L"-"},
+ {111, 2318, 0, L""},
+ {112, 1132, 0, L""},
+ {112, 2319, 0, L""},
+ {113, 1133, 0, L"-"},
+ {113, 1134, 0, L""},
+ {113, 2320, 0, L""},
+ {114, 1135, 0, L""},
+ {114, 2321, 0, L""},
+ {115, 1136, 0, L""},
+ {115, 2322, 0, L""},
+ {116, 1137, 0, L"-"},
+ {116, 1138, 0, L""},
+ {116, 1139, 0, L""},
+ {116, 2323, 0, L""},
+ {117, 1140, 0, L""},
+ {117, 2324, 0, L""},
+ {122, 1141, 0, L""},
+ {122, 2325, 0, L""},
+ {89, 1072, 0, L""},
+ {89, 1073, 0, L""},
+ {89, 1142, 0, L""},
+ {89, 2326, 0, L""},
+ {94, 3250, 0, L""},
+ {94, 1143, 0, L"-"},
+ {94, 2327, 0, L""},
+ {78, 1144, 0, L""},
+ {78, 2328, 0, L""},
+ {91, 1145, 0, L""},
+ {91, 3307, 0, L""},
+ {91, 3308, 0, L""},
+ {91, 2329, 0, L""},
+ {119, 1146, 0, L""},
+ {119, 1147, 0, L""},
+ {119, 2330, 0, L""},
+ {120, 1148, 0, L""},
+ {120, 2331, 0, L""},
+ {132, 1149, 0, L""},
+ {132, 2332, 0, L""},
+ {90, 1150, 0, L""},
+ {90, 3079, 0, L""},
+ {90, 2333, 0, L""},
+ {77, 1152, 0, L""},
+ {77, 1153, 0, L""},
+ {77, 3080, 0, L""},
+ {77, 1151, 0, L""},
+ {77, 1154, 0, L""},
+ {77, 1155, 0, L""},
+ {77, 2334, 0, L""},
+ {93, 3362, 0, L""},
+ {93, 3137, 0, L""},
+ {93, 3273, 0, L""},
+ {93, 1156, 0, L""},
+ {93, 1157, 0, L""},
+ {93, 3167, 0, L""},
+ {93, 3347, 0, L""},
+ {93, 1158, 0, L""},
+ {93, 1159, 0, L""},
+ {93, 1160, 0, L""},
+ {93, 1161, 0, L""},
+ {93, 1162, 0, L""},
+ {93, 1163, 0, L""},
+ {93, 1164, 0, L""},
+ {93, 2335, 0, L""},
+ {121, 1165, 0, L""},
+ {121, 3319, 0, L""},
+ {121, 2336, 0, L""},
+ {98, 1166, 0, L""},
+ {98, 2337, 0, L""},
+ {75, 3176, 0, L""},
+ {75, 3339, 0, L""},
+ {75, 1167, 0, L""},
+ {75, 1168, 0, L""},
+ {75, 2338, 0, L""},
+ {123, 1914, 0, L""},
+ {123, 2957, 0, L" "},
+ {123, 1915, 0, L""},
+ {123, 3331, 0, L""},
+ {123, 1916, 0, L""},
+ {123, 3001, 0, L""},
+ {123, 1917, 0, L""},
+ {123, 3217, 0, L""},
+ {123, 3064, 0, L""},
+ {123, 3020, 0, L" "},
+ {123, 1918, 0, L""},
+ {123, 3238, 0, L""},
+ {123, 2339, 0, L""},
+ {454, 1192, 0, L"-"},
+ {454, 2366, 0, L""},
+ {124, 1919, 0, L"-"},
+ {124, 2340, 0, L""},
+ {453, 1193, 0, L""},
+ {453, 2368, 0, L""},
+ {126, 1921, 0, L""},
+ {126, 2342, 0, L""},
+ {127, 1922, 0, L""},
+ {127, 2343, 0, L""},
+ {128, 1923, 0, L""},
+ {128, 2344, 0, L""},
+ {129, 1924, 0, L""},
+ {129, 2345, 0, L""},
+ {130, 1925, 0, L""},
+ {130, 1926, 0, L""},
+ {130, 1928, 0, L""},
+ {130, 1929, 0, L""},
+ {130, 3235, 0, L""},
+ {130, 1927, 0, L""},
+ {130, 3323, 0, L""},
+ {130, 2346, 0, L""},
+ {131, 1930, 0, L""},
+ {131, 2347, 0, L""},
+ {133, 1931, 0, L"-"},
+ {133, 2348, 0, L""},
+ {125, 1920, 0, L""},
+ {125, 2341, 0, L""},
+ {134, 1932, 0, L""},
+ {134, 2349, 0, L""},
+ {135, 1933, 0, L""},
+ {135, 2350, 0, L""},
+ {136, 1934, 0, L""},
+ {136, 2351, 0, L""},
+ {137, 1935, 0, L""},
+ {137, 2352, 0, L""},
+ {138, 3055, 0, L""},
+ {138, 3049, 0, L""},
+ {138, 3330, 0, L""},
+ {138, 1169, 0, L""},
+ {138, 3106, 0, L""},
+ {138, 1170, 0, L""},
+ {138, 1171, 0, L""},
+ {138, 1172, 0, L""},
+ {138, 3365, 0, L""},
+ {138, 1173, 0, L""},
+ {138, 3104, 0, L""},
+ {138, 3366, 0, L""},
+ {138, 1174, 0, L""},
+ {138, 2964, 0, L""},
+ {138, 3113, 0, L""},
+ {138, 1175, 0, L""},
+ {138, 2920, 0, L"-"},
+ {138, 2889, 0, L"-"},
+ {138, 1176, 0, L""},
+ {138, 2903, 0, L" "},
+ {138, 1177, 0, L""},
+ {138, 1178, 0, L""},
+ {138, 2946, 0, L""},
+ {138, 1179, 0, L""},
+ {138, 1180, 0, L""},
+ {138, 2353, 0, L""},
+ {139, 407, 0, L""},
+ {139, 426, 0, L""},
+ {139, 378, 0, L""},
+ {139, 412, 0, L""},
+ {139, 446, 0, L""},
+ {139, 434, 0, L""},
+ {139, 416, 0, L""},
+ {139, 428, 0, L""},
+ {139, 440, 0, L""},
+ {139, 352, 0, L""},
+ {139, 394, 0, L""},
+ {139, 374, 0, L""},
+ {139, 448, 0, L""},
+ {139, 390, 0, L""},
+ {139, 402, 0, L""},
+ {139, 396, 0, L" "},
+ {139, 370, 0, L""},
+ {139, 368, 0, L""},
+ {139, 444, 0, L""},
+ {139, 388, 0, L""},
+ {139, 408, 0, L""},
+ {139, 430, 0, L""},
+ {139, 358, 0, L""},
+ {139, 418, 0, L""},
+ {139, 354, 0, L""},
+ {139, 376, 0, L""},
+ {139, 414, 0, L""},
+ {139, 380, 0, L""},
+ {139, 372, 0, L""},
+ {139, 424, 0, L""},
+ {139, 348, 0, L""},
+ {139, 392, 0, L""},
+ {139, 386, 0, L""},
+ {139, 438, 0, L""},
+ {139, 362, 0, L"-"},
+ {139, 360, 0, L"-"},
+ {139, 432, 0, L"-"},
+ {139, 350, 0, L"-"},
+ {139, 366, 0, L""},
+ {139, 420, 0, L""},
+ {139, 442, 0, L""},
+ {139, 364, 0, L""},
+ {139, 450, 0, L"-"},
+ {139, 356, 0, L"-"},
+ {139, 382, 0, L" "},
+ {139, 398, 0, L" "},
+ {139, 410, 0, L""},
+ {139, 422, 0, L""},
+ {139, 406, 0, L" "},
+ {139, 404, 0, L""},
+ {139, 384, 0, L" "},
+ {139, 400, 0, L" "},
+ {139, 436, 0, L""},
+ {140, 1238, 0, L"-"},
+ {140, 2442, 0, L""},
+ {141, 1239, 0, L"-"},
+ {141, 2441, 0, L""},
+ {142, 1240, 0, L""},
+ {142, 2440, 0, L""},
+ {143, 1241, 0, L""},
+ {143, 2439, 0, L""},
+ {146, 1242, 0, L""},
+ {146, 2438, 0, L""},
+ {144, 1243, 0, L"-"},
+ {144, 2437, 0, L""},
+ {145, 1244, 0, L""},
+ {145, 3094, 0, L" "},
+ {145, 1245, 0, L"--"},
+ {145, 1246, 0, L"-"},
+ {145, 2436, 0, L""},
+ {147, 1247, 0, L""},
+ {147, 2435, 0, L""},
+ {452, 1190, 0, L"-"},
+ {452, 2364, 0, L""},
+ {149, 1248, 0, L"--"},
+ {149, 2434, 0, L""},
+ {148, 1249, 0, L""},
+ {148, 2433, 0, L""},
+ {173, 1250, 0, L""},
+ {173, 2432, 0, L""},
+ {150, 1251, 0, L""},
+ {150, 2431, 0, L""},
+ {151, 1252, 0, L"-"},
+ {151, 2430, 0, L""},
+ {152, 1253, 0, L""},
+ {152, 2429, 0, L""},
+ {153, 1254, 0, L""},
+ {153, 2428, 0, L""},
+ {154, 1255, 0, L"-"},
+ {154, 2427, 0, L""},
+ {155, 1256, 0, L""},
+ {155, 2426, 0, L""},
+ {156, 1257, 0, L"-"},
+ {156, 2425, 0, L""},
+ {157, 1258, 0, L""},
+ {157, 2424, 0, L""},
+ {158, 1259, 0, L""},
+ {158, 1260, 0, L""},
+ {158, 2423, 0, L""},
+ {159, 1261, 0, L""},
+ {159, 2422, 0, L""},
+ {160, 1262, 0, L""},
+ {160, 2421, 0, L""},
+ {161, 1263, 0, L""},
+ {161, 2420, 0, L""},
+ {162, 1264, 0, L""},
+ {162, 2419, 0, L""},
+ {163, 1265, 0, L"-"},
+ {163, 2418, 0, L""},
+ {164, 1266, 0, L""},
+ {164, 2417, 0, L""},
+ {165, 1267, 0, L""},
+ {165, 2416, 0, L""},
+ {166, 1268, 0, L""},
+ {166, 2415, 0, L""},
+ {167, 1269, 0, L""},
+ {167, 2414, 0, L""},
+ {168, 1270, 0, L"--"},
+ {168, 2413, 0, L""},
+ {169, 1271, 0, L""},
+ {169, 2412, 0, L""},
+ {170, 1272, 0, L""},
+ {170, 2411, 0, L""},
+ {171, 1273, 0, L""},
+ {171, 1274, 0, L""},
+ {171, 2410, 0, L""},
+ {172, 1275, 0, L""},
+ {172, 2409, 0, L""},
+ {174, 1854, 0, L""},
+ {174, 2495, 0, L""},
+ {175, 1855, 0, L""},
+ {175, 2494, 0, L""},
+ {176, 1856, 0, L""},
+ {176, 1857, 0, L"-"},
+ {176, 2493, 0, L""},
+ {177, 1858, 0, L""},
+ {177, 2492, 0, L""},
+ {178, 1859, 0, L""},
+ {178, 2491, 0, L""},
+ {179, 1860, 0, L""},
+ {179, 2490, 0, L""},
+ {180, 1861, 0, L""},
+ {180, 2489, 0, L""},
+ {181, 1862, 0, L""},
+ {181, 2488, 0, L""},
+ {182, 1863, 0, L""},
+ {182, 2487, 0, L""},
+ {183, 1864, 0, L""},
+ {183, 2486, 0, L""},
+ {184, 1865, 0, L""},
+ {184, 2485, 0, L""},
+ {185, 1866, 0, L""},
+ {185, 2484, 0, L""},
+ {186, 3312, 0, L""},
+ {186, 1867, 0, L""},
+ {186, 1868, 0, L""},
+ {186, 2483, 0, L""},
+ {187, 1869, 0, L""},
+ {187, 2482, 0, L""},
+ {23, 1870, 0, L""},
+ {23, 2481, 0, L""},
+ {188, 1871, 0, L""},
+ {188, 2480, 0, L""},
+ {189, 1872, 0, L""},
+ {189, 2479, 0, L""},
+ {190, 1873, 0, L""},
+ {190, 2478, 0, L""},
+ {191, 1874, 0, L""},
+ {191, 2477, 0, L""},
+ {193, 1875, 0, L""},
+ {193, 2476, 0, L""},
+ {192, 1876, 0, L""},
+ {192, 2475, 0, L""},
+ {194, 1877, 0, L""},
+ {194, 2474, 0, L""},
+ {195, 1878, 0, L""},
+ {195, 2473, 0, L""},
+ {196, 1879, 0, L""},
+ {196, 2472, 0, L""},
+ {197, 1880, 0, L""},
+ {197, 2471, 0, L""},
+ {198, 1881, 0, L"-"},
+ {198, 2470, 0, L""},
+ {199, 1882, 0, L""},
+ {199, 2469, 0, L""},
+ {200, 1883, 0, L""},
+ {200, 2468, 0, L""},
+ {201, 1884, 0, L""},
+ {201, 2467, 0, L""},
+ {202, 1885, 0, L""},
+ {202, 2466, 0, L""},
+ {203, 1886, 0, L""},
+ {203, 1887, 0, L""},
+ {203, 2465, 0, L""},
+ {204, 1888, 0, L""},
+ {204, 2464, 0, L""},
+ {205, 1889, 0, L""},
+ {205, 2463, 0, L""},
+ {206, 1890, 0, L""},
+ {206, 2462, 0, L""},
+ {207, 1891, 0, L""},
+ {207, 2461, 0, L""},
+ {208, 1892, 0, L""},
+ {208, 2460, 0, L""},
+ {209, 1893, 0, L"-"},
+ {209, 2459, 0, L""},
+ {210, 1894, 0, L""},
+ {210, 2458, 0, L""},
+ {211, 1895, 0, L""},
+ {211, 2457, 0, L""},
+ {212, 1896, 0, L""},
+ {212, 2456, 0, L""},
+ {213, 1897, 0, L""},
+ {213, 2455, 0, L""},
+ {214, 1898, 0, L""},
+ {214, 2454, 0, L""},
+ {215, 1899, 0, L""},
+ {215, 2453, 0, L""},
+ {216, 1900, 0, L"--"},
+ {216, 1901, 0, L""},
+ {216, 2452, 0, L""},
+ {217, 1902, 0, L""},
+ {217, 2451, 0, L""},
+ {218, 1903, 0, L""},
+ {218, 2450, 0, L""},
+ {219, 1904, 0, L""},
+ {219, 2449, 0, L""},
+ {220, 1905, 0, L""},
+ {220, 2448, 0, L""},
+ {222, 1906, 0, L""},
+ {222, 2447, 0, L""},
+ {223, 1907, 0, L""},
+ {223, 2446, 0, L""},
+ {221, 1908, 0, L""},
+ {221, 2445, 0, L""},
+ {224, 1909, 0, L"-"},
+ {224, 2444, 0, L""},
+ {225, 1910, 0, L""},
+ {225, 1913, 0, L""},
+ {225, 1912, 0, L""},
+ {225, 3033, 0, L""},
+ {225, 1911, 0, L""},
+ {225, 2443, 0, L""},
+ {39, 314, 0, L""},
+ {39, 315, 0, L" ."},
+ {39, 316, 0, L" ."},
+ {39, 317, 0, L" ."},
+ {39, 318, 0, L" ."},
+ {39, 319, 0, L" ."},
+ {39, 320, 0, L" ."},
+ {39, 321, 0, L" ."},
+ {39, 322, 0, L"- ."},
+ {39, 323, 0, L" ."},
+ {39, 324, 0, L" ."},
+ {39, 325, 0, L""},
+ {39, 326, 0, L" ."},
+ {39, 327, 0, L" ."},
+ {39, 328, 0, L" ."},
+ {39, 329, 0, L" ."},
+ {39, 330, 0, L" ."},
+ {39, 331, 0, L" ."},
+ {39, 332, 0, L" ."},
+ {39, 333, 0, L" ."},
+ {39, 334, 0, L" ."},
+ {39, 335, 0, L" ."},
+ {39, 336, 0, L" ."},
+ {39, 337, 0, L" ."},
+ {39, 338, 0, L" ."},
+ {39, 339, 0, L" ."},
+ {40, 602, 0, L" "},
+ {40, 604, 0, L""},
+ {40, 603, 0, L""},
+ {40, 608, 0, L""},
+ {40, 606, 0, L""},
+ {40, 3099, 0, L"--"},
+ {40, 605, 0, L""},
+ {40, 3174, 0, L""},
+ {40, 609, 0, L""},
+ {40, 607, 0, L""},
+ {40, 610, 0, L""},
+ {40, 611, 0, L""},
+ {40, 2541, 0, L""},
+ {32, 612, 0, L""},
+ {32, 2540, 0, L""},
+ {33, 613, 0, L"--"},
+ {33, 2539, 0, L""},
+ {340, 341, 0, L""},
+ {340, 342, 0, L" ."},
+ {340, 343, 0, L" ."},
+ {340, 344, 0, L" ."},
+ {340, 345, 0, L" ."},
+ {340, 346, 0, L" ."},
+ {340, 347, 0, L" ."},
+ {38, 760, 0, L""},
+ {38, 767, 0, L""},
+ {38, 762, 0, L""},
+ {38, 761, 0, L""},
+ {38, 763, 0, L""},
+ {38, 769, 0, L""},
+ {38, 765, 0, L""},
+ {38, 764, 0, L""},
+ {38, 3117, 0, L""},
+ {38, 766, 0, L""},
+ {38, 768, 0, L""},
+ {38, 2532, 0, L""},
+ {41, 3098, 0, L""},
+ {41, 792, 0, L""},
+ {41, 770, 0, L""},
+ {41, 771, 0, L""},
+ {41, 773, 0, L""},
+ {41, 776, 0, L"-"},
+ {41, 788, 0, L""},
+ {41, 789, 0, L""},
+ {41, 796, 0, L""},
+ {41, 777, 0, L""},
+ {41, 781, 0, L""},
+ {41, 786, 0, L""},
+ {41, 791, 0, L""},
+ {41, 793, 0, L""},
+ {41, 795, 0, L""},
+ {41, 787, 0, L""},
+ {41, 790, 0, L""},
+ {41, 3133, 0, L""},
+ {41, 794, 0, L""},
+ {41, 782, 0, L""},
+ {41, 780, 0, L""},
+ {41, 779, 0, L""},
+ {41, 774, 0, L""},
+ {41, 784, 0, L""},
+ {41, 772, 0, L""},
+ {41, 775, 0, L""},
+ {41, 3116, 0, L""},
+ {41, 785, 0, L""},
+ {41, 778, 0, L""},
+ {41, 783, 0, L""},
+ {41, 2531, 0, L""},
+ {42, 797, 0, L"-"},
+ {42, 799, 0, L""},
+ {42, 798, 0, L""},
+ {42, 800, 0, L""},
+ {42, 2530, 0, L""},
+ {45, 802, 0, L""},
+ {45, 3075, 0, L""},
+ {45, 801, 0, L""},
+ {45, 804, 0, L""},
+ {45, 803, 0, L""},
+ {45, 805, 0, L""},
+ {45, 3168, 0, L""},
+ {45, 806, 0, L""},
+ {45, 807, 0, L""},
+ {45, 808, 0, L""},
+ {45, 809, 0, L""},
+ {45, 3131, 0, L""},
+ {45, 810, 0, L""},
+ {45, 3342, 0, L""},
+ {45, 811, 0, L""},
+ {45, 812, 0, L""},
+ {45, 813, 0, L""},
+ {45, 814, 0, L""},
+ {45, 3089, 0, L""},
+ {45, 815, 0, L""},
+ {45, 816, 0, L""},
+ {45, 817, 0, L""},
+ {45, 818, 0, L""},
+ {45, 819, 0, L""},
+ {45, 820, 0, L""},
+ {45, 2976, 0, L""},
+ {45, 2988, 0, L""},
+ {45, 821, 0, L""},
+ {45, 3088, 0, L""},
+ {45, 822, 0, L""},
+ {45, 823, 0, L""},
+ {45, 824, 0, L""},
+ {45, 825, 0, L""},
+ {45, 3343, 0, L""},
+ {45, 2867, 0, L""},
+ {45, 2986, 0, L"-"},
+ {45, 826, 0, L""},
+ {45, 3063, 0, L""},
+ {45, 827, 0, L""},
+ {45, 3140, 0, L""},
+ {45, 828, 0, L""},
+ {45, 829, 0, L""},
+ {45, 830, 0, L""},
+ {45, 2529, 0, L""},
+ {44, 831, 0, L""},
+ {44, 832, 0, L""},
+ {44, 836, 0, L""},
+ {44, 835, 0, L""},
+ {44, 834, 0, L""},
+ {44, 833, 0, L""},
+ {44, 2528, 0, L""},
+ {46, 3007, 0, L""},
+ {46, 837, 0, L""},
+ {46, 838, 0, L"-"},
+ {46, 3371, 0, L""},
+ {46, 839, 0, L"-"},
+ {46, 840, 0, L""},
+ {46, 841, 0, L""},
+ {46, 3163, 0, L""},
+ {46, 842, 0, L""},
+ {46, 843, 0, L""},
+ {46, 3015, 0, L""},
+ {46, 844, 0, L""},
+ {46, 2921, 0, L""},
+ {46, 845, 0, L""},
+ {46, 846, 0, L""},
+ {46, 847, 0, L""},
+ {46, 848, 0, L""},
+ {46, 849, 0, L""},
+ {46, 3010, 0, L""},
+ {46, 850, 0, L""},
+ {46, 851, 0, L""},
+ {46, 3072, 0, L""},
+ {46, 852, 0, L""},
+ {46, 853, 0, L""},
+ {46, 854, 0, L""},
+ {46, 855, 0, L""},
+ {46, 3082, 0, L""},
+ {46, 3309, 0, L""},
+ {46, 856, 0, L""},
+ {46, 857, 0, L""},
+ {46, 3138, 0, L""},
+ {46, 858, 0, L""},
+ {46, 859, 0, L""},
+ {46, 2872, 0, L""},
+ {46, 2965, 0, L""},
+ {46, 3135, 0, L""},
+ {46, 3156, 0, L""},
+ {46, 3192, 0, L""},
+ {46, 860, 0, L""},
+ {46, 861, 0, L""},
+ {46, 2864, 0, L""},
+ {46, 862, 0, L""},
+ {46, 3009, 0, L""},
+ {46, 2993, 0, L""},
+ {46, 863, 0, L""},
+ {46, 864, 0, L""},
+ {46, 865, 0, L""},
+ {46, 866, 0, L""},
+ {46, 3191, 0, L""},
+ {46, 2974, 0, L"-"},
+ {46, 3127, 0, L""},
+ {46, 867, 0, L""},
+ {46, 868, 0, L""},
+ {46, 869, 0, L"--"},
+ {46, 3373, 0, L""},
+ {46, 3313, 0, L""},
+ {46, 870, 0, L""},
+ {46, 3045, 0, L""},
+ {46, 2906, 0, L""},
+ {46, 2527, 0, L""},
+ {48, 871, 0, L""},
+ {48, 873, 0, L""},
+ {48, 3147, 0, L""},
+ {48, 872, 0, L""},
+ {48, 3178, 0, L""},
+ {48, 2526, 0, L""},
+ {49, 3006, 0, L""},
+ {49, 874, 0, L""},
+ {49, 875, 0, L""},
+ {49, 3285, 0, L""},
+ {49, 876, 0, L""},
+ {49, 3126, 0, L""},
+ {49, 2525, 0, L""},
+ {50, 3377, 0, L""},
+ {50, 3067, 0, L""},
+ {50, 877, 0, L""},
+ {50, 3065, 0, L""},
+ {50, 3066, 0, L""},
+ {50, 878, 0, L""},
+ {50, 3069, 0, L""},
+ {50, 3068, 0, L""},
+ {50, 2524, 0, L""},
+ {51, 879, 0, L""},
+ {51, 2523, 0, L""},
+ {34, 880, 0, L""},
+ {34, 3125, 0, L""},
+ {34, 881, 0, L""},
+ {34, 890, 0, L""},
+ {34, 3076, 0, L""},
+ {34, 882, 0, L""},
+ {34, 3070, 0, L""},
+ {34, 888, 0, L""},
+ {34, 886, 0, L""},
+ {34, 891, 0, L"-"},
+ {34, 3310, 0, L" "},
+ {34, 883, 0, L""},
+ {34, 884, 0, L""},
+ {34, 885, 0, L""},
+ {34, 892, 0, L""},
+ {34, 3179, 0, L" "},
+ {34, 3177, 0, L"-"},
+ {34, 3289, 0, L"---"},
+ {34, 889, 0, L""},
+ {34, 887, 0, L""},
+ {34, 893, 0, L""},
+ {34, 2522, 0, L""},
+ {52, 3318, 0, L""},
+ {52, 3278, 0, L""},
+ {52, 906, 0, L""},
+ {52, 894, 0, L""},
+ {52, 895, 0, L""},
+ {52, 905, 0, L""},
+ {52, 896, 0, L""},
+ {52, 897, 0, L""},
+ {52, 3369, 0, L""},
+ {52, 3327, 0, L""},
+ {52, 898, 0, L""},
+ {52, 899, 0, L""},
+ {52, 907, 0, L""},
+ {52, 908, 0, L""},
+ {52, 900, 0, L""},
+ {52, 901, 0, L""},
+ {52, 3368, 0, L"-"},
+ {52, 3384, 0, L""},
+ {52, 3252, 0, L""},
+ {52, 902, 0, L""},
+ {52, 903, 0, L""},
+ {52, 3130, 0, L""},
+ {52, 904, 0, L""},
+ {52, 2521, 0, L""},
+ {53, 2939, 0, L""},
+ {53, 3054, 0, L""},
+ {53, 909, 0, L""},
+ {53, 2934, 0, L""},
+ {53, 913, 0, L""},
+ {53, 2935, 0, L""},
+ {53, 912, 0, L""},
+ {53, 2905, 0, L""},
+ {53, 911, 0, L""},
+ {53, 2936, 0, L""},
+ {53, 2937, 0, L""},
+ {53, 910, 0, L""},
+ {53, 2520, 0, L""},
+ {54, 914, 0, L""},
+ {54, 915, 0, L""},
+ {54, 916, 0, L""},
+ {54, 918, 0, L""},
+ {54, 919, 0, L""},
+ {54, 3173, 0, L""},
+ {54, 917, 0, L""},
+ {54, 2519, 0, L""},
+ {55, 920, 0, L""},
+ {55, 2518, 0, L""},
+ {56, 3376, 0, L""},
+ {56, 921, 0, L""},
+ {56, 2517, 0, L""},
+ {57, 3142, 0, L""},
+ {57, 922, 0, L""},
+ {57, 2516, 0, L""},
+ {58, 923, 0, L""},
+ {58, 3154, 0, L""},
+ {58, 924, 0, L""},
+ {58, 2515, 0, L""},
+ {59, 925, 0, L""},
+ {59, 926, 0, L""},
+ {59, 3234, 0, L""},
+ {59, 3275, 0, L""},
+ {59, 927, 0, L""},
+ {59, 3321, 0, L""},
+ {59, 928, 0, L""},
+ {59, 929, 0, L""},
+ {59, 3281, 0, L"-"},
+ {59, 2514, 0, L""},
+ {36, 930, 0, L"-"},
+ {36, 2513, 0, L""},
+ {60, 931, 0, L""},
+ {60, 933, 0, L""},
+ {60, 932, 0, L""},
+ {60, 934, 0, L""},
+ {60, 935, 0, L""},
+ {60, 2977, 0, L""},
+ {60, 3030, 0, L""},
+ {60, 3091, 0, L""},
+ {60, 936, 0, L""},
+ {60, 937, 0, L""},
+ {60, 3044, 0, L""},
+ {60, 3380, 0, L""},
+ {60, 2512, 0, L""},
+ {61, 3190, 0, L""},
+ {61, 2857, 0, L""},
+ {61, 938, 0, L""},
+ {61, 3355, 0, L""},
+ {61, 939, 0, L""},
+ {61, 2511, 0, L""},
+ {62, 940, 0, L""},
+ {62, 941, 0, L""},
+ {62, 3164, 0, L""},
+ {62, 942, 0, L""},
+ {62, 943, 0, L""},
+ {62, 3237, 0, L""},
+ {62, 3165, 0, L" "},
+ {62, 944, 0, L""},
+ {62, 945, 0, L""},
+ {62, 3008, 0, L""},
+ {62, 3150, 0, L""},
+ {62, 946, 0, L""},
+ {62, 947, 0, L""},
+ {62, 948, 0, L""},
+ {62, 2958, 0, L""},
+ {62, 2510, 0, L""},
+ {35, 949, 0, L""},
+ {35, 950, 0, L""},
+ {35, 2509, 0, L""},
+ {63, 952, 0, L""},
+ {63, 951, 0, L""},
+ {63, 954, 0, L""},
+ {63, 955, 0, L""},
+ {63, 953, 0, L""},
+ {63, 2508, 0, L""},
+ {64, 956, 0, L"-"},
+ {64, 2507, 0, L""},
+ {74, 957, 0, L""},
+ {74, 960, 0, L""},
+ {74, 958, 0, L"-"},
+ {74, 959, 0, L""},
+ {74, 2506, 0, L""},
+ {65, 961, 0, L""},
+ {65, 962, 0, L""},
+ {65, 3101, 0, L""},
+ {65, 963, 0, L""},
+ {65, 964, 0, L""},
+ {65, 965, 0, L""},
+ {65, 966, 0, L""},
+ {65, 2505, 0, L""},
+ {66, 968, 0, L""},
+ {66, 967, 0, L""},
+ {66, 969, 0, L""},
+ {66, 2504, 0, L""},
+ {67, 970, 0, L""},
+ {67, 2503, 0, L""},
+ {68, 2888, 0, L""},
+ {68, 971, 0, L""},
+ {68, 979, 0, L""},
+ {68, 972, 0, L""},
+ {68, 980, 0, L""},
+ {68, 973, 0, L""},
+ {68, 3375, 0, L""},
+ {68, 3159, 0, L""},
+ {68, 974, 0, L""},
+ {68, 975, 0, L""},
+ {68, 976, 0, L""},
+ {68, 977, 0, L""},
+ {68, 978, 0, L""},
+ {68, 2502, 0, L""},
+ {37, 996, 0, L""},
+ {37, 983, 0, L""},
+ {37, 997, 0, L""},
+ {37, 984, 0, L""},
+ {37, 998, 0, L""},
+ {37, 987, 0, L""},
+ {37, 988, 0, L""},
+ {37, 993, 0, L"-"},
+ {37, 3037, 0, L""},
+ {37, 989, 0, L""},
+ {37, 985, 0, L""},
+ {37, 991, 0, L""},
+ {37, 3161, 0, L""},
+ {37, 990, 0, L""},
+ {37, 994, 0, L""},
+ {37, 995, 0, L""},
+ {37, 999, 0, L""},
+ {37, 981, 0, L""},
+ {37, 3374, 0, L""},
+ {37, 992, 0, L""},
+ {37, 982, 0, L""},
+ {37, 986, 0, L""},
+ {37, 3314, 0, L""},
+ {37, 2501, 0, L""},
+ {69, 1003, 0, L""},
+ {69, 1000, 0, L""},
+ {69, 1001, 0, L""},
+ {69, 1004, 0, L""},
+ {69, 1002, 0, L""},
+ {69, 2500, 0, L""},
+ {70, 1005, 0, L""},
+ {70, 3291, 0, L"-"},
+ {70, 1007, 0, L"-"},
+ {70, 1008, 0, L"-"},
+ {70, 3019, 0, L""},
+ {70, 1010, 0, L""},
+ {70, 1009, 0, L""},
+ {70, 1015, 0, L""},
+ {70, 3105, 0, L" "},
+ {70, 1006, 0, L""},
+ {70, 3246, 0, L""},
+ {70, 1011, 0, L""},
+ {70, 1012, 0, L"--"},
+ {70, 1014, 0, L"-"},
+ {70, 1013, 0, L"--"},
+ {70, 2499, 0, L""},
+ {71, 1016, 0, L""},
+ {71, 1019, 0, L""},
+ {71, 1017, 0, L""},
+ {71, 1018, 0, L""},
+ {71, 1020, 0, L""},
+ {71, 1021, 0, L""},
+ {71, 1022, 0, L""},
+ {71, 3189, 0, L""},
+ {71, 1023, 0, L""},
+ {71, 1024, 0, L""},
+ {71, 1025, 0, L""},
+ {71, 1026, 0, L""},
+ {71, 1027, 0, L""},
+ {71, 1028, 0, L""},
+ {71, 1029, 0, L""},
+ {71, 1030, 0, L""},
+ {71, 2498, 0, L""},
+ {72, 2883, 0, L""},
+ {72, 1031, 0, L""},
+ {72, 1032, 0, L""},
+ {72, 1037, 0, L""},
+ {72, 1036, 0, L""},
+ {72, 1042, 0, L""},
+ {72, 1033, 0, L""},
+ {72, 1034, 0, L""},
+ {72, 1041, 0, L""},
+ {72, 1039, 0, L""},
+ {72, 1043, 0, L""},
+ {72, 1040, 0, L""},
+ {72, 1038, 0, L""},
+ {72, 2497, 0, L""},
+ {73, 3013, 0, L""},
+ {73, 1044, 0, L""},
+ {73, 1045, 0, L"-"},
+ {73, 1046, 0, L""},
+ {73, 1047, 0, L""},
+ {73, 1048, 0, L""},
+ {73, 1049, 0, L""},
+ {73, 1050, 0, L""},
+ {73, 1051, 0, L""},
+ {73, 1052, 0, L""},
+ {73, 1053, 0, L""},
+ {73, 1054, 0, L""},
+ {24, 233, 474, L""},
+ {24, 233, 2809, L""},
+ {24, 233, 2804, L""},
+ {24, 233, 475, L""},
+ {24, 233, 477, L""},
+ {24, 233, 476, L""},
+ {24, 233, 2806, L""},
+ {24, 233, 3115, L""},
+ {24, 233, 2808, L""},
+ {24, 233, 2807, L""},
+ {24, 233, 2805, L""},
+ {24, 233, 478, L"-"},
+ {24, 233, 479, L""},
+ {24, 233, 2263, L""},
+ {24, 232, 2819, L""},
+ {24, 232, 464, L""},
+ {24, 232, 465, L" "},
+ {24, 232, 466, L""},
+ {24, 232, 2817, L""},
+ {24, 232, 2818, L""},
+ {24, 232, 3359, L""},
+ {24, 232, 467, L"-"},
+ {24, 232, 468, L""},
+ {24, 232, 469, L""},
+ {24, 232, 470, L""},
+ {24, 232, 471, L""},
+ {24, 232, 472, L""},
+ {24, 232, 2816, L"-"},
+ {24, 232, 473, L""},
+ {24, 232, 2258, L""},
+ {24, 235, 487, L""},
+ {24, 235, 2821, L""},
+ {24, 235, 488, L""},
+ {24, 235, 2820, L""},
+ {24, 235, 489, L"--"},
+ {24, 235, 490, L"--"},
+ {24, 235, 491, L" "},
+ {24, 235, 3353, L""},
+ {24, 235, 492, L""},
+ {24, 235, 2280, L""},
+ {24, 227, 455, L""},
+ {24, 227, 456, L""},
+ {24, 227, 2814, L""},
+ {24, 227, 2813, L""},
+ {24, 227, 2815, L""},
+ {24, 227, 2812, L""},
+ {24, 227, 2811, L""},
+ {24, 227, 457, L""},
+ {24, 227, 2217, L""},
+ {24, 227, 2218, L""},
+ {24, 229, 460, L""},
+ {24, 229, 2822, L""},
+ {24, 229, 459, L"-."},
+ {24, 229, 2234, L""},
+ {24, 231, 462, L""},
+ {24, 231, 2823, L""},
+ {24, 231, 463, L""},
+ {24, 231, 2246, L""},
+ {24, 234, 480, L"-"},
+ {24, 234, 2829, L""},
+ {24, 234, 2833, L""},
+ {24, 234, 2825, L""},
+ {24, 234, 481, L""},
+ {24, 234, 482, L""},
+ {24, 234, 2826, L""},
+ {24, 234, 2832, L""},
+ {24, 234, 2836, L""},
+ {24, 234, 2830, L""},
+ {24, 234, 483, L""},
+ {24, 234, 2828, L""},
+ {24, 234, 2824, L"-"},
+ {24, 234, 2827, L""},
+ {24, 234, 2831, L""},
+ {24, 234, 484, L""},
+ {24, 234, 2834, L""},
+ {24, 234, 2835, L""},
+ {24, 234, 485, L"-"},
+ {24, 234, 486, L"-"},
+ {24, 234, 2264, L""},
+ {24, 228, 458, L""},
+ {24, 228, 2810, L""},
+ {24, 228, 2226, L""},
+ {24, 230, 461, L""},
+ {24, 230, 2239, L""},
+ {24, 236, 493, L""},
+ {24, 236, 2287, L""},
+ {24, 237, 2850, L""},
+ {24, 237, 2851, L""},
+ {24, 237, 2657, L""},
+ {24, 237, 2662, L""},
+ {24, 237, 494, L""},
+ {24, 237, 2658, L""},
+ {24, 237, 2660, L""},
+ {24, 237, 2659, L""},
+ {24, 237, 2663, L""},
+ {24, 237, 495, L""},
+ {24, 237, 496, L""},
+ {24, 237, 2655, L""},
+ {24, 237, 497, L""},
+ {24, 237, 2654, L""},
+ {24, 237, 499, L""},
+ {24, 237, 2656, L""},
+ {24, 237, 498, L""},
+ {24, 237, 500, L""},
+ {24, 237, 2661, L""},
+ {24, 237, 501, L""},
+ {24, 237, 502, L""},
+ {24, 237, 2664, L""},
+ {24, 237, 2220, L""},
+ {24, 240, 509, L""},
+ {24, 240, 510, L""},
+ {24, 240, 511, L"-"},
+ {24, 240, 512, L""},
+ {24, 240, 2247, L""},
+ {24, 241, 513, L" "},
+ {24, 241, 2147, L""},
+ {24, 241, 2150, L""},
+ {24, 241, 2148, L""},
+ {24, 241, 2910, L""},
+ {24, 241, 515, L""},
+ {24, 241, 514, L""},
+ {24, 241, 2149, L""},
+ {24, 241, 2923, L""},
+ {24, 241, 2248, L""},
+ {24, 248, 2569, L""},
+ {24, 248, 2575, L""},
+ {24, 248, 569, L""},
+ {24, 248, 570, L""},
+ {24, 248, 2571, L""},
+ {24, 248, 571, L""},
+ {24, 248, 2570, L""},
+ {24, 248, 572, L""},
+ {24, 248, 573, L""},
+ {24, 248, 2576, L""},
+ {24, 248, 574, L""},
+ {24, 248, 575, L""},
+ {24, 248, 2577, L""},
+ {24, 248, 2572, L""},
+ {24, 248, 576, L""},
+ {24, 248, 2573, L""},
+ {24, 248, 577, L" "},
+ {24, 248, 578, L""},
+ {24, 248, 579, L""},
+ {24, 248, 2574, L""},
+ {24, 248, 580, L""},
+ {24, 248, 2271, L""},
+ {24, 249, 3311, L""},
+ {24, 249, 581, L""},
+ {24, 249, 582, L""},
+ {24, 249, 583, L""},
+ {24, 249, 584, L""},
+ {24, 249, 2665, L""},
+ {24, 249, 585, L""},
+ {24, 249, 586, L""},
+ {24, 249, 587, L""},
+ {24, 249, 2277, L""},
+ {24, 251, 2158, L""},
+ {24, 251, 2156, L""},
+ {24, 251, 2151, L""},
+ {24, 251, 2152, L" "},
+ {24, 251, 2155, L""},
+ {24, 251, 2153, L""},
+ {24, 251, 592, L""},
+ {24, 251, 2157, L""},
+ {24, 251, 2154, L""},
+ {24, 251, 2286, L""},
+ {24, 238, 2168, L" "},
+ {24, 238, 503, L" "},
+ {24, 238, 2164, L""},
+ {24, 238, 504, L""},
+ {24, 238, 505, L"-"},
+ {24, 238, 2160, L""},
+ {24, 238, 506, L""},
+ {24, 238, 2167, L""},
+ {24, 238, 2159, L""},
+ {24, 238, 2169, L""},
+ {24, 238, 2163, L""},
+ {24, 238, 2170, L""},
+ {24, 238, 2166, L""},
+ {24, 238, 2165, L""},
+ {24, 238, 2162, L""},
+ {24, 238, 2171, L""},
+ {24, 238, 2161, L""},
+ {24, 238, 507, L""},
+ {24, 238, 2237, L""},
+ {24, 242, 516, L""},
+ {24, 242, 517, L""},
+ {24, 242, 2139, L""},
+ {24, 242, 518, L""},
+ {24, 242, 519, L""},
+ {24, 242, 520, L""},
+ {24, 242, 2140, L""},
+ {24, 242, 2138, L""},
+ {24, 242, 521, L""},
+ {24, 242, 2137, L""},
+ {24, 242, 522, L""},
+ {24, 242, 523, L""},
+ {24, 242, 524, L""},
+ {24, 242, 2891, L""},
+ {24, 242, 525, L""},
+ {24, 242, 2145, L""},
+ {24, 242, 2143, L""},
+ {24, 242, 2144, L""},
+ {24, 242, 2146, L""},
+ {24, 242, 526, L" "},
+ {24, 242, 527, L""},
+ {24, 242, 2135, L""},
+ {24, 242, 528, L""},
+ {24, 242, 529, L""},
+ {24, 242, 530, L""},
+ {24, 242, 2141, L""},
+ {24, 242, 2136, L""},
+ {24, 242, 2897, L""},
+ {24, 242, 2142, L""},
+ {24, 242, 2251, L""},
+ {24, 243, 2678, L""},
+ {24, 243, 2673, L""},
+ {24, 243, 531, L""},
+ {24, 243, 532, L""},
+ {24, 243, 2674, L""},
+ {24, 243, 2675, L""},
+ {24, 243, 533, L""},
+ {24, 243, 535, L""},
+ {24, 243, 536, L""},
+ {24, 243, 3360, L""},
+ {24, 243, 2677, L"-"},
+ {24, 243, 2676, L""},
+ {24, 243, 537, L""},
+ {24, 243, 538, L""},
+ {24, 243, 2254, L""},
+ {24, 244, 539, L""},
+ {24, 244, 2597, L""},
+ {24, 244, 2595, L""},
+ {24, 244, 2593, L""},
+ {24, 244, 540, L""},
+ {24, 244, 2598, L" "},
+ {24, 244, 2592, L""},
+ {24, 244, 541, L""},
+ {24, 244, 3304, L" "},
+ {24, 244, 2596, L""},
+ {24, 244, 2594, L""},
+ {24, 244, 2256, L""},
+ {24, 245, 2690, L""},
+ {24, 245, 542, L""},
+ {24, 245, 2679, L""},
+ {24, 245, 2680, L""},
+ {24, 245, 2687, L""},
+ {24, 245, 2686, L""},
+ {24, 245, 543, L""},
+ {24, 245, 544, L""},
+ {24, 245, 2681, L""},
+ {24, 245, 545, L""},
+ {24, 245, 546, L""},
+ {24, 245, 547, L""},
+ {24, 245, 548, L""},
+ {24, 245, 2683, L""},
+ {24, 245, 2684, L""},
+ {24, 245, 2682, L""},
+ {24, 245, 549, L""},
+ {24, 245, 550, L""},
+ {24, 245, 2685, L""},
+ {24, 245, 551, L""},
+ {24, 245, 2689, L""},
+ {24, 245, 2688, L""},
+ {24, 245, 552, L""},
+ {24, 245, 553, L""},
+ {24, 245, 2257, L""},
+ {24, 246, 554, L""},
+ {24, 246, 555, L""},
+ {24, 246, 2599, L""},
+ {24, 246, 3293, L" "},
+ {24, 246, 2602, L""},
+ {24, 246, 556, L""},
+ {24, 246, 2600, L""},
+ {24, 246, 557, L""},
+ {24, 246, 558, L""},
+ {24, 246, 559, L""},
+ {24, 246, 560, L""},
+ {24, 246, 561, L""},
+ {24, 246, 2601, L""},
+ {24, 246, 562, L""},
+ {24, 246, 2261, L""},
+ {24, 247, 2613, L""},
+ {24, 247, 2606, L""},
+ {24, 247, 563, L""},
+ {24, 247, 564, L""},
+ {24, 247, 565, L""},
+ {24, 247, 2608, L""},
+ {24, 247, 2607, L""},
+ {24, 247, 2609, L""},
+ {24, 247, 2610, L" "},
+ {24, 247, 2605, L""},
+ {24, 247, 566, L""},
+ {24, 247, 2603, L""},
+ {24, 247, 2604, L""},
+ {24, 247, 2612, L""},
+ {24, 247, 567, L""},
+ {24, 247, 2611, L""},
+ {24, 247, 568, L""},
+ {24, 247, 3267, L"-12"},
+ {24, 247, 2262, L""},
+ {24, 250, 2614, L""},
+ {24, 250, 588, L""},
+ {24, 250, 2615, L""},
+ {24, 250, 589, L""},
+ {24, 250, 2616, L""},
+ {24, 250, 590, L""},
+ {24, 250, 591, L""},
+ {24, 250, 2278, L""},
+ {24, 239, 508, L""},
+ {24, 239, 2238, L""},
+ {24, 255, 1355, L""},
+ {24, 255, 1356, L""},
+ {24, 255, 1357, L""},
+ {24, 255, 1358, L""},
+ {24, 255, 1359, L""},
+ {24, 255, 1360, L""},
+ {24, 255, 1362, L""},
+ {24, 255, 1361, L""},
+ {24, 255, 3286, L""},
+ {24, 255, 1937, L""},
+ {24, 255, 1363, L""},
+ {24, 255, 1938, L""},
+ {24, 255, 3287, L""},
+ {24, 255, 1936, L""},
+ {24, 255, 1364, L""},
+ {24, 255, 1365, L""},
+ {24, 255, 1939, L""},
+ {24, 255, 2201, L""},
+ {24, 256, 1366, L""},
+ {24, 256, 1367, L""},
+ {24, 256, 2202, L""},
+ {24, 256, 1368, L""},
+ {24, 256, 1940, L""},
+ {24, 256, 1369, L""},
+ {24, 256, 1941, L""},
+ {24, 256, 1370, L""},
+ {24, 256, 1371, L""},
+ {24, 256, 1372, L""},
+ {24, 256, 2203, L""},
+ {24, 252, 593, L""},
+ {24, 252, 594, L""},
+ {24, 252, 1945, L""},
+ {24, 252, 595, L""},
+ {24, 252, 596, L""},
+ {24, 252, 1944, L""},
+ {24, 252, 597, L""},
+ {24, 252, 598, L""},
+ {24, 252, 1946, L""},
+ {24, 252, 599, L""},
+ {24, 252, 600, L""},
+ {24, 252, 601, L""},
+ {24, 252, 1942, L""},
+ {24, 252, 3239, L""},
+ {24, 252, 1943, L""},
+ {24, 252, 2204, L""},
+ {24, 253, 1950, L""},
+ {24, 253, 1949, L""},
+ {24, 253, 1338, L" "},
+ {24, 253, 1339, L""},
+ {24, 253, 1951, L""},
+ {24, 253, 1340, L""},
+ {24, 253, 1952, L""},
+ {24, 253, 2871, L""},
+ {24, 253, 1341, L""},
+ {24, 253, 1955, L""},
+ {24, 253, 1342, L""},
+ {24, 253, 1947, L""},
+ {24, 253, 1343, L""},
+ {24, 253, 1953, L""},
+ {24, 253, 1954, L""},
+ {24, 253, 1948, L""},
+ {24, 253, 1344, L""},
+ {24, 253, 2205, L""},
+ {24, 254, 2838, L""},
+ {24, 254, 1345, L""},
+ {24, 254, 2846, L""},
+ {24, 254, 2843, L""},
+ {24, 254, 1346, L""},
+ {24, 254, 1347, L""},
+ {24, 254, 1348, L""},
+ {24, 254, 2842, L""},
+ {24, 254, 2845, L""},
+ {24, 254, 2848, L""},
+ {24, 254, 2837, L""},
+ {24, 254, 2844, L""},
+ {24, 254, 1349, L""},
+ {24, 254, 2841, L""},
+ {24, 254, 2839, L""},
+ {24, 254, 1350, L""},
+ {24, 254, 1351, L""},
+ {24, 254, 1352, L""},
+ {24, 254, 2840, L""},
+ {24, 254, 1353, L""},
+ {24, 254, 1354, L""},
+ {24, 254, 2231, L""},
+ {24, 257, 1985, L""},
+ {24, 257, 1374, L""},
+ {24, 257, 1373, L""},
+ {24, 257, 1375, L""},
+ {24, 257, 1995, L""},
+ {24, 257, 1376, L""},
+ {24, 257, 1378, L""},
+ {24, 257, 1993, L""},
+ {24, 257, 1379, L""},
+ {24, 257, 1380, L""},
+ {24, 257, 1381, L""},
+ {24, 257, 1384, L""},
+ {24, 257, 1984, L" "},
+ {24, 257, 1990, L""},
+ {24, 257, 1994, L""},
+ {24, 257, 1386, L""},
+ {24, 257, 1987, L" "},
+ {24, 257, 1996, L""},
+ {24, 257, 1986, L""},
+ {24, 257, 1983, L""},
+ {24, 257, 1992, L""},
+ {24, 257, 1988, L""},
+ {24, 257, 3071, L""},
+ {24, 257, 1989, L""},
+ {24, 257, 1389, L""},
+ {24, 257, 1991, L""},
+ {24, 257, 1391, L" "},
+ {24, 257, 1392, L""},
+ {24, 257, 1393, L""},
+ {24, 257, 1394, L""},
+ {24, 257, 2207, L""},
+ {24, 258, 1395, L""},
+ {24, 258, 1959, L""},
+ {24, 258, 1396, L""},
+ {24, 258, 1397, L""},
+ {24, 258, 1398, L""},
+ {24, 258, 1399, L""},
+ {24, 258, 1958, L""},
+ {24, 258, 1400, L""},
+ {24, 258, 1401, L""},
+ {24, 258, 1402, L""},
+ {24, 258, 1403, L""},
+ {24, 258, 1404, L" "},
+ {24, 258, 1956, L""},
+ {24, 258, 1957, L""},
+ {24, 258, 3288, L""},
+ {24, 258, 2206, L""},
+ {24, 260, 1406, L""},
+ {24, 260, 2001, L""},
+ {24, 260, 2003, L""},
+ {24, 260, 1407, L" "},
+ {24, 260, 1408, L""},
+ {24, 260, 2002, L" "},
+ {24, 260, 1409, L""},
+ {24, 260, 2000, L""},
+ {24, 260, 1997, L""},
+ {24, 260, 1410, L" "},
+ {24, 260, 1998, L""},
+ {24, 260, 1999, L""},
+ {24, 260, 2208, L""},
+ {24, 261, 1412, L" "},
+ {24, 261, 2004, L""},
+ {24, 261, 2009, L""},
+ {24, 261, 2005, L""},
+ {24, 261, 1413, L""},
+ {24, 261, 2006, L""},
+ {24, 261, 2008, L""},
+ {24, 261, 1414, L""},
+ {24, 261, 1415, L""},
+ {24, 261, 1411, L""},
+ {24, 261, 1416, L""},
+ {24, 261, 2007, L""},
+ {24, 261, 1417, L""},
+ {24, 261, 2209, L""},
+ {24, 259, 1405, L"-"},
+ {24, 259, 2250, L""},
+ {24, 265, 2764, L""},
+ {24, 265, 2760, L""},
+ {24, 265, 2762, L""},
+ {24, 265, 2763, L""},
+ {24, 265, 2761, L""},
+ {24, 265, 1446, L"-"},
+ {24, 265, 2222, L""},
+ {24, 263, 1439, L"-"},
+ {24, 263, 2215, L""},
+ {24, 273, 2766, L"-"},
+ {24, 273, 1494, L""},
+ {24, 273, 2768, L" "},
+ {24, 273, 2767, L""},
+ {24, 273, 2765, L""},
+ {24, 273, 2275, L""},
+ {24, 275, 2769, L""},
+ {24, 275, 1496, L""},
+ {24, 275, 1497, L""},
+ {24, 275, 2770, L""},
+ {24, 275, 2771, L""},
+ {24, 275, 2281, L""},
+ {24, 264, 1440, L""},
+ {24, 264, 1441, L""},
+ {24, 264, 1442, L""},
+ {24, 264, 1443, L""},
+ {24, 264, 2728, L""},
+ {24, 264, 2731, L""},
+ {24, 264, 2729, L""},
+ {24, 264, 2732, L"--"},
+ {24, 264, 3292, L""},
+ {24, 264, 2730, L""},
+ {24, 264, 1444, L""},
+ {24, 264, 1445, L""},
+ {24, 264, 3231, L""},
+ {24, 264, 2216, L""},
+ {24, 268, 2781, L""},
+ {24, 268, 1469, L""},
+ {24, 268, 2784, L""},
+ {24, 268, 2773, L""},
+ {24, 268, 2774, L""},
+ {24, 268, 3122, L""},
+ {24, 268, 2772, L""},
+ {24, 268, 3294, L""},
+ {24, 268, 2777, L""},
+ {24, 268, 1470, L""},
+ {24, 268, 2778, L""},
+ {24, 268, 2782, L""},
+ {24, 268, 2783, L""},
+ {24, 268, 1471, L""},
+ {24, 268, 1472, L""},
+ {24, 268, 1473, L""},
+ {24, 268, 2775, L""},
+ {24, 268, 2776, L""},
+ {24, 268, 2780, L""},
+ {24, 268, 2779, L""},
+ {24, 268, 2785, L""},
+ {24, 268, 1474, L""},
+ {24, 268, 2242, L""},
+ {24, 266, 2792, L""},
+ {24, 266, 1447, L""},
+ {24, 266, 1448, L""},
+ {24, 266, 2791, L""},
+ {24, 266, 1450, L""},
+ {24, 266, 1451, L""},
+ {24, 266, 2793, L""},
+ {24, 266, 2789, L"-"},
+ {24, 266, 2786, L""},
+ {24, 266, 1452, L""},
+ {24, 266, 2794, L""},
+ {24, 266, 2787, L""},
+ {24, 266, 1449, L""},
+ {24, 266, 2790, L""},
+ {24, 266, 1453, L""},
+ {24, 266, 2788, L""},
+ {24, 266, 1454, L""},
+ {24, 266, 1455, L"-"},
+ {24, 266, 2908, L""},
+ {24, 266, 1456, L"-"},
+ {24, 266, 1457, L"-"},
+ {24, 266, 1458, L""},
+ {24, 266, 1459, L""},
+ {24, 266, 2795, L""},
+ {24, 266, 2229, L""},
+ {24, 267, 2737, L"-"},
+ {24, 267, 2740, L""},
+ {24, 267, 2746, L""},
+ {24, 267, 2739, L""},
+ {24, 267, 2742, L""},
+ {24, 267, 1460, L""},
+ {24, 267, 1461, L""},
+ {24, 267, 2738, L"-"},
+ {24, 267, 2745, L""},
+ {24, 267, 1462, L""},
+ {24, 267, 1463, L""},
+ {24, 267, 1464, L""},
+ {24, 267, 2744, L""},
+ {24, 267, 3358, L""},
+ {24, 267, 1465, L""},
+ {24, 267, 1466, L""},
+ {24, 267, 2743, L""},
+ {24, 267, 2741, L""},
+ {24, 267, 1467, L""},
+ {24, 267, 1468, L""},
+ {24, 267, 2236, L""},
+ {24, 269, 1475, L""},
+ {24, 269, 1476, L""},
+ {24, 269, 1477, L""},
+ {24, 269, 2750, L""},
+ {24, 269, 1478, L""},
+ {24, 269, 2752, L""},
+ {24, 269, 2751, L""},
+ {24, 269, 3107, L""},
+ {24, 269, 2753, L""},
+ {24, 269, 2755, L""},
+ {24, 269, 1479, L""},
+ {24, 269, 2759, L""},
+ {24, 269, 2756, L""},
+ {24, 269, 2758, L""},
+ {24, 269, 2757, L""},
+ {24, 269, 2754, L""},
+ {24, 269, 2252, L""},
+ {24, 270, 2733, L""},
+ {24, 270, 1480, L""},
+ {24, 270, 1481, L""},
+ {24, 270, 2735, L""},
+ {24, 270, 1482, L""},
+ {24, 270, 2734, L""},
+ {24, 270, 2736, L""},
+ {24, 270, 2253, L""},
+ {24, 272, 1488, L""},
+ {24, 272, 1489, L" "},
+ {24, 272, 3295, L""},
+ {24, 272, 1491, L""},
+ {24, 272, 1492, L""},
+ {24, 272, 1493, L""},
+ {24, 272, 1490, L""},
+ {24, 272, 2273, L""},
+ {24, 276, 2803, L""},
+ {24, 276, 2799, L""},
+ {24, 276, 1499, L""},
+ {24, 276, 2801, L""},
+ {24, 276, 2800, L""},
+ {24, 276, 2802, L"-"},
+ {24, 276, 2798, L""},
+ {24, 276, 2796, L""},
+ {24, 276, 1498, L""},
+ {24, 276, 2797, L""},
+ {24, 276, 2285, L""},
+ {24, 262, 1438, L""},
+ {24, 262, 2213, L""},
+ {24, 271, 3233, L""},
+ {24, 271, 1485, L""},
+ {24, 271, 1487, L""},
+ {24, 271, 1483, L""},
+ {24, 271, 1484, L""},
+ {24, 271, 1486, L""},
+ {24, 271, 2269, L""},
+ {24, 274, 1495, L"-"},
+ {24, 274, 2279, L""},
+ {24, 277, 1500, L""},
+ {24, 277, 2288, L""},
+ {24, 278, 2668, L""},
+ {24, 278, 2667, L""},
+ {24, 278, 1524, L""},
+ {24, 278, 2669, L""},
+ {24, 278, 2666, L""},
+ {24, 278, 2671, L""},
+ {24, 278, 1525, L""},
+ {24, 278, 2670, L""},
+ {24, 278, 2672, L""},
+ {24, 278, 2243, L""},
+ {24, 279, 1526, L""},
+ {24, 279, 1527, L""},
+ {24, 279, 2691, L""},
+ {24, 279, 1528, L""},
+ {24, 279, 2924, L""},
+ {24, 279, 2707, L""},
+ {24, 279, 1529, L""},
+ {24, 279, 2698, L" "},
+ {24, 279, 1530, L" "},
+ {24, 279, 1531, L" "},
+ {24, 279, 1532, L" "},
+ {24, 279, 2696, L" "},
+ {24, 279, 2692, L""},
+ {24, 279, 2706, L""},
+ {24, 279, 2709, L""},
+ {24, 279, 1533, L""},
+ {24, 279, 1534, L""},
+ {24, 279, 1535, L""},
+ {24, 279, 1536, L""},
+ {24, 279, 1537, L"-"},
+ {24, 279, 1538, L""},
+ {24, 279, 2708, L""},
+ {24, 279, 1539, L""},
+ {24, 279, 2712, L""},
+ {24, 279, 1540, L""},
+ {24, 279, 2694, L""},
+ {24, 279, 2693, L""},
+ {24, 279, 1541, L""},
+ {24, 279, 2711, L""},
+ {24, 279, 2713, L""},
+ {24, 279, 1542, L""},
+ {24, 279, 2702, L" "},
+ {24, 279, 1543, L" "},
+ {24, 279, 2695, L" "},
+ {24, 279, 2697, L" "},
+ {24, 279, 2699, L" "},
+ {24, 279, 2909, L""},
+ {24, 279, 1544, L""},
+ {24, 279, 1545, L""},
+ {24, 279, 1546, L""},
+ {24, 279, 1547, L""},
+ {24, 279, 3296, L""},
+ {24, 279, 2700, L""},
+ {24, 279, 1548, L""},
+ {24, 279, 2710, L""},
+ {24, 279, 2701, L" "},
+ {24, 279, 2703, L""},
+ {24, 279, 1549, L""},
+ {24, 279, 2704, L""},
+ {24, 279, 2705, L""},
+ {24, 279, 2265, L""},
+ {24, 280, 1550, L""},
+ {24, 280, 1551, L""},
+ {24, 280, 3326, L""},
+ {24, 280, 1552, L""},
+ {24, 280, 1553, L""},
+ {24, 280, 2748, L""},
+ {24, 280, 2276, L""},
+ {24, 282, 1564, L""},
+ {24, 282, 2723, L""},
+ {24, 282, 2724, L""},
+ {24, 282, 2716, L" "},
+ {24, 282, 3297, L""},
+ {24, 282, 2725, L""},
+ {24, 282, 1565, L""},
+ {24, 282, 2722, L""},
+ {24, 282, 1566, L""},
+ {24, 282, 2718, L""},
+ {24, 282, 2720, L"-"},
+ {24, 282, 1567, L""},
+ {24, 282, 2721, L""},
+ {24, 282, 2715, L""},
+ {24, 282, 1568, L""},
+ {24, 282, 1569, L""},
+ {24, 282, 1570, L""},
+ {24, 282, 2726, L""},
+ {24, 282, 2717, L""},
+ {24, 282, 3100, L""},
+ {24, 282, 1571, L""},
+ {24, 282, 2719, L""},
+ {24, 282, 2727, L""},
+ {24, 282, 1572, L""},
+ {24, 282, 3332, L""},
+ {24, 282, 1573, L""},
+ {24, 282, 1574, L"-"},
+ {24, 282, 1575, L""},
+ {24, 282, 1576, L""},
+ {24, 282, 1577, L""},
+ {24, 282, 2714, L""},
+ {24, 282, 2283, L""},
+ {24, 281, 2749, L""},
+ {24, 281, 1554, L""},
+ {24, 281, 1555, L""},
+ {24, 281, 1556, L""},
+ {24, 281, 1561, L""},
+ {24, 281, 1562, L""},
+ {24, 281, 1559, L""},
+ {24, 281, 2852, L""},
+ {24, 281, 2853, L""},
+ {24, 281, 2854, L"-"},
+ {24, 281, 1560, L""},
+ {24, 281, 1563, L""},
+ {24, 281, 2747, L""},
+ {24, 281, 1557, L""},
+ {24, 281, 1558, L"-"},
+ {24, 281, 3344, L""},
+ {24, 281, 2282, L""},
+ {24, 283, 3298, L""},
+ {24, 283, 1578, L""},
+ {24, 283, 2856, L""},
+ {24, 283, 1579, L""},
+ {24, 283, 1580, L" "},
+ {24, 283, 1581, L""},
+ {24, 283, 1582, L""},
+ {24, 283, 1583, L""},
+ {24, 283, 2289, L""},
+ {24, 284, 1625, L""},
+ {24, 284, 1626, L""},
+ {24, 284, 2172, L""},
+ {24, 284, 2173, L""},
+ {24, 284, 1627, L""},
+ {24, 284, 2174, L""},
+ {24, 284, 2175, L" "},
+ {24, 284, 1628, L" "},
+ {24, 284, 1629, L""},
+ {24, 284, 2221, L""},
+ {24, 285, 1630, L""},
+ {24, 285, 3283, L""},
+ {24, 285, 1631, L""},
+ {24, 285, 2013, L""},
+ {24, 285, 2015, L""},
+ {24, 285, 1632, L""},
+ {24, 285, 1633, L""},
+ {24, 285, 1634, L""},
+ {24, 285, 2016, L""},
+ {24, 285, 2018, L""},
+ {24, 285, 2017, L""},
+ {24, 285, 2020, L""},
+ {24, 285, 2014, L""},
+ {24, 285, 2010, L""},
+ {24, 285, 2012, L""},
+ {24, 285, 2011, L""},
+ {24, 285, 2019, L""},
+ {24, 285, 2210, L""},
+ {24, 286, 1635, L""},
+ {24, 286, 1636, L""},
+ {24, 286, 2021, L""},
+ {24, 286, 1637, L""},
+ {24, 286, 2022, L""},
+ {24, 286, 1638, L"-"},
+ {24, 286, 2023, L""},
+ {24, 286, 2031, L""},
+ {24, 286, 2024, L""},
+ {24, 286, 1639, L""},
+ {24, 286, 1640, L""},
+ {24, 286, 2026, L""},
+ {24, 286, 3299, L" "},
+ {24, 286, 2033, L""},
+ {24, 286, 2025, L""},
+ {24, 286, 1641, L""},
+ {24, 286, 1642, L""},
+ {24, 286, 2027, L""},
+ {24, 286, 2211, L""},
+ {24, 286, 2028, L""},
+ {24, 286, 2032, L""},
+ {24, 286, 2029, L""},
+ {24, 286, 1643, L""},
+ {24, 286, 2030, L"-"},
+ {24, 286, 2212, L""},
+ {24, 287, 1644, L""},
+ {24, 287, 1645, L""},
+ {24, 287, 1646, L""},
+ {24, 287, 1647, L""},
+ {24, 287, 1648, L""},
+ {24, 287, 2178, L""},
+ {24, 287, 2176, L""},
+ {24, 287, 1649, L""},
+ {24, 287, 2177, L""},
+ {24, 287, 2180, L""},
+ {24, 287, 1650, L""},
+ {24, 287, 2181, L""},
+ {24, 287, 1651, L""},
+ {24, 287, 2179, L""},
+ {24, 287, 2182, L""},
+ {24, 287, 2224, L""},
+ {24, 288, 1652, L""},
+ {24, 288, 2036, L" "},
+ {24, 288, 1657, L""},
+ {24, 288, 1653, L""},
+ {24, 288, 1656, L""},
+ {24, 288, 2040, L""},
+ {24, 288, 2037, L""},
+ {24, 288, 2043, L""},
+ {24, 288, 3300, L""},
+ {24, 288, 2039, L""},
+ {24, 288, 2038, L""},
+ {24, 288, 2042, L""},
+ {24, 288, 2044, L""},
+ {24, 288, 1655, L""},
+ {24, 288, 2034, L""},
+ {24, 288, 1654, L""},
+ {24, 288, 2041, L""},
+ {24, 288, 2035, L""},
+ {24, 288, 2227, L""},
+ {24, 289, 2050, L""},
+ {24, 289, 2051, L""},
+ {24, 289, 3301, L""},
+ {24, 289, 2052, L""},
+ {24, 289, 1660, L""},
+ {24, 289, 1658, L""},
+ {24, 289, 2046, L""},
+ {24, 289, 1661, L""},
+ {24, 289, 2053, L""},
+ {24, 289, 2049, L""},
+ {24, 289, 1659, L""},
+ {24, 289, 2054, L""},
+ {24, 289, 2055, L""},
+ {24, 289, 2047, L""},
+ {24, 289, 1662, L""},
+ {24, 289, 2057, L""},
+ {24, 289, 2056, L"-"},
+ {24, 289, 2045, L""},
+ {24, 289, 1663, L""},
+ {24, 289, 2131, L""},
+ {24, 289, 2048, L""},
+ {24, 289, 2233, L""},
+ {24, 290, 1664, L""},
+ {24, 290, 1665, L""},
+ {24, 290, 1666, L""},
+ {24, 290, 2059, L""},
+ {24, 290, 1667, L""},
+ {24, 290, 3302, L"--"},
+ {24, 290, 1668, L""},
+ {24, 290, 2060, L""},
+ {24, 290, 1669, L""},
+ {24, 290, 2061, L""},
+ {24, 290, 2062, L""},
+ {24, 290, 2058, L""},
+ {24, 290, 1670, L""},
+ {24, 290, 2240, L""},
+ {24, 291, 1671, L"-"},
+ {24, 291, 1673, L""},
+ {24, 291, 3279, L""},
+ {24, 291, 1672, L""},
+ {24, 291, 2187, L""},
+ {24, 291, 2188, L""},
+ {24, 291, 2184, L""},
+ {24, 291, 2185, L""},
+ {24, 291, 2183, L""},
+ {24, 291, 2189, L""},
+ {24, 291, 2186, L""},
+ {24, 291, 2244, L""},
+ {24, 292, 2194, L""},
+ {24, 292, 2193, L""},
+ {24, 292, 1674, L""},
+ {24, 292, 2190, L""},
+ {24, 292, 2195, L""},
+ {24, 292, 1675, L""},
+ {24, 292, 2192, L""},
+ {24, 292, 2191, L""},
+ {24, 292, 2245, L""},
+ {24, 293, 1733, L""},
+ {24, 293, 1732, L""},
+ {24, 293, 1731, L""},
+ {24, 293, 1730, L""},
+ {24, 293, 2063, L""},
+ {24, 293, 2064, L""},
+ {24, 293, 1729, L""},
+ {24, 293, 1728, L""},
+ {24, 293, 1727, L""},
+ {24, 293, 2065, L""},
+ {24, 293, 1726, L""},
+ {24, 293, 1725, L""},
+ {24, 293, 1724, L""},
+ {24, 293, 1723, L""},
+ {24, 293, 2066, L""},
+ {24, 293, 1722, L""},
+ {24, 293, 1721, L""},
+ {24, 293, 1720, L""},
+ {24, 293, 1719, L""},
+ {24, 293, 2067, L""},
+ {24, 293, 1718, L""},
+ {24, 293, 1715, L""},
+ {24, 293, 1717, L""},
+ {24, 293, 2068, L""},
+ {24, 293, 2069, L""},
+ {24, 293, 1716, L""},
+ {24, 293, 1714, L""},
+ {24, 293, 1713, L""},
+ {24, 293, 1712, L""},
+ {24, 293, 1711, L""},
+ {24, 293, 1710, L""},
+ {24, 293, 2070, L""},
+ {24, 293, 2071, L""},
+ {24, 293, 1709, L"-"},
+ {24, 293, 1708, L""},
+ {24, 293, 2072, L"-"},
+ {24, 293, 1707, L""},
+ {24, 293, 1706, L""},
+ {24, 293, 1705, L""},
+ {24, 293, 1704, L""},
+ {24, 293, 1703, L""},
+ {24, 293, 1702, L""},
+ {24, 293, 1701, L"-"},
+ {24, 293, 1700, L""},
+ {24, 293, 1698, L""},
+ {24, 293, 2073, L""},
+ {24, 293, 2074, L""},
+ {24, 293, 1699, L"-"},
+ {24, 293, 1697, L" "},
+ {24, 293, 1696, L""},
+ {24, 293, 1695, L""},
+ {24, 293, 1694, L""},
+ {24, 293, 1693, L""},
+ {24, 293, 1692, L""},
+ {24, 293, 1691, L""},
+ {24, 293, 1690, L""},
+ {24, 293, 2075, L""},
+ {24, 293, 2076, L""},
+ {24, 293, 1689, L" "},
+ {24, 293, 1688, L""},
+ {24, 293, 1687, L""},
+ {24, 293, 1686, L""},
+ {24, 293, 2077, L""},
+ {24, 293, 2078, L""},
+ {24, 293, 1685, L""},
+ {24, 293, 1684, L""},
+ {24, 293, 1683, L""},
+ {24, 293, 1682, L""},
+ {24, 293, 1681, L""},
+ {24, 293, 1680, L""},
+ {24, 293, 1679, L""},
+ {24, 293, 1678, L""},
+ {24, 293, 2080, L""},
+ {24, 293, 1677, L""},
+ {24, 293, 1676, L""},
+ {24, 293, 2079, L""},
+ {24, 293, 3031, L""},
+ {24, 293, 2081, L""},
+ {24, 293, 2249, L""},
+ {24, 294, 2083, L""},
+ {24, 294, 2082, L"-"},
+ {24, 294, 3160, L""},
+ {24, 294, 1736, L""},
+ {24, 294, 2084, L""},
+ {24, 294, 1737, L""},
+ {24, 294, 2085, L""},
+ {24, 294, 1735, L""},
+ {24, 294, 2255, L""},
+ {24, 295, 1740, L"-"},
+ {24, 295, 1741, L""},
+ {24, 295, 2086, L""},
+ {24, 295, 2087, L""},
+ {24, 295, 2089, L""},
+ {24, 295, 2091, L""},
+ {24, 295, 2093, L""},
+ {24, 295, 1738, L""},
+ {24, 295, 3305, L""},
+ {24, 295, 1739, L""},
+ {24, 295, 2090, L""},
+ {24, 295, 2088, L"-"},
+ {24, 295, 2092, L"-"},
+ {24, 295, 2094, L""},
+ {24, 295, 3320, L""},
+ {24, 295, 2260, L""},
+ {24, 296, 2095, L""},
+ {24, 296, 1743, L""},
+ {24, 296, 1744, L""},
+ {24, 296, 2096, L""},
+ {24, 296, 1745, L""},
+ {24, 296, 1746, L""},
+ {24, 296, 2097, L""},
+ {24, 296, 2098, L""},
+ {24, 296, 2099, L""},
+ {24, 296, 2100, L""},
+ {24, 296, 2101, L""},
+ {24, 296, 1747, L""},
+ {24, 296, 1742, L""},
+ {24, 296, 2102, L""},
+ {24, 296, 1748, L""},
+ {24, 296, 2267, L""},
+ {24, 297, 2198, L""},
+ {24, 297, 2199, L""},
+ {24, 297, 1752, L""},
+ {24, 297, 1751, L""},
+ {24, 297, 2196, L""},
+ {24, 297, 1750, L""},
+ {24, 297, 3271, L""},
+ {24, 297, 1749, L""},
+ {24, 297, 3272, L""},
+ {24, 297, 2197, L""},
+ {24, 297, 2270, L""},
+ {24, 298, 2103, L""},
+ {24, 298, 2104, L""},
+ {24, 298, 2105, L""},
+ {24, 298, 2106, L""},
+ {24, 298, 2107, L""},
+ {24, 298, 1753, L" "},
+ {24, 298, 2108, L" "},
+ {24, 298, 2109, L""},
+ {24, 298, 2110, L""},
+ {24, 298, 2111, L""},
+ {24, 298, 1758, L""},
+ {24, 298, 1756, L""},
+ {24, 298, 2112, L" "},
+ {24, 298, 1759, L""},
+ {24, 298, 1760, L""},
+ {24, 298, 1761, L""},
+ {24, 298, 2113, L""},
+ {24, 298, 1757, L""},
+ {24, 298, 2114, L""},
+ {24, 298, 1754, L""},
+ {24, 298, 2115, L""},
+ {24, 298, 2116, L""},
+ {24, 298, 1755, L""},
+ {24, 298, 2272, L""},
+ {24, 299, 2127, L""},
+ {24, 299, 2126, L""},
+ {24, 299, 2118, L""},
+ {24, 299, 2122, L""},
+ {24, 299, 2129, L""},
+ {24, 299, 1762, L""},
+ {24, 299, 2128, L""},
+ {24, 299, 3354, L""},
+ {24, 299, 2124, L""},
+ {24, 299, 1763, L""},
+ {24, 299, 2123, L""},
+ {24, 299, 1764, L""},
+ {24, 299, 2117, L""},
+ {24, 299, 2130, L"-"},
+ {24, 299, 2120, L""},
+ {24, 299, 2119, L""},
+ {24, 299, 2125, L""},
+ {24, 299, 1765, L""},
+ {24, 299, 1766, L""},
+ {24, 299, 2121, L""},
+ {24, 299, 1767, L""},
+ {24, 299, 2274, L""},
+ {24, 300, 3053, L" "},
+ {24, 300, 3268, L""},
+ {24, 300, 1773, L"-"},
+ {24, 300, 2132, L""},
+ {24, 300, 3269, L" "},
+ {24, 300, 2133, L""},
+ {24, 300, 3270, L""},
+ {24, 300, 1774, L""},
+ {24, 300, 2994, L""},
+ {24, 300, 1775, L"-"},
+ {24, 300, 2134, L""},
+ {24, 300, 1769, L""},
+ {24, 300, 1771, L""},
+ {24, 300, 1772, L""},
+ {24, 300, 1770, L""},
+ {24, 300, 1768, L""},
+ {24, 300, 2290, L""},
+ {24, 301, 2849, L""},
+ {24, 301, 1776, L""},
+ {24, 301, 2214, L""},
+ {24, 304, 2617, L""},
+ {24, 304, 1791, L""},
+ {24, 304, 1788, L""},
+ {24, 304, 2619, L""},
+ {24, 304, 1789, L""},
+ {24, 304, 2618, L""},
+ {24, 304, 1790, L""},
+ {24, 304, 1792, L""},
+ {24, 304, 2620, L""},
+ {24, 304, 2225, L""},
+ {24, 305, 3052, L""},
+ {24, 305, 1787, L""},
+ {24, 305, 2228, L""},
+ {24, 306, 2621, L""},
+ {24, 306, 1794, L""},
+ {24, 306, 1793, L""},
+ {24, 306, 2622, L""},
+ {24, 306, 1795, L""},
+ {24, 306, 2623, L""},
+ {24, 306, 2624, L""},
+ {24, 306, 3274, L""},
+ {24, 306, 2230, L""},
+ {24, 307, 2567, L""},
+ {24, 307, 2568, L""},
+ {24, 307, 3324, L""},
+ {24, 307, 1796, L""},
+ {24, 307, 2232, L""},
+ {24, 308, 1799, L""},
+ {24, 308, 1798, L""},
+ {24, 308, 2626, L""},
+ {24, 308, 2625, L"-"},
+ {24, 308, 1797, L""},
+ {24, 308, 2235, L""},
+ {24, 311, 2630, L""},
+ {24, 311, 2631, L""},
+ {24, 311, 2628, L""},
+ {24, 311, 1839, L""},
+ {24, 311, 2629, L""},
+ {24, 311, 2627, L""},
+ {24, 311, 2266, L""},
+ {24, 313, 2632, L""},
+ {24, 313, 1853, L""},
+ {24, 313, 2633, L""},
+ {24, 313, 2284, L""},
+ {24, 309, 2636, L""},
+ {24, 309, 1800, L""},
+ {24, 309, 1801, L""},
+ {24, 309, 1802, L""},
+ {24, 309, 1803, L""},
+ {24, 309, 1804, L""},
+ {24, 309, 1805, L" "},
+ {24, 309, 2637, L""},
+ {24, 309, 1806, L""},
+ {24, 309, 1807, L""},
+ {24, 309, 2638, L""},
+ {24, 309, 1808, L""},
+ {24, 309, 1809, L""},
+ {24, 309, 1810, L""},
+ {24, 309, 1811, L""},
+ {24, 309, 3232, L""},
+ {24, 309, 2639, L""},
+ {24, 309, 1812, L""},
+ {24, 309, 1813, L""},
+ {24, 309, 1814, L"-"},
+ {24, 309, 3102, L""},
+ {24, 309, 1815, L"--"},
+ {24, 309, 1816, L""},
+ {24, 309, 3266, L""},
+ {24, 309, 3039, L""},
+ {24, 309, 1817, L""},
+ {24, 309, 2635, L""},
+ {24, 309, 1818, L""},
+ {24, 309, 1819, L""},
+ {24, 309, 1820, L"-"},
+ {24, 309, 2634, L""},
+ {24, 309, 2241, L""},
+ {24, 312, 1840, L""},
+ {24, 312, 2644, L""},
+ {24, 312, 1841, L""},
+ {24, 312, 1842, L""},
+ {24, 312, 1843, L""},
+ {24, 312, 1844, L""},
+ {24, 312, 2647, L""},
+ {24, 312, 2641, L""},
+ {24, 312, 2642, L""},
+ {24, 312, 1845, L""},
+ {24, 312, 1846, L""},
+ {24, 312, 3367, L""},
+ {24, 312, 3265, L""},
+ {24, 312, 1847, L""},
+ {24, 312, 1848, L" "},
+ {24, 312, 1849, L""},
+ {24, 312, 2645, L""},
+ {24, 312, 2643, L""},
+ {24, 312, 1850, L""},
+ {24, 312, 1851, L""},
+ {24, 312, 1852, L""},
+ {24, 312, 2646, L""},
+ {24, 312, 2640, L""},
+ {24, 312, 2268, L""},
+ {24, 302, 1777, L""},
+ {24, 302, 1778, L""},
+ {24, 302, 3383, L""},
+ {24, 302, 2578, L""},
+ {24, 302, 2579, L""},
+ {24, 302, 1786, L""},
+ {24, 302, 2219, L""},
+ {24, 303, 1779, L""},
+ {24, 303, 1780, L""},
+ {24, 303, 2584, L""},
+ {24, 303, 1781, L""},
+ {24, 303, 1782, L"--"},
+ {24, 303, 1783, L""},
+ {24, 303, 2588, L""},
+ {24, 303, 2591, L""},
+ {24, 303, 2587, L""},
+ {24, 303, 2582, L""},
+ {24, 303, 2590, L""},
+ {24, 303, 1784, L""},
+ {24, 303, 2581, L""},
+ {24, 303, 2583, L""},
+ {24, 303, 2580, L" "},
+ {24, 303, 2589, L""},
+ {24, 303, 2585, L""},
+ {24, 303, 1785, L""},
+ {24, 303, 2586, L""},
+ {24, 303, 2223, L""},
+ {24, 310, 1821, L""},
+ {24, 310, 1822, L""},
+ {24, 310, 1823, L""},
+ {24, 310, 1824, L""},
+ {24, 310, 1825, L" "},
+ {24, 310, 1826, L""},
+ {24, 310, 1827, L""},
+ {24, 310, 2651, L""},
+ {24, 310, 1828, L""},
+ {24, 310, 3264, L""},
+ {24, 310, 2652, L"-"},
+ {24, 310, 2649, L""},
+ {24, 310, 2648, L" "},
+ {24, 310, 1829, L""},
+ {24, 310, 2653, L""},
+ {24, 310, 1830, L""},
+ {24, 310, 1831, L""},
+ {24, 310, 1832, L""},
+ {24, 310, 1833, L"--"},
+ {24, 310, 1834, L""},
+ {24, 310, 1835, L""},
+ {24, 310, 1836, L""},
+ {24, 310, 1837, L"-"},
+ {24, 310, 3263, L""},
+ {24, 310, 2650, L""},
+ {24, 310, 1838, L""},
+ {24, 310, 2259, L""},
+ {139, 407, 407, L" "},
+ {139, 426, 427, L""},
+ {139, 426, 2354, L""},
+ {139, 378, 3109, L" "},
+ {139, 378, 379, L"-"},
+ {139, 378, 2963, L""},
+ {139, 378, 2355, L""},
+ {139, 412, 3236, L""},
+ {139, 412, 413, L""},
+ {139, 412, 1181, L""},
+ {139, 412, 2356, L""},
+ {139, 446, 1182, L""},
+ {139, 446, 447, L""},
+ {139, 446, 1183, L""},
+ {139, 446, 2357, L""},
+ {139, 434, 2917, L""},
+ {139, 434, 1184, L""},
+ {139, 434, 435, L""},
+ {139, 434, 3061, L""},
+ {139, 434, 2358, L""},
+ {139, 416, 417, L"-"},
+ {139, 416, 2359, L""},
+ {139, 428, 3017, L""},
+ {139, 428, 429, L""},
+ {139, 428, 2360, L""},
+ {139, 440, 2956, L""},
+ {139, 440, 2967, L""},
+ {139, 440, 3385, L""},
+ {139, 440, 2865, L""},
+ {139, 440, 441, L""},
+ {139, 440, 3352, L" "},
+ {139, 440, 2876, L""},
+ {139, 440, 3003, L""},
+ {139, 440, 1185, L""},
+ {139, 440, 2983, L""},
+ {139, 440, 1186, L""},
+ {139, 440, 3152, L" "},
+ {139, 440, 2886, L""},
+ {139, 440, 2361, L""},
+ {139, 352, 353, L""},
+ {139, 352, 2861, L""},
+ {139, 352, 2362, L""},
+ {139, 394, 1188, L""},
+ {139, 394, 1187, L""},
+ {139, 394, 2969, L""},
+ {139, 394, 1189, L""},
+ {139, 394, 3114, L""},
+ {139, 394, 2885, L"-"},
+ {139, 394, 2979, L" "},
+ {139, 394, 3338, L""},
+ {139, 394, 395, L""},
+ {139, 394, 3005, L""},
+ {139, 394, 2991, L""},
+ {139, 394, 2996, L""},
+ {139, 394, 3097, L""},
+ {139, 394, 2981, L""},
+ {139, 394, 2363, L""},
+ {139, 374, 2995, L"-"},
+ {139, 374, 375, L""},
+ {139, 374, 2365, L""},
+ {139, 448, 449, L""},
+ {139, 448, 1191, L""},
+ {139, 448, 2367, L""},
+ {139, 390, 3021, L""},
+ {139, 390, 391, L""},
+ {139, 390, 2973, L""},
+ {139, 390, 2369, L""},
+ {139, 402, 403, L""},
+ {139, 402, 2370, L""},
+ {139, 396, 397, L""},
+ {139, 396, 2371, L""},
+ {139, 370, 2911, L""},
+ {139, 370, 3074, L""},
+ {139, 370, 371, L""},
+ {139, 370, 2930, L""},
+ {139, 370, 1194, L""},
+ {139, 370, 2372, L""},
+ {139, 368, 369, L""},
+ {139, 368, 1195, L""},
+ {139, 368, 2373, L""},
+ {139, 444, 2959, L""},
+ {139, 444, 2961, L""},
+ {139, 444, 2912, L""},
+ {139, 444, 2899, L" "},
+ {139, 444, 1196, L""},
+ {139, 444, 3249, L""},
+ {139, 444, 3014, L""},
+ {139, 444, 3048, L""},
+ {139, 444, 2901, L"-"},
+ {139, 444, 2926, L" "},
+ {139, 444, 2922, L""},
+ {139, 444, 1203, L""},
+ {139, 444, 2978, L""},
+ {139, 444, 2990, L""},
+ {139, 444, 3077, L""},
+ {139, 444, 2918, L""},
+ {139, 444, 2881, L""},
+ {139, 444, 3247, L""},
+ {139, 444, 3092, L" "},
+ {139, 444, 2948, L""},
+ {139, 444, 1197, L"-"},
+ {139, 444, 1198, L"-"},
+ {139, 444, 3058, L"-"},
+ {139, 444, 3328, L"--"},
+ {139, 444, 2874, L"-"},
+ {139, 444, 2998, L""},
+ {139, 444, 3087, L""},
+ {139, 444, 2947, L""},
+ {139, 444, 2900, L" "},
+ {139, 444, 1199, L""},
+ {139, 444, 3335, L""},
+ {139, 444, 2966, L""},
+ {139, 444, 445, L""},
+ {139, 444, 1200, L"-"},
+ {139, 444, 3317, L"-"},
+ {139, 444, 1201, L"-"},
+ {139, 444, 1202, L"-"},
+ {139, 444, 2878, L""},
+ {139, 444, 2925, L"-"},
+ {139, 444, 2875, L"-"},
+ {139, 444, 1204, L"-"},
+ {139, 444, 2859, L"-"},
+ {139, 444, 3157, L" "},
+ {139, 444, 3146, L""},
+ {139, 444, 2970, L" "},
+ {139, 444, 2949, L"-"},
+ {139, 444, 3057, L" "},
+ {139, 444, 3032, L"-"},
+ {139, 444, 3381, L""},
+ {139, 444, 3028, L""},
+ {139, 444, 2858, L""},
+ {139, 444, 3040, L""},
+ {139, 444, 2374, L""},
+ {139, 388, 3041, L""},
+ {139, 388, 389, L""},
+ {139, 388, 2375, L""},
+ {139, 408, 3004, L""},
+ {139, 408, 1205, L""},
+ {139, 408, 409, L""},
+ {139, 408, 2376, L""},
+ {139, 430, 1206, L""},
+ {139, 430, 3095, L""},
+ {139, 430, 431, L""},
+ {139, 430, 1207, L"-"},
+ {139, 430, 3046, L""},
+ {139, 430, 2377, L""},
+ {139, 358, 2968, L""},
+ {139, 358, 3018, L""},
+ {139, 358, 2882, L""},
+ {139, 358, 359, L""},
+ {139, 358, 3047, L""},
+ {139, 358, 2378, L""},
+ {139, 418, 419, L"-"},
+ {139, 418, 1208, L" "},
+ {139, 418, 2408, L""},
+ {139, 354, 2931, L""},
+ {139, 354, 3334, L""},
+ {139, 354, 355, L""},
+ {139, 354, 3059, L""},
+ {139, 354, 2919, L""},
+ {139, 354, 2902, L""},
+ {139, 354, 1209, L""},
+ {139, 354, 3336, L""},
+ {139, 354, 2985, L""},
+ {139, 354, 3022, L""},
+ {139, 354, 2407, L""},
+ {139, 376, 1210, L""},
+ {139, 376, 2980, L""},
+ {139, 376, 377, L"-"},
+ {139, 376, 3035, L" "},
+ {139, 376, 2406, L""},
+ {139, 414, 415, L""},
+ {139, 414, 2405, L""},
+ {139, 380, 381, L"-"},
+ {139, 380, 3062, L" "},
+ {139, 380, 3038, L" "},
+ {139, 380, 1211, L"-"},
+ {139, 380, 2895, L""},
+ {139, 380, 2404, L""},
+ {139, 372, 3357, L" "},
+ {139, 372, 1212, L"-"},
+ {139, 372, 1213, L""},
+ {139, 372, 3103, L""},
+ {139, 372, 373, L""},
+ {139, 372, 2987, L""},
+ {139, 372, 2887, L""},
+ {139, 372, 2403, L""},
+ {139, 424, 1214, L"-"},
+ {139, 424, 425, L""},
+ {139, 424, 2402, L""},
+ {139, 348, 349, L""},
+ {139, 348, 3000, L""},
+ {139, 348, 2401, L""},
+ {139, 392, 393, L""},
+ {139, 392, 1215, L""},
+ {139, 392, 3143, L""},
+ {139, 392, 3337, L" "},
+ {139, 392, 2904, L" "},
+ {139, 392, 3329, L""},
+ {139, 392, 2400, L""},
+ {139, 386, 387, L""},
+ {139, 386, 1216, L""},
+ {139, 386, 2399, L""},
+ {139, 438, 439, L"-"},
+ {139, 438, 1217, L"-"},
+ {139, 438, 2890, L""},
+ {139, 438, 2398, L""},
+ {139, 362, 1219, L"-"},
+ {139, 362, 1218, L""},
+ {139, 362, 3276, L""},
+ {139, 362, 3073, L""},
+ {139, 362, 2955, L""},
+ {139, 362, 3349, L""},
+ {139, 362, 363, L""},
+ {139, 362, 3078, L""},
+ {139, 362, 3248, L" "},
+ {139, 362, 2397, L""},
+ {139, 360, 3134, L""},
+ {139, 360, 3081, L""},
+ {139, 360, 2997, L""},
+ {139, 360, 2999, L""},
+ {139, 360, 3139, L""},
+ {139, 360, 3060, L""},
+ {139, 360, 1220, L"-"},
+ {139, 360, 361, L""},
+ {139, 360, 2914, L""},
+ {139, 360, 3056, L" "},
+ {139, 360, 2396, L""},
+ {139, 432, 1222, L""},
+ {139, 432, 433, L"-"},
+ {139, 432, 2395, L""},
+ {139, 350, 2989, L""},
+ {139, 350, 351, L""},
+ {139, 350, 2950, L""},
+ {139, 350, 1221, L""},
+ {139, 350, 3111, L""},
+ {139, 350, 2898, L""},
+ {139, 350, 2938, L""},
+ {139, 350, 2394, L""},
+ {139, 366, 2953, L""},
+ {139, 366, 3112, L" "},
+ {139, 366, 1223, L""},
+ {139, 366, 367, L""},
+ {139, 366, 2951, L""},
+ {139, 366, 2862, L""},
+ {139, 366, 3034, L""},
+ {139, 366, 2860, L""},
+ {139, 366, 2393, L""},
+ {139, 420, 421, L"-"},
+ {139, 420, 1224, L""},
+ {139, 420, 2392, L""},
+ {139, 442, 2877, L"-"},
+ {139, 442, 2945, L"-"},
+ {139, 442, 1225, L""},
+ {139, 442, 443, L""},
+ {139, 442, 1226, L""},
+ {139, 442, 2391, L""},
+ {139, 364, 3316, L""},
+ {139, 364, 3282, L""},
+ {139, 364, 2972, L" "},
+ {139, 364, 1227, L""},
+ {139, 364, 2893, L""},
+ {139, 364, 3110, L" "},
+ {139, 364, 1228, L""},
+ {139, 364, 365, L""},
+ {139, 364, 2390, L""},
+ {139, 450, 451, L""},
+ {139, 450, 3093, L"-"},
+ {139, 450, 2389, L""},
+ {139, 356, 357, L""},
+ {139, 356, 2388, L""},
+ {139, 382, 383, L""},
+ {139, 382, 2387, L""},
+ {139, 398, 2960, L""},
+ {139, 398, 2915, L""},
+ {139, 398, 399, L""},
+ {139, 398, 2386, L""},
+ {139, 410, 2863, L""},
+ {139, 410, 411, L""},
+ {139, 410, 1229, L""},
+ {139, 410, 2385, L""},
+ {139, 422, 3085, L""},
+ {139, 422, 2913, L""},
+ {139, 422, 1233, L""},
+ {139, 422, 2916, L""},
+ {139, 422, 3123, L""},
+ {139, 422, 2873, L""},
+ {139, 422, 3096, L" "},
+ {139, 422, 423, L""},
+ {139, 422, 1232, L"-"},
+ {139, 422, 3023, L""},
+ {139, 422, 1231, L""},
+ {139, 422, 1230, L"-"},
+ {139, 422, 2384, L""},
+ {139, 406, 2383, L""},
+ {139, 404, 2879, L"-"},
+ {139, 404, 2880, L""},
+ {139, 404, 3086, L""},
+ {139, 404, 3002, L""},
+ {139, 404, 3124, L" "},
+ {139, 404, 2894, L"-"},
+ {139, 404, 3290, L"-"},
+ {139, 404, 1234, L""},
+ {139, 404, 1236, L""},
+ {139, 404, 3372, L" "},
+ {139, 404, 2952, L"-"},
+ {139, 404, 3340, L""},
+ {139, 404, 1235, L"-"},
+ {139, 404, 405, L""},
+ {139, 404, 2962, L" "},
+ {139, 404, 2382, L""},
+ {139, 384, 385, L""},
+ {139, 384, 2381, L""},
+ {139, 400, 401, L""},
+ {139, 400, 3090, L""},
+ {139, 400, 1237, L""},
+ {139, 400, 2380, L""},
+ {139, 436, 3036, L""},
+ {139, 436, 3024, L""},
+ {139, 436, 3108, L""},
+ {139, 436, 2866, L"-"},
+ {139, 436, 437, L"--"},
+ {139, 436, 2379, L""},
+ {39, 315, 614, L""},
+ {39, 315, 615, L""},
+ {39, 315, 2566, L""},
+ {39, 316, 2940, L""},
+ {39, 316, 616, L""},
+ {39, 316, 2565, L""},
+ {39, 317, 617, L""},
+ {39, 317, 618, L""},
+ {39, 317, 619, L" "},
+ {39, 317, 620, L""},
+ {39, 317, 621, L""},
+ {39, 317, 622, L""},
+ {39, 317, 623, L""},
+ {39, 317, 2564, L""},
+ {39, 318, 624, L""},
+ {39, 318, 625, L""},
+ {39, 318, 626, L""},
+ {39, 318, 627, L""},
+ {39, 318, 628, L""},
+ {39, 318, 629, L""},
+ {39, 318, 630, L""},
+ {39, 318, 2944, L""},
+ {39, 318, 631, L""},
+ {39, 318, 632, L""},
+ {39, 318, 633, L""},
+ {39, 318, 634, L""},
+ {39, 318, 635, L""},
+ {39, 318, 2563, L""},
+ {39, 319, 636, L""},
+ {39, 319, 637, L""},
+ {39, 319, 2942, L""},
+ {39, 319, 638, L""},
+ {39, 319, 2907, L""},
+ {39, 319, 639, L"-"},
+ {39, 319, 2562, L""},
+ {39, 320, 640, L""},
+ {39, 320, 641, L""},
+ {39, 320, 3119, L""},
+ {39, 320, 3162, L""},
+ {39, 320, 642, L""},
+ {39, 320, 643, L""},
+ {39, 320, 2561, L""},
+ {39, 321, 644, L""},
+ {39, 321, 3128, L""},
+ {39, 321, 645, L""},
+ {39, 321, 646, L""},
+ {39, 321, 3121, L""},
+ {39, 321, 3378, L""},
+ {39, 321, 2560, L""},
+ {39, 322, 3379, L""},
+ {39, 322, 647, L"-"},
+ {39, 322, 3170, L""},
+ {39, 322, 2559, L""},
+ {39, 323, 648, L" "},
+ {39, 323, 649, L""},
+ {39, 323, 651, L""},
+ {39, 323, 650, L""},
+ {39, 323, 652, L""},
+ {39, 323, 3341, L"-"},
+ {39, 323, 653, L""},
+ {39, 323, 654, L""},
+ {39, 323, 655, L""},
+ {39, 323, 2558, L""},
+ {39, 324, 656, L""},
+ {39, 324, 657, L""},
+ {39, 324, 658, L""},
+ {39, 324, 2557, L""},
+ {39, 325, 659, L""},
+ {39, 325, 2984, L""},
+ {39, 325, 3042, L""},
+ {39, 325, 660, L""},
+ {39, 325, 662, L""},
+ {39, 325, 3382, L""},
+ {39, 325, 663, L""},
+ {39, 325, 667, L""},
+ {39, 325, 666, L""},
+ {39, 325, 668, L""},
+ {39, 325, 669, L""},
+ {39, 325, 665, L""},
+ {39, 325, 661, L""},
+ {39, 325, 3370, L" "},
+ {39, 325, 670, L""},
+ {39, 325, 664, L""},
+ {39, 325, 3148, L""},
+ {39, 325, 671, L""},
+ {39, 325, 2556, L""},
+ {39, 326, 672, L""},
+ {39, 326, 673, L""},
+ {39, 326, 674, L""},
+ {39, 326, 675, L""},
+ {39, 326, 3364, L""},
+ {39, 326, 676, L""},
+ {39, 326, 677, L""},
+ {39, 326, 678, L""},
+ {39, 326, 679, L""},
+ {39, 326, 680, L""},
+ {39, 326, 2555, L""},
+ {39, 327, 3284, L""},
+ {39, 327, 681, L""},
+ {39, 327, 682, L""},
+ {39, 327, 2554, L""},
+ {39, 328, 3322, L""},
+ {39, 328, 2870, L""},
+ {39, 328, 683, L""},
+ {39, 328, 3118, L""},
+ {39, 328, 3325, L""},
+ {39, 328, 2553, L""},
+ {39, 329, 684, L"-"},
+ {39, 329, 685, L""},
+ {39, 329, 689, L""},
+ {39, 329, 686, L""},
+ {39, 329, 688, L""},
+ {39, 329, 687, L""},
+ {39, 329, 2552, L""},
+ {39, 330, 690, L""},
+ {39, 330, 691, L""},
+ {39, 330, 693, L""},
+ {39, 330, 694, L""},
+ {39, 330, 695, L""},
+ {39, 330, 692, L""},
+ {39, 330, 2551, L""},
+ {39, 331, 696, L""},
+ {39, 331, 697, L""},
+ {39, 331, 3361, L""},
+ {39, 331, 2550, L""},
+ {39, 332, 3356, L""},
+ {39, 332, 698, L""},
+ {39, 332, 700, L""},
+ {39, 332, 699, L""},
+ {39, 332, 701, L""},
+ {39, 332, 2549, L""},
+ {39, 333, 702, L""},
+ {39, 333, 3171, L""},
+ {39, 333, 703, L""},
+ {39, 333, 704, L""},
+ {39, 333, 2548, L""},
+ {39, 334, 705, L""},
+ {39, 334, 3346, L""},
+ {39, 334, 3351, L""},
+ {39, 334, 706, L""},
+ {39, 334, 708, L""},
+ {39, 334, 707, L""},
+ {39, 334, 709, L""},
+ {39, 334, 2547, L""},
+ {39, 335, 710, L""},
+ {39, 335, 711, L""},
+ {39, 335, 712, L" "},
+ {39, 335, 3280, L""},
+ {39, 335, 713, L""},
+ {39, 335, 2546, L""},
+ {39, 336, 714, L"-"},
+ {39, 336, 715, L""},
+ {39, 336, 2941, L""},
+ {39, 336, 716, L""},
+ {39, 336, 3120, L""},
+ {39, 336, 2943, L""},
+ {39, 336, 717, L""},
+ {39, 336, 3155, L""},
+ {39, 336, 2542, L""},
+ {39, 337, 3169, L""},
+ {39, 337, 3016, L""},
+ {39, 337, 3333, L""},
+ {39, 337, 718, L""},
+ {39, 337, 719, L""},
+ {39, 337, 720, L""},
+ {39, 337, 2545, L""},
+ {39, 338, 721, L""},
+ {39, 338, 722, L""},
+ {39, 338, 723, L""},
+ {39, 338, 2544, L""},
+ {39, 339, 724, L""},
+ {39, 339, 2543, L""},
+ {340, 342, 725, L""},
+ {340, 342, 726, L""},
+ {340, 342, 727, L""},
+ {340, 342, 728, L""},
+ {340, 342, 3172, L""},
+ {340, 342, 729, L""},
+ {340, 342, 730, L""},
+ {340, 342, 731, L""},
+ {340, 342, 732, L""},
+ {340, 342, 2538, L""},
+ {340, 343, 733, L""},
+ {340, 343, 735, L""},
+ {340, 343, 734, L""},
+ {340, 343, 736, L""},
+ {340, 343, 737, L""},
+ {340, 343, 738, L""},
+ {340, 343, 2537, L""},
+ {340, 344, 739, L""},
+ {340, 344, 740, L""},
+ {340, 344, 741, L""},
+ {340, 344, 742, L""},
+ {340, 344, 743, L""},
+ {340, 344, 744, L""},
+ {340, 344, 2536, L""},
+ {340, 345, 745, L""},
+ {340, 345, 746, L""},
+ {340, 345, 747, L""},
+ {340, 345, 3244, L""},
+ {340, 345, 748, L""},
+ {340, 345, 2535, L""},
+ {340, 346, 3149, L""},
+ {340, 346, 749, L""},
+ {340, 346, 750, L""},
+ {340, 346, 751, L""},
+ {340, 346, 752, L" "},
+ {340, 346, 753, L""},
+ {340, 346, 2896, L""},
+ {340, 346, 754, L""},
+ {340, 346, 755, L""},
+ {340, 346, 756, L""},
+ {340, 346, 2534, L""},
+ {340, 347, 757, L""},
+ {340, 347, 758, L""},
+ {340, 347, 759, L""},
+ {340, 347, 2533, L""},
+ {0, 0, 0, NULL}
+};
+
+
+
+
+
+#endif // !defined(AFX_MRA_PLACES_H__INCLUDED_) \ No newline at end of file
diff --git a/protocols/MRA/MraPopUp.cpp b/protocols/MRA/MraPopUp.cpp
new file mode 100644
index 0000000000..9a2fac8fb9
--- /dev/null
+++ b/protocols/MRA/MraPopUp.cpp
@@ -0,0 +1,308 @@
+#include "Mra.h"
+#include "MraPopUp.h"
+
+
+INT_PTR CALLBACK MraPopupDlgProcOpts (HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+LRESULT CALLBACK MraPopupDlgProc (HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+
+
+
+#define POPUPS_TYPES_COUNT 7
+static LPCWSTR lpcwszPopupsTypes[]=
+{
+ L"None",
+ L"Debug",
+ L"Information",
+ L"Question",
+ L"Warning",
+ L"Error",
+ L"NewMail",
+ NULL
+};
+
+
+
+
+int MraPopupOptInit(WPARAM wParam,LPARAM lParam)
+{
+ if (ServiceExists(MS_POPUP_ADDPOPUP)) {
+ OPTIONSDIALOGPAGE odp = {0};
+
+ odp.cbSize = sizeof(odp);
+ odp.position = 100000000;
+ odp.hInstance = masMraSettings.hInstance;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_POPUPS);
+ odp.ptszTitle = PROTOCOL_NAMEW;
+ odp.ptszGroup = TranslateW(L"Popups");
+ odp.groupPosition = 900000000;
+ odp.flags = (ODPF_BOLDGROUPS | ODPF_UNICODE);
+ odp.nIDBottomSimpleControl = IDC_GROUPMAIN;
+ odp.pfnDlgProc = MraPopupDlgProcOpts;
+ CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
+ }
+return(0);
+}
+
+
+INT_PTR CALLBACK MraPopupDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch(msg){
+ case WM_INITDIALOG:
+ {
+ HWND hWndCombo = GetDlgItem(hWndDlg, IDC_COMBO_POPUP_TYPE);
+ DWORD dwItem;
+
+ SendMessage(hWndCombo, CB_RESETCONTENT, 0, 0);
+ for (SIZE_T i = 0; i < POPUPS_TYPES_COUNT; i++) {
+ dwItem=SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)TranslateW(lpcwszPopupsTypes[i]));
+ SendMessage(hWndCombo, CB_SETITEMDATA, dwItem, i);
+ }
+ SendMessage(hWndCombo, CB_SETCURSEL, 0, 0);
+ SendMessage(hWndDlg, WM_COMMAND, MAKELONG(IDC_COMBO_POPUP_TYPE, CBN_SELCHANGE), 0);
+
+ TranslateDialogDefault(hWndDlg);
+ }
+ return(TRUE);
+ case WM_COMMAND:
+ switch(LOWORD(wParam)){
+ case IDC_COMBO_POPUP_TYPE:
+ if (HIWORD(wParam) == CBN_SELCHANGE) {
+ BOOL bEnabled, bUseWinColors;
+ char szBuff[MAX_PATH];
+ DWORD dwType = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_COMBO_POPUP_TYPE);
+
+ bEnabled = GetBit(DB_Mra_GetDword(NULL, "PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER), dwType);
+ CHECK_DLG_BUTTON(hWndDlg, IDC_CHK_ENABLE, bEnabled);
+
+ mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]);
+ bUseWinColors = DB_Mra_GetByte(NULL, szBuff, MRA_DEFAULT_POPUP_USE_WIN_COLORS);
+ CHECK_DLG_BUTTON(hWndDlg, IDC_CHK_USE_WIN_COLORS, bUseWinColors);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_CHK_USE_WIN_COLORS), bEnabled);
+
+ mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorBack", lpcwszPopupsTypes[dwType]);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_BACKCOLOR, CPM_SETCOLOUR, 0, DB_Mra_GetDword(NULL, szBuff, MRA_DEFAULT_POPUP_COLOR_BACK));
+ EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_BACKCOLOR),(bEnabled && bUseWinColors == FALSE));
+
+ mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorText", lpcwszPopupsTypes[dwType]);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_TEXTCOLOR, CPM_SETCOLOUR, 0, DB_Mra_GetDword(NULL, szBuff, MRA_DEFAULT_POPUP_COLOR_TEXT));
+ EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_TEXTCOLOR), (bEnabled && bUseWinColors == FALSE));
+
+ mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%STimeout", lpcwszPopupsTypes[dwType]);
+ SetDlgItemInt(hWndDlg, IDC_POPUP_TIMEOUT, DB_Mra_GetDword(NULL, szBuff, MRA_DEFAULT_POPUP_TIMEOUT), FALSE);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_TIMEOUT), bEnabled);
+ }
+ break;
+ case IDC_PREVIEW:
+ {
+ for (SIZE_T i = 0; i < POPUPS_TYPES_COUNT; i++) {
+ MraPopupShowFromAgentW(i, 0, TranslateW(lpcwszPopupsTypes[i]));
+ }
+ }
+ break;
+ case IDC_CHK_ENABLE:
+ case IDC_CHK_USE_WIN_COLORS:
+ {
+ BOOL bEnabled, bUseWinColors;
+
+ bEnabled = IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_ENABLE);
+ bUseWinColors = IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_USE_WIN_COLORS);
+
+ EnableWindow(GetDlgItem(hWndDlg, IDC_CHK_USE_WIN_COLORS), bEnabled);
+ EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_BACKCOLOR), (bEnabled && bUseWinColors == FALSE));
+ EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_TEXTCOLOR), (bEnabled && bUseWinColors == FALSE));
+ EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_TIMEOUT), bEnabled);
+ }
+ default:
+ if ((LOWORD(wParam) == IDC_POPUP_TIMEOUT) && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()) )
+ return(FALSE);
+ SendMessage(GetParent(hWndDlg), PSM_CHANGED, 0, 0);
+ }
+ break;
+ case WM_NOTIFY:
+ switch(((LPNMHDR)lParam)->code){
+ case PSN_APPLY:
+ {
+ char szBuff[MAX_PATH];
+ DWORD dwPopupsEventFilter, dwType = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_COMBO_POPUP_TYPE);
+
+ dwPopupsEventFilter = DB_Mra_GetDword(NULL, "PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER);
+ if (IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_CHK_ENABLE)) {
+ dwPopupsEventFilter |= (1<<dwType);
+ }else{
+ dwPopupsEventFilter &= ~(1<<dwType);
+ }
+ DB_Mra_SetDword(NULL, "PopupsEventFilter", dwPopupsEventFilter);
+
+ mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]);
+ DB_Mra_SetByte(NULL, szBuff, IS_DLG_BUTTON_CHECKED(hWndDlg, IDC_CHK_USE_WIN_COLORS));
+
+ mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorBack", lpcwszPopupsTypes[dwType]);
+ DB_Mra_SetDword(NULL, szBuff, SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_BACKCOLOR, CPM_GETCOLOUR, 0, 0));
+
+ mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorText", lpcwszPopupsTypes[dwType]);
+ DB_Mra_SetDword(NULL, szBuff, SEND_DLG_ITEM_MESSAGE(hWndDlg, IDC_POPUP_TEXTCOLOR, CPM_GETCOLOUR, 0, 0));
+
+ mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%STimeout", lpcwszPopupsTypes[dwType]);
+ DB_Mra_SetDword(NULL, szBuff, GetDlgItemInt(hWndDlg, IDC_POPUP_TIMEOUT, NULL, FALSE));
+ }
+ return(TRUE);
+ }
+ break;
+ }
+return(FALSE);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// ShowPopup - popup plugin support
+void CALLBACK MraPopupThreadMarandaCallback(ULONG_PTR dwParam)
+{
+ if (dwParam == 0)
+ return;
+
+ if ((SIZE_T)(((POPUPDATAW*)dwParam)->PluginData) == MRA_POPUP_TYPE_EMAIL_STATUS && masMraSettings.hWndEMailPopupStatus) {
+ // 1: PUDeletePopUp(hWndDlg);
+ // 1: PUAddPopUpW((POPUPDATAW*)dwParam);
+ // 2: PUChangeW(masMraSettings.hWndEMailPopupStatus,(POPUPDATAW*)dwParam); //- crash :/
+ PUChangeTextW(masMraSettings.hWndEMailPopupStatus,((POPUPDATAW*)dwParam)->lpwzText);
+ }else{
+ PUAddPopUpW((POPUPDATAW*)dwParam);
+ }
+
+ MEMFREE(dwParam);
+
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Popup plugin window proc
+LRESULT CALLBACK MraPopupDlgProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch(msg){
+ case UM_INITPOPUP:
+ if ((SIZE_T)PUGetPluginData(hWndDlg) == MRA_POPUP_TYPE_EMAIL_STATUS) {
+ // update/load avatar
+ MraAvatarsQueueGetAvatarSimple(masMraSettings.hAvatarsQueueHandle, GAIF_FORCE, PUGetContact(hWndDlg), 0);
+
+ // delete old email popup
+ if (masMraSettings.hWndEMailPopupStatus)
+ PUDeletePopUp(masMraSettings.hWndEMailPopupStatus);
+
+ masMraSettings.hWndEMailPopupStatus = hWndDlg;
+ }
+ break;
+ case WM_COMMAND:
+ if (HIWORD(wParam) == STN_CLICKED) { //It was a click on the Popup.
+ if ((SIZE_T)PUGetPluginData(hWndDlg) == MRA_POPUP_TYPE_EMAIL_STATUS)
+ {
+ CallProtoService(PROTOCOL_NAMEA, MRA_GOTO_INBOX, 0, 0);
+ masMraSettings.hWndEMailPopupStatus = NULL;
+ }
+ }
+ PUDeletePopUp(hWndDlg);
+ break;
+ case WM_CONTEXTMENU:
+ if ((SIZE_T)PUGetPluginData(hWndDlg) == MRA_POPUP_TYPE_EMAIL_STATUS)
+ masMraSettings.hWndEMailPopupStatus = NULL;
+ PUDeletePopUp(hWndDlg);
+ break;
+ case UM_FREEPLUGINDATA:
+ if ((SIZE_T)PUGetPluginData(hWndDlg) == MRA_POPUP_TYPE_EMAIL_STATUS)
+ masMraSettings.hWndEMailPopupStatus = NULL;
+ break;
+ }
+return(DefWindowProc(hWndDlg, msg, wParam, lParam));
+}
+
+
+void MraPopupShowFromContactW(HANDLE hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszMessage)
+{
+ WCHAR szNick[MAX_EMAIL_LEN], szEMail[MAX_EMAIL_LEN], szTitle[MAX_CONTACTNAME];
+
+ DB_Mra_GetStaticStringW(hContact, "Nick", szNick, SIZEOF(szNick), NULL);
+ DB_Mra_GetStaticStringW(hContact, "e-mail", szEMail, SIZEOF(szEMail), NULL);
+ if (hContact) {
+ mir_sntprintf(szTitle, SIZEOF(szTitle), L"%s <%s>",szNick, szEMail);
+ }else{
+ mir_sntprintf(szTitle, SIZEOF(szTitle), L"%s: %s <%s>", PROTOCOL_DISPLAY_NAMEW, szNick, szEMail);
+ }
+ MraPopupShowW(hContact, dwType, dwFlags, szTitle, lpszMessage);
+}
+
+
+void MraPopupShowW(HANDLE hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszTitle, LPWSTR lpszMessage)
+{
+ if (DB_Mra_GetByte(NULL,"PopupsEnabled", MRA_DEFAULT_POPUPS_ENABLED))
+ if (GetBit(DB_Mra_GetDword(NULL,"PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER), dwType))
+ if (ServiceExists(MS_POPUP_ADDPOPUPW))
+ {
+ BOOL bUseWinColors;
+ char szBuff[MAX_PATH];
+ POPUPDATAW *ppd = (POPUPDATAW*)MEMALLOC(sizeof(POPUPDATAW));
+
+ //if (ServiceExists(MS_POPUP2_SHOW)==FALSE)// yapp used
+ if (dwType == MRA_POPUP_TYPE_EMAIL_STATUS && masMraSettings.hWndEMailPopupStatus) {
+ // delete old email popup
+ PUDeletePopUp(masMraSettings.hWndEMailPopupStatus);
+ masMraSettings.hWndEMailPopupStatus = NULL;
+ }
+
+ // load icon
+ switch(dwType){
+ case MRA_POPUP_TYPE_NONE:// proto icon
+ ppd->lchIcon = (HICON)LoadImage(masMraSettings.hInstance, MAKEINTRESOURCE(IDI_MRA), IMAGE_ICON, 0, 0, LR_SHARED);
+ break;
+ case MRA_POPUP_TYPE_DEBUG:// IDI_APPLICATION
+ ppd->lchIcon = (HICON)LoadImage(NULL, IDI_APPLICATION, IMAGE_ICON, 0, 0, LR_SHARED);
+ break;
+ case MRA_POPUP_TYPE_INFORMATION:// IDI_INFORMATION
+ ppd->lchIcon = (HICON)LoadImage(NULL, IDI_INFORMATION, IMAGE_ICON, 0, 0, LR_SHARED);
+ break;
+ case MRA_POPUP_TYPE_QUESTION:// IDI_QUESTION
+ ppd->lchIcon = (HICON)LoadImage(NULL, IDI_QUESTION, IMAGE_ICON, 0, 0, LR_SHARED);
+ break;
+ case MRA_POPUP_TYPE_WARNING:// IDI_WARNING
+ ppd->lchIcon = (HICON)LoadImage(NULL, IDI_WARNING, IMAGE_ICON, 0, 0, LR_SHARED);
+ break;
+ case MRA_POPUP_TYPE_ERROR:// IDI_ERROR
+ ppd->lchIcon = (HICON)LoadImage(NULL, IDI_ERROR, IMAGE_ICON, 0, 0, LR_SHARED);
+ break;
+ case MRA_POPUP_TYPE_EMAIL_STATUS:
+ ppd->lchIcon = (HICON)LoadImage(masMraSettings.hInstance, MAKEINTRESOURCE(IDI_MAIL_NOTIFY), IMAGE_ICON, 0, 0, LR_SHARED);
+ break;
+ }
+
+ ppd->lchContact = hContact;
+ if (lpszTitle)
+ lstrcpynW(ppd->lpwzContactName, lpszTitle, SIZEOF(ppd->lpwzContactName));
+ if (lpszMessage)
+ lstrcpynW(ppd->lpwzText, lpszMessage, SIZEOF(ppd->lpwzText));
+ ppd->PluginWindowProc = (WNDPROC)MraPopupDlgProc;
+ ppd->PluginData = (LPVOID)dwType;
+
+ mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]);
+ bUseWinColors = DB_Mra_GetByte(NULL, szBuff, MRA_DEFAULT_POPUP_USE_WIN_COLORS);
+ if (bUseWinColors) {
+ ppd->colorBack = GetSysColor(COLOR_BTNFACE);
+ ppd->colorText = GetSysColor(COLOR_WINDOWTEXT);
+ }else{
+ mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorBack", lpcwszPopupsTypes[dwType]);
+ ppd->colorBack = DB_Mra_GetDword(NULL, szBuff, MRA_DEFAULT_POPUP_COLOR_BACK);
+
+ mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%SColorText", lpcwszPopupsTypes[dwType]);
+ ppd->colorText = DB_Mra_GetDword(NULL, szBuff, MRA_DEFAULT_POPUP_COLOR_TEXT);
+ }
+
+ mir_snprintf(szBuff, SIZEOF(szBuff), "PopupType%STimeout", lpcwszPopupsTypes[dwType]);
+ ppd->iSeconds = DB_Mra_GetDword(NULL, szBuff, MRA_DEFAULT_POPUP_TIMEOUT);
+
+ //if (MraAPCQueueAdd(MraPopupThreadMarandaCallback,&masMraSettings.ffmtAPCQueue,(ULONG_PTR)ppd)!=NO_ERROR)
+ {// sync call
+ MraPopupThreadMarandaCallback((ULONG_PTR)ppd);
+ }
+ }else{
+ if (dwFlags & MRA_POPUP_ALLOW_MSGBOX)
+ MessageBox(NULL, lpszMessage, lpszTitle, MB_OK+(dwType == MRA_POPUP_TYPE_WARNING)?MB_ICONERROR:MB_ICONINFORMATION);
+ }
+}
+
+
+
diff --git a/protocols/MRA/MraPopUp.h b/protocols/MRA/MraPopUp.h
new file mode 100644
index 0000000000..5b768cdc1a
--- /dev/null
+++ b/protocols/MRA/MraPopUp.h
@@ -0,0 +1,34 @@
+#if !defined(AFX_MRA_POPUP_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
+#define AFX_MRA_POPUP_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_
+
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+
+#define MRA_POPUP_ALLOW_MSGBOX 1
+#define MRA_POPUP_ALLOW_ENTER 2
+
+#define MRA_POPUP_TYPE_NONE 0 // proto icon
+#define MRA_POPUP_TYPE_DEBUG 1 // IDI_APPLICATION
+#define MRA_POPUP_TYPE_INFORMATION 2 // IDI_INFORMATION
+#define MRA_POPUP_TYPE_QUESTION 3 // IDI_QUESTION
+#define MRA_POPUP_TYPE_WARNING 4 // IDI_WARNING
+#define MRA_POPUP_TYPE_ERROR 5 // IDI_ERROR
+#define MRA_POPUP_TYPE_EMAIL_STATUS 6 //
+
+
+int MraPopupOptInit (WPARAM wParam,LPARAM lParam);
+
+void MraPopupShowFromContactW (HANDLE hContact,DWORD dwType,DWORD dwFlags,LPWSTR lpszMessage);
+#define MraPopupShowFromAgentW(dwType,dwFlags,lpszMessage) MraPopupShowFromContactW(NULL,dwType,dwFlags,lpszMessage)
+
+void MraPopupShowW (HANDLE hContact,DWORD dwType,DWORD dwFlags,LPWSTR lpszTitle,LPWSTR lpszMessage);
+
+
+
+
+
+#endif // !defined(AFX_MRA_POPUP_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/MraRTFMsg.cpp b/protocols/MRA/MraRTFMsg.cpp
new file mode 100644
index 0000000000..e0c3a1d67f
--- /dev/null
+++ b/protocols/MRA/MraRTFMsg.cpp
@@ -0,0 +1,341 @@
+#include "Mra.h"
+#include "MraRTFMsg.h"
+
+
+
+#define COLORTABLE_COUNT 8
+#define RTF_COLORTBLCOLOURS "\\red255\\green0\\blue0;\\red0\\green255\\blue0;\\red0\\green0\\blue255;\\red255\\green0\\blue255;\\red255\\green255\\blue0;\\red0\\green255\\blue255;\\red0\\green0\\blue0;\\red255\\green255\\blue255;"
+static const LPSTR lpszColours[COLORTABLE_COUNT]=
+{
+ "red",
+ "green",
+ "blue",
+ "magenta",
+ "yellow",
+ "cyan",
+ "black",
+ "white"
+};
+
+
+
+#define CRLF "\r\n"
+#define PAR "\\par "
+
+
+#define BB_COLOR_TAG "[color="
+#define SIMBOLS_COUNT 19
+static const LPSTR lpszSimbols[SIMBOLS_COUNT]=
+{
+ "\r\n",
+ "\\",
+ "{",
+ "}",
+ "[b]",
+ "[/b]",
+ "[u]",
+ "[/u]",
+ "[i]",
+ "[/i]",
+ "[/color]",
+ "[color=red]",
+ "[color=green]",
+ "[color=blue]",
+ "[color=magenta]",
+ "[color=yellow]",
+ "[color=cyan]",
+ "[color=black]",
+ "[color=white]",
+};
+
+static const SIZE_T dwcSimbolsCount[SIMBOLS_COUNT]=
+{
+ 2,
+ 1,
+ 1,
+ 1,
+ 3,
+ 4,
+ 3,
+ 4,
+ 3,
+ 4,
+ 8,
+ 11,
+ 13,
+ 12,
+ 15,
+ 14,
+ 12,
+ 13,
+ 13,
+};
+
+static const LPSTR lpszRTFTags[SIMBOLS_COUNT]=
+{
+ "\\par",
+ "\\\\",
+ "\\{",
+ "\\}",
+ "{\\b ",
+ "}",
+ "{\\ul ",
+ "}",
+ "{\\i ",
+ "}",
+ "}",
+ "{\\cf2 ",
+ "{\\cf3 ",
+ "{\\cf4 ",
+ "{\\cf5 ",
+ "{\\cf6 ",
+ "{\\cf7 ",
+ "{\\cf8 ",
+ "{\\cf9 ",
+};
+
+static const SIZE_T dwcRTFTagsCount[SIMBOLS_COUNT]=
+{
+ 4,
+ 2,
+ 2,
+ 2,
+ 4,
+ 1,
+ 5,
+ 1,
+ 4,
+ 1,
+ 1,
+ 6,
+ 6,
+ 6,
+ 6,
+ 6,
+ 6,
+ 6,
+ 6,
+};
+
+
+DWORD MraTextToRTFData(LPSTR lpszMessage,SIZE_T dwMessageSize,LPSTR lpszMessageConverted,SIZE_T dwMessageConvertedBuffSize,SIZE_T *pdwMessageConvertedSize);
+
+
+BOOL MraIsMessageFlashAnimation(LPWSTR lpwszMessage,SIZE_T dwMessageSize)
+{
+ BOOL bRet=FALSE;
+ LPWSTR lpwszFounded;
+
+ dwMessageSize*=sizeof(WCHAR);
+ lpwszFounded=(LPWSTR)MemoryFind(0,lpwszMessage,dwMessageSize,L"<SMILE>id=flas",28);
+ if (lpwszFounded)
+ {
+ if (MemoryFind(((lpwszFounded-lpwszMessage)+32),lpwszMessage,dwMessageSize,L"'</SMILE>",18)) bRet=TRUE;
+ }
+return(bRet);
+}
+
+
+
+DWORD MraTextToRTFData(LPSTR lpszMessage,SIZE_T dwMessageSize,LPSTR lpszMessageConverted,SIZE_T dwMessageConvertedBuffSize,SIZE_T *pdwMessageConvertedSize)
+{
+ DWORD dwRetErrorCode=NO_ERROR;
+
+ if (lpszMessage && dwMessageSize && lpszMessageConverted && dwMessageConvertedBuffSize)
+ {
+ BYTE tm,bCurByte;
+ LPSTR lpszMessageConvertedCur,lpszMessageConvertedMax;
+ SIZE_T i;
+
+ lpszMessageConvertedCur=lpszMessageConverted;
+ lpszMessageConvertedMax=(lpszMessageConverted+dwMessageConvertedBuffSize);
+ for(i=0;(i<dwMessageSize && (lpszMessageConvertedMax-lpszMessageConvertedCur)>3);i++)
+ {
+ //lpszMessageConvertedCur+=mir_snprintf(lpszMessageConvertedCur,8,"\\'%x",(*((BYTE*)lpszMessage+i)));
+
+ (*((WORD*)lpszMessageConvertedCur))=(*((WORD*)"\\'"));
+ bCurByte=(*((BYTE*)lpszMessage+i));
+ tm=(bCurByte>>4)&0xf;
+ lpszMessageConvertedCur[2]=(tm>9)? ('a'+tm-10):('0'+tm);
+
+ tm=bCurByte&0xf;
+ lpszMessageConvertedCur[3]=(tm>9)? ('a'+tm-10):('0'+tm);
+ lpszMessageConvertedCur+=4;
+ (*((BYTE*)lpszMessageConvertedCur))=0;
+ }
+ if (pdwMessageConvertedSize) (*pdwMessageConvertedSize)=(lpszMessageConvertedCur-lpszMessageConverted);
+ }else{
+ if (pdwMessageConvertedSize) (*pdwMessageConvertedSize)=0;
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD MraSybolsToRTFTags(DWORD dwFlags,LPSTR lpszMessage,SIZE_T dwMessageSize,LPSTR lpszMessageConverted,SIZE_T dwMessageConvertedBuffSize,SIZE_T *pdwMessageConvertedSize)
+{
+ DWORD dwRetErrorCode=NO_ERROR;
+ LPSTR lpszFounded[SIMBOLS_COUNT],lpszMessageConvertedCur,lpszMessageCur,lpszMessageCurPrev,lpszMessageConvertedMax;
+ SIZE_T i,dwFirstFoundedIndex=0,dwFoundedCount=0,dwMemPartToCopy;
+
+#ifdef _DEBUG //check table
+ for(i=0;i<SIMBOLS_COUNT;i++)
+ {
+ if (lstrlenA(lpszSimbols[i])!=dwcSimbolsCount[i]) DebugBreak();
+ if (lstrlenA(lpszRTFTags[i])!=dwcRTFTagsCount[i]) DebugBreak();
+ }
+#endif
+
+ lpszMessageCurPrev=lpszMessage;
+ lpszMessageConvertedCur=lpszMessageConverted;
+ lpszMessageConvertedMax=(lpszMessageConverted+dwMessageConvertedBuffSize);
+ for(i=0;i<SIMBOLS_COUNT;i++)
+ {// loking for first time
+ lpszFounded[i]=(LPSTR)MemoryFind((lpszMessageCurPrev-lpszMessage),lpszMessage,dwMessageSize,lpszSimbols[i],dwcSimbolsCount[i]);
+ if (lpszFounded[i]) dwFoundedCount++;
+ }
+
+ while(dwFoundedCount)
+ {
+ for(i=0;i<SIMBOLS_COUNT;i++)
+ {// looking for first to replace
+ if (lpszFounded[i] && (lpszFounded[i]<lpszFounded[dwFirstFoundedIndex] || lpszFounded[dwFirstFoundedIndex]==NULL)) dwFirstFoundedIndex=i;
+ }
+
+ if (lpszFounded[dwFirstFoundedIndex])
+ {// founded
+ dwMemPartToCopy=(lpszFounded[dwFirstFoundedIndex]-lpszMessageCurPrev);
+ if (lpszMessageConvertedMax>(lpszMessageConvertedCur+(dwMemPartToCopy+dwcRTFTagsCount[dwFirstFoundedIndex])))
+ {
+ //memmove(lpszMessageConvertedCur,lpszMessageCurPrev,dwMemPartToCopy);lpszMessageConvertedCur+=dwMemPartToCopy;
+ MraTextToRTFData(lpszMessageCurPrev,dwMemPartToCopy,lpszMessageConvertedCur,(lpszMessageConvertedMax-lpszMessageConvertedCur),&i);lpszMessageConvertedCur+=i;
+ memmove(lpszMessageConvertedCur,lpszRTFTags[dwFirstFoundedIndex],dwcRTFTagsCount[dwFirstFoundedIndex]);lpszMessageConvertedCur+=dwcRTFTagsCount[dwFirstFoundedIndex];
+ lpszMessageCurPrev=(lpszFounded[dwFirstFoundedIndex]+dwcSimbolsCount[dwFirstFoundedIndex]);
+
+ for(i=0;i<SIMBOLS_COUNT;i++)
+ {// loking for next time
+ if (lpszFounded[i] && lpszFounded[i]<lpszMessageCurPrev)
+ {
+ dwFoundedCount--;// , : "):-(" ":-("
+ lpszFounded[i]=(LPSTR)MemoryFind((lpszMessageCurPrev-lpszMessage),lpszMessage,dwMessageSize,lpszSimbols[i],dwcSimbolsCount[i]);
+ if (lpszFounded[i]) dwFoundedCount++;
+ }
+ }
+ }else{
+ dwRetErrorCode=ERROR_BUFFER_OVERFLOW;
+ DebugBreak();
+ break;
+ }
+ }else{// , .
+ DebugBreak();
+ break;
+ }
+ }
+ lpszMessageCur=(lpszMessage+dwMessageSize);
+ //memmove(lpszMessageConvertedCur,lpszMessageCurPrev,(lpszMessageCur-lpszMessageCurPrev));lpszMessageConvertedCur+=(lpszMessageCur-lpszMessageCurPrev);
+ MraTextToRTFData(lpszMessageCurPrev,(lpszMessageCur-lpszMessageCurPrev),lpszMessageConvertedCur,(lpszMessageConvertedMax-lpszMessageConvertedCur),&i);lpszMessageConvertedCur+=i;
+ (*((WORD*)lpszMessageConvertedCur))=0;
+
+ if (pdwMessageConvertedSize) (*pdwMessageConvertedSize)=(lpszMessageConvertedCur-lpszMessageConverted);
+
+return(dwRetErrorCode);
+}
+
+
+DWORD MraConvertToRTFW(LPWSTR lpwszMessage,SIZE_T dwMessageSize,LPSTR lpszMessageRTF,SIZE_T dwMessageRTFBuffSize,SIZE_T *pdwMessageRTFSize)
+{
+ DWORD dwRetErrorCode;
+
+ if (lpwszMessage && lpszMessageRTF)
+ {
+ if ((dwMessageSize+1024)<=dwMessageRTFBuffSize)
+ {
+ LPSTR lpszMessage;
+
+ lpszMessage=(LPSTR)MEMALLOC(dwMessageSize+32);
+ if (lpszMessage)
+ {
+ LPSTR lpszMessageRTFCur=lpszMessageRTF;
+ SIZE_T dwtm;
+ DWORD dwRTFFontColour,dwFontSize;
+ LOGFONT lf={0};
+
+ WideCharToMultiByte(MRA_CODE_PAGE,0,lpwszMessage,dwMessageSize,lpszMessage,(dwMessageSize+32),NULL,NULL);
+
+ dwRTFFontColour=DB_Mra_GetDword(NULL,"RTFFontColour",MRA_DEFAULT_RTF_FONT_COLOUR);
+ if (DB_Mra_GetContactSettingBlob(NULL,"RTFFont",&lf,sizeof(LOGFONT),NULL))
+ {
+ /*HDC hDC=GetDC(NULL);// kegl
+ dwFontSize=-MulDiv(lf.lfHeight,72,GetDeviceCaps(hDC,LOGPIXELSY));
+ ReleaseDC(NULL,hDC);*/
+ }else{
+ HDC hDC=GetDC(NULL);// kegl
+ lf.lfCharSet=MRA_DEFAULT_RTF_FONT_CHARSET;
+ lf.lfHeight=-MulDiv(MRA_DEFAULT_RTF_FONT_SIZE,GetDeviceCaps(hDC,LOGPIXELSY),72);
+ lstrcpynW(lf.lfFaceName,MRA_DEFAULT_RTF_FONT_NAME,LF_FACESIZE);
+ ReleaseDC(NULL,hDC);
+ }
+ dwFontSize=((-lf.lfHeight)+(((-lf.lfHeight)+4)/8));
+/* mail agent:
+{\rtf1\ansi\ansicpg1251\deff0\deflang1049{\fonttbl{\f0\fnil\fcharset204 Tahoma;}}
+{\colortbl ;\red255\green0\blue0;}
+\viewkind4\uc1\pard\cf1\f0\fs18\'ef\'f0\'e8\'e2\'e5\'f2\par
+}
+
+{\rtf1\ansi\ansicpg1251\deff0\deflang1049{\fonttbl{\f0\fnil\fcharset204 Tahoma;}}
+{\colortbl ;\red255\green0\blue0;}
+\viewkind4\uc1\pard\cf1\f0\fs18 1\par
+2\par
+3\par
+}
+*/
+ lpszMessageRTFCur+=mir_snprintf(lpszMessageRTFCur,(dwMessageRTFBuffSize-((SIZE_T)lpszMessageRTFCur-(SIZE_T)lpszMessageRTF)),"{\\rtf1\\ansi\\ansicpg1251\\deff0\\deflang1049{\\fonttbl{\\f0\\fnil\\fcharset%lu %s;}}\r\n",lf.lfCharSet,lf.lfFaceName);
+
+ if (MemoryFind(0,lpszMessage,dwMessageSize,BB_COLOR_TAG,(sizeof(BB_COLOR_TAG)-1)))
+ {//BB_COLOR_TAG// ,
+ lpszMessageRTFCur+=mir_snprintf(lpszMessageRTFCur,(dwMessageRTFBuffSize-((SIZE_T)lpszMessageRTFCur-(SIZE_T)lpszMessageRTF)),"{\\colortbl;\\red%lu\\green%lu\\blue%lu;%s}\r\n",(*((RGBTRIPLE*)&dwRTFFontColour)).rgbtBlue,(*((RGBTRIPLE*)&dwRTFFontColour)).rgbtGreen,(*((RGBTRIPLE*)&dwRTFFontColour)).rgbtRed,RTF_COLORTBLCOLOURS);
+ }else{
+ lpszMessageRTFCur+=mir_snprintf(lpszMessageRTFCur,(dwMessageRTFBuffSize-((SIZE_T)lpszMessageRTFCur-(SIZE_T)lpszMessageRTF)),"{\\colortbl;\\red%lu\\green%lu\\blue%lu;}\r\n",(*((RGBTRIPLE*)&dwRTFFontColour)).rgbtBlue,(*((RGBTRIPLE*)&dwRTFFontColour)).rgbtGreen,(*((RGBTRIPLE*)&dwRTFFontColour)).rgbtRed);
+ }
+
+ {
+ LPSTR lpszNotfink="",
+ lpszBold=((lf.lfWeight==FW_BOLD)? "\\b1":lpszNotfink),
+ lpszItalic=(lf.lfItalic? "\\i1":lpszNotfink),
+ lpszUnderline=(lf.lfUnderline? "\\ul1":lpszNotfink),
+ lpszStrikeOut=(lf.lfStrikeOut? "\\strike1":lpszNotfink);
+ lpszMessageRTFCur+=mir_snprintf(lpszMessageRTFCur,(dwMessageRTFBuffSize-((SIZE_T)lpszMessageRTFCur-(SIZE_T)lpszMessageRTF)),"\\viewkind4\\uc1\\pard\\cf1\\f0\\fs%lu%s%s%s%s",dwFontSize,lpszBold,lpszItalic,lpszUnderline,lpszStrikeOut);
+ }
+
+ if ((dwRetErrorCode=MraSybolsToRTFTags(0,lpszMessage,dwMessageSize,lpszMessageRTFCur,(dwMessageRTFBuffSize-(lpszMessageRTFCur-lpszMessageRTF)),&dwtm))==NO_ERROR)
+ {
+ lpszMessageRTFCur+=dwtm;
+ if ((lpszMessageRTF+dwMessageRTFBuffSize)>=(lpszMessageRTFCur+sizeof(PAR)+sizeof(CRLF)+2))
+ {
+ memmove(lpszMessageRTFCur,PAR,sizeof(PAR));lpszMessageRTFCur+=(sizeof(PAR)-1);
+ memmove(lpszMessageRTFCur,CRLF,sizeof(CRLF));lpszMessageRTFCur+=(sizeof(CRLF)-1);
+ memmove(lpszMessageRTFCur,"}",2);lpszMessageRTFCur+=2;
+ if (pdwMessageRTFSize) (*pdwMessageRTFSize)=(lpszMessageRTFCur-lpszMessageRTF);
+ DebugPrintCRLFA(lpszMessageRTF);
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ if (pdwMessageRTFSize) (*pdwMessageRTFSize)=dwMessageRTFBuffSize+1024;
+ dwRetErrorCode=ERROR_BUFFER_OVERFLOW;
+ DebugBreak();
+ }
+ }
+ MEMFREE(lpszMessage);
+ }
+ }else{
+ if (pdwMessageRTFSize) (*pdwMessageRTFSize)=dwMessageSize;
+ dwRetErrorCode=ERROR_BUFFER_OVERFLOW;
+ DebugBreak();
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+
diff --git a/protocols/MRA/MraRTFMsg.h b/protocols/MRA/MraRTFMsg.h
new file mode 100644
index 0000000000..80d198981e
--- /dev/null
+++ b/protocols/MRA/MraRTFMsg.h
@@ -0,0 +1,19 @@
+#if !defined(AFX_MRA_RTFMSG_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
+#define AFX_MRA_RTFMSG_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_
+
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+
+
+
+BOOL MraIsMessageFlashAnimation (LPWSTR lpwszMessage,SIZE_T dwMessageSize);
+DWORD MraConvertToRTFW (LPWSTR lpwszMessage,SIZE_T dwMessageSize,LPSTR lpszMessageRTF,SIZE_T dwMessageRTFBuffSize,SIZE_T *pdwMessageRTFSize);
+
+
+
+
+#endif // !defined(AFX_MRA_RTFMSG_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/MraSelectEMail.cpp b/protocols/MRA/MraSelectEMail.cpp
new file mode 100644
index 0000000000..ba9da3d471
--- /dev/null
+++ b/protocols/MRA/MraSelectEMail.cpp
@@ -0,0 +1,187 @@
+#include "Mra.h"
+#include "MraSelectEMail.h"
+#include "BuffToLowerCase.h"
+
+
+
+struct MraSelectEMailDlgData
+{
+ HANDLE hContact;
+ DWORD dwType;
+};
+
+
+
+
+void AddContactEMailToListParam(HANDLE hContact,BOOL bMRAOnly,LPSTR lpszModule,LPSTR lpszValueName,HWND hWndList)
+{
+ CHAR szBuff[MAX_PATH],szEMail[MAX_EMAIL_LEN];
+ WCHAR wszBuff[MAX_PATH];
+ SIZE_T i,dwEMailSize;
+
+ if(DB_GetStaticStringA(hContact,lpszModule,lpszValueName,szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ if (bMRAOnly==FALSE || IsEMailMR(szEMail,dwEMailSize))
+ {
+ MultiByteToWideChar(MRA_CODE_PAGE,0,szEMail,(dwEMailSize+1),wszBuff,SIZEOF(wszBuff));
+ if (SendMessage(hWndList,LB_FINDSTRING,-1,(LPARAM)wszBuff)==LB_ERR) SendMessage(hWndList,LB_ADDSTRING,0,(LPARAM)wszBuff);
+ }
+ }
+
+ for (i=0;TRUE;i++)
+ {
+ mir_snprintf(szBuff,SIZEOF(szBuff),"%s%lu",lpszValueName,i);
+ if(DB_GetStaticStringA(hContact,lpszModule,szBuff,szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ if (bMRAOnly==FALSE || IsEMailMR(szEMail,dwEMailSize))
+ {
+ MultiByteToWideChar(MRA_CODE_PAGE,0,szEMail,(dwEMailSize+1),wszBuff,SIZEOF(wszBuff));
+ if (SendMessage(hWndList,LB_FINDSTRING,-1,(LPARAM)wszBuff)==LB_ERR) SendMessage(hWndList,LB_ADDSTRING,0,(LPARAM)wszBuff);
+ }
+ }else{
+ if (i>EMAILS_MIN_COUNT) break;
+ }
+ }
+}
+
+
+INT_PTR CALLBACK MraSelectEMailDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM lParam)
+{
+ MraSelectEMailDlgData *pmrasemddDlgData=(MraSelectEMailDlgData*)GetWindowLongPtr(hWndDlg,GWLP_USERDATA);
+
+ if (pmrasemddDlgData)
+ {
+ switch(message){
+ case WM_CLOSE:
+ DestroyWindow(hWndDlg);
+ break;
+ case WM_DESTROY:
+ SetWindowLongPtr(hWndDlg,GWLP_USERDATA,(LONG_PTR)0);
+ MEMFREE(pmrasemddDlgData);
+ EndDialog(hWndDlg,NO_ERROR);
+ break;
+ case WM_COMMAND:
+ switch(LOWORD(wParam)){
+ case IDC_LIST_EMAILS:
+ if (HIWORD(wParam)==LBN_DBLCLK)
+ {
+ //switch(pmrasemddDlgData->dwType){
+ //case MRA_SELECT_EMAIL_TYPE_SEND_POSTCARD:
+ // break;
+ //case MRA_SELECT_EMAIL_TYPE_VIEW_ALBUM:
+ //case MRA_SELECT_EMAIL_TYPE_READ_BLOG:
+ SendMessage(hWndDlg,WM_COMMAND,MAKEWPARAM(IDOK,BN_CLICKED),(LPARAM)GetDlgItem(hWndDlg,IDOK));
+ // break;
+ //}
+ }
+ break;
+ case IDOK:
+ {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ WCHAR wszBuff[MAX_PATH];
+ SIZE_T dwEMailSize;
+
+ dwEMailSize=SendMessage(GetDlgItem(hWndDlg,IDC_LIST_EMAILS),LB_GETTEXT,SendMessage(GetDlgItem(hWndDlg,IDC_LIST_EMAILS),LB_GETCURSEL,0,0),(LPARAM)wszBuff);
+ WideCharToMultiByte(MRA_CODE_PAGE,0,wszBuff,(dwEMailSize+1),szEMail,SIZEOF(szEMail),NULL,NULL);
+ BuffToLowerCase(szEMail,szEMail,dwEMailSize);
+
+ switch(pmrasemddDlgData->dwType){
+ case MRA_SELECT_EMAIL_TYPE_SEND_POSTCARD:
+ {
+ SIZE_T dwUrlSize;
+ CHAR szUrl[BUFF_SIZE_URL];
+ dwUrlSize=mir_snprintf(szUrl,SIZEOF(szUrl),"http://cards.mail.ru/event.html?rcptname=%s&rcptemail=%s",GetContactNameA(pmrasemddDlgData->hContact),szEMail);
+ MraMPopSessionQueueAddUrl(masMraSettings.hMPopSessionQueue,szUrl,dwUrlSize);
+ }
+ break;
+ case MRA_SELECT_EMAIL_TYPE_VIEW_ALBUM:
+ MraMPopSessionQueueAddUrlAndEMail(masMraSettings.hMPopSessionQueue,MRA_FOTO_URL,sizeof(MRA_FOTO_URL),szEMail,dwEMailSize);
+ break;
+ case MRA_SELECT_EMAIL_TYPE_READ_BLOG:
+ MraMPopSessionQueueAddUrlAndEMail(masMraSettings.hMPopSessionQueue,MRA_BLOGS_URL,sizeof(MRA_BLOGS_URL),szEMail,dwEMailSize);
+ break;
+ case MRA_SELECT_EMAIL_TYPE_VIEW_VIDEO:
+ MraMPopSessionQueueAddUrlAndEMail(masMraSettings.hMPopSessionQueue,MRA_VIDEO_URL,sizeof(MRA_VIDEO_URL),szEMail,dwEMailSize);
+ break;
+ case MRA_SELECT_EMAIL_TYPE_ANSWERS:
+ MraMPopSessionQueueAddUrlAndEMail(masMraSettings.hMPopSessionQueue,MRA_ANSWERS_URL,sizeof(MRA_ANSWERS_URL),szEMail,dwEMailSize);
+ break;
+ case MRA_SELECT_EMAIL_TYPE_WORLD:
+ MraMPopSessionQueueAddUrlAndEMail(masMraSettings.hMPopSessionQueue,MRA_WORLD_URL,sizeof(MRA_WORLD_URL),szEMail,dwEMailSize);
+ break;
+ }
+ }
+ //break;
+ case IDCANCEL:
+ DestroyWindow(hWndDlg);
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+ }else{
+ pmrasemddDlgData=(MraSelectEMailDlgData*)lParam;
+
+ if (message==WM_INITDIALOG)
+ {
+ HWND hWndList;
+ BOOL bMRAOnly;
+ LPSTR lpszProto;
+
+ SetWindowLongPtr(hWndDlg,GWLP_USERDATA,(LONG_PTR)lParam);
+ hWndList=GetDlgItem(hWndDlg,IDC_LIST_EMAILS);
+ //SendMessage(hWndList,CB_RESETCONTENT,0,0);
+
+ switch(pmrasemddDlgData->dwType){
+ case MRA_SELECT_EMAIL_TYPE_SEND_POSTCARD:
+ // SetWindowLongPtr(hWndList,GWL_STYLE,(GetWindowLongPtr(hWndList,GWL_STYLE)|LBS_MULTIPLESEL));
+ // SetWindowLongPtr(hWndList,GWL_STYLE,(GetWindowLongPtr(hWndList,GWL_STYLE)&~LBS_SORT));
+ bMRAOnly=FALSE;
+ break;
+ case MRA_SELECT_EMAIL_TYPE_VIEW_ALBUM:
+ case MRA_SELECT_EMAIL_TYPE_READ_BLOG:
+ // SetWindowLongPtr(hWndList,GWL_STYLE,(LONG)(GetWindowLong(hWndList,GWL_STYLE)|LBS_NOSEL));
+ bMRAOnly=TRUE;
+ break;
+ default:
+ bMRAOnly=FALSE;
+ break;
+ }
+
+ if (pmrasemddDlgData->hContact)
+ {
+ lpszProto=(LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)pmrasemddDlgData->hContact,0);
+ }else{
+ lpszProto=PROTOCOL_NAMEA;
+ }
+ AddContactEMailToListParam(pmrasemddDlgData->hContact,bMRAOnly,lpszProto,"e-mail",hWndList);
+ AddContactEMailToListParam(pmrasemddDlgData->hContact,bMRAOnly,"UserInfo","e-mail",hWndList);
+ AddContactEMailToListParam(pmrasemddDlgData->hContact,bMRAOnly,"UserInfo","Mye-mail",hWndList);
+ AddContactEMailToListParam(pmrasemddDlgData->hContact,bMRAOnly,"UserInfo","Companye-mail",hWndList);
+ AddContactEMailToListParam(pmrasemddDlgData->hContact,bMRAOnly,"UserInfo","MyCompanye-mail",hWndList);
+
+ TranslateDialogDefault(hWndDlg);
+ }
+
+ //return(DefWindowProc(hWndDlg,message,wParam,lParam));
+ }
+return(FALSE);
+}
+
+
+DWORD MraSelectEMailDlgShow(HANDLE hContact,DWORD dwType)
+{
+ MraSelectEMailDlgData *pmrasemddDlgData;
+
+ pmrasemddDlgData=(MraSelectEMailDlgData*)MEMALLOC(sizeof(MraSelectEMailDlgData));
+ if (pmrasemddDlgData)
+ {
+ pmrasemddDlgData->hContact=hContact;
+ pmrasemddDlgData->dwType=dwType;
+ DialogBoxParam(masMraSettings.hInstance,MAKEINTRESOURCE(IDD_DIALOG_SELECT_EMAIL),NULL,MraSelectEMailDlgProc,(LPARAM)pmrasemddDlgData);
+ }
+return(0);
+} \ No newline at end of file
diff --git a/protocols/MRA/MraSelectEMail.h b/protocols/MRA/MraSelectEMail.h
new file mode 100644
index 0000000000..d1ad657dc1
--- /dev/null
+++ b/protocols/MRA/MraSelectEMail.h
@@ -0,0 +1,25 @@
+#if !defined(AFX_MRA_SELECT_EMAIL_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
+#define AFX_MRA_SELECT_EMAIL_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_
+
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+
+#define MRA_SELECT_EMAIL_TYPE_SEND_POSTCARD 1
+#define MRA_SELECT_EMAIL_TYPE_VIEW_ALBUM 2
+#define MRA_SELECT_EMAIL_TYPE_READ_BLOG 3
+#define MRA_SELECT_EMAIL_TYPE_VIEW_VIDEO 4
+#define MRA_SELECT_EMAIL_TYPE_ANSWERS 5
+#define MRA_SELECT_EMAIL_TYPE_WORLD 6
+
+
+DWORD MraSelectEMailDlgShow(HANDLE hContact,DWORD dwType);
+
+
+
+
+
+#endif // !defined(AFX_MRA_SELECT_EMAIL_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/MraSendCommand.cpp b/protocols/MRA/MraSendCommand.cpp
new file mode 100644
index 0000000000..f27ef57860
--- /dev/null
+++ b/protocols/MRA/MraSendCommand.cpp
@@ -0,0 +1,878 @@
+#include "Mra.h"
+#include "MraSendCommand.h"
+#include "MraRTFMsg.h"
+#include "proto.h"
+
+
+
+
+
+void SetUL (LPBYTE *plpBuff,DWORD dwData);
+void SetUIDL (LPBYTE *plpBuff,DWORDLONG dwData);
+void SetGUID (LPBYTE *plpBuff,MRA_GUID guidData);
+void SetLPS (LPBYTE *plpBuff,LPSTR lpszData,DWORD dwSize);
+void SetLPSW (LPBYTE *plpBuff,LPWSTR lpwszData,DWORD dwSize);
+void SetLPSWtoA (LPBYTE *plpBuff,LPWSTR lpwszData,DWORD dwSize);
+void SetLPSLowerCase (LPBYTE *plpBuff,LPSTR lpszData,DWORD dwSize);
+void SetLPSLowerCaseW (LPBYTE *plpBuff,LPWSTR lpwszData,DWORD dwSize);
+
+
+
+
+
+
+DWORD MraSendCommand_MessageW(BOOL bAddToQueue,HANDLE hContact,DWORD dwAckType,DWORD dwFlags,LPSTR lpszEMail,SIZE_T dwEMailSize,LPWSTR lpwszMessage,SIZE_T dwMessageSize,LPBYTE lpbMultiChatData,SIZE_T dwMultiChatDataSize)
+{//
+ DWORD dwRet=0;
+ LPBYTE lpbData,lpbDataCurrent;
+ LPSTR lpszMessageConverted=(LPSTR)lpwszMessage;
+ LPSTR lpszMessageRTF=NULL;
+ SIZE_T dwMessageConvertedSize=(dwMessageSize*sizeof(WCHAR)),dwMessageRTFSize=0;
+
+
+ if (MraIsMessageFlashAnimation(lpwszMessage,dwMessageSize)) dwFlags|=MESSAGE_FLAG_FLASH;
+
+ if (dwFlags&MESSAGE_FLAG_AUTHORIZE)
+ {// pack auth message
+ LPBYTE lpbAuthMsgBuff;
+ SIZE_T dwMessageConvertedBuffSize=(((((dwMessageSize*sizeof(WCHAR))+1024)+2)/3)*4);
+
+ lpszMessageConverted=(LPSTR)MEMALLOC(dwMessageConvertedBuffSize);
+ lpbAuthMsgBuff=(LPBYTE)MEMALLOC(((dwMessageSize*sizeof(WCHAR))+1024));
+ if (lpszMessageConverted && lpbAuthMsgBuff)
+ {
+ lpbDataCurrent=lpbAuthMsgBuff;
+ SetUL(&lpbDataCurrent,2);
+ SetLPSW(&lpbDataCurrent,NULL,0);//***deb possible nick here
+ SetLPSW(&lpbDataCurrent,lpwszMessage,dwMessageSize);
+
+ BASE64EncodeUnSafe(lpbAuthMsgBuff,(lpbDataCurrent-lpbAuthMsgBuff),lpszMessageConverted,dwMessageConvertedBuffSize,&dwMessageConvertedSize);
+ }else{
+ MEMFREE(lpszMessageConverted);
+ lpszMessageConverted=(LPSTR)lpwszMessage;
+ }
+ MEMFREE(lpbAuthMsgBuff);
+ }else
+ if (dwFlags&MESSAGE_FLAG_FLASH)
+ {//
+ if (masMraSettings.lpfnCompress2)// only if func exist
+ {
+ SIZE_T dwRFTBuffSize=(((dwMessageSize*sizeof(WCHAR))*4)+8192),dwRTFDataSize;
+ LPBYTE lpbRTFData;
+
+ dwFlags|=MESSAGE_FLAG_RTF;
+ lpszMessageRTF=(LPSTR)MEMALLOC(dwRFTBuffSize);
+ lpbRTFData=(LPBYTE)MEMALLOC(dwRFTBuffSize);
+ if (lpszMessageRTF && lpbRTFData)
+ {
+ DWORD dwBackColour;
+
+ dwBackColour=DB_Mra_GetDword(NULL,"RTFBackgroundColour",MRA_DEFAULT_RTF_BACKGROUND_COLOUR);
+ lpbDataCurrent=(LPBYTE)lpszMessageRTF;
+
+ WideCharToMultiByte(MRA_CODE_PAGE,0,lpwszMessage,dwMessageSize,(LPSTR)lpbRTFData,dwRFTBuffSize,NULL,NULL);
+
+ SetUL(&lpbDataCurrent,4);
+ SetLPS(&lpbDataCurrent,(LPSTR)lpbRTFData,dwMessageSize);// :)
+ SetLPS(&lpbDataCurrent,(LPSTR)&dwBackColour,sizeof(DWORD));//
+ SetLPS(&lpbDataCurrent,(LPSTR)lpbRTFData,dwMessageSize);// ANSI
+ SetLPSW(&lpbDataCurrent,lpwszMessage,dwMessageSize);// UNICODE
+
+ dwRTFDataSize=dwRFTBuffSize;
+ if ((PCOMPRESS2(masMraSettings.lpfnCompress2))(lpbRTFData,(DWORD*)&dwRTFDataSize,(LPBYTE)lpszMessageRTF,(lpbDataCurrent-(LPBYTE)lpszMessageRTF),Z_BEST_COMPRESSION)==Z_OK)
+ {
+ BASE64EncodeUnSafe(lpbRTFData,dwRTFDataSize,lpszMessageRTF,dwRFTBuffSize,&dwMessageRTFSize);
+ }
+ }
+ MEMFREE(lpbRTFData);
+ }
+ }else// standart message
+ if ((dwFlags&(MESSAGE_FLAG_CONTACT|MESSAGE_FLAG_NOTIFY|MESSAGE_FLAG_SMS))==0)
+ {// Only if message is simple text message or RTF or ALARM
+ if (dwFlags&MESSAGE_FLAG_RTF)// add RFT part
+ if (masMraSettings.lpfnCompress2)// only if func exist
+ {//
+ SIZE_T dwRFTBuffSize=(((dwMessageSize*sizeof(WCHAR))*16)+8192),dwRTFDataSize;
+ LPBYTE lpbRTFData;
+
+ lpszMessageRTF=(LPSTR)MEMALLOC(dwRFTBuffSize);
+ lpbRTFData=(LPBYTE)MEMALLOC(dwRFTBuffSize);
+ if (lpszMessageRTF && lpbRTFData)
+ {
+ if (MraConvertToRTFW(lpwszMessage,dwMessageSize,(LPSTR)lpbRTFData,dwRFTBuffSize,&dwRTFDataSize)==NO_ERROR)
+ {
+ DWORD dwBackColour;
+
+ dwBackColour=DB_Mra_GetDword(NULL,"RTFBackgroundColour",MRA_DEFAULT_RTF_BACKGROUND_COLOUR);
+ lpbDataCurrent=(LPBYTE)lpszMessageRTF;
+
+ SetUL(&lpbDataCurrent,2);
+ SetLPS(&lpbDataCurrent,(LPSTR)lpbRTFData,dwRTFDataSize);
+ SetLPS(&lpbDataCurrent,(LPSTR)&dwBackColour,sizeof(DWORD));
+
+ dwRTFDataSize=dwRFTBuffSize;
+ if ((PCOMPRESS2(masMraSettings.lpfnCompress2))(lpbRTFData,(DWORD*)&dwRTFDataSize,(LPBYTE)lpszMessageRTF,(lpbDataCurrent-(LPBYTE)lpszMessageRTF),Z_BEST_COMPRESSION)==Z_OK)
+ {
+ BASE64EncodeUnSafe(lpbRTFData,dwRTFDataSize,lpszMessageRTF,dwRFTBuffSize,&dwMessageRTFSize);
+ }
+ }
+ }
+ MEMFREE(lpbRTFData);
+ }
+ }//*/
+ if (lpszMessageRTF==NULL || dwMessageRTFSize==0) dwFlags&=~(MESSAGE_FLAG_RTF|MESSAGE_FLAG_FLASH);
+ if (lpbMultiChatData==NULL || dwMultiChatDataSize==0) dwFlags&=~MESSAGE_FLAG_MULTICHAT;
+
+ lpbData=(LPBYTE)MEMALLOC((sizeof(DWORD)+dwEMailSize+dwMessageConvertedSize+dwMessageRTFSize+dwMultiChatDataSize+128));
+ if (lpbData)
+ {
+ lpbDataCurrent=lpbData;
+ SetUL(&lpbDataCurrent,dwFlags);
+ SetLPSLowerCase(&lpbDataCurrent,lpszEMail,dwEMailSize);
+ SetLPS(&lpbDataCurrent,lpszMessageConverted,dwMessageConvertedSize);
+ SetLPS(&lpbDataCurrent,lpszMessageRTF,dwMessageRTFSize);
+ if (dwFlags&MESSAGE_FLAG_MULTICHAT) SetLPS(&lpbDataCurrent,(LPSTR)lpbMultiChatData,dwMultiChatDataSize);
+
+ if (bAddToQueue)
+ {
+ dwRet=MraSendQueueCMD(masMraSettings.hSendQueueHandle,0,hContact,dwAckType,(LPBYTE)lpwszMessage,(dwMessageSize*sizeof(WCHAR)),MRIM_CS_MESSAGE,lpbData,(lpbDataCurrent-lpbData));
+ }else{
+ dwRet=MraSendCMD(MRIM_CS_MESSAGE,lpbData,(lpbDataCurrent-lpbData));
+ }
+ MEMFREE(lpbData);
+ }
+ if (lpszMessageConverted!=(LPSTR)lpwszMessage) MEMFREE(lpszMessageConverted);
+ MEMFREE(lpszMessageRTF);
+
+return(dwRet);
+}
+
+
+DWORD MraSendCommand_MessageAskW(DWORD dwMsgID,DWORD dwFlags,LPSTR lpszEMail,SIZE_T dwEMailSize,LPWSTR lpwszMessage,SIZE_T dwMessageSize,LPSTR lpwszMessageRTF,SIZE_T dwMessageRTFSize)
+{//
+ DWORD dwRet=0;
+
+ if (lpszEMail && dwEMailSize>4 && lpwszMessage && dwMessageSize)
+ {
+ LPBYTE lpbData,lpbDataCurrent;
+
+ lpbData=(LPBYTE)MEMALLOC((sizeof(DWORD)+sizeof(DWORD)+dwEMailSize+dwMessageSize+dwMessageRTFSize+32));
+ if (lpbData)
+ {
+ lpbDataCurrent=lpbData;
+ SetUL(&lpbDataCurrent,dwMsgID);//UL msg_id
+ SetUL(&lpbDataCurrent,dwFlags);//UL flags
+ SetLPSLowerCase(&lpbDataCurrent,lpszEMail,dwEMailSize);// LPS from e-mail ANSI
+ SetLPS(&lpbDataCurrent,(LPSTR)lpwszMessage,dwMessageSize);// LPS message UNICODE
+ if (dwFlags&MESSAGE_FLAG_RTF)
+ SetLPS(&lpbDataCurrent,(LPSTR)lpwszMessageRTF,dwMessageRTFSize);// LPS //rtf-formatted message (>=1.1) - MESSAGE_FLAG_RTF
+
+ dwRet=MraSendCMD(MRIM_CS_MESSAGE_ACK,lpbData,(lpbDataCurrent-lpbData));
+ //dwRet=MraSendCMD(MRIM_CS_MESSAGE,lpbData,(lpbDataCurrent-lpbData));
+ MEMFREE(lpbData);
+ }
+ }else{
+ DebugBreak();
+ }
+return(dwRet);
+}
+
+
+DWORD MraSendCommand_MessageRecv(LPSTR lpszFrom,SIZE_T dwFromSize,DWORD dwMsgID)
+{//
+ DWORD dwRet=0;
+
+ if (lpszFrom && dwFromSize>4)
+ {
+ LPBYTE lpbData,lpbDataCurrent;
+
+ lpbData=(LPBYTE)MEMALLOC((dwFromSize+sizeof(DWORD)+32));
+ if (lpbData)
+ {
+ lpbDataCurrent=lpbData;
+ SetLPSLowerCase(&lpbDataCurrent,lpszFrom,dwFromSize);
+ SetUL(&lpbDataCurrent,dwMsgID);
+
+ dwRet=MraSendCMD(MRIM_CS_MESSAGE_RECV,lpbData,(lpbDataCurrent-lpbData));
+ MEMFREE(lpbData);
+ }
+ }else{
+ DebugBreak();
+ }
+return(dwRet);
+}
+
+
+DWORD MraSendCommand_AddContactW(HANDLE hContact,DWORD dwContactFlag,DWORD dwGroupID,LPSTR lpszEMail,SIZE_T dwEMailSize,LPWSTR lpwszCustomName,SIZE_T dwCustomNameSize,LPSTR lpszPhones,SIZE_T dwPhonesSize,LPWSTR lpwszAuthMessage,SIZE_T dwAuthMessageSize,DWORD dwActions)
+{//
+ DWORD dwRet=0;
+
+ if (lpszEMail && dwEMailSize>4)
+ {
+ LPBYTE lpbData,lpbDataCurrent;
+
+ lpbData=(LPBYTE)MEMALLOC((sizeof(DWORD)+sizeof(DWORD)+dwEMailSize+(dwCustomNameSize*sizeof(WCHAR))+dwPhonesSize+(((((dwAuthMessageSize*sizeof(WCHAR))+1024)+2)/3)*4)+32)+sizeof(DWORD));
+ if (lpbData)
+ {
+ dwContactFlag|=CONTACT_FLAG_UNICODE_NAME;
+
+ lpbDataCurrent=lpbData;
+ SetUL(&lpbDataCurrent,dwContactFlag);
+ SetUL(&lpbDataCurrent,dwGroupID);
+ SetLPSLowerCase(&lpbDataCurrent,lpszEMail,dwEMailSize);
+ SetLPSW(&lpbDataCurrent,lpwszCustomName,dwCustomNameSize);
+ SetLPS(&lpbDataCurrent,lpszPhones,dwPhonesSize);
+ {// pack auth message
+ LPBYTE lpbAuthMsgBuff,lpbAuthMessageConverted,lpbAuthDataCurrent;
+ SIZE_T dwAuthMessageConvertedBuffSize=(((((dwAuthMessageSize*sizeof(WCHAR))+1024)+2)/3)*4),dwAuthMessageConvertedSize=0;
+
+ lpbAuthMessageConverted=(LPBYTE)MEMALLOC(dwAuthMessageConvertedBuffSize);
+ lpbAuthMsgBuff=(LPBYTE)MEMALLOC(((dwAuthMessageSize*sizeof(WCHAR))+1024));
+ if (lpbAuthMessageConverted && lpbAuthMsgBuff)
+ {
+ lpbAuthDataCurrent=lpbAuthMsgBuff;
+ SetUL(&lpbAuthDataCurrent,2);
+ SetLPSW(&lpbAuthDataCurrent,NULL,0);//***deb possible nick here
+ SetLPSW(&lpbAuthDataCurrent,lpwszAuthMessage,dwAuthMessageSize);
+
+ BASE64EncodeUnSafe(lpbAuthMsgBuff,(lpbAuthDataCurrent-lpbAuthMsgBuff),lpbAuthMessageConverted,dwAuthMessageConvertedBuffSize,&dwAuthMessageConvertedSize);
+ }
+ SetLPS(&lpbDataCurrent,(LPSTR)lpbAuthMessageConverted,dwAuthMessageConvertedSize);
+ MEMFREE(lpbAuthMsgBuff);
+ MEMFREE(lpbAuthMessageConverted);
+ }
+ SetUL(&lpbDataCurrent,dwActions);
+
+ dwRet=MraSendQueueCMD(masMraSettings.hSendQueueHandle,0,hContact,ACKTYPE_ADDED,NULL,0,MRIM_CS_ADD_CONTACT,lpbData,(lpbDataCurrent-lpbData));
+ MEMFREE(lpbData);
+ }
+ }else{
+ //DebugBreak();
+ }
+return(dwRet);
+}
+
+
+DWORD MraSendCommand_ModifyContactW(HANDLE hContact,DWORD dwID,DWORD dwContactFlag,DWORD dwGroupID,LPSTR lpszEMail,SIZE_T dwEMailSize,LPWSTR lpwszCustomName,SIZE_T dwCustomNameSize,LPSTR lpszPhones,SIZE_T dwPhonesSize)
+{//
+ DWORD dwRet=0;
+
+ LPBYTE lpbData,lpbDataCurrent;
+
+ if (dwID!=-1)
+ {
+ lpbData=(LPBYTE)MEMALLOC((sizeof(DWORD)+sizeof(DWORD)+sizeof(DWORD)+dwEMailSize+(dwCustomNameSize*sizeof(WCHAR))+dwPhonesSize+32));
+ if (lpbData)
+ {
+ dwContactFlag|=CONTACT_FLAG_UNICODE_NAME;
+
+ lpbDataCurrent=lpbData;
+ SetUL(&lpbDataCurrent,dwID);
+ SetUL(&lpbDataCurrent,dwContactFlag);
+ SetUL(&lpbDataCurrent,dwGroupID);
+ SetLPSLowerCase(&lpbDataCurrent,lpszEMail,dwEMailSize);
+ SetLPSW(&lpbDataCurrent,lpwszCustomName,dwCustomNameSize);
+ SetLPS(&lpbDataCurrent,lpszPhones,dwPhonesSize);
+
+ dwRet=MraSendQueueCMD(masMraSettings.hSendQueueHandle,0,hContact,ACKTYPE_ADDED,NULL,0,MRIM_CS_MODIFY_CONTACT,lpbData,(lpbDataCurrent-lpbData));
+ MEMFREE(lpbData);
+ }
+ }else{
+ DebugBreak();
+ }
+return(dwRet);
+}
+
+
+DWORD MraSendCommand_OfflineMessageDel(DWORDLONG dwMsgUIDL)
+{//
+return(MraSendCMD(MRIM_CS_DELETE_OFFLINE_MESSAGE,&dwMsgUIDL,sizeof(DWORDLONG)));
+}
+
+
+DWORD MraSendCommand_Authorize(LPSTR lpszEMail,SIZE_T dwEMailSize)
+{// -
+ DWORD dwRet=0;
+
+ if (lpszEMail && dwEMailSize>4)
+ {
+ LPBYTE lpbData,lpbDataCurrent;
+
+ lpbData=(LPBYTE)MEMALLOC((dwEMailSize+32));
+ if (lpbData)
+ {
+ lpbDataCurrent=lpbData;
+ SetLPSLowerCase(&lpbDataCurrent,lpszEMail,dwEMailSize);
+
+ dwRet=MraSendCMD(MRIM_CS_AUTHORIZE,lpbData,(lpbDataCurrent-lpbData));
+ MEMFREE(lpbData);
+ }
+ }else{
+ DebugBreak();
+ }
+return(dwRet);
+}
+
+
+DWORD MraSendCommand_ChangeStatusW(DWORD dwStatus,LPSTR lpszStatusUri,SIZE_T dwStatusUriSize,LPWSTR lpwszStatusTitle,SIZE_T dwStatusTitleSize,LPWSTR lpwszStatusDesc,SIZE_T dwStatusDescSize,DWORD dwFutureFlags)
+{//
+ DWORD dwRet=0;
+ LPBYTE lpbData,lpbDataCurrent;
+
+ if (dwStatusUriSize>SPEC_STATUS_URI_MAX) dwStatusUriSize=SPEC_STATUS_URI_MAX;
+ if (dwStatusTitleSize>STATUS_TITLE_MAX) dwStatusTitleSize=STATUS_TITLE_MAX;
+ if (dwStatusDescSize>STATUS_DESC_MAX) dwStatusDescSize=STATUS_DESC_MAX;
+
+ lpbData=(LPBYTE)MEMALLOC((sizeof(DWORD)+dwStatusUriSize+(dwStatusTitleSize*sizeof(WCHAR))+(dwStatusDescSize*sizeof(WCHAR))+sizeof(DWORD)+32));
+ if (lpbData)
+ {
+ lpbDataCurrent=lpbData;
+ SetUL(&lpbDataCurrent,dwStatus);
+ SetLPS(&lpbDataCurrent,lpszStatusUri,dwStatusUriSize);
+ SetLPSW(&lpbDataCurrent,lpwszStatusTitle,dwStatusTitleSize);
+ SetLPSW(&lpbDataCurrent,lpwszStatusDesc,dwStatusDescSize);
+ SetUL(&lpbDataCurrent,dwFutureFlags);
+
+ dwRet=MraSendCMD(MRIM_CS_CHANGE_STATUS,lpbData,(lpbDataCurrent-lpbData));
+ MEMFREE(lpbData);
+ }
+return(dwRet);
+}
+
+
+DWORD MraSendCommand_FileTransfer(LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwIDRequest,DWORD dwFilesTotalSize,LPWSTR lpwszFiles,SIZE_T dwFilesSize,LPSTR lpszAddreses,SIZE_T dwAddresesSize)
+{//
+ DWORD dwRet=0;
+
+ if (lpszEMail && dwEMailSize>4)
+ {
+ SIZE_T dwFilesSizeA;
+ LPBYTE lpbData,lpbDataCurrent;
+
+ dwFilesSizeA=WideCharToMultiByte(MRA_CODE_PAGE,0,lpwszFiles,dwFilesSize,NULL,0,NULL,NULL);
+ lpbData=(LPBYTE)MEMALLOC((dwEMailSize+dwFilesSizeA+(dwFilesSize*sizeof(WCHAR))+dwAddresesSize+MAX_PATH));
+ if (lpbData)
+ {
+ lpbDataCurrent=lpbData;
+ SetLPSLowerCase(&lpbDataCurrent,lpszEMail,dwEMailSize);
+ SetUL(&lpbDataCurrent,dwIDRequest);
+ SetUL(&lpbDataCurrent,dwFilesTotalSize);
+ SetUL(&lpbDataCurrent,(sizeof(DWORD)+dwFilesSizeA + sizeof(DWORD)+(sizeof(DWORD)+sizeof(DWORD)+(dwFilesSize*sizeof(WCHAR))) + sizeof(DWORD)+dwAddresesSize));//SetLPS(&lpbDataCurrent,(LPSTR)lpbDataEx,dwDataExSize);
+ {
+ SetLPSWtoA(&lpbDataCurrent,lpwszFiles,dwFilesSize);
+ SetUL(&lpbDataCurrent,(sizeof(DWORD)+sizeof(DWORD)+(dwFilesSize*sizeof(WCHAR))));//SetLPS(&lpbDataCurrent,lpbDescription,dwDescriptionSize);
+ {
+ SetUL(&lpbDataCurrent,1);
+ SetLPSW(&lpbDataCurrent,lpwszFiles,dwFilesSize);
+ }
+ SetLPS(&lpbDataCurrent,lpszAddreses,dwAddresesSize);
+ }
+
+ dwRet=MraSendCMD(MRIM_CS_FILE_TRANSFER,lpbData,(lpbDataCurrent-lpbData));
+ MEMFREE(lpbData);
+ }
+ }else{
+ DebugBreak();
+ }
+return(dwRet);
+}
+
+
+DWORD MraSendCommand_FileTransferAck(DWORD dwStatus,LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwIDRequest,LPBYTE lpbDescription,SIZE_T dwDescriptionSize)
+{//
+ DWORD dwRet=0;
+
+ if (lpszEMail && dwEMailSize>4)
+ {
+ LPBYTE lpbData,lpbDataCurrent;
+
+ lpbData=(LPBYTE)MEMALLOC((dwEMailSize+dwDescriptionSize+32));
+ if (lpbData)
+ {
+ lpbDataCurrent=lpbData;
+ SetUL(&lpbDataCurrent,dwStatus);
+ SetLPSLowerCase(&lpbDataCurrent,lpszEMail,dwEMailSize);
+ SetUL(&lpbDataCurrent,dwIDRequest);
+ SetLPS(&lpbDataCurrent,(LPSTR)lpbDescription,dwDescriptionSize);
+
+ dwRet=MraSendCMD(MRIM_CS_FILE_TRANSFER_ACK,lpbData,(lpbDataCurrent-lpbData));
+ MEMFREE(lpbData);
+ }
+ }else{
+ DebugBreak();
+ }
+return(dwRet);
+}
+
+
+/*DWORD MraSendCommand_WPRequestA(HANDLE hContact,DWORD dwAckType,DWORD dwRequestFlags,LPSTR lpszUser,SIZE_T dwUserSize,LPSTR lpszDomain,SIZE_T dwDomainSize,LPSTR lpszNickName,SIZE_T dwNickNameSize,LPSTR lpszFirstName,SIZE_T dwFirstNameSize,LPSTR lpszLastName,SIZE_T dwLastNameSize,DWORD dwSex,DWORD dwDate1,DWORD dwDate2,DWORD dwCityID,DWORD dwZodiak,DWORD dwBirthdayMonth,DWORD dwBirthdayDay,DWORD dwCountryID,DWORD dwOnline)
+{//
+ //WCHAR wszUser[MAX_PATH],wszDomain[MAX_PATH];
+ WCHAR wszNickName[MAX_PATH],wszFirstName[MAX_PATH],wszLastName[MAX_PATH];
+
+ //if (lpszUser && dwUserSize) dwUserSize=MultiByteToWideChar(MRA_CODE_PAGE,0,lpszUser,dwUserSize,wszUser,SIZEOF(wszUser));
+ //if (lpszDomain && dwDomainSize) dwDomainSize=MultiByteToWideChar(MRA_CODE_PAGE,0,lpszDomain,dwDomainSize,wszDomain,SIZEOF(wszDomain));
+ if (lpszNickName && dwNickNameSize) dwNickNameSize=MultiByteToWideChar(MRA_CODE_PAGE,0,lpszNickName,dwNickNameSize,wszNickName,SIZEOF(wszNickName));
+ if (lpszFirstName && dwFirstNameSize) dwFirstNameSize=MultiByteToWideChar(MRA_CODE_PAGE,0,lpszFirstName,dwFirstNameSize,wszFirstName,SIZEOF(wszFirstName));
+ if (lpszLastName && dwLastNameSize) dwLastNameSize=MultiByteToWideChar(MRA_CODE_PAGE,0,lpszLastName,dwLastNameSize,wszLastName,SIZEOF(wszLastName));
+
+return(MraSendCommand_WPRequestW(hContact,dwAckType,dwRequestFlags,lpszUser,dwUserSize,lpszDomain,dwDomainSize,wszNickName,dwNickNameSize,wszFirstName,dwFirstNameSize,wszLastName,dwLastNameSize,dwSex,dwDate1,dwDate2,dwCityID,dwZodiak,dwBirthdayMonth,dwBirthdayDay,dwCountryID,dwOnline));
+}//*/
+
+DWORD MraSendCommand_WPRequestW(HANDLE hContact,DWORD dwAckType,DWORD dwRequestFlags,LPSTR lpszUser,SIZE_T dwUserSize,LPSTR lpszDomain,SIZE_T dwDomainSize,LPWSTR lpwszNickName,SIZE_T dwNickNameSize,LPWSTR lpwszFirstName,SIZE_T dwFirstNameSize,LPWSTR lpwszLastName,SIZE_T dwLastNameSize,DWORD dwSex,DWORD dwDate1,DWORD dwDate2,DWORD dwCityID,DWORD dwZodiak,DWORD dwBirthdayMonth,DWORD dwBirthdayDay,DWORD dwCountryID,DWORD dwOnline)
+{//
+ DWORD dwRet=0;
+ LPBYTE lpbData,lpbDataCurrent;
+
+ lpbData=(LPBYTE)MEMALLOC(((dwUserSize+dwDomainSize+dwNickNameSize+dwFirstNameSize+dwLastNameSize)*sizeof(WCHAR))+4096);
+ if (lpbData)
+ {
+ CHAR szBuff[MAX_PATH];
+ SIZE_T dwBuffSize;
+
+ lpbDataCurrent=lpbData;
+
+ if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_USER)) {SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_USER);SetLPSLowerCase(&lpbDataCurrent,lpszUser,dwUserSize);}
+ if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_DOMAIN)) {SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_DOMAIN);SetLPSLowerCase(&lpbDataCurrent,lpszDomain,dwDomainSize);}
+ if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_NICKNAME)) {SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_NICKNAME);SetLPSW(&lpbDataCurrent,lpwszNickName,dwNickNameSize);}
+ if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_FIRSTNAME)) {SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_FIRSTNAME);SetLPSW(&lpbDataCurrent,lpwszFirstName,dwFirstNameSize);}
+ if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_LASTNAME)) {SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_LASTNAME);SetLPSW(&lpbDataCurrent,lpwszLastName,dwLastNameSize);}
+
+ if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_SEX))
+ {
+ dwBuffSize=mir_snprintf(szBuff,SIZEOF(szBuff),"%lu",dwSex);
+ SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_SEX);
+ SetLPS(&lpbDataCurrent,szBuff,dwBuffSize);
+ }
+
+ /*if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY))
+ {
+ dwBuffSize=mir_snprintf(szBuff,SIZEOF(szBuff),"%lu",dwSex);
+ SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY);
+ SetLPS(&lpbDataCurrent,szBuff,dwBuffSize);
+ }*/
+
+ if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_DATE1))
+ {
+ dwBuffSize=mir_snprintf(szBuff,SIZEOF(szBuff),"%lu",dwDate1);
+ SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_DATE1);
+ SetLPS(&lpbDataCurrent,szBuff,dwBuffSize);
+ }
+
+ if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_DATE2))
+ {
+ dwBuffSize=mir_snprintf(szBuff,SIZEOF(szBuff),"%lu",dwDate2);
+ SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_DATE2);
+ SetLPS(&lpbDataCurrent,szBuff,dwBuffSize);
+ }
+
+ if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_CITY_ID))
+ {
+ dwBuffSize=mir_snprintf(szBuff,SIZEOF(szBuff),"%lu",dwCityID);
+ SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_CITY_ID);
+ SetLPS(&lpbDataCurrent,szBuff,dwBuffSize);
+ }
+
+ if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_ZODIAC))
+ {
+ dwBuffSize=mir_snprintf(szBuff,SIZEOF(szBuff),"%lu",dwZodiak);
+ SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_ZODIAC);
+ SetLPS(&lpbDataCurrent,szBuff,dwBuffSize);
+ }
+
+ if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_MONTH))
+ {
+ dwBuffSize=mir_snprintf(szBuff,SIZEOF(szBuff),"%lu",dwBirthdayMonth);
+ SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_MONTH);
+ SetLPS(&lpbDataCurrent,szBuff,dwBuffSize);
+ }
+
+ if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_DAY))
+ {
+ dwBuffSize=mir_snprintf(szBuff,SIZEOF(szBuff),"%lu",dwBirthdayDay);
+ SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_DAY);
+ SetLPS(&lpbDataCurrent,szBuff,dwBuffSize);
+ }
+
+ if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_COUNTRY_ID))
+ {
+ dwBuffSize=mir_snprintf(szBuff,SIZEOF(szBuff),"%lu",dwCountryID);
+ SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_COUNTRY_ID);
+ SetLPS(&lpbDataCurrent,szBuff,dwBuffSize);
+ }
+
+ if (GetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_ONLINE))
+ {
+ dwBuffSize=mir_snprintf(szBuff,SIZEOF(szBuff),"%lu",dwOnline);
+ SetUL(&lpbDataCurrent,MRIM_CS_WP_REQUEST_PARAM_ONLINE);
+ SetLPS(&lpbDataCurrent,szBuff,dwBuffSize);
+ }
+
+ dwRet=MraSendQueueCMD(masMraSettings.hSendQueueHandle,0,hContact,dwAckType,NULL,0,MRIM_CS_WP_REQUEST,lpbData,(lpbDataCurrent-lpbData));
+ MEMFREE(lpbData);
+ }
+return(dwRet);
+}
+
+
+DWORD MraSendCommand_WPRequestByEMail(HANDLE hContact,DWORD dwAckType,LPSTR lpszEMail,SIZE_T dwEMailSize)
+{// EMail
+ DWORD dwRet=0,dwRequestFlags=0;
+
+ if (lpszEMail && dwEMailSize>4)
+ {
+ LPSTR lpszUser,lpszDomain;
+ SIZE_T dwUserSize,dwDomainSize;
+
+ lpszDomain=(LPSTR)MemoryFindByte(0,lpszEMail,dwEMailSize,'@');
+ if (lpszDomain)
+ {
+ lpszUser=lpszEMail;
+ dwUserSize=(lpszDomain-lpszEMail);
+ lpszDomain++;
+ dwDomainSize=(dwEMailSize-(dwUserSize+1));
+
+ SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_USER);
+ SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_DOMAIN);
+
+ dwRet=MraSendCommand_WPRequestW(hContact,dwAckType,dwRequestFlags,lpszUser,dwUserSize,lpszDomain,dwDomainSize,NULL,0,NULL,0,NULL,0,0,0,0,0,0,0,0,0,0);
+ }
+ }
+return(dwRet);
+}
+
+
+DWORD MraSendCommand_Game(LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwGameSessionID,DWORD dwGameMsg,DWORD dwGameMsgID,LPSTR lpszData,SIZE_T dwDataSize)
+{//
+ DWORD dwRet=0;
+
+ if (lpszEMail && dwEMailSize>4)
+ {
+ LPBYTE lpbData,lpbDataCurrent;
+
+ lpbData=(LPBYTE)MEMALLOC((dwEMailSize+(sizeof(DWORD)*4)+dwDataSize+32));
+ if (lpbData)
+ {
+ lpbDataCurrent=lpbData;
+ SetLPSLowerCase(&lpbDataCurrent,lpszEMail,dwEMailSize);
+ SetUL(&lpbDataCurrent,dwGameSessionID);
+ SetUL(&lpbDataCurrent,dwGameMsg);
+ SetUL(&lpbDataCurrent,dwGameMsgID);
+ SetUL(&lpbDataCurrent,_time32(NULL));
+ SetLPS(&lpbDataCurrent,lpszData,dwDataSize);
+
+ dwRet=MraSendCMD(MRIM_CS_GAME,lpbData,(lpbDataCurrent-lpbData));
+ MEMFREE(lpbData);
+ }
+ }else{
+ DebugBreak();
+ }
+return(dwRet);
+}
+
+
+DWORD MraSendCommand_Login2W(LPSTR lpszLogin,SIZE_T dwLoginSize,LPSTR lpszPassword,SIZE_T dwPasswordSize,DWORD dwStatus,LPSTR lpszStatusUri,SIZE_T dwStatusUriSize,LPWSTR lpwszStatusTitle,SIZE_T dwStatusTitleSize,LPWSTR lpwszStatusDesc,SIZE_T dwStatusDescSize,DWORD dwFutureFlags,LPSTR lpszUserAgentFormated,SIZE_T dwUserAgentFormatedSize,LPSTR lpszUserAgent,SIZE_T dwUserAgentSize)
+{//
+ DWORD dwRet=0;
+ LPBYTE lpbData,lpbDataCurrent;
+
+ if (dwStatusUriSize>SPEC_STATUS_URI_MAX) dwStatusUriSize=SPEC_STATUS_URI_MAX;
+ if (dwStatusTitleSize>STATUS_TITLE_MAX) dwStatusTitleSize=STATUS_TITLE_MAX;
+ if (dwStatusDescSize>STATUS_DESC_MAX) dwStatusDescSize=STATUS_DESC_MAX;
+ if (dwUserAgentFormatedSize>USER_AGENT_MAX) dwUserAgentFormatedSize=USER_AGENT_MAX;
+ if (dwUserAgentSize>MAX_CLIENT_DESCRIPTION) dwUserAgentSize=MAX_CLIENT_DESCRIPTION;
+
+ lpbData=(LPBYTE)MEMALLOC((dwLoginSize+dwPasswordSize+sizeof(DWORD)+dwStatusUriSize+(dwStatusTitleSize*sizeof(WCHAR))+(dwStatusDescSize*sizeof(WCHAR))+2+sizeof(DWORD)+(sizeof(DWORD)*2)+dwUserAgentFormatedSize+dwUserAgentSize+32));
+ if (lpbData)
+ {
+ lpbDataCurrent=lpbData;
+ SetLPS(&lpbDataCurrent,lpszLogin,dwLoginSize);
+ SetLPS(&lpbDataCurrent,lpszPassword,dwPasswordSize);
+ SetUL(&lpbDataCurrent,dwStatus);
+ SetLPS(&lpbDataCurrent,lpszStatusUri,dwStatusUriSize);
+ SetLPSW(&lpbDataCurrent,lpwszStatusTitle,dwStatusTitleSize);
+ SetLPSW(&lpbDataCurrent,lpwszStatusDesc,dwStatusDescSize);
+ SetUL(&lpbDataCurrent,dwFutureFlags);
+ SetLPS(&lpbDataCurrent,lpszUserAgentFormated,dwUserAgentFormatedSize);
+ SetLPS(&lpbDataCurrent,"ru",2);
+ SetLPS(&lpbDataCurrent,NULL,0);
+ SetLPS(&lpbDataCurrent,NULL,0);
+ SetLPS(&lpbDataCurrent,lpszUserAgent,dwUserAgentSize);// LPS client description /max 256
+
+ dwRet=MraSendCMD(MRIM_CS_LOGIN2,lpbData,(lpbDataCurrent-lpbData));
+ MEMFREE(lpbData);
+ }
+return(dwRet);
+}
+
+
+DWORD MraSendCommand_SMSW(HANDLE hContact,LPSTR lpszPhone,SIZE_T dwPhoneSize,LPWSTR lpwszMessage,SIZE_T dwMessageSize)
+{// SMS
+ DWORD dwRet=0;
+ LPBYTE lpbData,lpbDataCurrent,lpbDataQueue;
+ LPSTR lpszPhoneLocal;
+
+ lpbData=(LPBYTE)MEMALLOC((dwPhoneSize+(dwMessageSize*sizeof(WCHAR))+32));
+ lpbDataQueue=(LPBYTE)MEMALLOC((dwPhoneSize+(dwMessageSize*sizeof(WCHAR))+32));
+ lpszPhoneLocal=(LPSTR)MEMALLOC((dwPhoneSize+32));
+ if (lpbData && lpbDataQueue && lpszPhoneLocal)
+ {
+ lpszPhoneLocal[0]='+';
+ dwPhoneSize=1+CopyNumber((lpszPhoneLocal+1),lpszPhone,dwPhoneSize);
+
+ lpbDataCurrent=lpbData;
+ SetUL(&lpbDataCurrent,0);
+ SetLPS(&lpbDataCurrent,lpszPhoneLocal,dwPhoneSize);
+ SetLPSW(&lpbDataCurrent,lpwszMessage,dwMessageSize);
+
+ (*(DWORD*)lpbDataQueue)=dwPhoneSize;
+ memmove((lpbDataQueue+sizeof(DWORD)),lpszPhoneLocal,(dwPhoneSize+1));
+ memmove((lpbDataQueue+sizeof(DWORD)+dwPhoneSize+1),lpwszMessage,((dwMessageSize*sizeof(WCHAR))+1));
+
+ dwRet=MraSendQueueCMD(masMraSettings.hSendQueueHandle,0,hContact,ICQACKTYPE_SMS,lpbDataQueue,(dwPhoneSize+(dwMessageSize*sizeof(WCHAR))+sizeof(DWORD)+2),MRIM_CS_SMS,lpbData,(lpbDataCurrent-lpbData));
+ MEMFREE(lpbData);
+ MEMFREE(lpszPhoneLocal);
+ }else{
+ MEMFREE(lpbData);
+ MEMFREE(lpbDataQueue);
+ MEMFREE(lpszPhoneLocal);
+ }
+return(dwRet);
+}
+
+
+
+DWORD MraSendCommand_Proxy(LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwIDRequest,DWORD dwDataType,LPSTR lpszData,SIZE_T dwDataSize,LPSTR lpszAddreses,SIZE_T dwAddresesSize,MRA_GUID mguidSessionID)
+{//
+ DWORD dwRet=0;
+
+ if (lpszEMail && dwEMailSize>4)
+ {
+ LPBYTE lpbData,lpbDataCurrent;
+
+ lpbData=(LPBYTE)MEMALLOC((dwEMailSize+(sizeof(DWORD)*2)+dwDataSize+dwAddresesSize+sizeof(MRA_GUID)+32));
+ if (lpbData)
+ {
+ lpbDataCurrent=lpbData;
+ SetLPSLowerCase(&lpbDataCurrent,lpszEMail,dwEMailSize);
+ SetUL(&lpbDataCurrent,dwIDRequest);
+ SetUL(&lpbDataCurrent,dwDataType);
+ SetLPS(&lpbDataCurrent,lpszData,dwDataSize);
+ SetLPS(&lpbDataCurrent,lpszAddreses,dwAddresesSize);
+ SetGUID(&lpbDataCurrent,mguidSessionID);
+
+ dwRet=MraSendCMD(MRIM_CS_PROXY,lpbData,(lpbDataCurrent-lpbData));
+ MEMFREE(lpbData);
+ }
+ }else{
+ DebugBreak();
+ }
+return(dwRet);
+}
+
+
+DWORD MraSendCommand_ProxyAck(DWORD dwStatus,LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwIDRequest,DWORD dwDataType,LPSTR lpszData,SIZE_T dwDataSize,LPSTR lpszAddreses,SIZE_T dwAddresesSize,MRA_GUID mguidSessionID)
+{//
+ DWORD dwRet=0;
+
+ if (lpszEMail && dwEMailSize>4)
+ {
+ LPBYTE lpbData,lpbDataCurrent;
+
+ lpbData=(LPBYTE)MEMALLOC((dwEMailSize+(sizeof(DWORD)*3)+dwDataSize+dwAddresesSize+sizeof(MRA_GUID)+32));
+ if (lpbData)
+ {
+ lpbDataCurrent=lpbData;
+ SetUL(&lpbDataCurrent,dwStatus);
+ SetLPSLowerCase(&lpbDataCurrent,lpszEMail,dwEMailSize);
+ SetUL(&lpbDataCurrent,dwIDRequest);
+ SetUL(&lpbDataCurrent,dwDataType);
+ SetLPS(&lpbDataCurrent,lpszData,dwDataSize);
+ SetLPS(&lpbDataCurrent,lpszAddreses,dwAddresesSize);
+ SetGUID(&lpbDataCurrent,mguidSessionID);
+
+ dwRet=MraSendCMD(MRIM_CS_PROXY_ACK,lpbData,(lpbDataCurrent-lpbData));
+ MEMFREE(lpbData);
+ }
+ }else{
+ DebugBreak();
+ }
+return(dwRet);
+}
+
+
+DWORD MraSendCommand_ChangeUserBlogStatus(DWORD dwFlags,LPWSTR lpwszText,SIZE_T dwTextSize,DWORDLONG dwBlogStatusID)
+{//
+ DWORD dwRet=0;
+ LPBYTE lpbData,lpbDataCurrent;
+
+ if (dwTextSize>MICBLOG_STATUS_MAX) dwTextSize=MICBLOG_STATUS_MAX;
+
+ lpbData=(LPBYTE)MEMALLOC((sizeof(DWORD)+(dwTextSize*sizeof(WCHAR))+sizeof(DWORDLONG)+32));
+ if (lpbData)
+ {
+ lpbDataCurrent=lpbData;
+ SetUL(&lpbDataCurrent,dwFlags);
+ SetLPSW(&lpbDataCurrent,lpwszText,dwTextSize);
+ SetUIDL(&lpbDataCurrent,dwBlogStatusID);
+
+ dwRet=MraSendCMD(MRIM_CS_CHANGE_USER_BLOG_STATUS,lpbData,(lpbDataCurrent-lpbData));
+ MEMFREE(lpbData);
+ }
+
+return(dwRet);
+}
+
+
+void SetUL(LPBYTE *plpBuff,DWORD dwData)
+{
+ (*(DWORD*)(*plpBuff))=dwData;
+ (*plpBuff)+=sizeof(DWORD);
+}
+
+
+void SetUIDL(LPBYTE *plpBuff,DWORDLONG dwData)
+{
+ (*(DWORDLONG*)(*plpBuff))=dwData;
+ (*plpBuff)+=sizeof(DWORDLONG);
+}
+
+
+void SetGUID(LPBYTE *plpBuff,MRA_GUID guidData)
+{
+ (*(MRA_GUID*)(*plpBuff))=guidData;
+ (*plpBuff)+=sizeof(MRA_GUID);
+}
+
+
+void SetLPS(LPBYTE *plpBuff,LPSTR lpszData,DWORD dwSize)
+{
+ (*(DWORD*)(*plpBuff))=dwSize;
+ (*plpBuff)+=sizeof(DWORD);
+ memmove((*plpBuff),lpszData,dwSize);
+ (*plpBuff)+=dwSize;
+}
+
+
+void SetLPSW(LPBYTE *plpBuff,LPWSTR lpwszData,DWORD dwSize)
+{
+ dwSize*=sizeof(WCHAR);
+ (*(DWORD*)(*plpBuff))=dwSize;
+ (*plpBuff)+=sizeof(DWORD);
+ memmove((*plpBuff),lpwszData,dwSize);
+ (*plpBuff)+=dwSize;
+}
+
+
+void SetLPSWtoA(LPBYTE *plpBuff,LPWSTR lpwszData,DWORD dwSize)
+{
+ dwSize=WideCharToMultiByte(MRA_CODE_PAGE,0,lpwszData,dwSize,(LPSTR)((*plpBuff)+sizeof(DWORD)),(dwSize*sizeof(WCHAR)),NULL,NULL);
+ (*(DWORD*)(*plpBuff))=dwSize;
+ (*plpBuff)+=(sizeof(DWORD)+dwSize);
+}
+
+
+
+void SetLPSLowerCase(LPBYTE *plpBuff,LPSTR lpszData,DWORD dwSize)
+{
+ (*(DWORD*)(*plpBuff))=dwSize;
+ (*plpBuff)+=sizeof(DWORD);
+ BuffToLowerCase((*plpBuff),lpszData,dwSize);
+ (*plpBuff)+=dwSize;
+}
+
+
+void SetLPSLowerCaseW(LPBYTE *plpBuff,LPWSTR lpwszData,DWORD dwSize)
+{
+ dwSize*=sizeof(WCHAR);
+ (*(DWORD*)(*plpBuff))=dwSize;
+ (*plpBuff)+=sizeof(DWORD);
+ memmove((*plpBuff),lpwszData,dwSize);
+ CharLowerBuff((LPWSTR)(*plpBuff),(dwSize/sizeof(WCHAR)));
+ (*plpBuff)+=dwSize;
+}
+
+
+DWORD MraSendPacket(HANDLE hConnection,DWORD dwCMDNum,DWORD dwType,LPVOID lpData,SIZE_T dwDataSize)
+{
+ DWORD dwRet;
+
+ LPBYTE lpbData;
+ mrim_packet_header_t *pmaHeader;
+
+ lpbData=(LPBYTE)MEMALLOC((dwDataSize+sizeof(mrim_packet_header_t)));
+ if (lpbData)
+ {
+ pmaHeader=(mrim_packet_header_t*)lpbData;
+ pmaHeader->magic=CS_MAGIC;
+ pmaHeader->proto=PROTO_VERSION;//
+ pmaHeader->seq=dwCMDNum;// Sequence
+ pmaHeader->msg=dwType;//
+ pmaHeader->dlen=dwDataSize;//
+ //bzero(&maHeader->reserved[0],24);//
+
+ memmove((lpbData+sizeof(mrim_packet_header_t)),lpData,dwDataSize);
+ dwRet=Netlib_Send(hConnection,(LPSTR)lpbData,(dwDataSize+sizeof(mrim_packet_header_t)),0);
+
+ /*if (dwType==MRIM_CS_ADD_CONTACT)
+ {
+ {
+ char sztm[100];
+
+ SHA1GetStringDigestA((LPSTR)lpbData,(dwDataSize+sizeof(mrim_packet_header_t)),sztm);
+ OutputDebugStringA((sztm));
+ OutputDebugStringA("\r\n");
+ }
+
+ {
+ DWORD dwTemp;
+ HANDLE hFile=CreateFileW(L"C:\\Documents and Settings\\rozhuk_im\\ \\AddContact.txt",GENERIC_WRITE,FILE_SHARE_READ,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
+
+ if (hFile!=INVALID_HANDLE_VALUE)
+ {
+ WriteFile(hFile,lpbData,(dwDataSize+sizeof(mrim_packet_header_t)),&dwTemp,NULL);
+ CloseHandle(hFile);
+ }
+ }
+ }//*/
+ MEMFREE(lpbData);
+ }
+return(dwRet);
+}
+
+
+DWORD MraSendCMD(DWORD dwType,LPVOID lpData,SIZE_T dwDataSize)
+{
+ DWORD dwRet;
+
+ dwRet=InterlockedIncrement((LONG volatile*)&masMraSettings.dwCMDNum);
+ EnterCriticalSection(&masMraSettings.csCriticalSectionSend);// guarding winsock internal buffers
+ if (MraSendPacket(masMraSettings.hConnection,dwRet,dwType,lpData,dwDataSize)==0)
+ {// err on send
+ dwRet=0;
+ }
+ LeaveCriticalSection(&masMraSettings.csCriticalSectionSend);
+return(dwRet);
+}
+
+
+DWORD MraSendQueueCMD(HANDLE hSendQueueHandle,DWORD dwFlags,HANDLE hContact,DWORD dwAckType,LPBYTE lpbDataQueue,SIZE_T dwDataQueueSize,DWORD dwType,LPVOID lpData,SIZE_T dwDataSize)
+{
+ DWORD dwRet;
+
+ dwRet=InterlockedIncrement((LONG volatile*)&masMraSettings.dwCMDNum);
+ if (MraSendQueueAdd(hSendQueueHandle,dwRet,dwFlags,hContact,dwAckType,lpbDataQueue,dwDataQueueSize)==NO_ERROR)
+ {
+ EnterCriticalSection(&masMraSettings.csCriticalSectionSend);// guarding winsock internal buffers
+ if (MraSendPacket(masMraSettings.hConnection,dwRet,dwType,lpData,dwDataSize)==0)
+ {
+ MraSendQueueFree(hSendQueueHandle,dwRet);
+ dwRet=0;
+ }
+ LeaveCriticalSection(&masMraSettings.csCriticalSectionSend);
+ }
+return(dwRet);
+}
+
+
+
diff --git a/protocols/MRA/MraSendCommand.h b/protocols/MRA/MraSendCommand.h
new file mode 100644
index 0000000000..a32519b799
--- /dev/null
+++ b/protocols/MRA/MraSendCommand.h
@@ -0,0 +1,36 @@
+#if !defined(AFX_MRA_SENDCOMMAND_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
+#define AFX_MRA_SENDCOMMAND_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_
+
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+DWORD MraSendCommand_MessageW (BOOL bAddToQueue,HANDLE hContact,DWORD dwAckType,DWORD dwFlags,LPSTR lpszEMail,SIZE_T dwEMailSize,LPWSTR lpwszMessage,SIZE_T dwMessageSize,LPBYTE lpbMultiChatData,SIZE_T dwMultiChatDataSize);
+DWORD MraSendCommand_MessageAskW (DWORD dwMsgID,DWORD dwFlags,LPSTR lpszEMail,SIZE_T dwEMailSize,LPWSTR lpwszMessage,SIZE_T dwMessageSize,LPSTR lpwszMessageRTF,SIZE_T dwMessageRTFSize);
+DWORD MraSendCommand_MessageRecv (LPSTR lpszFrom,SIZE_T dwFromSize,DWORD dwMsgID);
+DWORD MraSendCommand_AddContactW (HANDLE hContact,DWORD dwContactFlag,DWORD dwGroupID,LPSTR lpszEMail,SIZE_T dwEMailSize,LPWSTR lpwszCustomName,SIZE_T dwCustomNameSize,LPSTR lpszPhones,SIZE_T dwPhonesSize,LPWSTR lpwszAuthMessage,SIZE_T dwAuthMessageSize,DWORD dwActions);
+DWORD MraSendCommand_ModifyContactW (HANDLE hContact,DWORD dwID,DWORD dwContactFlag,DWORD dwGroupID,LPSTR lpszEMail,SIZE_T dwEMailSize,LPWSTR lpwszCustomName,SIZE_T dwCustomNameSize,LPSTR lpszPhones,SIZE_T dwPhonesSize);
+DWORD MraSendCommand_OfflineMessageDel(DWORDLONG dwMsgUIDL);
+DWORD MraSendCommand_Authorize (LPSTR lpszEMail,SIZE_T dwEMailSize);
+DWORD MraSendCommand_ChangeStatusW (DWORD dwStatus,LPSTR lpszStatusUri,SIZE_T dwStatusUriSize,LPWSTR lpwszStatusTitle,SIZE_T dwStatusTitleSize,LPWSTR lpwszStatusDesc,SIZE_T dwStatusDescSize,DWORD dwFutureFlags);
+DWORD MraSendCommand_FileTransfer (LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwIdRequest,DWORD dwFilesTotalSize,LPWSTR lpwszFiles,SIZE_T dwFilesSize,LPSTR lpszAddreses,SIZE_T dwAddresesSize);
+DWORD MraSendCommand_FileTransferAck (DWORD dwStatus,LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwIdRequest,LPBYTE lpbDescription,SIZE_T dwDescriptionSize);
+DWORD MraSendCommand_WPRequestW (HANDLE hContact,DWORD dwAckType,DWORD dwRequestFlags,LPSTR lpszUser,SIZE_T dwUserSize,LPSTR lpszDomain,SIZE_T dwDomainSize,LPWSTR lpwszNickName,SIZE_T dwNickNameSize,LPWSTR lpwszFirstName,SIZE_T dwFirstNameSize,LPWSTR lpwszLastName,SIZE_T dwLastNameSize,DWORD dwSex,DWORD dwDate1,DWORD dwDate2,DWORD dwCityID,DWORD dwZodiak,DWORD dwBirthdayMonth,DWORD dwBirthdayDay,DWORD dwCountryID,DWORD dwOnline);
+DWORD MraSendCommand_WPRequestA (HANDLE hContact,DWORD dwAckType,DWORD dwRequestFlags,LPSTR lpszUser,SIZE_T dwUserSize,LPSTR lpszDomain,SIZE_T dwDomainSize,LPSTR lpszNickName,SIZE_T dwNickNameSize,LPSTR lpszFirstName,SIZE_T dwFirstNameSize,LPSTR lpszLastName,SIZE_T dwLastNameSize,DWORD dwSex,DWORD dwDate1,DWORD dwDate2,DWORD dwCityID,DWORD dwZodiak,DWORD dwBirthdayMonth,DWORD dwBirthdayDay,DWORD dwCountryID,DWORD dwOnline);
+DWORD MraSendCommand_WPRequestByEMail (HANDLE hContact,DWORD dwAckType,LPSTR lpszEMail,SIZE_T dwEMailSize);
+DWORD MraSendCommand_Game (LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwGameSessionID,DWORD dwGameMsg,DWORD dwGameMsgID,LPSTR lpszData,SIZE_T dwDataSize);
+DWORD MraSendCommand_Login2W (LPSTR lpszLogin,SIZE_T dwLoginSize,LPSTR lpszPassword,SIZE_T dwPasswordSize,DWORD dwStatus,LPSTR lpszStatusUri,SIZE_T dwStatusUriSize,LPWSTR lpwszStatusTitle,SIZE_T dwStatusTitleSize,LPWSTR lpwszStatusDesc,SIZE_T dwStatusDescSize,DWORD dwFutureFlags,LPSTR lpszUserAgentFormated,SIZE_T dwUserAgentFormatedSize,LPSTR lpszUserAgent,SIZE_T dwUserAgentSize);
+DWORD MraSendCommand_SMSW (HANDLE hContact,LPSTR lpszPhone,SIZE_T dwPhoneSize,LPWSTR lpwszMessage,SIZE_T dwMessageSize);
+DWORD MraSendCommand_Proxy (LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwIDRequest,DWORD dwDataType,LPSTR lpszData,SIZE_T dwDataSize,LPSTR lpszAddreses,SIZE_T dwAddresesSize,MRA_GUID mguidSessionID);
+DWORD MraSendCommand_ProxyAck (DWORD dwStatus,LPSTR lpszEMail,SIZE_T dwEMailSize,DWORD dwIDRequest,DWORD dwDataType,LPSTR lpszData,SIZE_T dwDataSize,LPSTR lpszAddreses,SIZE_T dwAddresesSize,MRA_GUID mguidSessionID);
+DWORD MraSendCommand_ChangeUserBlogStatus(DWORD dwFlags,LPWSTR lpwszText,SIZE_T dwTextSize,DWORDLONG dwBlogStatusID);
+
+DWORD MraSendPacket (HANDLE hConnection,DWORD dwCMDNum,DWORD dwType,LPVOID lpData,SIZE_T dwDataSize);
+DWORD MraSendCMD (DWORD dwType,LPVOID lpData,SIZE_T dwDataSize);
+DWORD MraSendQueueCMD (HANDLE hSendQueueHandle,DWORD dwFlags,HANDLE hContact,DWORD dwAckType,LPBYTE lpbDataQueue,SIZE_T dwDataQueueSize,DWORD dwType,LPVOID lpData,SIZE_T dwDataSize);
+
+
+
+#endif // !defined(AFX_MRA_SENDCOMMAND_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/MraSendQueue.cpp b/protocols/MRA/MraSendQueue.cpp
new file mode 100644
index 0000000000..de68943569
--- /dev/null
+++ b/protocols/MRA/MraSendQueue.cpp
@@ -0,0 +1,225 @@
+#include "Mra.h"
+#include "MraSendQueue.h"
+
+
+
+
+typedef struct
+{
+ LIST_MT lmtListMT;
+ DWORD dwSendTimeOutInterval;
+} MRA_SEND_QUEUE;
+
+
+typedef struct
+{
+ // internal
+ LIST_MT_ITEM lmtListMTItem;
+ FILETIME ftSendTime;
+ // external
+ DWORD dwCMDNum;
+ DWORD dwFlags;
+ HANDLE hContact;
+ DWORD dwAckType;
+ LPBYTE lpbData;
+ SIZE_T dwDataSize;
+} MRA_SEND_QUEUE_ITEM;
+
+
+
+#define FILETIME_SECOND ((DWORDLONG)10000000)
+
+
+
+
+DWORD MraSendQueueInitialize(DWORD dwSendTimeOutInterval,HANDLE *phSendQueueHandle)
+{
+ DWORD dwRetErrorCode;
+
+ if (phSendQueueHandle)
+ {
+ MRA_SEND_QUEUE *pmrasqSendQueue;
+
+ pmrasqSendQueue=(MRA_SEND_QUEUE*)MEMALLOC(sizeof(MRA_SEND_QUEUE));
+ if (pmrasqSendQueue)
+ {
+ dwRetErrorCode=ListMTInitialize(&pmrasqSendQueue->lmtListMT,0);
+ if (dwRetErrorCode==NO_ERROR)
+ {
+ pmrasqSendQueue->dwSendTimeOutInterval=dwSendTimeOutInterval;
+ (*phSendQueueHandle)=(HANDLE)pmrasqSendQueue;
+ }
+ }else{
+ dwRetErrorCode=GetLastError();
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+void MraSendQueueDestroy(HANDLE hSendQueueHandle)
+{
+ if (hSendQueueHandle)
+ {
+ MRA_SEND_QUEUE *pmrasqSendQueue=(MRA_SEND_QUEUE*)hSendQueueHandle;
+ MRA_SEND_QUEUE_ITEM *pmrasqiSendQueueItem;
+
+ ListMTLock(&pmrasqSendQueue->lmtListMT);
+ while(ListMTItemGetFirst(&pmrasqSendQueue->lmtListMT,NULL,(LPVOID*)&pmrasqiSendQueueItem)==NO_ERROR)
+ {
+ ListMTItemDelete(&pmrasqSendQueue->lmtListMT,&pmrasqiSendQueueItem->lmtListMTItem);
+ //MEMFREE(pmrasqiSendQueueItem->lpbData);
+ MEMFREE(pmrasqiSendQueueItem);
+ }
+ ListMTUnLock(&pmrasqSendQueue->lmtListMT);
+
+ ListMTDestroy(&pmrasqSendQueue->lmtListMT);
+ MEMFREE(pmrasqSendQueue);
+ }
+}
+
+
+DWORD MraSendQueueAdd(HANDLE hSendQueueHandle,DWORD dwCMDNum,DWORD dwFlags,HANDLE hContact,DWORD dwAckType,LPBYTE lpbData,SIZE_T dwDataSize)
+{
+ DWORD dwRetErrorCode;
+
+ if (hSendQueueHandle && dwCMDNum)
+ {
+ MRA_SEND_QUEUE *pmrasqSendQueue=(MRA_SEND_QUEUE*)hSendQueueHandle;
+ MRA_SEND_QUEUE_ITEM *pmrasqiSendQueueItem;
+
+ pmrasqiSendQueueItem=(MRA_SEND_QUEUE_ITEM*)MEMALLOC(sizeof(MRA_SEND_QUEUE_ITEM));
+ if (pmrasqiSendQueueItem)
+ {
+ //pmrasqiSendQueueItem->lmtListMTItem;
+ GetSystemTimeAsFileTime(&pmrasqiSendQueueItem->ftSendTime);
+ pmrasqiSendQueueItem->dwCMDNum=dwCMDNum;
+ pmrasqiSendQueueItem->dwFlags=dwFlags;
+ pmrasqiSendQueueItem->hContact=hContact;
+ pmrasqiSendQueueItem->dwAckType=dwAckType;
+ pmrasqiSendQueueItem->lpbData=lpbData;
+ pmrasqiSendQueueItem->dwDataSize=dwDataSize;
+
+ ListMTLock(&pmrasqSendQueue->lmtListMT);
+ ListMTItemAdd(&pmrasqSendQueue->lmtListMT,&pmrasqiSendQueueItem->lmtListMTItem,pmrasqiSendQueueItem);
+ ListMTUnLock(&pmrasqSendQueue->lmtListMT);
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ dwRetErrorCode=GetLastError();
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD MraSendQueueFree(HANDLE hSendQueueHandle,DWORD dwCMDNum)
+{
+ DWORD dwRetErrorCode;
+
+ if (hSendQueueHandle)
+ {
+ MRA_SEND_QUEUE *pmrasqSendQueue=(MRA_SEND_QUEUE*)hSendQueueHandle;
+ MRA_SEND_QUEUE_ITEM *pmrasqiSendQueueItem;
+ LIST_MT_ITERATOR lmtiIterator;
+
+ dwRetErrorCode=ERROR_NOT_FOUND;
+ ListMTLock(&pmrasqSendQueue->lmtListMT);
+ ListMTIteratorMoveFirst(&pmrasqSendQueue->lmtListMT,&lmtiIterator);
+ do
+ {//
+ if (ListMTIteratorGet(&lmtiIterator,NULL,(LPVOID*)&pmrasqiSendQueueItem)==NO_ERROR)
+ if (pmrasqiSendQueueItem->dwCMDNum==dwCMDNum)
+ {
+ ListMTItemDelete(&pmrasqSendQueue->lmtListMT,&pmrasqiSendQueueItem->lmtListMTItem);
+ //MEMFREE(pmrasqiSendQueueItem->lpbData);
+ MEMFREE(pmrasqiSendQueueItem);
+ dwRetErrorCode=NO_ERROR;
+ break;
+ }
+ }while(ListMTIteratorMoveNext(&lmtiIterator));
+ ListMTUnLock(&pmrasqSendQueue->lmtListMT);
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD MraSendQueueFind(HANDLE hSendQueueHandle,DWORD dwCMDNum,DWORD *pdwFlags,HANDLE *phContact,DWORD *pdwAckType,LPBYTE *plpbData,SIZE_T *pdwDataSize)
+{
+ DWORD dwRetErrorCode;
+
+ if (hSendQueueHandle)
+ {
+ MRA_SEND_QUEUE *pmrasqSendQueue=(MRA_SEND_QUEUE*)hSendQueueHandle;
+ MRA_SEND_QUEUE_ITEM *pmrasqiSendQueueItem;
+ LIST_MT_ITERATOR lmtiIterator;
+
+ dwRetErrorCode=ERROR_NOT_FOUND;
+ ListMTLock(&pmrasqSendQueue->lmtListMT);
+ ListMTIteratorMoveFirst(&pmrasqSendQueue->lmtListMT,&lmtiIterator);
+ do
+ {//
+ if (ListMTIteratorGet(&lmtiIterator,NULL,(LPVOID*)&pmrasqiSendQueueItem)==NO_ERROR)
+ if (pmrasqiSendQueueItem->dwCMDNum==dwCMDNum)
+ {
+ if (pdwFlags) (*pdwFlags)=pmrasqiSendQueueItem->dwFlags;
+ if (phContact) (*phContact)=pmrasqiSendQueueItem->hContact;
+ if (pdwAckType) (*pdwAckType)=pmrasqiSendQueueItem->dwAckType;
+ if (plpbData) (*plpbData)=pmrasqiSendQueueItem->lpbData;
+ if (pdwDataSize) (*pdwDataSize)=pmrasqiSendQueueItem->dwDataSize;
+ dwRetErrorCode=NO_ERROR;
+ break;
+ }
+ }while(ListMTIteratorMoveNext(&lmtiIterator));
+ ListMTUnLock(&pmrasqSendQueue->lmtListMT);
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD MraSendQueueFindOlderThan(HANDLE hSendQueueHandle,DWORD dwTime,DWORD *pdwCMDNum,DWORD *pdwFlags,HANDLE *phContact,DWORD *pdwAckType,LPBYTE *plpbData,SIZE_T *pdwDataSize)
+{
+ DWORD dwRetErrorCode;
+
+ if (hSendQueueHandle)
+ {
+ FILETIME ftExpireTime;
+ MRA_SEND_QUEUE *pmrasqSendQueue=(MRA_SEND_QUEUE*)hSendQueueHandle;
+ MRA_SEND_QUEUE_ITEM *pmrasqiSendQueueItem;
+ LIST_MT_ITERATOR lmtiIterator;
+
+ GetSystemTimeAsFileTime(&ftExpireTime);
+ (*((DWORDLONG*)&ftExpireTime))-=((DWORDLONG)dwTime*FILETIME_SECOND);
+ dwRetErrorCode=ERROR_NOT_FOUND;
+ ListMTLock(&pmrasqSendQueue->lmtListMT);
+ ListMTIteratorMoveFirst(&pmrasqSendQueue->lmtListMT,&lmtiIterator);
+ do
+ {//
+ if (ListMTIteratorGet(&lmtiIterator,NULL,(LPVOID*)&pmrasqiSendQueueItem)==NO_ERROR)
+ if ((*((DWORDLONG*)&ftExpireTime))>(*((DWORDLONG*)&pmrasqiSendQueueItem->ftSendTime)))
+ {
+ if (pdwCMDNum) (*pdwCMDNum)=pmrasqiSendQueueItem->dwCMDNum;
+ if (pdwFlags) (*pdwFlags)=pmrasqiSendQueueItem->dwFlags;
+ if (phContact) (*phContact)=pmrasqiSendQueueItem->hContact;
+ if (pdwAckType) (*pdwAckType)=pmrasqiSendQueueItem->dwAckType;
+ if (plpbData) (*plpbData)=pmrasqiSendQueueItem->lpbData;
+ if (pdwDataSize) (*pdwDataSize)=pmrasqiSendQueueItem->dwDataSize;
+ dwRetErrorCode=NO_ERROR;
+ break;
+ }
+ }while(ListMTIteratorMoveNext(&lmtiIterator));
+ ListMTUnLock(&pmrasqSendQueue->lmtListMT);
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
diff --git a/protocols/MRA/MraSendQueue.h b/protocols/MRA/MraSendQueue.h
new file mode 100644
index 0000000000..f1376128c9
--- /dev/null
+++ b/protocols/MRA/MraSendQueue.h
@@ -0,0 +1,23 @@
+#if !defined(AFX_MRA_SENDQUEUE_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
+#define AFX_MRA_SENDQUEUE_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_
+
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+
+DWORD MraSendQueueInitialize(DWORD dwSendTimeOutInterval,HANDLE *phSendQueueHandle);
+void MraSendQueueDestroy(HANDLE hSendQueueHandle);
+
+DWORD MraSendQueueAdd(HANDLE hSendQueueHandle,DWORD dwCMDNum,DWORD dwFlags,HANDLE hContact,DWORD dwAckType,LPBYTE lpbData,SIZE_T dwDataSize);
+DWORD MraSendQueueFree(HANDLE hSendQueueHandle,DWORD dwCMDNum);
+
+DWORD MraSendQueueFind(HANDLE hSendQueueHandle,DWORD dwCMDNum,DWORD *pdwFlags,HANDLE *phContact,DWORD *pdwAckType,LPBYTE *plpbData,SIZE_T *pdwDataSize);
+DWORD MraSendQueueFindOlderThan(HANDLE hSendQueueHandle,DWORD dwTime,DWORD *pdwCMDNum,DWORD *pdwFlags,HANDLE *phContact,DWORD *pdwAckType,LPBYTE *plpbData,SIZE_T *pdwDataSize);
+
+
+
+
+#endif // !defined(AFX_MRA_SENDQUEUE_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/Mra_functions.cpp b/protocols/MRA/Mra_functions.cpp
new file mode 100644
index 0000000000..222dd85dda
--- /dev/null
+++ b/protocols/MRA/Mra_functions.cpp
@@ -0,0 +1,2417 @@
+#include "Mra.h"
+
+
+
+typedef struct SetXStatusData_s {
+ DWORD dwXStatus;
+ DWORD dwCountdown;
+ HICON hDlgIcon;
+}SetXStatusData;
+
+
+typedef struct
+{
+ HANDLE hContact;
+}SetBlogStatusData;
+
+
+
+
+#define RECURSION_DATA_STACK_ITEMS_MIN 128
+struct RECURSION_DATA_STACK_ITEM
+{
+ HANDLE hFind;
+ DWORD dwFileNameLen;
+ WIN32_FIND_DATA w32fdFindFileData;
+};
+
+
+typedef struct _MRA_APC_QUEUE_ITEM
+{
+ FIFO_MT_ITEM ffmtItem;
+ PAPCFUNC pfnAPC;
+}MRA_APC_QUEUE_ITEM;
+
+
+
+
+void MraAPCQueueProcess (PFIFO_MT pffmtAPCQueue);
+void CALLBACK ThreadMarandaCallbackAck (ULONG_PTR dwParam);
+LRESULT CALLBACK MessageEditSubclassProc (HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam);
+INT_PTR CALLBACK SetXStatusDlgProc (HWND hWndDlg,UINT message,WPARAM wParam,LPARAM lParam);
+INT_PTR CALLBACK SendReplyBlogStatusDlgProc (HWND hWndDlg,UINT message,WPARAM wParam,LPARAM lParam);
+
+
+
+DWORD MraGetSelfVersionString(LPSTR lpszSelfVersion,SIZE_T dwSelfVersionSize,SIZE_T *pdwSelfVersionSizeRet)
+{
+ DWORD dwRetErrorCode;
+
+ if (lpszSelfVersion && dwSelfVersionSize)
+ {
+ DWORD dwMirVer=CallService(MS_SYSTEM_GETVERSION,0,0);
+ LPSTR lpszUnicode=(IsUnicodeEnv()? " Unicode":""),
+ lpszSecIM=(ServiceExists("SecureIM/IsContactSecured")? " + SecureIM":"");
+ SIZE_T dwSelfVersionSizeRet;
+
+ dwSelfVersionSizeRet=mir_snprintf(lpszSelfVersion,dwSelfVersionSize,"Miranda IM %lu.%lu.%lu.%lu%s (MRA v%lu.%lu.%lu.%lu)%s, version: %lu.%lu",(((dwMirVer)>>24)&0xFF),(((dwMirVer)>>16)&0xFF),(((dwMirVer)>>8)&0xFF),((dwMirVer)&0xFF),lpszUnicode,(((PLUGIN_VERSION_DWORD)>>24)&0xFF),(((PLUGIN_VERSION_DWORD)>>16)&0xFF),(((PLUGIN_VERSION_DWORD)>>8)&0xFF),((PLUGIN_VERSION_DWORD)&0xFF),lpszSecIM,PROTO_MAJOR(PROTO_VERSION),PROTO_MINOR(PROTO_VERSION));
+
+ if (pdwSelfVersionSizeRet) (*pdwSelfVersionSizeRet)=dwSelfVersionSizeRet;
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+DWORD GetParamValue(LPSTR lpszData,SIZE_T dwDataSize,LPSTR lpszParamName,SIZE_T dwParamNameSize,LPSTR lpszParamValue,SIZE_T dwParamValueSize,SIZE_T *pParamValueSizeRet)
+{
+ DWORD dwRetErrorCode;
+
+ if (lpszData && dwDataSize && lpszParamName && dwParamNameSize && lpszParamValue && dwParamValueSize)
+ {
+ char szData[USER_AGENT_MAX+4096];
+ LPSTR lpszParamDataStart,lpszParamDataEnd;
+
+ dwRetErrorCode=ERROR_NOT_FOUND;
+
+ dwDataSize=((dwDataSize<SIZEOF(szData))? dwDataSize:SIZEOF(szData));
+ BuffToLowerCase(szData,lpszData,dwDataSize);
+
+ lpszParamDataStart=(LPSTR)MemoryFind(0,szData,dwDataSize,lpszParamName,dwParamNameSize);
+ if (lpszParamDataStart)
+ if ((*((WORD*)(lpszParamDataStart+dwParamNameSize)))==(*((WORD*)"=\"")))
+ {
+ lpszParamDataStart+=dwParamNameSize+2;
+ lpszParamDataEnd=(LPSTR)MemoryFindByte((lpszParamDataStart-szData),szData,dwDataSize,'"');
+ if (lpszParamDataEnd)
+ {
+ memmove(lpszParamValue,(lpszData+(lpszParamDataStart-szData)),(lpszParamDataEnd-lpszParamDataStart));
+ if (pParamValueSizeRet) (*pParamValueSizeRet)=(lpszParamDataEnd-lpszParamDataStart);
+ dwRetErrorCode=NO_ERROR;
+ }
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+DWORD MraGetVersionStringFromFormated(LPSTR lpszUserAgentFormated,SIZE_T dwUserAgentFormatedSize,LPSTR lpszVersion,SIZE_T dwVersionSize,SIZE_T *pdwVersionSizeRet)
+{
+ DWORD dwRetErrorCode;
+
+ if (lpszUserAgentFormated && dwUserAgentFormatedSize && lpszVersion && dwVersionSize)
+ {
+ char szBuff[4096];
+ SIZE_T dwBuffSize,dwVersionSizeRet;
+
+ if (GetParamValue(lpszUserAgentFormated,dwUserAgentFormatedSize,"name",4,szBuff,SIZEOF(szBuff),&dwBuffSize)==NO_ERROR && CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,szBuff,((dwBuffSize<10)? dwBuffSize:10),"Miranda IM",10)==CSTR_EQUAL)
+ {// Miranda IM
+ GetParamValue(lpszUserAgentFormated,dwUserAgentFormatedSize,"title",5,lpszVersion,dwVersionSize,pdwVersionSizeRet);
+ }else{
+ dwVersionSizeRet=0;
+
+ if (GetParamValue(lpszUserAgentFormated,dwUserAgentFormatedSize,"client",6,lpszVersion,dwVersionSize,&dwBuffSize)==NO_ERROR)
+ {
+ dwVersionSizeRet+=dwBuffSize;
+ (*((BYTE*)(lpszVersion+dwVersionSizeRet)))=' ';
+ }
+
+ if (GetParamValue(lpszUserAgentFormated,dwUserAgentFormatedSize,"name",4,lpszVersion,dwVersionSize,&dwBuffSize)==NO_ERROR)
+ {
+ dwVersionSizeRet+=dwBuffSize;
+ (*((BYTE*)(lpszVersion+dwVersionSizeRet)))=' ';
+ }
+
+ if (GetParamValue(lpszUserAgentFormated,dwUserAgentFormatedSize,"title",5,lpszVersion,dwVersionSize,&dwBuffSize)==NO_ERROR)
+ {
+ dwVersionSizeRet+=dwBuffSize;
+ (*((BYTE*)(lpszVersion+dwVersionSizeRet)))=' ';
+ }
+
+ if (GetParamValue(lpszUserAgentFormated,dwUserAgentFormatedSize,"version",7,(lpszVersion+dwVersionSizeRet+1),(dwVersionSize-dwVersionSizeRet),&dwBuffSize)==NO_ERROR)
+ {
+ dwVersionSizeRet+=(dwBuffSize+1);
+ (*((BYTE*)(lpszVersion+dwVersionSizeRet)))='.';
+ if (GetParamValue(lpszUserAgentFormated,dwUserAgentFormatedSize,"build",5,(lpszVersion+dwVersionSizeRet+1),(dwVersionSize-dwVersionSizeRet),&dwBuffSize)==NO_ERROR)
+ {
+ dwVersionSizeRet+=(dwBuffSize+1);
+ }
+ }
+
+ if (dwVersionSizeRet==0)
+ {// no data extracted, copy raw
+ dwVersionSizeRet=((dwUserAgentFormatedSize<dwVersionSize)? dwUserAgentFormatedSize:dwVersionSize);
+ memmove(lpszVersion,lpszUserAgentFormated,dwVersionSizeRet);
+ }
+
+ if (pdwVersionSizeRet) (*pdwVersionSizeRet)=dwVersionSizeRet;
+ }
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD MraAddrListGetFromBuff(LPSTR lpszAddreses,SIZE_T dwAddresesSize,MRA_ADDR_LIST *pmalAddrList)
+{
+ DWORD dwRetErrorCode;
+
+ if (lpszAddreses && dwAddresesSize && pmalAddrList)
+ {
+ LPSTR lpszCurrentItem,lpszDelimiter,lpszEndItem;
+ DWORD dwAllocatedCount;
+
+ dwAllocatedCount=ALLOCATED_COUNT;
+ pmalAddrList->dwAddrCount=0;
+ pmalAddrList->pmaliAddress=(MRA_ADDR_LIST_ITEM*)MEMALLOC(sizeof(MRA_ADDR_LIST_ITEM)*dwAllocatedCount);
+ lpszCurrentItem=lpszAddreses;
+
+ while(TRUE)
+ {
+ lpszEndItem=(LPSTR)MemoryFindByte((lpszCurrentItem-lpszAddreses),lpszAddreses,dwAddresesSize,';');
+ if (lpszEndItem==NULL) lpszEndItem=(lpszAddreses+dwAddresesSize);
+ if (lpszEndItem)
+ {
+ lpszDelimiter=(LPSTR)MemoryFindByte((lpszCurrentItem-lpszAddreses),lpszAddreses,dwAddresesSize,':');
+ if (lpszDelimiter)
+ {
+ if (pmalAddrList->dwAddrCount==dwAllocatedCount)
+ {
+ dwAllocatedCount+=ALLOCATED_COUNT;
+ pmalAddrList->pmaliAddress=(MRA_ADDR_LIST_ITEM*)MEMREALLOC(pmalAddrList->pmaliAddress,(sizeof(MRA_ADDR_LIST_ITEM)*dwAllocatedCount));
+ }
+
+ (*lpszDelimiter)=0;
+ pmalAddrList->pmaliAddress[pmalAddrList->dwAddrCount].dwAddr=inet_addr(lpszCurrentItem);
+ pmalAddrList->pmaliAddress[pmalAddrList->dwAddrCount].dwPort=StrToUNum32((lpszDelimiter+1),(lpszEndItem-(lpszDelimiter+1)));
+ (*lpszDelimiter)=':';
+ pmalAddrList->dwAddrCount++;
+ lpszCurrentItem=(lpszEndItem+1);
+ }else{
+ break;
+ }
+ if (lpszEndItem==(lpszAddreses+dwAddresesSize)) break;
+ }else{
+ break;
+ }
+ }
+ pmalAddrList->pmaliAddress=(MRA_ADDR_LIST_ITEM*)MEMREALLOC(pmalAddrList->pmaliAddress,(sizeof(MRA_ADDR_LIST_ITEM)*pmalAddrList->dwAddrCount));
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD MraAddrListGetToBuff(MRA_ADDR_LIST *pmalAddrList,LPSTR lpszBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSizeRet)
+{
+ DWORD dwRetErrorCode;
+
+ if (pmalAddrList && lpszBuff && dwBuffSize)
+ {
+ LPSTR lpszCurPos=lpszBuff;
+
+ for (SIZE_T i=0;i<pmalAddrList->dwAddrCount;i++)
+ {
+ lpszCurPos+=mir_snprintf(lpszCurPos,(dwBuffSize-((SIZE_T)lpszCurPos-(SIZE_T)lpszBuff)),"%s:%lu;",inet_ntoa((*((in_addr*)&pmalAddrList->pmaliAddress[i].dwAddr))),pmalAddrList->pmaliAddress[i].dwPort);
+ }
+
+ if (pdwBuffSizeRet) (*pdwBuffSizeRet)=(lpszCurPos-lpszBuff);
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+void MraAddrListStoreToContact(HANDLE hContact,MRA_ADDR_LIST *pmalAddrList)
+{
+ if (hContact && pmalAddrList)
+ if (pmalAddrList->dwAddrCount)
+ {
+ DB_Mra_SetDword(hContact,"OldIP",DB_Mra_GetDword(hContact,"IP",0));
+ DB_Mra_SetDword(hContact,"IP",HTONL(pmalAddrList->pmaliAddress[0].dwAddr));
+ if (pmalAddrList->dwAddrCount>1)
+ {
+ DB_Mra_SetDword(hContact,"OldRealIP",DB_Mra_GetDword(hContact,"RealIP",0));
+ DB_Mra_SetDword(hContact,"RealIP",HTONL(pmalAddrList->pmaliAddress[1].dwAddr));
+ }
+ }
+}
+
+
+void MraAddrListFree(MRA_ADDR_LIST *pmalAddrList)
+{
+ if (pmalAddrList)
+ {
+ MEMFREE(pmalAddrList->pmaliAddress);
+ pmalAddrList->dwAddrCount=0;
+ }
+}
+
+
+
+
+void DB_Mra_CreateResidentSetting(LPSTR lpszValueName)
+{
+ char szSetting[2*MAX_PATH];
+
+ mir_snprintf(szSetting,SIZEOF(szSetting),"%s/%s",PROTOCOL_NAMEA,lpszValueName);
+ CallService(MS_DB_SETSETTINGRESIDENT,TRUE,(WPARAM)szSetting);
+}
+
+BOOL DB_GetStaticStringA(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPSTR lpszRetBuff,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize)
+{// sizes in wchars
+ BOOL bRet=FALSE;
+ SIZE_T dwReadedStringLen,dwRetBuffSizeLocal;
+ DBVARIANT dbv={0};
+ DBCONTACTGETSETTING sVal={0};
+
+ dbv.type=DBVT_WCHAR;
+ sVal.pValue=&dbv;
+ sVal.szModule=lpszModule;
+ sVal.szSetting=lpszValueName;
+ if (CallService(MS_DB_CONTACT_GETSETTING_STR,(WPARAM)hContact,(LPARAM)&sVal)==0)
+ {
+ dwReadedStringLen=lstrlenW(dbv.pwszVal);
+ if (lpszRetBuff && (dwRetBuffSize>dwReadedStringLen))
+ {
+ dwRetBuffSizeLocal=WideCharToMultiByte(MRA_CODE_PAGE,0,dbv.pwszVal,dwReadedStringLen,lpszRetBuff,dwRetBuffSize,NULL,NULL);
+ (*((CHAR*)(lpszRetBuff+dwRetBuffSizeLocal)))=0;
+ bRet=TRUE;
+ }else{
+ dwRetBuffSizeLocal=dwReadedStringLen;
+ if (lpszRetBuff && dwRetBuffSize>=sizeof(WORD)) (*((WORD*)lpszRetBuff))=0;
+ }
+ if (pdwRetBuffSize) (*pdwRetBuffSize)=dwRetBuffSizeLocal;
+
+ DBFreeVariant(&dbv);
+ }else{
+ if (lpszRetBuff && dwRetBuffSize>=sizeof(WORD)) (*((WORD*)lpszRetBuff))=0;
+ if (pdwRetBuffSize) (*pdwRetBuffSize)=0;
+ }
+return(bRet);
+}
+
+
+BOOL DB_GetStaticStringW(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpwszRetBuff,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize)
+{// sizes in wchars
+ BOOL bRet=FALSE;
+ SIZE_T dwReadedStringLen;
+ DBVARIANT dbv={0};
+ DBCONTACTGETSETTING sVal={0};
+
+ dbv.type=DBVT_WCHAR;
+ sVal.pValue=&dbv;
+ sVal.szModule=lpszModule;
+ sVal.szSetting=lpszValueName;
+ if (CallService(MS_DB_CONTACT_GETSETTING_STR,(WPARAM)hContact,(LPARAM)&sVal)==0)
+ {
+ dwReadedStringLen=lstrlenW(dbv.pwszVal);
+ if (lpwszRetBuff && (dwRetBuffSize>dwReadedStringLen))
+ {
+ memmove(lpwszRetBuff,dbv.pszVal,(dwReadedStringLen*sizeof(WCHAR)));//include null terminated
+ (*((WCHAR*)(lpwszRetBuff+dwReadedStringLen)))=0;
+ bRet=TRUE;
+ }else{
+ if (lpwszRetBuff && dwRetBuffSize>=sizeof(WCHAR)) (*((WCHAR*)lpwszRetBuff))=0;
+ }
+ if (pdwRetBuffSize) (*pdwRetBuffSize)=dwReadedStringLen;
+
+ DBFreeVariant(&dbv);
+ }else{
+ if (lpwszRetBuff && dwRetBuffSize>=sizeof(WCHAR)) (*((WCHAR*)lpwszRetBuff))=0;
+ if (pdwRetBuffSize) (*pdwRetBuffSize)=0;
+ }
+return(bRet);
+}
+
+
+BOOL DB_SetStringExA(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPSTR lpszValue,SIZE_T dwValueSize)
+{
+ BOOL bRet=FALSE;
+
+ if (lpszValue && dwValueSize)
+ {
+ LPWSTR lpwszValueLocal;
+ SIZE_T dwValueSizeLocal;
+
+ dwValueSizeLocal=(dwValueSize+MAX_PATH);
+ lpwszValueLocal=(LPWSTR)MEMALLOC((dwValueSizeLocal*sizeof(WCHAR)));
+
+ if (lpwszValueLocal)
+ {
+ DBCONTACTWRITESETTING cws={0};
+
+ cws.szModule=lpszModule;
+ cws.szSetting=lpszValueName;
+ cws.value.type=DBVT_WCHAR;
+ cws.value.pwszVal=(WCHAR*)lpwszValueLocal;
+
+ dwValueSizeLocal=MultiByteToWideChar(MRA_CODE_PAGE,0,lpszValue,dwValueSize,lpwszValueLocal,dwValueSizeLocal);
+ lpwszValueLocal[dwValueSizeLocal]=0;
+ bRet=(CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws)==0);
+
+ MEMFREE(lpwszValueLocal);
+ }
+ }else{
+ bRet=TRUE;
+ DBDeleteContactSetting(hContact,lpszModule,lpszValueName);
+ }
+return(bRet);
+}
+
+
+BOOL DB_SetStringExW(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpwszValue,SIZE_T dwValueSize)
+{
+ BOOL bRet=FALSE;
+
+ if (lpwszValue && dwValueSize)
+ {
+ LPWSTR lpwszValueLocal=(LPWSTR)MEMALLOC(((dwValueSize+MAX_PATH)*sizeof(WCHAR)));
+
+ if (lpwszValueLocal)
+ {
+ DBCONTACTWRITESETTING cws={0};
+
+ cws.szModule=lpszModule;
+ cws.szSetting=lpszValueName;
+ cws.value.type=DBVT_WCHAR;
+ cws.value.pwszVal=(WCHAR*)lpwszValueLocal;
+ memmove(lpwszValueLocal,lpwszValue,(dwValueSize*sizeof(WCHAR)));
+ bRet=(CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws)==0);
+
+ MEMFREE(lpwszValueLocal);
+ }
+ }else{
+ bRet=TRUE;
+ DBDeleteContactSetting(hContact,lpszModule,lpszValueName);
+ }
+return(bRet);
+}
+
+
+int DB_WriteContactSettingBlob(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPVOID lpValue,SIZE_T dwValueSize)
+{
+ DBCONTACTWRITESETTING cws={0};
+
+ cws.szModule=lpszModule;
+ cws.szSetting=lpszValueName;
+ cws.value.type=DBVT_BLOB;
+ cws.value.pbVal=(LPBYTE)lpValue;
+ cws.value.cpbVal=(WORD)dwValueSize;
+return(CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws));
+}
+
+
+BOOL DB_GetContactSettingBlob(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPVOID lpRet,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize)
+{
+ BOOL bRet=FALSE;
+ DBVARIANT dbv;
+ DBCONTACTGETSETTING sVal={0};
+
+ sVal.pValue=&dbv;
+ sVal.szModule=lpszModule;
+ sVal.szSetting=lpszValueName;
+ if (CallService(MS_DB_CONTACT_GETSETTING,(WPARAM)hContact,(LPARAM)&sVal)==0)
+ {
+ if (dbv.type==DBVT_BLOB)
+ {
+ if (dwRetBuffSize>=dbv.cpbVal)
+ {
+ memmove(lpRet,dbv.pbVal,dbv.cpbVal);
+ bRet=TRUE;
+ }
+ if (pdwRetBuffSize) (*pdwRetBuffSize)=dbv.cpbVal;
+ }
+ DBFreeVariant(&dbv);
+ }else{
+ if (pdwRetBuffSize) (*pdwRetBuffSize)=0;
+ bRet=FALSE;
+ }
+return(bRet);
+}
+
+
+DWORD GetContactFlags(HANDLE hContact)
+{
+ DWORD dwRet=0;
+
+ if (IsContactMra(hContact))
+ {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ SIZE_T dwEMailSize;
+
+ dwRet=DB_Mra_GetDword(hContact,"ContactFlags",0);
+ dwRet&=~(CONTACT_FLAG_REMOVED|CONTACT_FLAG_GROUP|CONTACT_FLAG_INVISIBLE|CONTACT_FLAG_VISIBLE|CONTACT_FLAG_IGNORE|CONTACT_FLAG_SHADOW|CONTACT_FLAG_MULTICHAT);
+ dwRet|=CONTACT_FLAG_UNICODE_NAME;
+
+ if (DB_Mra_GetStaticStringA(hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ if (IsEMailChatAgent(szEMail,dwEMailSize))
+ {
+ dwRet|=CONTACT_FLAG_MULTICHAT;
+ }
+ }
+
+ if (DBGetContactSettingByte(hContact,"CList","Hidden",0)) dwRet|=CONTACT_FLAG_SHADOW;
+
+ switch(DB_Mra_GetWord(hContact,"ApparentMode",0)){
+ case ID_STATUS_OFFLINE:
+ dwRet|=CONTACT_FLAG_INVISIBLE;
+ break;
+ case ID_STATUS_ONLINE:
+ dwRet|=CONTACT_FLAG_VISIBLE;
+ break;
+ }
+
+ if (CallService(MS_IGNORE_ISIGNORED,(WPARAM)hContact,IGNOREEVENT_MESSAGE)) dwRet|=CONTACT_FLAG_IGNORE;
+ }
+return(dwRet);
+}
+
+DWORD SetContactFlags(HANDLE hContact,DWORD dwContactFlag)
+{
+ DWORD dwRetErrorCode=NO_ERROR;
+
+ if (IsContactMra(hContact))
+ {
+ DB_Mra_SetDword(hContact,"ContactFlags",dwContactFlag);
+
+ if (dwContactFlag&CONTACT_FLAG_SHADOW)
+ {
+ DBWriteContactSettingByte(hContact,"CList","Hidden",1);
+ }else{
+ DBDeleteContactSetting(hContact,"CList","Hidden");
+ }
+ switch(dwContactFlag&(CONTACT_FLAG_INVISIBLE|CONTACT_FLAG_VISIBLE)){
+ case CONTACT_FLAG_INVISIBLE:
+ DB_Mra_SetWord(hContact,"ApparentMode",ID_STATUS_OFFLINE);
+ break;
+ case CONTACT_FLAG_VISIBLE:
+ DB_Mra_SetWord(hContact,"ApparentMode",ID_STATUS_ONLINE);
+ break;
+ default:
+ DB_Mra_SetWord(hContact,"ApparentMode",0);
+ break;
+ }
+
+ if (dwContactFlag&CONTACT_FLAG_IGNORE)
+ {
+ CallService(MS_IGNORE_IGNORE,(WPARAM)hContact,IGNOREEVENT_MESSAGE);
+ }else{
+ CallService(MS_IGNORE_UNIGNORE,(WPARAM)hContact,IGNOREEVENT_MESSAGE);
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD GetContactBasicInfoW(HANDLE hContact,DWORD *pdwID,DWORD *pdwGroupID,DWORD *pdwContactFlag,DWORD *pdwContactSeverFlags,DWORD *pdwStatus,LPSTR lpszEMail,SIZE_T dwEMailSize,SIZE_T *pdwEMailSize,LPWSTR lpwszNick,SIZE_T dwNickSize,SIZE_T *pdwNickSize,LPSTR lpszPhones,SIZE_T dwPhonesSize,SIZE_T *pdwPhonesSize)
+{
+ DWORD dwRetErrorCode=NO_ERROR;
+
+ if (IsContactMra(hContact))
+ {
+ if (pdwID) (*pdwID)=DB_Mra_GetDword(hContact,"ContactID",-1);
+ if (pdwGroupID) (*pdwGroupID)=DB_Mra_GetDword(hContact,"GroupID",-1);
+ if (pdwContactSeverFlags) (*pdwContactSeverFlags)=DB_Mra_GetDword(hContact,"ContactSeverFlags",0);
+ if (pdwStatus) (*pdwStatus)=MraGetContactStatus(hContact);
+ if (pdwContactFlag) (*pdwContactFlag)=GetContactFlags(hContact);
+
+ if (lpszEMail && pdwEMailSize) DB_Mra_GetStaticStringA(hContact,"e-mail",lpszEMail,dwEMailSize,pdwEMailSize);
+ if (lpwszNick && pdwNickSize)
+ {
+ DB_GetStaticStringW(hContact,"CList","MyHandle",lpwszNick,dwNickSize,pdwNickSize);
+ //if ((*pdwNickSize)==0) DebugBreak();
+ }
+ if (lpszPhones && pdwPhonesSize)
+ {
+ char szPhone[MAX_PATH],szValue[MAX_PATH];
+ SIZE_T dwPhoneSize,dwCopyed=0;
+
+ for(SIZE_T i=0;i<3;i++)
+ {
+ mir_snprintf(szValue,SIZEOF(szValue),"MyPhone%lu",i);
+ if (DB_GetStaticStringA(hContact,"UserInfo",szValue,szPhone,SIZEOF(szPhone),&dwPhoneSize))
+ {
+ if (dwCopyed) (*((LPBYTE)(lpszPhones+dwCopyed++)))=',';
+ dwCopyed+=CopyNumber((lpszPhones+dwCopyed),szPhone,dwPhoneSize);
+ }
+ }
+ (*pdwPhonesSize)=dwCopyed;
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD SetContactBasicInfoW(HANDLE hContact,DWORD dwSetInfoFlags,DWORD dwFlags,DWORD dwID,DWORD dwGroupID,DWORD dwContactFlag,DWORD dwContactSeverFlags,DWORD dwStatus,LPSTR lpszEMail,SIZE_T dwEMailSize,LPWSTR lpwszNick,SIZE_T dwNickSize,LPSTR lpszPhones,SIZE_T dwPhonesSize)
+{
+ DWORD dwRetErrorCode=NO_ERROR;
+
+ if (IsContactMra(hContact))
+ {
+ // LOCK
+ if (dwSetInfoFlags&SCBIFSI_LOCK_CHANGES_EVENTS) DB_Mra_SetDword(hContact,"HooksLocked",TRUE);
+
+ // ,
+ if(dwFlags&SCBIF_ID) DB_Mra_SetDword(hContact,"ContactID",dwID);
+
+ if(dwFlags&SCBIF_EMAIL)
+ {
+ if (lpszEMail && dwEMailSize) DB_Mra_SetStringExA(hContact,"e-mail",lpszEMail,dwEMailSize);
+ }
+
+ //
+ if(dwFlags&SCBIF_GROUP_ID) DB_Mra_SetDword(hContact,"GroupID",dwGroupID);
+
+ if(dwFlags&SCBIF_NICK)
+ {
+ if((dwFlags&SCBIF_FLAG) && ((dwContactFlag&CONTACT_FLAG_UNICODE_NAME)==0))
+ {
+ if (lpwszNick && dwNickSize) DB_SetStringExA(hContact,"CList","MyHandle",(LPSTR)lpwszNick,dwNickSize);
+ }else{
+ if (lpwszNick && dwNickSize) DB_SetStringExW(hContact,"CList","MyHandle",lpwszNick,dwNickSize);
+ //if (dwNickSize==0) DebugBreak();
+ }
+ }
+
+ if(dwFlags&SCBIF_PHONES)
+ {
+ if (lpszPhones && dwPhonesSize)
+ {
+ char szPhone[MAX_PATH],szValue[MAX_PATH];
+ LPSTR lpszCurPhone,lpszPhoneNext;
+ SIZE_T i,dwCurPhoneSize;
+
+ i=0;
+ lpszCurPhone=lpszPhones;
+ lpszPhoneNext=lpszPhones;
+ while(lpszPhoneNext)
+ {
+ lpszPhoneNext=(LPSTR)MemoryFindByte((lpszCurPhone-lpszPhones),lpszPhones,dwPhonesSize,',');
+ if (lpszPhoneNext)
+ {
+ dwCurPhoneSize=(lpszPhoneNext-lpszCurPhone);
+ }else{
+ dwCurPhoneSize=((lpszPhones+dwPhonesSize)-lpszCurPhone);
+ }
+
+ szPhone[0]='+';
+ memmove((szPhone+1),lpszCurPhone,min(dwCurPhoneSize,(SIZEOF(szPhone)-1)));
+ mir_snprintf(szValue,SIZEOF(szValue),"MyPhone%lu",i);
+ DB_SetStringExA(hContact,"UserInfo",szValue,szPhone,(1+dwCurPhoneSize));
+
+ i++;
+ lpszCurPhone=(lpszPhoneNext+1);
+ }
+ }
+ }
+
+ if(dwFlags&SCBIF_FLAG) SetContactFlags(hContact,dwContactFlag);
+
+ if(dwFlags&SCBIF_SERVER_FLAG) DB_Mra_SetDword(hContact,"ContactSeverFlags",dwContactSeverFlags);
+
+ if(dwFlags&SCBIF_STATUS) MraSetContactStatus(hContact,dwStatus);
+
+ SetExtraIcons(hContact);
+ // UNLOCK
+ if (dwSetInfoFlags&SCBIFSI_LOCK_CHANGES_EVENTS) DB_Mra_SetDword(hContact,"HooksLocked",FALSE);
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+
+HANDLE MraHContactFromEmail(LPSTR lpszEMail,SIZE_T dwEMailSize,BOOL bAddIfNeeded,BOOL bTemporary,BOOL *pbAdded)
+{
+ HANDLE hContact=NULL;
+
+ if (lpszEMail && dwEMailSize)
+ {
+ BOOL bFounded=FALSE;
+ CHAR szEMailLocal[MAX_EMAIL_LEN];
+ SIZE_T dwEMailLocalSize;
+
+ if (dwEMailSize==-1) dwEMailSize=lstrlenA(lpszEMail);
+ //check not already on list
+ for(hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ {
+ if (IsContactMra(hContact))
+ if (DB_Mra_GetStaticStringA(hContact,"e-mail",szEMailLocal,SIZEOF(szEMailLocal),&dwEMailLocalSize))
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,szEMailLocal,dwEMailLocalSize,lpszEMail,dwEMailSize)==CSTR_EQUAL)
+ {
+ if (bTemporary==FALSE) DBDeleteContactSetting(hContact,"CList","NotOnList");
+ bFounded=TRUE;
+ break;
+ }
+ }
+
+ if (bFounded==FALSE && bAddIfNeeded)
+ {//not already there: add
+ if (IsEMailChatAgent(lpszEMail,dwEMailSize))
+ {
+ GCSESSION gcw={0};
+ WCHAR wszEMail[MAX_EMAIL_LEN]={0};
+
+ gcw.cbSize=sizeof(GCSESSION);
+ gcw.iType=GCW_CHATROOM;
+ gcw.pszModule=PROTOCOL_NAMEA;
+ gcw.ptszName=wszEMail;
+ gcw.ptszID=(LPWSTR)wszEMail;
+ gcw.dwFlags=GC_UNICODE;
+ MultiByteToWideChar(MRA_CODE_PAGE,0,lpszEMail,dwEMailSize,wszEMail,SIZEOF(wszEMail));
+
+ if (CallServiceSync(MS_GC_NEWSESSION,NULL,(LPARAM)&gcw)==0)
+ {
+ BOOL bChatAdded=FALSE;
+ for(hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ {
+ if (IsContactMra(hContact))
+ if (DB_Mra_GetStaticStringA(hContact,"ChatRoomID",szEMailLocal,SIZEOF(szEMailLocal),&dwEMailLocalSize))
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,szEMailLocal,dwEMailLocalSize,lpszEMail,dwEMailSize)==CSTR_EQUAL)
+ {
+ bChatAdded=TRUE;
+ break;
+ }
+ }
+ if (bChatAdded==FALSE) hContact=NULL;
+ }
+ }else{
+ hContact=(HANDLE)CallService(MS_DB_CONTACT_ADD,0,0);
+ CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact,(LPARAM)PROTOCOL_NAMEA);
+ }
+
+ if (hContact)
+ {
+ if (IsEMailChatAgent(lpszEMail,dwEMailSize))
+ {
+ SetContactBasicInfoW(hContact,SCBIFSI_LOCK_CHANGES_EVENTS,(SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS|SCBIF_EMAIL),-1,-1,0,CONTACT_INTFLAG_NOT_AUTHORIZED,ID_STATUS_ONLINE,lpszEMail,dwEMailSize,NULL,0,NULL,0);
+ }else{
+ if (bTemporary) DBWriteContactSettingByte(hContact,"CList","NotOnList",1);
+ DB_Mra_SetStringExA(hContact,"MirVer",MIRVER_UNKNOWN,(sizeof(MIRVER_UNKNOWN)-1));
+ SetContactBasicInfoW(hContact,SCBIFSI_LOCK_CHANGES_EVENTS,(SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS|SCBIF_EMAIL),-1,-1,0,CONTACT_INTFLAG_NOT_AUTHORIZED,ID_STATUS_OFFLINE,lpszEMail,dwEMailSize,NULL,0,NULL,0);
+ }
+ }
+ }
+
+ if (pbAdded) (*pbAdded)=(bFounded==FALSE && bAddIfNeeded && hContact);
+ }
+return(hContact);
+}
+
+
+
+BOOL MraUpdateContactInfo(HANDLE hContact)
+{
+ BOOL bRet=FALSE;
+
+ if (masMraSettings.bLoggedIn && hContact)
+ if (IsContactMra(hContact))
+ {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ SIZE_T dwEMailSize;
+
+ if (DB_Mra_GetStaticStringA(hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ MraAvatarsQueueGetAvatarSimple(masMraSettings.hAvatarsQueueHandle,GAIF_FORCE,hContact,0);
+
+ if (MraSendCommand_WPRequestByEMail(hContact,ACKTYPE_GETINFO,szEMail,dwEMailSize))
+ {
+ bRet=TRUE;
+ }
+ }
+ }
+return(bRet);
+}
+
+
+
+DWORD MraContactCapabilitiesGet(HANDLE hContact)
+{
+return(DB_Mra_GetDword(hContact,DBSETTING_CAPABILITIES,0));
+}
+
+void MraContactCapabilitiesSet(HANDLE hContact,DWORD dwFutureFlags)
+{
+ DB_Mra_SetDword(hContact,DBSETTING_CAPABILITIES,dwFutureFlags);
+}
+
+
+DWORD MraGetContactStatus(HANDLE hContact)
+{
+return(DB_Mra_GetWord(hContact,"Status",ID_STATUS_OFFLINE));
+}
+
+
+DWORD MraSetContactStatus(HANDLE hContact,DWORD dwNewStatus)
+{
+ DWORD dwOldStatus=MraGetContactStatus(hContact);
+
+ if (dwNewStatus!=dwOldStatus)
+ {
+ BOOL bChatAgent;
+
+ bChatAgent=IsContactChatAgent(hContact);
+
+ if (dwNewStatus==ID_STATUS_OFFLINE)
+ {
+ if (hContact)
+ {
+ DB_Mra_SetByte(hContact,DBSETTING_XSTATUSID,MRA_MIR_XSTATUS_NONE);
+ DB_Mra_DeleteValue(hContact,DBSETTING_XSTATUSNAME);
+ DB_Mra_DeleteValue(hContact,DBSETTING_XSTATUSMSG);
+ DB_Mra_DeleteValue(hContact,DBSETTING_BLOGSTATUSTIME);
+ DB_Mra_DeleteValue(hContact,DBSETTING_BLOGSTATUSID);
+ DB_Mra_DeleteValue(hContact,DBSETTING_BLOGSTATUS);
+ DB_Mra_DeleteValue(hContact,DBSETTING_BLOGSTATUSMUSIC);
+ MraContactCapabilitiesSet(hContact,0);
+ if (bChatAgent) MraChatSessionDestroy(hContact);
+ }
+ DB_Mra_SetDword(hContact,"LogonTS",0);
+ DB_Mra_DeleteValue(hContact,"IP");
+ DB_Mra_DeleteValue(hContact,"RealIP");
+ }else{
+ if (dwOldStatus==ID_STATUS_OFFLINE)
+ {
+ DWORD dwTime=(DWORD)_time32(NULL);
+
+ DB_Mra_SetDword(hContact,"LogonTS",dwTime);
+ DB_Mra_SetDword(hContact,"OldLogonTS",dwTime);
+
+ if (bChatAgent) MraChatSessionNew(hContact);
+ }
+ MraAvatarsQueueGetAvatarSimple(masMraSettings.hAvatarsQueueHandle,0,hContact,0);
+ }
+
+ DB_Mra_SetWord(hContact,"Status",(WORD)dwNewStatus);
+ }
+return(dwOldStatus);
+}
+
+
+void MraUpdateEmailStatus(LPSTR lpszFrom,SIZE_T dwFromSize,LPSTR lpszSubject,SIZE_T dwSubjectSize,DWORD dwDate,DWORD dwUIDL)
+{
+ BOOL bTrayIconNewMailNotify;
+ WCHAR szStatusText[MAX_SECONDLINE];
+
+ bTrayIconNewMailNotify=DB_Mra_GetByte(NULL,"TrayIconNewMailNotify",MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY);
+
+ if (masMraSettings.dwEmailMessagesUnRead)
+ {
+ LPSTR lpszEMail;
+ SIZE_T dwEMailSize;
+ HANDLE hContact=NULL;
+ WCHAR szMailBoxStatus[MAX_SECONDLINE];
+
+ mir_sntprintf(szMailBoxStatus,SIZEOF(szMailBoxStatus),TranslateW(L"Unread mail is available: %lu/%lu messages"),masMraSettings.dwEmailMessagesUnRead,masMraSettings.dwEmailMessagesTotal);
+
+ if ((lpszFrom && dwFromSize) || (lpszSubject && dwSubjectSize))
+ {
+ WCHAR szFrom[MAX_PATH]={0},szSubject[MAX_PATH]={0};
+
+ if (GetEMailFromString(lpszFrom,dwFromSize,&lpszEMail,&dwEMailSize))
+ {
+ hContact=MraHContactFromEmail(lpszEMail,dwEMailSize,FALSE,TRUE,NULL);
+ }
+
+ dwFromSize=MultiByteToWideChar(MRA_CODE_PAGE,0,lpszFrom,dwFromSize,szFrom,SIZEOF(szFrom));
+ szFrom[dwFromSize]=0;
+
+ dwSubjectSize=MultiByteToWideChar(MRA_CODE_PAGE,0,lpszSubject,dwSubjectSize,szSubject,SIZEOF(szSubject));
+ szSubject[dwSubjectSize]=0;
+
+ mir_sntprintf(szStatusText,SIZEOF(szStatusText),TranslateW(L"From: %s\r\nSubject: %s\r\n%s"),szFrom,szSubject,szMailBoxStatus);
+ }else{
+ lstrcpynW(szStatusText,szMailBoxStatus,SIZEOF(szStatusText));
+ }
+
+ if (bTrayIconNewMailNotify)
+ {
+ char szServiceFunction[MAX_PATH],*pszServiceFunctionName;
+ CLISTEVENT cle={0};
+
+ cle.cbSize=sizeof(cle);
+ //cle.hContact;
+ //cle.hDbEvent;
+ cle.lpszProtocol=PROTOCOL_NAMEA;
+ cle.hIcon=IconLibGetIcon(masMraSettings.hMainMenuIcons[0]);
+ cle.flags=(CLEF_UNICODE|CLEF_PROTOCOLGLOBAL);
+ cle.pszService="";
+ cle.ptszTooltip=szStatusText;
+
+ if (DB_Mra_GetByte(NULL,"TrayIconNewMailClkToInbox",MRA_DEFAULT_TRAYICON_NEW_MAIL_CLK_TO_INBOX))
+ {
+ memmove(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
+ pszServiceFunctionName=(szServiceFunction+PROTOCOL_NAME_LEN);
+ memmove(pszServiceFunctionName,MRA_GOTO_INBOX,sizeof(MRA_GOTO_INBOX));
+ cle.pszService=szServiceFunction;
+ }
+ CallService(MS_CLIST_ADDEVENT,0,(LPARAM)&cle);
+ }
+
+ SkinPlaySound(masMraSettings.szNewMailSound);
+ if (hContact)
+ {// update user info
+ MraUpdateContactInfo(hContact);
+ MraPopupShowFromContactW(hContact,MRA_POPUP_TYPE_EMAIL_STATUS,(MRA_POPUP_ALLOW_ENTER),szStatusText);
+ }else{
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_EMAIL_STATUS,(MRA_POPUP_ALLOW_ENTER),szStatusText);
+ }
+ }else{
+ if (DB_Mra_GetByte(NULL,"IncrementalNewMailNotify",MRA_DEFAULT_INC_NEW_MAIL_NOTIFY))
+ {
+ if (bTrayIconNewMailNotify) CallService(MS_CLIST_REMOVEEVENT,0,(LPARAM)PROTOCOL_NAMEA);
+ PUDeletePopUp(masMraSettings.hWndEMailPopupStatus);
+ masMraSettings.hWndEMailPopupStatus=NULL;
+ }else{
+ mir_sntprintf(szStatusText,SIZEOF(szStatusText),TranslateW(L"No unread mail is available\r\nTotal messages: %lu"),masMraSettings.dwEmailMessagesTotal);
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_EMAIL_STATUS,(MRA_POPUP_ALLOW_ENTER),szStatusText);
+ }
+ }
+}
+
+
+BOOL IsUnicodeEnv()
+{// Are we running under unicode Miranda core ?
+ BOOL bRet=FALSE;
+ char szBuff[64]={0};
+
+ if (CallService(MS_SYSTEM_GETVERSIONTEXT,SIZEOF(szBuff),(LPARAM)szBuff)==0)
+ {
+ BuffToLowerCase(szBuff,szBuff,SIZEOF(szBuff));
+ bRet=(MemoryFind(0,szBuff,SIZEOF(szBuff),"unicode",7)!=NULL);
+ }
+return(bRet);
+}
+
+
+BOOL IsHTTPSProxyUsed(HANDLE hNetlibUser)
+{
+ BOOL bRet=FALSE;
+ NETLIBUSERSETTINGS nlus={0};
+
+ nlus.cbSize=sizeof(nlus);
+ if (CallService(MS_NETLIB_GETUSERSETTINGS,(WPARAM)hNetlibUser,(LPARAM)&nlus))
+ {
+ if (nlus.useProxy && nlus.proxyType==PROXYTYPE_HTTPS) bRet=TRUE;
+ }
+return(bRet);
+}
+
+
+BOOL IsContactMra(HANDLE hContact)
+{//
+return(CallService(MS_PROTO_ISPROTOONCONTACT,(WPARAM)hContact,(LPARAM)PROTOCOL_NAMEA));
+}
+
+
+BOOL IsContactMraProto(HANDLE hContact)
+{// MRA ,
+ BOOL bRet=FALSE;
+ LPSTR lpszProto=(LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
+
+ if (lpszProto)
+ {
+ WCHAR szBuff[MAX_PATH];
+
+ if (DB_GetStaticStringW(hContact,lpszProto,"AvatarLastCheckTime",szBuff,SIZEOF(szBuff),NULL))
+ if (DB_GetStaticStringW(hContact,lpszProto,"AvatarLastModifiedTime",szBuff,SIZEOF(szBuff),NULL))
+ {
+ bRet=TRUE;
+ }
+ }
+return(bRet);
+}
+
+
+
+BOOL IsEMailMy(LPSTR lpszEMail,SIZE_T dwEMailSize)
+{
+ BOOL bRet=FALSE;
+
+ if (lpszEMail)
+ {
+ CHAR szEMailMy[MAX_EMAIL_LEN];
+ SIZE_T dwEMailMySize;
+
+ if (DB_Mra_GetStaticStringA(NULL,"e-mail",szEMailMy,SIZEOF(szEMailMy),&dwEMailMySize))
+ {
+ if (dwEMailSize==0) dwEMailSize=lstrlenA(lpszEMail);
+
+ if (dwEMailMySize==dwEMailSize)
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszEMail,dwEMailSize,szEMailMy,dwEMailMySize)==CSTR_EQUAL)
+ {
+ bRet=TRUE;
+ }
+ }
+ }
+return(bRet);
+}
+
+
+BOOL IsEMailChatAgent(LPSTR lpszEMail,SIZE_T dwEMailSize)
+{
+ BOOL bRet=FALSE;
+
+ if (lpszEMail)
+ {
+ if (dwEMailSize==0) dwEMailSize=lstrlenA(lpszEMail);
+ if ((sizeof(MAILRU_CHAT_CONF_DOMAIN)-1)<dwEMailSize)
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,MAILRU_CHAT_CONF_DOMAIN,(sizeof(MAILRU_CHAT_CONF_DOMAIN)-1),(lpszEMail+(dwEMailSize-(sizeof(MAILRU_CHAT_CONF_DOMAIN)-1))),(sizeof(MAILRU_CHAT_CONF_DOMAIN)-1))==CSTR_EQUAL)
+ {
+ if ( (*(BYTE*)(lpszEMail+((dwEMailSize-(sizeof(MAILRU_CHAT_CONF_DOMAIN)-1))-1)))=='@' )
+ {
+ bRet=TRUE;
+ }
+ }
+ }
+return(bRet);
+}
+
+
+BOOL IsContactChatAgent(HANDLE hContact)
+{
+ BOOL bRet=FALSE;
+
+ if (hContact)
+ {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ SIZE_T dwEMailSize;
+
+ if (DB_Mra_GetStaticStringA(hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ bRet=IsEMailChatAgent(szEMail,dwEMailSize);
+ }
+ //bRet=((GetContactFlags(hContact)&CONTACT_FLAG_MULTICHAT)!=0);
+ }
+return(bRet);
+}
+
+
+
+BOOL IsEMailMR(LPSTR lpszEMail,SIZE_T dwEMailSize)
+{
+ BOOL bRet=FALSE;
+
+ if (lpszEMail)
+ {
+ SIZE_T i,dwDomainLen;
+
+ if (dwEMailSize==0) dwEMailSize=lstrlenA(lpszEMail);
+ for(i=0;lpcszMailRuDomains[i];i++)
+ {
+ dwDomainLen=lstrlenA(lpcszMailRuDomains[i]);
+ if (dwDomainLen<dwEMailSize)
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpcszMailRuDomains[i],dwDomainLen,(lpszEMail+(dwEMailSize-dwDomainLen)),dwDomainLen)==CSTR_EQUAL)
+ {
+ if ( (*(BYTE*)(lpszEMail+((dwEMailSize-dwDomainLen)-1)))=='@' )
+ {
+ bRet=TRUE;
+ break;
+ }
+ }
+ }
+ }
+return(bRet);
+}
+
+
+BOOL GetEMailFromString(LPSTR lpszBuff,SIZE_T dwBuffSize,LPSTR *plpszEMail,SIZE_T *pdwEMailSize)
+{
+ BOOL bRet=FALSE;
+
+ if (lpszBuff && dwBuffSize)
+ {
+ LPSTR lpszEMailStart,lpszEMailEnd;
+
+ if ((lpszEMailStart=(LPSTR)MemoryFindByte(0,lpszBuff,dwBuffSize,'<')))
+ {
+ lpszEMailStart++;
+ if ((lpszEMailEnd=(LPSTR)MemoryFindByte((lpszEMailStart-lpszBuff),lpszBuff,dwBuffSize,'>')))
+ {
+ if (plpszEMail) (*plpszEMail)=lpszEMailStart;
+ if (pdwEMailSize) (*pdwEMailSize)=(lpszEMailEnd-lpszEMailStart);
+
+ bRet=TRUE;
+ }
+ }
+ }
+
+ if (bRet==FALSE)
+ {
+ if (plpszEMail) (*plpszEMail)=NULL;
+ if (pdwEMailSize) (*pdwEMailSize)=0;
+ }
+
+return(bRet);
+}
+
+
+DWORD GetContactEMailCountParam(HANDLE hContact,BOOL bMRAOnly,LPSTR lpszModule,LPSTR lpszValueName)
+{
+ DWORD dwRet=0;
+ CHAR szBuff[MAX_PATH],szEMail[MAX_EMAIL_LEN];
+ SIZE_T i,dwEMailSize;
+
+ if(DB_GetStaticStringA(hContact,lpszModule,lpszValueName,szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ if (bMRAOnly==FALSE || IsEMailMR(szEMail,dwEMailSize)) dwRet++;
+ }
+
+ for (i=0;TRUE;i++)
+ {
+ mir_snprintf(szBuff,SIZEOF(szBuff),"%s%lu",lpszValueName,i);
+ if(DB_GetStaticStringA(hContact,lpszModule,szBuff,szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ if (bMRAOnly==FALSE || IsEMailMR(szEMail,dwEMailSize)) dwRet++;
+ }else{
+ if (i>EMAILS_MIN_COUNT) break;
+ }
+ }
+return(dwRet);
+}
+
+
+DWORD GetContactEMailCount(HANDLE hContact,BOOL bMRAOnly)
+{
+ DWORD dwRet=0;
+ LPSTR lpszProto;
+
+ if (hContact)
+ {
+ lpszProto=(LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
+ }else{
+ lpszProto=PROTOCOL_NAMEA;
+ }
+ dwRet+=GetContactEMailCountParam(hContact,bMRAOnly,lpszProto,"e-mail");
+ dwRet+=GetContactEMailCountParam(hContact,bMRAOnly,"UserInfo","e-mail");
+ dwRet+=GetContactEMailCountParam(hContact,bMRAOnly,"UserInfo","Mye-mail");
+ dwRet+=GetContactEMailCountParam(hContact,bMRAOnly,"UserInfo","Companye-mail");
+ dwRet+=GetContactEMailCountParam(hContact,bMRAOnly,"UserInfo","MyCompanye-mail");
+
+return(dwRet);
+}
+
+
+
+BOOL GetContactFirstEMailParam(HANDLE hContact,BOOL bMRAOnly,LPSTR lpszModule,LPSTR lpszValueName,LPSTR lpszRetBuff,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize)
+{
+ BOOL bRet=FALSE;
+ CHAR szBuff[MAX_PATH],szEMail[MAX_EMAIL_LEN];
+ SIZE_T i,dwEMailSize;
+
+ if(DB_GetStaticStringA(hContact,lpszModule,lpszValueName,szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ if (bMRAOnly==FALSE || IsEMailMR(szEMail,dwEMailSize))
+ {
+ lstrcpynA(lpszRetBuff,szEMail,dwRetBuffSize);
+ if (pdwRetBuffSize) (*pdwRetBuffSize)=dwEMailSize;
+ bRet=TRUE;
+ }
+ }
+
+ for (i=0;bRet==FALSE;i++)
+ {
+ mir_snprintf(szBuff,SIZEOF(szBuff),"%s%lu",lpszValueName,i);
+ if(DB_GetStaticStringA(hContact,lpszModule,szBuff,szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ if (bMRAOnly==FALSE || IsEMailMR(szEMail,dwEMailSize))
+ {
+ lstrcpynA(lpszRetBuff,szEMail,dwRetBuffSize);
+ if (pdwRetBuffSize) (*pdwRetBuffSize)=dwEMailSize;
+ bRet=TRUE;
+ break;
+ }
+ }else{
+ if (i>EMAILS_MIN_COUNT) break;
+ }
+ }
+return(bRet);
+}
+
+
+BOOL GetContactFirstEMail(HANDLE hContact,BOOL bMRAOnly,LPSTR lpszRetBuff,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize)
+{
+ BOOL bRet=FALSE;
+ LPSTR lpszProto;
+
+ if (hContact)
+ {
+ lpszProto=(LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
+ }else{
+ lpszProto=PROTOCOL_NAMEA;
+ }
+ bRet=GetContactFirstEMailParam(hContact,bMRAOnly,lpszProto,"e-mail",lpszRetBuff,dwRetBuffSize,pdwRetBuffSize);
+ if (bRet==FALSE) bRet=GetContactFirstEMailParam(hContact,bMRAOnly,"UserInfo","e-mail",lpszRetBuff,dwRetBuffSize,pdwRetBuffSize);
+ if (bRet==FALSE) bRet=GetContactFirstEMailParam(hContact,bMRAOnly,"UserInfo","Mye-mail",lpszRetBuff,dwRetBuffSize,pdwRetBuffSize);
+ if (bRet==FALSE) bRet=GetContactFirstEMailParam(hContact,bMRAOnly,"UserInfo","Companye-mail",lpszRetBuff,dwRetBuffSize,pdwRetBuffSize);
+ if (bRet==FALSE) bRet=GetContactFirstEMailParam(hContact,bMRAOnly,"UserInfo","MyCompanye-mail",lpszRetBuff,dwRetBuffSize,pdwRetBuffSize);
+
+return(bRet);
+}
+
+
+/////////////////////////////////////////////////////////////////////////////////////////
+//
+DWORD MraAPCQueueAdd(PAPCFUNC pfnAPC,PFIFO_MT pffmtAPCQueue,ULONG_PTR dwData)
+{
+ DWORD dwRetErrorCode;
+
+ if (masMraSettings.hThreadAPC && pffmtAPCQueue && pfnAPC)
+ {
+ MRA_APC_QUEUE_ITEM *pqiApcQueueItem;
+
+ pqiApcQueueItem=(MRA_APC_QUEUE_ITEM*)MEMALLOC(sizeof(MRA_APC_QUEUE_ITEM));
+ if (pqiApcQueueItem)
+ {
+ pqiApcQueueItem->pfnAPC=pfnAPC;
+ FifoMTItemPush(pffmtAPCQueue,(PCFIFO_MT_ITEM)pqiApcQueueItem,(LPVOID)dwData);
+ SetEvent(masMraSettings.hWaitEventThreadAPCHandle);
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ dwRetErrorCode=GetLastError();
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+void MraAPCQueueProcess(PFIFO_MT pffmtAPCQueue)
+{
+ LPVOID lpData;
+ MRA_APC_QUEUE_ITEM *pqiApcQueueItem;
+
+ while(FifoMTItemPop(pffmtAPCQueue,(PFIFO_MT_ITEM*)&pqiApcQueueItem,&lpData)==NO_ERROR)
+ {
+ SleepEx(10,FALSE);
+ pqiApcQueueItem->pfnAPC((ULONG_PTR)lpData);
+ MEMFREE(pqiApcQueueItem);
+ }
+}
+
+
+void MraAPCQueueDestroy(PFIFO_MT pffmtAPCQueue)
+{
+ if (masMraSettings.hThreadAPC)
+ {
+ LPVOID lpData;
+ PFIFO_MT_ITEM pffmtiFifoItem;
+
+ FifoMTLock(pffmtAPCQueue);
+
+ while(FifoMTItemPop(pffmtAPCQueue,&pffmtiFifoItem,&lpData)==NO_ERROR)
+ {
+ MEMFREE(lpData);
+ MEMFREE(pffmtiFifoItem);
+ }
+
+ FifoMTUnLock(pffmtAPCQueue);
+ FifoMTDestroy(pffmtAPCQueue);
+ }
+}
+
+
+void ShowFormatedErrorMessage(LPWSTR lpwszErrText,DWORD dwErrorCode)
+{
+ WCHAR szErrorText[2048],szErrDescription[1024];
+ SIZE_T dwErrDescriptionSize;
+
+ if (dwErrorCode==NO_ERROR)
+ {
+ mir_sntprintf(szErrorText,SIZEOF(szErrorText),L"%s",TranslateW(lpwszErrText));
+ }else{
+ dwErrDescriptionSize=(FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,NULL,dwErrorCode,0,szErrDescription,(SIZEOF(szErrDescription)-sizeof(WCHAR)),NULL)-2);
+ szErrDescription[dwErrDescriptionSize]=0;
+ mir_sntprintf(szErrorText,SIZEOF(szErrorText),L"%s %lu: %s",TranslateW(lpwszErrText),dwErrorCode,szErrDescription);
+ }
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_ERROR,0,szErrorText);
+}
+
+
+DWORD ProtoBroadcastAckAsynchEx(const char *szModule,HANDLE hContact,int type,int hResult,HANDLE hProcess,LPARAM lParam,SIZE_T dwLparamSize)
+{
+ DWORD dwRetErrorCode;
+ SIZE_T dwModuleSize;
+ ACKDATA *lpAck;
+
+ dwModuleSize=lstrlenA(szModule);
+ if (dwLparamSize==-1) dwLparamSize=lstrlenA((LPSTR)lParam);
+ lpAck=(ACKDATA*)MEMALLOC((sizeof(ACKDATA)+dwModuleSize+dwLparamSize+sizeof(DWORD)));
+ if (lpAck)
+ {
+ lpAck->cbSize=sizeof(ACKDATA);
+ lpAck->szModule=(((char*)lpAck)+sizeof(ACKDATA));
+ lpAck->hContact=hContact;
+ lpAck->type=type;
+ lpAck->result=hResult;
+ lpAck->hProcess=hProcess;
+ if (dwLparamSize)
+ {
+ lpAck->lParam=(LPARAM)(lpAck->szModule+dwModuleSize);
+ memmove((LPVOID)lpAck->lParam,(LPVOID)lParam,dwLparamSize);
+ }else{
+ lpAck->lParam=lParam;
+ }
+ memmove((LPVOID)lpAck->szModule,(LPVOID)szModule,dwModuleSize);
+
+ if ((dwRetErrorCode=MraAPCQueueAdd(ThreadMarandaCallbackAck,&masMraSettings.ffmtAPCQueue,(ULONG_PTR)lpAck))!=NO_ERROR)
+ {
+ CallService(MS_PROTO_BROADCASTACK,0,(LPARAM)lpAck);
+ MEMFREE(lpAck);
+ }
+ }else{
+ dwRetErrorCode=GetLastError();
+ }
+return(dwRetErrorCode);
+}
+
+
+void CALLBACK ThreadMarandaCallbackAck(ULONG_PTR dwParam)
+{
+ if (dwParam)
+ {
+ CallService(MS_PROTO_BROADCASTACK,0,(LPARAM)dwParam);
+ MEMFREE(dwParam);
+ }
+}
+
+
+void MraUserAPCThreadProc(LPVOID lpParameter)
+{
+ DWORD dwWaitRetCode=WAIT_TIMEOUT,dwCurTickTime,dwNextCheckTime,dwLastPingTime,dwFailCounter;
+
+ dwNextCheckTime=0;
+ dwFailCounter=0;
+
+ while(InterlockedExchangeAdd((volatile LONG*)&masMraSettings.dwAPCThreadRunning,0))
+ {
+ MraAPCQueueProcess(&masMraSettings.ffmtAPCQueue);
+
+ if (masMraSettings.hThreadWorker)
+ if (IsThreadAlive(masMraSettings.hThreadWorker))
+ {// check man thread last answer time
+ dwCurTickTime=GetTickCount();
+
+ if (dwCurTickTime>dwNextCheckTime)
+ {
+ dwLastPingTime=InterlockedExchangeAdd((volatile LONG*)&masMraSettings.dwThreadWorkerLastPingTime,0);
+ if ((dwCurTickTime>dwLastPingTime) && ((dwCurTickTime-dwLastPingTime)>(THREAD_MAX_PING_TIME*1000)))
+ {// ping failure, thread not answer
+ dwFailCounter++;
+ DebugPrintCRLFW(L"Watchdog: mra worker thread not answering");
+ if (dwFailCounter>THREAD_MAX_PING_FAIL_COUNT)
+ {
+ DebugPrintCRLFW(L"Watchdog: TERMINATING mra worker thread");
+ TerminateThread(masMraSettings.hThreadWorker,WAIT_TIMEOUT);
+ MraThreadClean();
+ dwFailCounter=0;
+ }
+ }else{// ping ok, reset failures counter
+ dwFailCounter=0;
+ }
+ dwNextCheckTime=(dwCurTickTime+(THREAD_MAX_PING_TIME*1000));
+ }
+ }else{// main thread is die, clean up
+ DebugPrintCRLFW(L"Watchdog: mra worker thread is down!!!!");
+ MraThreadClean();
+ }
+ dwWaitRetCode=WaitForSingleObjectEx(masMraSettings.hWaitEventThreadAPCHandle,THREAD_SLEEP_TIME,FALSE);
+ }
+
+ if (masMraSettings.hWaitEventThreadAPCHandle)
+ {
+ CloseHandle(masMraSettings.hWaitEventThreadAPCHandle);
+ masMraSettings.hWaitEventThreadAPCHandle=NULL;
+ }
+ MraAPCQueueDestroy(&masMraSettings.ffmtAPCQueue);
+ masMraSettings.hThreadAPC=NULL;
+ InterlockedExchange((volatile LONG*)&masMraSettings.dwAPCThreadRunning,FALSE);
+
+ DebugPrintCRLFW(L"Watchdog: APC thread ended, no watching.");
+}
+
+
+
+DWORD CreateBlobFromContact(HANDLE hContact,LPWSTR lpwszRequestReason,SIZE_T dwRequestReasonSize,LPBYTE lpbBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSizeRet)
+{
+ DWORD dwRetErrorCode;
+ SIZE_T dwBuffSizeRet=((sizeof(DWORD)*2)+dwRequestReasonSize+5),dwSize;
+
+ if (dwBuffSize>=dwBuffSizeRet)
+ {
+ PBYTE pCurBlob=lpbBuff;
+
+ (*(DWORD*)pCurBlob)=0;pCurBlob+=sizeof(DWORD);
+ (*(DWORD*)pCurBlob)=(DWORD)hContact;pCurBlob+=sizeof(DWORD);
+
+ DB_Mra_GetStaticStringA(hContact,"Nick",(LPSTR)pCurBlob,(dwBuffSize-(pCurBlob-lpbBuff)),&dwSize);
+ (*(pCurBlob+dwSize))=0;
+ pCurBlob+=(dwSize+1);
+
+ DB_Mra_GetStaticStringA(hContact,"FirstName",(LPSTR)pCurBlob,(dwBuffSize-(pCurBlob-lpbBuff)),&dwSize);
+ (*(pCurBlob+dwSize))=0;
+ pCurBlob+=(dwSize+1);
+
+ DB_Mra_GetStaticStringA(hContact,"LastName",(LPSTR)pCurBlob,(dwBuffSize-(pCurBlob-lpbBuff)),&dwSize);
+ (*(pCurBlob+dwSize))=0;
+ pCurBlob+=(dwSize+1);
+
+ DB_Mra_GetStaticStringA(hContact,"e-mail",(LPSTR)pCurBlob,(dwBuffSize-(pCurBlob-lpbBuff)),&dwSize);
+ (*(pCurBlob+dwSize))=0;
+ pCurBlob+=(dwSize+1);
+
+ dwSize=WideCharToMultiByte(MRA_CODE_PAGE,0,lpwszRequestReason,dwRequestReasonSize,(LPSTR)pCurBlob,(dwBuffSize-(pCurBlob-lpbBuff)),NULL,NULL);
+ //memmove(pCurBlob,lpszRequestReason,dwRequestReasonSize);
+ (*(pCurBlob+dwSize))=0;
+ pCurBlob+=(dwSize+1);
+
+ dwBuffSizeRet=(pCurBlob-lpbBuff);
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ dwRetErrorCode=ERROR_INSUFFICIENT_BUFFER;
+ }
+
+ if (pdwBuffSizeRet) (*pdwBuffSizeRet)=dwBuffSizeRet;
+return(dwRetErrorCode);
+}
+
+
+
+void CListCreateMenu(LONG lPosition,LONG lPopupPosition,HANDLE hMainIcon,LPSTR pszContactOwner,LPSTR lpszCListMenuType,const GUI_DISPLAY_ITEM *pgdiItems,HANDLE *hIcoLibIcons,SIZE_T dwCount,HANDLE *hResult)
+{
+ if (pgdiItems && hIcoLibIcons && dwCount && hResult)
+ {
+ char szServiceFunction[MAX_PATH],*pszServiceFunctionName;
+ CLISTMENUITEM mi={0};
+
+ memmove(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
+ pszServiceFunctionName=szServiceFunction+PROTOCOL_NAME_LEN;
+
+ mi.cbSize=sizeof(mi);
+ mi.popupPosition=lPopupPosition;
+ mi.ptszPopupName=PROTOCOL_DISPLAY_NAMEW;
+ mi.pszService=szServiceFunction;
+ mi.flags=(CMIF_UNICODE|CMIF_ICONFROMICOLIB);
+
+ for (SIZE_T i=0;i<dwCount;i++)
+ {
+ memmove(pszServiceFunctionName,pgdiItems[i].lpszName,(lstrlenA(pgdiItems[i].lpszName)+1));
+ if (pgdiItems[i].lpFunc) CreateServiceFunction(szServiceFunction,pgdiItems[i].lpFunc);
+ mi.position=(lPosition+i);
+ mi.icolibItem=hIcoLibIcons[i];
+ mi.ptszName=pgdiItems[i].lpwszDescr;
+
+ if (i==0 && hMainIcon)
+ {
+ mi.icolibItem=hMainIcon;
+ mi.flags=(CMIF_UNICODE);
+ }
+
+ hResult[i]=(HANDLE)CallService(lpszCListMenuType,0,(LPARAM)&mi);
+
+ if (i==0 && hMainIcon)
+ {
+ mi.flags=CMIM_FLAGS|CMIM_ICON|CMIF_ICONFROMICOLIB;
+ mi.icolibItem=hIcoLibIcons[i];
+ CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hResult[i],(LPARAM)&mi);
+ mi.flags=(CMIF_UNICODE|CMIF_ICONFROMICOLIB);
+ }
+ }
+ }
+}
+
+
+void CListDestroyMenu(const GUI_DISPLAY_ITEM *pgdiItems,SIZE_T dwCount)
+{
+ if (pgdiItems && dwCount)
+ {
+ CHAR szServiceFunction[MAX_PATH],*pszServiceFunctionName;
+
+ memmove(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
+ pszServiceFunctionName=szServiceFunction+PROTOCOL_NAME_LEN;
+
+ for (SIZE_T i=0;i<dwCount;i++)
+ {
+ memmove(pszServiceFunctionName,pgdiItems[i].lpszName,(lstrlenA(pgdiItems[i].lpszName)+1));
+ if (pgdiItems[i].lpFunc) DestroyServiceFunction(szServiceFunction);
+ }
+ }
+}
+
+
+void CListShowMenuItem(HANDLE hMenuItem,BOOL bShow)
+{
+ CLISTMENUITEM mi={0};
+
+ mi.cbSize=sizeof(mi);
+ mi.flags=CMIM_FLAGS;
+ if (bShow==FALSE) mi.flags|=CMIF_HIDDEN;
+
+ CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hMenuItem,(LPARAM)&mi);
+}
+
+/*void CListSetMenuItemIcon(HANDLE hMenuItem,HANDLE hIcon)
+{
+ CLISTMENUITEM mi={0};
+
+ mi.cbSize=sizeof(mi);
+ mi.flags=CMIM_FLAGS|CMIM_ICON|CMIF_ICONFROMICOLIB;
+ mi.icolibItem=hIcon;
+ CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hMenuItem,(LPARAM)&mi);
+}*/
+
+int ExtraSetIcon(HANDLE hExtraIcon,HANDLE hContact,HANDLE hImage,int iColumnType)
+{
+ int iRet;
+
+ if (hExtraIcon)
+ {
+ iRet=ExtraIcon_SetIcon(hExtraIcon,hContact,hImage);
+ }else{
+ IconExtraColumn iec;
+
+ iec.cbSize=sizeof(iec);
+ iec.ColumnType=iColumnType;
+ iec.hImage=((hImage!=NULL)? hImage:INVALID_HANDLE_VALUE);
+
+ iRet=CallService(MS_CLIST_EXTRA_SET_ICON,(WPARAM)hContact,(LPARAM)&iec);
+ }
+return(iRet);
+}
+
+
+
+SIZE_T CopyNumber(LPCVOID lpcOutBuff,LPCVOID lpcBuff,SIZE_T dwLen)
+{
+ BYTE btChar;
+ LPBYTE lpbOutBuff=(LPBYTE)lpcOutBuff,lpbInBuff=(LPBYTE)lpcBuff;
+
+ for(SIZE_T i=0;i<dwLen;i++)
+ {
+ btChar=(*lpbInBuff++);
+ if (btChar>='0' && btChar<='9') (*lpbOutBuff++)=btChar;
+ }
+ (*lpbOutBuff)=0;
+
+return((lpbOutBuff-(LPBYTE)lpcOutBuff));
+}
+
+
+/*
+BOOL IsPhone(LPSTR lpszString,SIZE_T dwStringSize)
+{
+ BOOL bRet;
+
+ if (dwStringSize>1)
+ {// country code
+ BYTE btChar;
+
+ bRet=TRUE;
+ for(SIZE_T i=0;i<dwStringSize;i++)
+ {
+ btChar=(*lpszString++);
+ if (btChar<'0' || btChar>'9')
+ if (btChar!='+' && btChar!='S' && btChar!='M' && btChar!=' ' && btChar!='(' && btChar!=')')
+ {
+ bRet=FALSE;
+ break;
+ }
+ }
+ }else{
+ bRet=FALSE;
+ }
+return(bRet);
+}
+
+
+BOOL IsContactPhoneParam(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPSTR lpszPhone,SIZE_T dwPhoneSize)
+{
+ BOOL bRet=FALSE;
+ char szBuff[MAX_PATH],szPhoneLocal[MAX_EMAIL_LEN];
+ SIZE_T i,dwPhoneSizeLocal;
+
+ if(DB_GetStaticStringA(hContact,lpszModule,lpszValueName,szPhoneLocal,SIZEOF(szPhoneLocal),&dwPhoneSizeLocal))
+ if (IsPhone(szPhoneLocal,dwPhoneSizeLocal))
+ {
+ dwPhoneSizeLocal=CopyNumber(szPhoneLocal,szPhoneLocal,dwPhoneSizeLocal);
+ if (MemoryCompare(szPhoneLocal,dwPhoneSizeLocal,lpszPhone,dwPhoneSize)==CMEM_EQUAL)
+ {
+ bRet=TRUE;
+ }
+ }
+
+ for (i=0;bRet==FALSE;i++)
+ {
+ mir_snprintf(szBuff,SIZEOF(szBuff),"%s%lu",lpszValueName,i);
+ if(DB_GetStaticStringA(hContact,lpszModule,szBuff,szPhoneLocal,SIZEOF(szPhoneLocal),&dwPhoneSizeLocal))
+ {
+ if (IsPhone(szPhoneLocal,dwPhoneSizeLocal))
+ {
+ dwPhoneSizeLocal=CopyNumber(szPhoneLocal,szPhoneLocal,dwPhoneSizeLocal);
+ if (MemoryCompare(szPhoneLocal,dwPhoneSizeLocal,lpszPhone,dwPhoneSize)==CMEM_EQUAL)
+ {
+ bRet=TRUE;
+ break;
+ }
+ }
+ }else{
+ if (i>PHONES_MIN_COUNT) break;
+ }
+ }
+return(bRet);
+}
+
+
+BOOL IsContactPhone(HANDLE hContact,LPSTR lpszPhone,SIZE_T dwPhoneSize)
+{
+ BOOL bRet=FALSE;
+ char szPhoneLocal[MAX_EMAIL_LEN];
+ LPSTR lpszProto;
+ SIZE_T dwPhoneSizeLocal;
+
+ if (hContact)
+ {
+ lpszProto=(LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
+ }else{
+ lpszProto=PROTOCOL_NAMEA;
+ }
+ dwPhoneSizeLocal=CopyNumber(szPhoneLocal,lpszPhone,dwPhoneSize);
+
+ if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,lpszProto,"Phone",szPhoneLocal,dwPhoneSizeLocal);
+ if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,lpszProto,"Cellular",szPhoneLocal,dwPhoneSizeLocal);
+ if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,lpszProto,"Fax",szPhoneLocal,dwPhoneSizeLocal);
+ if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,"UserInfo","MyPhone",szPhoneLocal,dwPhoneSizeLocal);
+ if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,"UserInfo","Phone",szPhoneLocal,dwPhoneSizeLocal);
+ if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,"UserInfo","Cellular",szPhoneLocal,dwPhoneSizeLocal);
+ if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,"UserInfo","Fax",szPhoneLocal,dwPhoneSizeLocal);
+
+return(bRet);
+}
+
+
+HANDLE MraHContactFromPhone(LPSTR lpszPhone,SIZE_T dwPhoneSize,BOOL bAddIfNeeded,BOOL bTemporary,BOOL *pbAdded)
+{
+ HANDLE hContact=NULL;
+
+ if (lpszPhone && dwPhoneSize)
+ {
+ BOOL bFounded=FALSE;
+
+ //check not already on list
+ for(hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ {
+ if (IsContactPhone(hContact,lpszPhone,dwPhoneSize))
+ {
+ if (bTemporary==FALSE) DBDeleteContactSetting(hContact,"CList","NotOnList");
+ bFounded=TRUE;
+ break;
+ }
+ }
+
+ if (bFounded==FALSE && bAddIfNeeded)
+ {//not already there: add
+ hContact=(HANDLE)CallService(MS_DB_CONTACT_ADD,0,0);
+ CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact,(LPARAM)PROTOCOL_NAMEA);
+ //SetContactBasicInfoW(hContact,SCBIFSI_LOCK_CHANGES_EVENTS,(SCBIF_ID|SCBIF_GROUP_ID|SCBIF_FLAG|SCBIF_SERVER_FLAG|SCBIF_STATUS|SCBIF_EMAIL|SCBIF_PHONES),-1,-1,0,CONTACT_INTFLAG_NOT_AUTHORIZED,ID_STATUS_OFFLINE,lpszEMail,dwEMailSize,NULL,0,lpszPhone,dwPhoneSize);
+ if (bTemporary) DBWriteContactSettingByte(hContact,"CList","NotOnList",1);
+ DB_Mra_SetStringExA(hContact,"MirVer",MIRVER_UNKNOWN,(sizeof(MIRVER_UNKNOWN)-1));
+ MraSetContactStatus(hContact,ID_STATUS_OFFLINE);
+ }
+
+ if (pbAdded) (*pbAdded)=(bFounded==FALSE && bAddIfNeeded && hContact);
+ }
+return(hContact);
+}*/
+
+void EnableControlsArray(HWND hWndDlg,WORD *pwControlsList,SIZE_T dwControlsListCount,BOOL bEnabled)
+{
+ for(SIZE_T i=0;i<dwControlsListCount;i++) EnableWindow(GetDlgItem(hWndDlg,pwControlsList[i]),bEnabled);
+}
+
+
+
+LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
+{
+ LRESULT lrRet=0;
+ WNDPROC OldMessageEditProc=(WNDPROC)GetWindowLongPtr(hwnd,GWLP_USERDATA);
+
+ if (msg==WM_CHAR)
+ if (GetKeyState(VK_CONTROL)&0x8000)
+ {
+ if(wParam=='\n')
+ {
+ PostMessage(GetParent(hwnd),WM_COMMAND,IDOK,0);
+ return(0);
+ }
+ if (wParam==1)
+ {// ctrl-a
+ SendMessage(hwnd,EM_SETSEL,0,-1);
+ return(0);
+ }
+ if (wParam==23)
+ {// ctrl-w
+ SendMessage(GetParent(hwnd),WM_CLOSE,0,0);
+ return(0);
+ }
+ }
+
+ if (OldMessageEditProc) lrRet=CallWindowProc(OldMessageEditProc,hwnd,msg,wParam,lParam);
+
+return(lrRet);
+}
+
+
+BOOL MraRequestXStatusDetails(DWORD dwXStatus)
+{
+ BOOL bRet;
+
+ if (IsXStatusValid(dwXStatus))
+ {
+ bRet=(DialogBoxParamW(masMraSettings.hInstance,MAKEINTRESOURCE(IDD_SETXSTATUS),NULL,SetXStatusDlgProc,(LPARAM)dwXStatus)!=-1);
+ }else{
+ bRet=FALSE;
+ }
+return(bRet);
+}
+
+INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=FALSE;
+ SetXStatusData *psxsData=(SetXStatusData*)GetWindowLongPtr(hWndDlg,GWLP_USERDATA);
+
+ switch(message){
+ case WM_INITDIALOG:// set our xStatus
+ TranslateDialogDefault(hWndDlg);
+
+ psxsData=(SetXStatusData*)MEMALLOC(sizeof(SetXStatusData));
+ if (psxsData)
+ {
+ char szValueName[MAX_PATH];
+ HWND hWndEdit;
+ WCHAR szBuff[STATUS_TITLE_MAX+STATUS_DESC_MAX];
+ WNDPROC OldMessageEditProc;
+
+ psxsData->dwXStatus=lParam;
+ psxsData->hDlgIcon=IconLibGetIcon(masMraSettings.hXStatusAdvancedStatusIcons[psxsData->dwXStatus]);
+ psxsData->dwCountdown=5;
+
+ hWndEdit=GetDlgItem(hWndDlg,IDC_XTITLE);
+ OldMessageEditProc=(WNDPROC)SetWindowLongPtr(hWndEdit,GWLP_WNDPROC,(LONG_PTR)MessageEditSubclassProc);
+ SetWindowLongPtr(hWndEdit,GWLP_USERDATA,(LONG_PTR)OldMessageEditProc);
+
+ hWndEdit=GetDlgItem(hWndDlg,IDC_XMSG);
+ OldMessageEditProc=(WNDPROC)SetWindowLongPtr(hWndEdit,GWLP_WNDPROC,(LONG_PTR)MessageEditSubclassProc);
+ SetWindowLongPtr(hWndEdit,GWLP_USERDATA,(LONG_PTR)OldMessageEditProc);
+
+ SetWindowLongPtr(hWndDlg,GWLP_USERDATA,(LONG_PTR)psxsData);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_XTITLE,EM_LIMITTEXT,STATUS_TITLE_MAX,0);
+ SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_XMSG,EM_LIMITTEXT,STATUS_DESC_MAX,0);
+ SendMessage(hWndDlg,WM_SETICON,ICON_BIG,(LPARAM)psxsData->hDlgIcon);
+ SendMessage(hWndDlg,WM_SETTEXT,0,(LPARAM)TranslateW(lpcszXStatusNameDef[psxsData->dwXStatus]));
+
+ mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%ldName",psxsData->dwXStatus);
+ if (DB_Mra_GetStaticStringW(NULL,szValueName,szBuff,(STATUS_TITLE_MAX+1),NULL))
+ {// custom xstatus name
+ SET_DLG_ITEM_TEXT(hWndDlg,IDC_XTITLE,szBuff);
+ }else{// default xstatus name
+ SET_DLG_ITEM_TEXT(hWndDlg,IDC_XTITLE,TranslateW(lpcszXStatusNameDef[psxsData->dwXStatus]));
+ }
+
+ mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%ldMsg",psxsData->dwXStatus);
+ if (DB_Mra_GetStaticStringW(NULL,szValueName,szBuff,(STATUS_DESC_MAX+1),NULL))
+ {// custom xstatus description
+ SET_DLG_ITEM_TEXT(hWndDlg,IDC_XMSG,szBuff);
+ }else{// default xstatus description
+ SET_DLG_ITEM_TEXT(hWndDlg,IDC_XMSG,L"");
+ }
+
+ SendMessage(hWndDlg,WM_TIMER,0,0);
+ SetTimer(hWndDlg,1,1000,0);
+ iRet=TRUE;
+ }
+ break;
+ case WM_TIMER:
+ if(psxsData->dwCountdown!=-1)
+ {
+ WCHAR szBuff[MAX_PATH];
+ mir_sntprintf(szBuff,SIZEOF(szBuff),L"%s %ld",TranslateW(L"Closing in"),psxsData->dwCountdown);
+ SET_DLG_ITEM_TEXT(hWndDlg,IDOK,szBuff);
+ psxsData->dwCountdown--;
+ break;
+ }
+ case WM_CLOSE:
+ DestroyWindow(hWndDlg);
+ break;
+ case WM_COMMAND:
+ switch(LOWORD(wParam)){
+ case IDOK:
+ DestroyWindow(hWndDlg);
+ break;
+ case IDC_XTITLE:
+ case IDC_XMSG:
+ KillTimer(hWndDlg,1);
+ SET_DLG_ITEM_TEXTW(hWndDlg,IDOK,TranslateW(L"OK"));
+ break;
+ }
+ break;
+ case WM_DESTROY:
+ if (psxsData)
+ { // set our xStatus
+ char szValueName[MAX_PATH];
+ HWND hWndEdit;
+ WCHAR szBuff[STATUS_TITLE_MAX+STATUS_DESC_MAX];
+ SIZE_T dwBuffSize;
+ WNDPROC OldMessageEditProc;
+ CLISTMENUITEM mi={0};
+
+ SetWindowLongPtr(hWndDlg,GWLP_USERDATA,(LONG_PTR)0);
+
+ hWndEdit=GetDlgItem(hWndDlg,IDC_XTITLE);
+ OldMessageEditProc=(WNDPROC)GetWindowLongPtr(hWndEdit,GWLP_USERDATA);
+ SetWindowLongPtr(hWndEdit,GWLP_WNDPROC,(LONG_PTR)OldMessageEditProc);
+ SetWindowLongPtr(hWndEdit,GWLP_USERDATA,(LONG_PTR)0);
+
+ hWndEdit=GetDlgItem(hWndDlg,IDC_XMSG);
+ OldMessageEditProc=(WNDPROC)GetWindowLongPtr(hWndEdit,GWLP_USERDATA);
+ SetWindowLongPtr(hWndEdit,GWLP_WNDPROC,(LONG_PTR)OldMessageEditProc);
+ SetWindowLongPtr(hWndEdit,GWLP_USERDATA,(LONG_PTR)0);
+
+ dwBuffSize=GET_DLG_ITEM_TEXT(hWndDlg,IDC_XMSG,szBuff,(STATUS_DESC_MAX+1));
+ mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%ldMsg",psxsData->dwXStatus);
+ DB_Mra_SetStringExW(NULL,szValueName,szBuff,dwBuffSize);
+ DB_Mra_SetStringExW(NULL,DBSETTING_XSTATUSMSG,szBuff,dwBuffSize);
+
+ dwBuffSize=GET_DLG_ITEM_TEXT(hWndDlg,IDC_XTITLE,szBuff,(STATUS_TITLE_MAX+1));
+ if (dwBuffSize==0)
+ {// user delete all text
+ lstrcpynW(szBuff,TranslateW(lpcszXStatusNameDef[psxsData->dwXStatus]),(STATUS_TITLE_MAX+1));
+ dwBuffSize=lstrlenW(szBuff);
+ }
+ mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%dName",psxsData->dwXStatus);
+ DB_Mra_SetStringExW(NULL,szValueName,szBuff,dwBuffSize);
+ DB_Mra_SetStringExW(NULL,DBSETTING_XSTATUSNAME,szBuff,dwBuffSize);
+
+ mi.cbSize=sizeof(mi);
+ mi.flags=(CMIM_NAME|CMIF_UNICODE);
+ mi.ptszName=szBuff;
+ CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)masMraSettings.hXStatusMenuItems[psxsData->dwXStatus],(LPARAM)&mi);
+
+ MraSetXStatusInternal(psxsData->dwXStatus);
+
+ MEMFREE(psxsData);
+ }
+ EndDialog(hWndDlg,NO_ERROR);
+ break;
+ //default:
+ // bRet=DefWindowProc(hWndDlg,message,wParam,lParam);
+ // break;
+ }
+return(iRet);
+}
+
+
+BOOL MraSendReplyBlogStatus(HANDLE hContact)
+{
+ BOOL bRet;
+
+ bRet=(CreateDialogParam(masMraSettings.hInstance,MAKEINTRESOURCE(IDD_MINIBLOG),NULL,SendReplyBlogStatusDlgProc,(LPARAM)hContact)!=NULL);
+return(bRet);
+}
+
+INT_PTR CALLBACK SendReplyBlogStatusDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=FALSE;
+ SetBlogStatusData *psbsdData=(SetBlogStatusData*)GetWindowLongPtr(hWndDlg,GWLP_USERDATA);
+
+ switch(message){
+ case WM_INITDIALOG:// set our xStatus
+ TranslateDialogDefault(hWndDlg);
+
+ psbsdData=(SetBlogStatusData*)MEMALLOC(sizeof(SetBlogStatusData));
+ if (psbsdData)
+ {
+ HWND hWndEdit;
+ DWORD dwTime;
+ WCHAR szBuff[MICBLOG_STATUS_MAX];
+ WNDPROC OldMessageEditProc;
+ SYSTEMTIME stBlogStatusTime={0};
+
+ psbsdData->hContact=(HANDLE)lParam;
+ //psbsdData->hDlgIcon=IconLibGetIcon(masMraSettings.hXStatusAdvancedStatusIcons[psxsData->dwXStatus]);
+ SetWindowLongPtr(hWndDlg,GWLP_USERDATA,(LONG_PTR)psbsdData);
+
+ hWndEdit=GetDlgItem(hWndDlg,IDC_MSG_TO_SEND);
+ OldMessageEditProc=(WNDPROC)SetWindowLongPtr(hWndEdit,GWLP_WNDPROC,(LONG_PTR)MessageEditSubclassProc);
+ SetWindowLongPtr(hWndEdit,GWLP_USERDATA,(LONG_PTR)OldMessageEditProc);
+ SendMessage(hWndEdit,EM_LIMITTEXT,MICBLOG_STATUS_MAX,0);
+
+
+ SendMessage(hWndDlg,WM_SETICON,ICON_BIG,(LPARAM)IconLibGetIcon(masMraSettings.hMainMenuIcons[5]));
+
+ if (DB_Mra_GetStaticStringW(psbsdData->hContact,DBSETTING_BLOGSTATUS,szBuff,SIZEOF(szBuff),NULL))
+ {// blog status message
+ SET_DLG_ITEM_TEXT(hWndDlg,IDC_USER_BLOG_STATUS_MSG,szBuff);
+ }
+
+ if (psbsdData->hContact)
+ {// reply to some user blog
+ mir_sntprintf(szBuff,SIZEOF(szBuff),TranslateW(L"Reply to %s blog status"),GetContactNameW(psbsdData->hContact));
+ SendMessage(hWndDlg,WM_SETTEXT,0,(LPARAM)szBuff);
+ }else{
+ SendMessage(hWndDlg,WM_SETTEXT,0,(LPARAM)TranslateW(L"Set my blog status"));
+ }
+
+ dwTime=DB_Mra_GetDword(psbsdData->hContact,DBSETTING_BLOGSTATUSTIME,0);
+ if (dwTime && MakeLocalSystemTimeFromTime32(dwTime,&stBlogStatusTime))
+ {
+ mir_sntprintf(szBuff,SIZEOF(szBuff),L"%s: %04ld.%02ld.%02ld %02ld:%02ld",TranslateW(L"Writed"),stBlogStatusTime.wYear,stBlogStatusTime.wMonth,stBlogStatusTime.wDay,stBlogStatusTime.wHour,stBlogStatusTime.wMinute);
+ }else{
+ szBuff[0]=0;
+ }
+ SET_DLG_ITEM_TEXT(hWndDlg,IDC_STATIC_WRITED_TIME,szBuff);
+
+ EnableWindow(GetDlgItem(hWndDlg,IDC_CHK_NOTIFY),(psbsdData->hContact==NULL));
+
+ iRet=TRUE;
+ }
+ break;
+ case WM_CLOSE:
+ DestroyWindow(hWndDlg);
+ break;
+ case WM_COMMAND:
+ switch(LOWORD(wParam)){
+ case IDOK:
+ {
+ DWORD dwFlags;
+ WCHAR szBuff[MICBLOG_STATUS_MAX];
+ SIZE_T dwBuffSize;
+ DWORDLONG dwBlogStatusID;
+
+ dwBuffSize=GET_DLG_ITEM_TEXT(hWndDlg,IDC_MSG_TO_SEND,szBuff,SIZEOF(szBuff));
+ if (psbsdData->hContact)
+ {
+ dwFlags=(MRIM_BLOG_STATUS_REPLY|MRIM_BLOG_STATUS_NOTIFY);
+ DB_Mra_GetContactSettingBlob(psbsdData->hContact,DBSETTING_BLOGSTATUSID,&dwBlogStatusID,sizeof(DWORDLONG),NULL);
+ }else{
+ dwFlags=MRIM_BLOG_STATUS_UPDATE;
+ if (IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_CHK_NOTIFY)) dwFlags|=MRIM_BLOG_STATUS_NOTIFY;
+ dwBlogStatusID=0;
+ }
+ MraSendCommand_ChangeUserBlogStatus(dwFlags,szBuff,dwBuffSize,dwBlogStatusID);
+ }
+ case IDCANCEL:
+ DestroyWindow(hWndDlg);
+ break;
+ case IDC_MSG_TO_SEND:
+ if (HIWORD(wParam)==EN_CHANGE)
+ {
+ WCHAR wszBuff[MAX_PATH];
+ SIZE_T dwMessageSize=GET_DLG_ITEM_TEXT_LENGTH(hWndDlg,IDC_MSG_TO_SEND);
+
+ EnableWindow(GetDlgItem(hWndDlg,IDOK),dwMessageSize);
+ mir_sntprintf(wszBuff,SIZEOF(wszBuff),L"%d/%d",dwMessageSize,MICBLOG_STATUS_MAX);
+ SET_DLG_ITEM_TEXTW(hWndDlg,IDC_STATIC_CHARS_COUNTER,wszBuff);
+ }
+ break;
+ }
+ break;
+ case WM_DESTROY:
+ if (psbsdData)
+ {
+ HWND hWndEdit;
+ WNDPROC OldMessageEditProc;
+
+ SetWindowLongPtr(hWndDlg,GWLP_USERDATA,(LONG_PTR)0);
+
+ hWndEdit=GetDlgItem(hWndDlg,IDC_MSG_TO_SEND);
+ OldMessageEditProc=(WNDPROC)GetWindowLongPtr(hWndEdit,GWLP_USERDATA);
+ SetWindowLongPtr(hWndEdit,GWLP_WNDPROC,(LONG_PTR)OldMessageEditProc);
+ SetWindowLongPtr(hWndEdit,GWLP_USERDATA,(LONG_PTR)0);
+
+
+ MEMFREE(psbsdData);
+ }
+ EndDialog(hWndDlg,NO_ERROR);
+ break;
+ //default:
+ // bRet=DefWindowProc(hWndDlg,message,wParam,lParam);
+ // break;
+ }
+return(iRet);
+}
+
+
+DWORD GetYears(CONST PSYSTEMTIME pcstSystemTime)
+{
+ DWORD dwRet=0;
+
+ if (pcstSystemTime)
+ {
+ SYSTEMTIME stTime;
+
+ GetLocalTime(&stTime);
+ dwRet=(stTime.wYear-pcstSystemTime->wYear);
+ if (stTime.wMonth<pcstSystemTime->wMonth)
+ {//
+ dwRet--;
+ }else{// ...
+ if (stTime.wMonth==pcstSystemTime->wMonth)
+ {//
+ if (stTime.wDay<pcstSystemTime->wDay)
+ {// ,
+ dwRet--;
+ }// ...
+ }
+ }
+ }
+return(dwRet);
+}
+
+
+
+DWORD FindFile(LPWSTR lpszFolder,DWORD dwFolderLen,LPWSTR lpszFileName,DWORD dwFileNameLen,LPWSTR lpszRetFilePathName,DWORD dwRetFilePathLen,DWORD *pdwRetFilePathLen)
+{
+ DWORD dwRetErrorCode;
+
+ if (lpszFolder && dwFolderLen && lpszFileName && dwFileNameLen)
+ {
+ WCHAR szPath[32768];
+ DWORD dwPathLen,dwRecDeepAllocated,dwRecDeepCurPos,dwFilePathLen;
+ RECURSION_DATA_STACK_ITEM *prdsiItems;
+
+ if (dwFolderLen==-1) dwFolderLen=lstrlenW(lpszFolder);
+ if (dwFileNameLen==-1) dwFileNameLen=lstrlenW(lpszFileName);
+
+ dwRecDeepCurPos=0;
+ dwRecDeepAllocated=RECURSION_DATA_STACK_ITEMS_MIN;
+ prdsiItems=(RECURSION_DATA_STACK_ITEM*)MEMALLOC(dwRecDeepAllocated*sizeof(RECURSION_DATA_STACK_ITEM));
+ if (prdsiItems)
+ {
+ dwPathLen=dwFolderLen;
+ memmove(szPath,lpszFolder,(dwPathLen*sizeof(WCHAR)));
+ if (szPath[(dwPathLen-1)]!='\\')
+ {
+ szPath[dwPathLen]='\\';
+ dwPathLen++;
+ }
+ szPath[dwPathLen]=0;
+ lstrcatW(szPath,L"*.*");
+
+ prdsiItems[dwRecDeepCurPos].dwFileNameLen=0;
+ prdsiItems[dwRecDeepCurPos].hFind=FindFirstFileEx(szPath,FindExInfoStandard,&prdsiItems[dwRecDeepCurPos].w32fdFindFileData,FindExSearchNameMatch,NULL,0);
+ if (prdsiItems[dwRecDeepCurPos].hFind!=INVALID_HANDLE_VALUE)
+ {
+ dwRetErrorCode=ERROR_FILE_NOT_FOUND;
+ do
+ {
+ dwPathLen-=prdsiItems[dwRecDeepCurPos].dwFileNameLen;
+
+ while(dwRetErrorCode==ERROR_FILE_NOT_FOUND && FindNextFile(prdsiItems[dwRecDeepCurPos].hFind,&prdsiItems[dwRecDeepCurPos].w32fdFindFileData))
+ {
+ if (prdsiItems[dwRecDeepCurPos].w32fdFindFileData.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
+ {// folder
+ if (CompareString(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName,-1,L".",1)!=CSTR_EQUAL)
+ if (CompareString(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName,-1,L"..",2)!=CSTR_EQUAL)
+ {
+ prdsiItems[dwRecDeepCurPos].dwFileNameLen=(lstrlenW(prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName)+1);
+ memmove((szPath+dwPathLen),prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName,(prdsiItems[dwRecDeepCurPos].dwFileNameLen*sizeof(WCHAR)));
+ lstrcatW(szPath,L"\\*.*");
+ dwPathLen+=prdsiItems[dwRecDeepCurPos].dwFileNameLen;
+
+ dwRecDeepCurPos++;
+ if (dwRecDeepCurPos==dwRecDeepAllocated)
+ {// need more space
+ dwRecDeepAllocated+=RECURSION_DATA_STACK_ITEMS_MIN;
+ prdsiItems=(RECURSION_DATA_STACK_ITEM*)MEMREALLOC(prdsiItems,dwRecDeepAllocated*sizeof(RECURSION_DATA_STACK_ITEM));
+ if (prdsiItems==NULL)
+ {
+ dwRecDeepCurPos=0;
+ dwRetErrorCode=GetLastError();
+ break;
+ }
+ }
+ prdsiItems[dwRecDeepCurPos].hFind=FindFirstFileEx(szPath,FindExInfoStandard,&prdsiItems[dwRecDeepCurPos].w32fdFindFileData,FindExSearchNameMatch,NULL,0);
+ }
+ }else{// file
+ if (CompareString(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName,-1,lpszFileName,dwFileNameLen)==CSTR_EQUAL)
+ {
+ prdsiItems[dwRecDeepCurPos].dwFileNameLen=lstrlenW(prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName);
+ memmove((szPath+dwPathLen),prdsiItems[dwRecDeepCurPos].w32fdFindFileData.cFileName,((prdsiItems[dwRecDeepCurPos].dwFileNameLen+1)*sizeof(WCHAR)));
+ dwFilePathLen=(dwPathLen+prdsiItems[dwRecDeepCurPos].dwFileNameLen);
+
+ if (pdwRetFilePathLen) (*pdwRetFilePathLen)=dwFilePathLen;
+ if (lpszRetFilePathName && dwRetFilePathLen)
+ {
+ dwFilePathLen=min(dwFilePathLen,dwRetFilePathLen);
+ memmove(lpszRetFilePathName,szPath,((dwFilePathLen+1)*sizeof(WCHAR)));
+ }
+
+ dwRetErrorCode=NO_ERROR;
+ }
+ }
+ }
+
+ if (prdsiItems) FindClose(prdsiItems[dwRecDeepCurPos].hFind);
+ dwRecDeepCurPos--;
+ }while(dwRecDeepCurPos!=-1);
+ }
+ MEMFREE(prdsiItems);
+ }else{
+ dwRetErrorCode=GetLastError();
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD MemFillRandom(LPVOID lpBuff,SIZE_T dwBuffSize)
+{
+ DWORD dwRetErrorCode;
+
+ if (lpBuff && dwBuffSize)
+ {
+ HCRYPTPROV hCryptProv=NULL;
+
+ if (CryptAcquireContext(&hCryptProv,NULL,MS_STRONG_PROV,PROV_RSA_FULL,0)==FALSE && GetLastError()==NTE_BAD_KEYSET) CryptAcquireContext(&hCryptProv,NULL,MS_STRONG_PROV,PROV_RSA_FULL,CRYPT_NEWKEYSET);
+
+ if (hCryptProv)
+ {
+ if (CryptGenRandom(hCryptProv,dwBuffSize,(BYTE*)lpBuff))
+ {
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ dwRetErrorCode=GetLastError();
+ }
+ }else{
+ dwRetErrorCode=GetLastError();
+ }
+
+ CryptReleaseContext(hCryptProv,0);
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+
+
+
+#define MRA_PASS_CRYPT_VER 2
+
+
+
+#if MRA_PASS_CRYPT_VER==1
+
+BOOL SetPassDB(LPSTR lpszBuff,SIZE_T dwBuffSize)
+{
+ BOOL bRet=FALSE;
+ BYTE btRandomData[256],btCryptedPass[256]={0},bthmacSHA1[SHA1HashSize]={0};
+ char szEMail[MAX_EMAIL_LEN]={0};
+ SIZE_T dwEMailSize;
+
+
+#if /*defined (_DEBUG) ||*/ defined (REL_DEB)
+
+ DB_Mra_SetStringExA(NULL,"Pass",lpszBuff,dwBuffSize);
+ bRet=TRUE;
+#else
+ if (dwBuffSize<128)
+ if (DB_Mra_GetStaticStringA(NULL,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ MemFillRandom(btRandomData,sizeof(btRandomData));
+
+ SHA1GetDigest(lpszBuff,dwBuffSize,&btCryptedPass[1]);
+
+ BASE64EncodeUnSafe(lpszBuff,dwBuffSize,&btCryptedPass[(1+SHA1HashSize)],(sizeof(btCryptedPass)-1),&dwBuffSize);
+ btCryptedPass[0]=(BYTE)dwBuffSize;
+ //memmove(&btCryptedPass[1],lpszBuff,dwBuffSize);
+
+ hmac_sha1(btRandomData,sizeof(btRandomData),(BYTE*)szEMail,dwEMailSize,bthmacSHA1);
+
+ RC4(btCryptedPass,sizeof(btCryptedPass),bthmacSHA1,SHA1HashSize);
+ RC4(btCryptedPass,sizeof(btCryptedPass),btRandomData,sizeof(btRandomData));
+ CopyMemoryReverseDWORD(btCryptedPass,btCryptedPass,sizeof(btCryptedPass));
+ RC4(btCryptedPass,sizeof(btCryptedPass),bthmacSHA1,SHA1HashSize);
+
+
+ DB_Mra_SetDword(NULL,"pCryptVer",MRA_PASS_CRYPT_VER);
+ DB_Mra_WriteContactSettingBlob(NULL,"pCryptData",btRandomData,sizeof(btRandomData));
+ DB_Mra_WriteContactSettingBlob(NULL,"pCryptPass",btCryptedPass,sizeof(btCryptedPass));
+
+ bRet=TRUE;
+ }
+#endif
+return(bRet);
+}
+#endif
+
+
+#if MRA_PASS_CRYPT_VER==2
+BOOL SetPassDB(LPSTR lpszBuff,SIZE_T dwBuffSize)
+{
+ BOOL bRet=FALSE;
+ BYTE btRandomData[256],btCryptedPass[256]={0},bthmacSHA1[SHA1HashSize]={0};
+ char szEMail[MAX_EMAIL_LEN]={0};
+ SIZE_T dwEMailSize;
+
+
+#if /*defined (_DEBUG) ||*/ defined (REL_DEB)
+
+ DB_Mra_SetStringExA(NULL,"Pass",lpszBuff,dwBuffSize);
+ bRet=TRUE;
+#else
+ if (dwBuffSize<128)
+ if (DB_Mra_GetStaticStringA(NULL,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ MemFillRandom(btRandomData,sizeof(btRandomData));
+
+ SHA1GetDigest(lpszBuff,dwBuffSize,&btCryptedPass[1]);
+
+ //BASE64EncodeUnSafe(lpszBuff,dwBuffSize,&btCryptedPass[(1+SHA1HashSize)],(sizeof(btCryptedPass)-1),&dwBuffSize);
+ memmove(&btCryptedPass[(1+SHA1HashSize)],lpszBuff,dwBuffSize);
+ btCryptedPass[0]=(BYTE)dwBuffSize;
+ //memmove(&btCryptedPass[1],lpszBuff,dwBuffSize);
+
+ hmac_sha1(btRandomData,sizeof(btRandomData),(BYTE*)szEMail,dwEMailSize,bthmacSHA1);
+
+ RC4(btCryptedPass,sizeof(btCryptedPass),bthmacSHA1,SHA1HashSize);
+ RC4(btCryptedPass,sizeof(btCryptedPass),btRandomData,sizeof(btRandomData));
+ CopyMemoryReverseDWORD(btCryptedPass,btCryptedPass,sizeof(btCryptedPass));
+ RC4(btCryptedPass,sizeof(btCryptedPass),bthmacSHA1,SHA1HashSize);
+
+
+ DB_Mra_SetDword(NULL,"pCryptVer",MRA_PASS_CRYPT_VER);
+ DB_Mra_WriteContactSettingBlob(NULL,"pCryptData",btRandomData,sizeof(btRandomData));
+ DB_Mra_WriteContactSettingBlob(NULL,"pCryptPass",btCryptedPass,sizeof(btCryptedPass));
+
+ bRet=TRUE;
+ }
+#endif
+return(bRet);
+}
+#endif
+
+
+BOOL GetPassDB_v1(LPSTR lpszBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSize)
+{
+ BOOL bRet=FALSE;
+ BYTE btRandomData[256]={0},btCryptedPass[256]={0},bthmacSHA1[SHA1HashSize]={0};
+ char szEMail[MAX_EMAIL_LEN]={0};
+ SIZE_T dwRandomDataSize,dwCryptedPass,dwEMailSize,dwPassSize;
+
+
+ if (DB_Mra_GetDword(NULL,"pCryptVer",0)==1)
+ if (DB_Mra_GetContactSettingBlob(NULL,"pCryptData",btRandomData,sizeof(btRandomData),&dwRandomDataSize))
+ if (dwRandomDataSize==sizeof(btRandomData))
+ if (DB_Mra_GetContactSettingBlob(NULL,"pCryptPass",btCryptedPass,sizeof(btCryptedPass),&dwCryptedPass))
+ if (dwCryptedPass==sizeof(btCryptedPass))
+ if (DB_Mra_GetStaticStringA(NULL,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ hmac_sha1(btRandomData,sizeof(btRandomData),(BYTE*)szEMail,dwEMailSize,bthmacSHA1);
+
+ RC4(btCryptedPass,sizeof(btCryptedPass),bthmacSHA1,SHA1HashSize);
+ CopyMemoryReverseDWORD(btCryptedPass,btCryptedPass,sizeof(btCryptedPass));
+ RC4(btCryptedPass,sizeof(btCryptedPass),btRandomData,dwRandomDataSize);
+ RC4(btCryptedPass,sizeof(btCryptedPass),bthmacSHA1,SHA1HashSize);
+
+ dwPassSize=(*btCryptedPass);
+ BASE64DecodeUnSafe(&btCryptedPass[(1+SHA1HashSize)],dwPassSize,&btCryptedPass[(1+SHA1HashSize)],(sizeof(btCryptedPass)-1),&dwPassSize);
+ SHA1GetDigest(&btCryptedPass[(1+SHA1HashSize)],dwPassSize,btRandomData);
+ if (MemoryCompare(&btCryptedPass[1],SHA1HashSize,btRandomData,SHA1HashSize)==CMEM_EQUAL)
+ if (dwBuffSize>=dwPassSize)
+ {
+ memmove(lpszBuff,&btCryptedPass[(1+SHA1HashSize)],dwPassSize);
+ (*(lpszBuff+dwPassSize))=0;
+
+ if (pdwBuffSize) (*pdwBuffSize)=dwPassSize;
+ bRet=TRUE;
+ }
+ }
+
+return(bRet);
+}
+
+
+BOOL GetPassDB_v2(LPSTR lpszBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSize)
+{
+ BOOL bRet=FALSE;
+ BYTE btRandomData[256]={0},btCryptedPass[256]={0},bthmacSHA1[SHA1HashSize]={0};
+ char szEMail[MAX_EMAIL_LEN]={0};
+ SIZE_T dwRandomDataSize,dwCryptedPass,dwEMailSize,dwPassSize;
+
+
+ if (DB_Mra_GetDword(NULL,"pCryptVer",0)==2)
+ if (DB_Mra_GetContactSettingBlob(NULL,"pCryptData",btRandomData,sizeof(btRandomData),&dwRandomDataSize))
+ if (dwRandomDataSize==sizeof(btRandomData))
+ if (DB_Mra_GetContactSettingBlob(NULL,"pCryptPass",btCryptedPass,sizeof(btCryptedPass),&dwCryptedPass))
+ if (dwCryptedPass==sizeof(btCryptedPass))
+ if (DB_Mra_GetStaticStringA(NULL,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ hmac_sha1(btRandomData,sizeof(btRandomData),(BYTE*)szEMail,dwEMailSize,bthmacSHA1);
+
+ RC4(btCryptedPass,sizeof(btCryptedPass),bthmacSHA1,SHA1HashSize);
+ CopyMemoryReverseDWORD(btCryptedPass,btCryptedPass,sizeof(btCryptedPass));
+ RC4(btCryptedPass,sizeof(btCryptedPass),btRandomData,dwRandomDataSize);
+ RC4(btCryptedPass,sizeof(btCryptedPass),bthmacSHA1,SHA1HashSize);
+
+ dwPassSize=((*btCryptedPass)&0xff);
+ SHA1GetDigest(&btCryptedPass[(1+SHA1HashSize)],dwPassSize,btRandomData);
+ if (MemoryCompare(&btCryptedPass[1],SHA1HashSize,btRandomData,SHA1HashSize)==CMEM_EQUAL)
+ if (dwBuffSize>=dwPassSize)
+ {
+ memmove(lpszBuff,&btCryptedPass[(1+SHA1HashSize)],dwPassSize);
+ (*(lpszBuff+dwPassSize))=0;
+
+ if (pdwBuffSize) (*pdwBuffSize)=dwPassSize;
+ bRet=TRUE;
+ }
+ }
+
+return(bRet);
+}
+
+
+BOOL GetPassDB(LPSTR lpszBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSize)
+{
+ BOOL bRet=FALSE;
+
+#if /*defined (_DEBUG) ||*/ defined (REL_DEB)
+ DB_Mra_GetStaticStringA(NULL,"Pass",lpszBuff,dwBuffSize,pdwBuffSize);
+ bRet=TRUE;
+#else
+ switch (DB_Mra_GetDword(NULL,"pCryptVer",0)) {
+ case 1:
+ bRet=GetPassDB_v1(lpszBuff,dwBuffSize,pdwBuffSize);
+ break;
+ case 2:
+ bRet=GetPassDB_v2(lpszBuff,dwBuffSize,pdwBuffSize);
+ break;
+ default:
+ bRet=FALSE;
+ break;
+ }
+#endif
+
+return(bRet);
+}
+
+
+
+
+DWORD ReplaceInBuff(LPVOID lpInBuff,SIZE_T dwInBuffSize,SIZE_T dwReplaceItemsCount,LPVOID *plpInReplaceItems,SIZE_T *pdwInReplaceItemsCounts,LPVOID *plpOutReplaceItems,SIZE_T *pdwOutReplaceItemsCounts,LPVOID lpOutBuff,SIZE_T dwOutBuffSize,SIZE_T *pdwOutBuffSize)
+{
+ DWORD dwRetErrorCode=NO_ERROR;
+ LPBYTE *plpbtFounded;
+#ifdef _DEBUG //check tables
+ for(SIZE_T i=0;i<dwReplaceItemsCount;i++)
+ {
+ if (lstrlen((LPTSTR)plpInReplaceItems[i])!=(pdwInReplaceItemsCounts[i]/sizeof(TCHAR))) DebugBreak();
+ if (lstrlen((LPTSTR)plpOutReplaceItems[i])!=(pdwOutReplaceItemsCounts[i]/sizeof(TCHAR))) DebugBreak();
+ }
+#endif
+
+ plpbtFounded=(LPBYTE*)MEMALLOC((sizeof(LPBYTE)*dwReplaceItemsCount));
+ if (plpbtFounded)
+ {
+ LPBYTE lpbtOutBuffCur,lpbtInBuffCur,lpbtInBuffCurPrev,lpbtOutBuffMax;
+ SIZE_T i,dwFirstFoundedIndex=0,dwFoundedCount=0,dwMemPartToCopy;
+
+ lpbtInBuffCurPrev=(LPBYTE)lpInBuff;
+ lpbtOutBuffCur=(LPBYTE)lpOutBuff;
+ lpbtOutBuffMax=(((LPBYTE)lpOutBuff)+dwOutBuffSize);
+ for(i=0;i<dwReplaceItemsCount;i++)
+ {// loking for in first time
+ plpbtFounded[i]=(LPBYTE)MemoryFind((lpbtInBuffCurPrev-(LPBYTE)lpInBuff),lpInBuff,dwInBuffSize,plpInReplaceItems[i],pdwInReplaceItemsCounts[i]);
+ if (plpbtFounded[i]) dwFoundedCount++;
+ }
+
+ while(dwFoundedCount)
+ {
+ for(i=0;i<dwReplaceItemsCount;i++)
+ {// looking for first to replace
+ if (plpbtFounded[i] && (plpbtFounded[i]<plpbtFounded[dwFirstFoundedIndex] || plpbtFounded[dwFirstFoundedIndex]==NULL)) dwFirstFoundedIndex=i;
+ }
+
+ if (plpbtFounded[dwFirstFoundedIndex])
+ {// in founded
+ dwMemPartToCopy=(plpbtFounded[dwFirstFoundedIndex]-lpbtInBuffCurPrev);
+ if (lpbtOutBuffMax>(lpbtOutBuffCur+(dwMemPartToCopy+pdwInReplaceItemsCounts[dwFirstFoundedIndex])))
+ {
+ memmove(lpbtOutBuffCur,lpbtInBuffCurPrev,dwMemPartToCopy);lpbtOutBuffCur+=dwMemPartToCopy;
+ memmove(lpbtOutBuffCur,plpOutReplaceItems[dwFirstFoundedIndex],pdwOutReplaceItemsCounts[dwFirstFoundedIndex]);lpbtOutBuffCur+=pdwOutReplaceItemsCounts[dwFirstFoundedIndex];
+ lpbtInBuffCurPrev=(plpbtFounded[dwFirstFoundedIndex]+pdwInReplaceItemsCounts[dwFirstFoundedIndex]);
+
+ for(i=0;i<dwReplaceItemsCount;i++)
+ {// loking for in next time
+ if (plpbtFounded[i] && plpbtFounded[i]<lpbtInBuffCurPrev)
+ {
+ plpbtFounded[i]=(LPBYTE)MemoryFind((lpbtInBuffCurPrev-(LPBYTE)lpInBuff),lpInBuff,dwInBuffSize,plpInReplaceItems[i],pdwInReplaceItemsCounts[i]);
+ if (plpbtFounded[i]==NULL) dwFoundedCount--;
+ }
+ }
+ }else{
+ dwRetErrorCode=ERROR_BUFFER_OVERFLOW;
+ DebugBreak();
+ break;
+ }
+ }else{// , .
+ DebugBreak();
+ break;
+ }
+ }
+ lpbtInBuffCur=(((LPBYTE)lpInBuff)+dwInBuffSize);
+ memmove(lpbtOutBuffCur,lpbtInBuffCurPrev,(lpbtInBuffCur-lpbtInBuffCurPrev));lpbtOutBuffCur+=(lpbtInBuffCur-lpbtInBuffCurPrev);
+ (*((WORD*)lpbtOutBuffCur))=0;
+
+ MEMFREE(plpbtFounded);
+
+ if (pdwOutBuffSize) (*pdwOutBuffSize)=(lpbtOutBuffCur-((LPBYTE)lpOutBuff));
+ }else{
+ dwRetErrorCode=GetLastError();
+ }
+return(dwRetErrorCode);
+}
+
+
+static const LPTSTR lpszXMLTags[] ={TEXT("&apos;"), TEXT("&quot;"), TEXT("&amp;"), TEXT("&lt;"), TEXT("&gt;")};
+static const SIZE_T dwXMLTagsCount[] ={(6*sizeof(TCHAR)), (6*sizeof(TCHAR)), (5*sizeof(TCHAR)), (4*sizeof(TCHAR)), (4*sizeof(TCHAR))};
+static const LPTSTR lpszXMLSymbols[] ={TEXT("\'"), TEXT("\""), TEXT("&"), TEXT("<"), TEXT(">")};
+static const SIZE_T dwXMLSymbolsCount[] ={sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR)};
+
+//Decode XML coded string. The function translate special xml code into standard characters.
+DWORD DecodeXML(LPTSTR lptszMessage,SIZE_T dwMessageSize,LPTSTR lptszMessageConverted,SIZE_T dwMessageConvertedBuffSize,SIZE_T *pdwMessageConvertedSize)
+{
+ DWORD dwRet=ReplaceInBuff(lptszMessage,(dwMessageSize*sizeof(TCHAR)),SIZEOF(lpszXMLTags),(LPVOID*)lpszXMLTags,(SIZE_T*)dwXMLTagsCount,(LPVOID*)lpszXMLSymbols,(SIZE_T*)dwXMLSymbolsCount,lptszMessageConverted,(dwMessageConvertedBuffSize*sizeof(TCHAR)),pdwMessageConvertedSize);
+
+ if (pdwMessageConvertedSize) (*pdwMessageConvertedSize)/=sizeof(TCHAR);
+return(dwRet);
+}
+
+//Encode XML coded string. The function translate special saved xml characters into special characters.
+DWORD EncodeXML(LPTSTR lptszMessage,SIZE_T dwMessageSize,LPTSTR lptszMessageConverted,SIZE_T dwMessageConvertedBuffSize,SIZE_T *pdwMessageConvertedSize)
+{
+ DWORD dwRet=ReplaceInBuff(lptszMessage,(dwMessageSize*sizeof(TCHAR)),SIZEOF(lpszXMLTags),(LPVOID*)lpszXMLSymbols,(SIZE_T*)dwXMLSymbolsCount,(LPVOID*)lpszXMLTags,(SIZE_T*)dwXMLTagsCount,lptszMessageConverted,(dwMessageConvertedBuffSize*sizeof(TCHAR)),pdwMessageConvertedSize);
+
+ if (pdwMessageConvertedSize) (*pdwMessageConvertedSize)/=sizeof(TCHAR);
+return(dwRet);
+}
+
diff --git a/protocols/MRA/Mra_options.cpp b/protocols/MRA/Mra_options.cpp
new file mode 100644
index 0000000000..b0f1484843
--- /dev/null
+++ b/protocols/MRA/Mra_options.cpp
@@ -0,0 +1,239 @@
+#include "Mra.h"
+
+
+
+INT_PTR CALLBACK DlgProcOptsAccount (HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK DlgProcOptsConnections (HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+
+
+
+int OptInit(WPARAM wParam,LPARAM lParam)
+{
+ OPTIONSDIALOGPAGE odp={0};
+
+ odp.cbSize=sizeof(odp);
+ odp.hInstance=masMraSettings.hInstance;
+ odp.pszTitle=PROTOCOL_NAMEA;
+ odp.pszGroup="Network";
+ odp.flags=ODPF_BOLDGROUPS;
+
+ odp.pszTab="Account";
+ odp.pszTemplate=MAKEINTRESOURCEA(IDD_OPT_ACCOUNT);
+ odp.pfnDlgProc=DlgProcOptsAccount;
+ CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp);
+
+ odp.pszTab="Connections";
+ odp.pszTemplate=MAKEINTRESOURCEA(IDD_OPT_CONNECTIONS);
+ odp.pfnDlgProc=DlgProcOptsConnections;
+ CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp);
+
+ odp.pszTab="Anti spam";
+ odp.pszTemplate=MAKEINTRESOURCEA(IDD_OPT_ANTISPAM);
+ odp.pfnDlgProc=MraAntiSpamDlgProcOpts;
+ CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp);
+
+ odp.pszTab="Files";
+ odp.pszTemplate=MAKEINTRESOURCEA(IDD_OPT_FILES);
+ odp.pfnDlgProc=MraFilesQueueDlgProcOpts;
+ CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp);
+
+ odp.pszTab="Avatars";
+ odp.pszTemplate=MAKEINTRESOURCEA(IDD_OPT_AVATRS);
+ odp.pfnDlgProc=MraAvatarsQueueDlgProcOpts;
+ CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp);
+
+ MraPopupOptInit(wParam,lParam);
+return(0);
+}
+
+
+
+INT_PTR CALLBACK DlgProcOptsAccount(HWND hWndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
+{
+ switch(msg){
+ case WM_INITDIALOG:
+ {
+ WCHAR szBuff[MAX_PATH];
+ //SIZE_T dwBuffSize;
+
+ TranslateDialogDefault(hWndDlg);
+
+ if (DB_Mra_GetStaticStringW(NULL,"e-mail",szBuff,SIZEOF(szBuff),NULL))
+ {
+ SET_DLG_ITEM_TEXTW(hWndDlg,IDC_LOGIN,szBuff);
+ }
+
+ SET_DLG_ITEM_TEXTW(hWndDlg,IDC_PASSWORD,(LPWSTR)L"");
+ //if (GetPassDB((LPSTR)szBuff,SIZEOF(szBuff),&dwBuffSize))
+ //{//bit of a security hole here, since it's easy to extract a password from an edit box
+ // SET_DLG_ITEM_TEXTA(hWndDlg,IDC_PASSWORD,(LPSTR)szBuff);
+ // SecureZeroMemory(szBuff,sizeof(szBuff));
+ //}
+ }
+ return(TRUE);
+ case WM_COMMAND:
+ switch (LOWORD(wParam)){
+ case IDC_NEW_ACCOUNT_LINK:
+ CallService(MS_UTILS_OPENURL,TRUE,(LPARAM)MRA_REGISTER_URL);
+ return(TRUE);
+ case IDC_LOOKUPLINK:
+ CallService(MS_UTILS_OPENURL,TRUE,(LPARAM)MRA_FORGOT_PASSWORD_URL);
+ return(TRUE);
+ }
+ if ((LOWORD(wParam)==IDC_LOGIN || LOWORD(wParam)==IDC_PASSWORD) && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus()) ) return 0;
+ SendMessage(GetParent(hWndDlg),PSM_CHANGED,0,0);
+ break;
+ case WM_NOTIFY:
+ switch(((LPNMHDR)lParam)->code){
+ case PSN_APPLY:
+ {
+ WCHAR szBuff[MAX_EMAIL_LEN];
+
+ GET_DLG_ITEM_TEXT(hWndDlg,IDC_LOGIN,szBuff,SIZEOF(szBuff));
+ DB_Mra_SetStringW(NULL,"e-mail",szBuff);
+
+ if (GET_DLG_ITEM_TEXTA(hWndDlg,IDC_PASSWORD,(LPSTR)szBuff,SIZEOF(szBuff)))
+ {
+ SetPassDB((LPSTR)szBuff,lstrlenA((LPSTR)szBuff));
+ SecureZeroMemory(szBuff,sizeof(szBuff));
+ }
+ }
+ return(TRUE);
+ }
+ break;
+ }
+return(FALSE);
+}
+
+
+INT_PTR CALLBACK DlgProcOptsConnections(HWND hWndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
+{
+ switch(msg){
+ case WM_INITDIALOG:
+ {
+ WCHAR szBuff[MAX_PATH];
+
+ TranslateDialogDefault(hWndDlg);
+
+ if (DB_Mra_GetStaticStringW(NULL,"Server",szBuff,SIZEOF(szBuff),NULL))
+ {
+ SET_DLG_ITEM_TEXT(hWndDlg,IDC_SERVER,szBuff);
+ }else{
+ SET_DLG_ITEM_TEXTA(hWndDlg,IDC_SERVER,MRA_DEFAULT_SERVER);
+ }
+ SetDlgItemInt(hWndDlg,IDC_SERVERPORT,DB_Mra_GetWord(NULL,"ServerPort",MRA_DEFAULT_SERVER_PORT),FALSE);
+ // if set SSL proxy, setting will ignored
+
+ //CHECK_DLG_BUTTON(hWndDlg, IDC_KEEPALIVE,DB_Mra_GetByte(NULL,"keepalive",0));
+ CHECK_DLG_BUTTON(hWndDlg,IDC_AUTO_ADD_CONTACTS_TO_SERVER,DB_Mra_GetByte(NULL,"AutoAddContactsToServer",MRA_DEFAULT_AUTO_ADD_CONTACTS_TO_SERVER));
+ CHECK_DLG_BUTTON(hWndDlg,IDC_AUTO_AUTH_REQ_ON_LOGON,DB_Mra_GetByte(NULL,"AutoAuthRequestOnLogon",MRA_DEFAULT_AUTO_AUTH_REQ_ON_LOGON));
+ CHECK_DLG_BUTTON(hWndDlg,IDC_AUTO_AUTH_GRAND_IN_CLIST,DB_Mra_GetByte(NULL,"AutoAuthGrandUsersInCList",MRA_DEFAULT_AUTO_AUTH_GRAND_IN_CLIST));
+ CHECK_DLG_BUTTON(hWndDlg,IDC_AUTO_AUTH_GRAND_NEW_USERS,DB_Mra_GetByte(NULL,"AutoAuthGrandNewUsers",MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS));
+ CHECK_DLG_BUTTON(hWndDlg,IDC_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK,DB_Mra_GetByte(NULL,"AutoAuthGrandNewUsersDisableSPAMCheck",MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK));
+ EnableWindow(GetDlgItem(hWndDlg,IDC_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK),IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_AUTO_AUTH_GRAND_NEW_USERS));
+
+ CHECK_DLG_BUTTON(hWndDlg,IDC_SLOWSEND,DB_Mra_GetByte(NULL,"SlowSend",MRA_DEFAULT_SLOW_SEND));
+ CHECK_DLG_BUTTON(hWndDlg,IDC_INCREMENTAL_NEW_MAIL_NOTIFY,DB_Mra_GetByte(NULL,"IncrementalNewMailNotify",MRA_DEFAULT_INC_NEW_MAIL_NOTIFY));
+ CHECK_DLG_BUTTON(hWndDlg,IDC_TRAYICON_NEW_MAIL_NOTIFY,DB_Mra_GetByte(NULL,"TrayIconNewMailNotify",MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY));
+ CHECK_DLG_BUTTON(hWndDlg,IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX,DB_Mra_GetByte(NULL,"TrayIconNewMailClkToInbox",MRA_DEFAULT_TRAYICON_NEW_MAIL_CLK_TO_INBOX));
+ EnableWindow(GetDlgItem(hWndDlg,IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX),DB_Mra_GetByte(NULL,"TrayIconNewMailNotify",MRA_DEFAULT_TRAYICON_NEW_MAIL_NOTIFY));
+
+ CHECK_DLG_BUTTON(hWndDlg,IDC_HIDE_MENU_ITEMS_FOR_NON_MRA,DB_Mra_GetByte(NULL,"HideMenuItemsForNonMRAContacts",MRA_DEFAULT_HIDE_MENU_ITEMS_FOR_NON_MRA));
+
+ CHECK_DLG_BUTTON(hWndDlg,IDC_RTF_RECEIVE_ENABLE,DB_Mra_GetByte(NULL,"RTFReceiveEnable",MRA_DEFAULT_RTF_RECEIVE_ENABLE));
+ EnableWindow(GetDlgItem(hWndDlg,IDC_RTF_RECEIVE_ENABLE),(BOOL)(masMraSettings.lpfnUncompress!=NULL));
+
+ CHECK_DLG_BUTTON(hWndDlg,IDC_RTF_SEND_ENABLE,DB_Mra_GetByte(NULL,"RTFSendEnable",MRA_DEFAULT_RTF_SEND_ENABLE));
+ EnableWindow(GetDlgItem(hWndDlg,IDC_RTF_SEND_ENABLE),(BOOL)(masMraSettings.lpfnCompress2!=NULL));
+ EnableWindow(GetDlgItem(hWndDlg,IDC_RTF_SEND_SMART),(DB_Mra_GetByte(NULL,"RTFSendEnable",MRA_DEFAULT_RTF_SEND_ENABLE) && masMraSettings.lpfnCompress2));
+ EnableWindow(GetDlgItem(hWndDlg,IDC_BUTTON_FONT),(DB_Mra_GetByte(NULL,"RTFSendEnable",MRA_DEFAULT_RTF_SEND_ENABLE) && masMraSettings.lpfnCompress2));
+ EnableWindow(GetDlgItem(hWndDlg,IDC_RTF_BGCOLOUR),(DB_Mra_GetByte(NULL,"RTFSendEnable",MRA_DEFAULT_RTF_SEND_ENABLE) && masMraSettings.lpfnCompress2));
+ SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_RTF_BGCOLOUR,CPM_SETCOLOUR,0,DB_Mra_GetDword(NULL,"RTFBackgroundColour",MRA_DEFAULT_RTF_BACKGROUND_COLOUR));
+ }
+ return(TRUE);
+ case WM_COMMAND:
+ switch(LOWORD(wParam)){
+ case IDC_BUTTON_DEFAULT:
+ SET_DLG_ITEM_TEXTA(hWndDlg,IDC_SERVER,MRA_DEFAULT_SERVER);
+ SetDlgItemInt(hWndDlg,IDC_SERVERPORT,MRA_DEFAULT_SERVER_PORT,FALSE);
+ break;
+ case IDC_AUTO_AUTH_GRAND_NEW_USERS:
+ EnableWindow(GetDlgItem(hWndDlg,IDC_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK),IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_AUTO_AUTH_GRAND_NEW_USERS));
+ break;
+ case IDC_TRAYICON_NEW_MAIL_NOTIFY:
+ EnableWindow(GetDlgItem(hWndDlg,IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX),IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_TRAYICON_NEW_MAIL_NOTIFY));
+ break;
+ case IDC_RTF_SEND_ENABLE:
+ EnableWindow(GetDlgItem(hWndDlg,IDC_RTF_SEND_SMART),IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_RTF_SEND_ENABLE));
+ EnableWindow(GetDlgItem(hWndDlg,IDC_BUTTON_FONT),IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_RTF_SEND_ENABLE));
+ EnableWindow(GetDlgItem(hWndDlg,IDC_RTF_BGCOLOUR),IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_RTF_SEND_ENABLE));
+ break;
+ case IDC_BUTTON_FONT:
+ {
+ LOGFONT lf={0};
+ CHOOSEFONT cf={0};
+
+ cf.lStructSize=sizeof(cf);
+ cf.lpLogFont=&lf;
+ cf.rgbColors=DB_Mra_GetDword(NULL,"RTFFontColour",MRA_DEFAULT_RTF_FONT_COLOUR);
+ cf.Flags=(CF_SCREENFONTS|CF_EFFECTS|CF_FORCEFONTEXIST|CF_INITTOLOGFONTSTRUCT);
+ if (DB_Mra_GetContactSettingBlob(NULL,"RTFFont",&lf,sizeof(LOGFONT),NULL)==FALSE)
+ {
+ HDC hDC=GetDC(NULL);// kegl
+ lf.lfCharSet=MRA_DEFAULT_RTF_FONT_CHARSET;
+ lf.lfHeight=-MulDiv(MRA_DEFAULT_RTF_FONT_SIZE,GetDeviceCaps(hDC,LOGPIXELSY),72);
+ lstrcpynW(lf.lfFaceName,MRA_DEFAULT_RTF_FONT_NAME,LF_FACESIZE);
+ ReleaseDC(NULL,hDC);
+ }
+
+ if (ChooseFont(&cf))
+ {
+ /*HDC hDC=GetDC(NULL);
+ DWORD dwFontSize;
+ dwFontSize=-MulDiv(lf.lfHeight,72,GetDeviceCaps(hDC,LOGPIXELSY));
+ dwFontSize+=((dwFontSize+4)/8);//MulDiv(dwFontSize,GetDeviceCaps(hDC,PHYSICALWIDTH),72);
+ ReleaseDC(NULL,hDC);*/
+
+ DB_Mra_WriteContactSettingBlob(NULL,"RTFFont",&lf,sizeof(LOGFONT));
+ DB_Mra_SetDword(NULL,"RTFFontColour",cf.rgbColors);
+ }
+ }
+ break;
+ }
+
+ if ((LOWORD(wParam)==IDC_SERVER || LOWORD(wParam)==IDC_SERVERPORT) && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus()) ) return(FALSE);
+ SendMessage(GetParent(hWndDlg),PSM_CHANGED,0,0);
+ break;
+ case WM_NOTIFY:
+ switch(((LPNMHDR)lParam)->code){
+ case PSN_APPLY:
+ {
+ WCHAR szBuff[MAX_PATH];
+
+ GET_DLG_ITEM_TEXT(hWndDlg,IDC_SERVER,szBuff,SIZEOF(szBuff));
+ DB_Mra_SetStringW(NULL,"Server",szBuff);
+ DB_Mra_SetWord(NULL,"ServerPort",(WORD)GetDlgItemInt(hWndDlg,IDC_SERVERPORT,NULL,FALSE));
+ DB_Mra_SetByte(NULL,"AutoAddContactsToServer",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_AUTO_ADD_CONTACTS_TO_SERVER));
+ DB_Mra_SetByte(NULL,"AutoAuthRequestOnLogon",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_AUTO_AUTH_REQ_ON_LOGON));
+ DB_Mra_SetByte(NULL,"AutoAuthGrandUsersInCList",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_AUTO_AUTH_GRAND_IN_CLIST));
+ DB_Mra_SetByte(NULL,"AutoAuthGrandNewUsers",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_AUTO_AUTH_GRAND_NEW_USERS));
+ DB_Mra_SetByte(NULL,"AutoAuthGrandNewUsersDisableSPAMCheck",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK));
+
+ DB_Mra_SetByte(NULL,"SlowSend",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_SLOWSEND));
+ DB_Mra_SetByte(NULL,"IncrementalNewMailNotify",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_INCREMENTAL_NEW_MAIL_NOTIFY));
+ DB_Mra_SetByte(NULL,"TrayIconNewMailNotify",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_TRAYICON_NEW_MAIL_NOTIFY));
+ DB_Mra_SetByte(NULL,"TrayIconNewMailClkToInbox",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX));
+
+ DB_Mra_SetByte(NULL,"HideMenuItemsForNonMRAContacts",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_HIDE_MENU_ITEMS_FOR_NON_MRA));
+
+ DB_Mra_SetByte(NULL,"RTFReceiveEnable",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_RTF_RECEIVE_ENABLE));
+ DB_Mra_SetByte(NULL,"RTFSendEnable",IS_DLG_BUTTON_CHECKED(hWndDlg,IDC_RTF_SEND_ENABLE));
+ DBWriteContactSettingDword(NULL,PROTOCOL_NAMEA,"RTFBackgroundColour",SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_RTF_BGCOLOUR,CPM_GETCOLOUR,0,0));
+ }
+ return(TRUE);
+ }
+ break;
+ }
+return(FALSE);
+}
+
diff --git a/protocols/MRA/Mra_proto.cpp b/protocols/MRA/Mra_proto.cpp
new file mode 100644
index 0000000000..7d1c865d5f
--- /dev/null
+++ b/protocols/MRA/Mra_proto.cpp
@@ -0,0 +1,2581 @@
+#include "Mra.h"
+#include "MraOfflineMsg.h"
+#include "MraRTFMsg.h"
+#include "MraPlaces.h"
+
+
+
+
+
+
+void MraThreadProc (LPVOID lpParameter);
+DWORD MraGetNLBData (LPSTR lpszHost,SIZE_T dwHostBuffSize,WORD *pwPort);
+DWORD MraNetworkDispather ();
+DWORD MraCommandDispather (mrim_packet_header_t *pmaHeader,DWORD *pdwPingPeriod,DWORD *pdwNextPingSendTickTime,BOOL *pbContinue);
+
+
+
+
+//DWORD GetMraStatusFromMiradaStatus (DWORD dwMirandaStatus,DWORD dwXStatusMir,DWORD *pdwXStatusMra);
+//DWORD GetMiradaStatusFromMraStatus (DWORD dwMraStatus,DWORD dwXStatusMra,DWORD *pdwXStatusMir);
+//DWORD GetMraXStatusIDFromMraUriStatus (LPSTR lpszStatusUri,SIZE_T dwStatusUriSize);
+
+DWORD GetUL (LPBYTE *plpData);
+DWORDLONG GetUIDL (LPBYTE *plpData);
+MRA_GUID GetGUID (LPBYTE *plpData);
+DWORD GetLPS (LPBYTE lpbData,DWORD dwDataSize,LPBYTE *plpCurrentData,MRA_LPS *plpsString);
+
+
+
+
+
+
+DWORD StartConnect()
+{
+ DWORD dwRetErrorCode=NO_ERROR;
+
+ if (InterlockedExchangeAdd((volatile LONG*)&masMraSettings.dwGlobalPluginRunning,0))
+ {
+ if (InterlockedCompareExchange((volatile LONG*)&masMraSettings.dwThreadWorkerRunning,TRUE,FALSE)==FALSE)
+ {// / ,
+ char szPass[MAX_PATH];
+ SIZE_T dwEMailSize=0,dwPasswordSize=0;
+
+ DB_Mra_GetStaticStringA(NULL,"e-mail",NULL,0,&dwEMailSize);
+
+ if (dwEMailSize>5 && GetPassDB(szPass,sizeof(szPass),&dwPasswordSize))
+ {// mir_forkthread
+ InterlockedExchange((volatile LONG*)&masMraSettings.dwThreadWorkerLastPingTime,GetTickCount());
+ masMraSettings.hThreadWorker=mir_forkthread(MraThreadProc,NULL);
+ if (masMraSettings.hThreadWorker==NULL)
+ {
+ dwRetErrorCode=GetLastError();
+ InterlockedExchange((volatile LONG*)&masMraSettings.dwThreadWorkerRunning,FALSE);
+ MraSetStatus(ID_STATUS_OFFLINE,0);
+ }
+ }else{
+ MraThreadClean();
+ if (!(dwEMailSize>5))
+ {
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_WARNING,0,TranslateW(L"Please, setup e-mail in options"));
+ }else{
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_WARNING,0,TranslateW(L"Please, setup password in options"));
+ }
+ }
+ SecureZeroMemory(szPass,sizeof(szPass));
+ }else{
+ DebugBreak();
+ }
+ }else{
+ dwRetErrorCode=ERROR_OPERATION_ABORTED;
+ //DebugBreak();
+ }
+return(dwRetErrorCode);
+}
+
+
+void MraThreadProc(LPVOID lpParameter)
+{
+ DWORD dwRetErrorCode=NO_ERROR;
+
+ if (TRUE)
+ {
+ BOOL bConnected=FALSE;
+ char szHost[MAX_PATH];
+ DWORD dwConnectReTryCount,dwCurConnectReTryCount;
+ NETLIBOPENCONNECTION nloc={0};
+
+ SleepEx(100,FALSE);// to prevent high CPU load by some status plugins like allwaysonline
+
+ dwConnectReTryCount=DB_Mra_GetDword(NULL,"ConnectReTryCountMRIM",MRA_DEFAULT_CONN_RETRY_COUNT_MRIM);
+
+ nloc.cbSize=sizeof(nloc);
+ nloc.flags=NLOCF_V2;
+ nloc.szHost=szHost;
+ nloc.timeout=DB_Mra_GetDword(NULL,"TimeOutConnectMRIM",MRA_DEFAULT_TIMEOUT_CONN_MRIM);
+ if (nloc.timeout<MRA_TIMEOUT_CONN_MIN) nloc.timeout=MRA_TIMEOUT_CONN_MIN;
+ if (nloc.timeout>MRA_TIMEOUT_CONN_) nloc.timeout=MRA_TIMEOUT_CONN_;
+
+ InterlockedExchange((volatile LONG*)&masMraSettings.dwThreadWorkerLastPingTime,GetTickCount());
+ if (MraGetNLBData((LPSTR)nloc.szHost,MAX_PATH,&nloc.wPort)==NO_ERROR)
+ {
+ dwCurConnectReTryCount=dwConnectReTryCount;
+ do{
+ InterlockedExchange((volatile LONG*)&masMraSettings.dwThreadWorkerLastPingTime,GetTickCount());
+ masMraSettings.hConnection=(HANDLE)CallService(MS_NETLIB_OPENCONNECTION,(WPARAM)masMraSettings.hNetlibUser,(LPARAM)&nloc);
+ }while(--dwCurConnectReTryCount && masMraSettings.hConnection==NULL);
+
+ if (masMraSettings.hConnection)
+ {
+ bConnected=TRUE;
+ }
+ }
+
+ if (bConnected==FALSE)
+ if (DB_Mra_GetByte(NULL,"NLBFailDirectConnect",MRA_DEFAULT_NLB_FAIL_DIRECT_CONNECT))
+ {
+ if (IsHTTPSProxyUsed(masMraSettings.hNetlibUser))
+ {// https 443
+ nloc.wPort=MRA_SERVER_PORT_HTTPS;
+ }else{
+ nloc.wPort=DB_Mra_GetWord(NULL,"ServerPort",MRA_DEFAULT_SERVER_PORT);
+ if (nloc.wPort==MRA_SERVER_PORT_STANDART_NLB) nloc.wPort=MRA_SERVER_PORT_STANDART;
+ }
+
+ for(DWORD i=1;(i<MRA_MAX_MRIM_SERVER && MraGetStatus(0,0)!=ID_STATUS_OFFLINE);i++)
+ {
+ mir_snprintf(szHost,SIZEOF(szHost),"mrim%lu.mail.ru",i);
+
+ dwCurConnectReTryCount=dwConnectReTryCount;
+ do{
+ InterlockedExchange((volatile LONG*)&masMraSettings.dwThreadWorkerLastPingTime,GetTickCount());
+ masMraSettings.hConnection=(HANDLE)CallService(MS_NETLIB_OPENCONNECTION,(WPARAM)masMraSettings.hNetlibUser,(LPARAM)&nloc);
+ }while(--dwCurConnectReTryCount && masMraSettings.hConnection==NULL);
+
+ if (masMraSettings.hConnection)
+ {
+ bConnected=TRUE;
+ break;
+ }
+ }
+ }
+
+
+ if (bConnected && MraGetStatus(0,0)!=ID_STATUS_OFFLINE)
+ {
+ /*SOCKET sktSocket;
+ struct sockaddr_in saName;
+ int iNamelen=sizeof(struct sockaddr_in);
+
+ sktSocket=(SOCKET)CallService(MS_NETLIB_GETSOCKET,(WPARAM)masMraSettings.hConnection,(LPARAM)NULL);
+ getsockname(sktSocket,(struct sockaddr*)&saName,&iNamelen);
+ memmove(&masMraSettings.dwIP,&saName.sin_addr,4);
+ masMraSettings.dwPort=ntohs(saName.sin_port);*/
+
+ dwRetErrorCode=MraNetworkDispather();
+ }else{
+ if (bConnected==FALSE)
+ {
+ ShowFormatedErrorMessage(L"Can't connect to MRIM server, error",GetLastError());
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,NULL,ACKTYPE_LOGIN,ACKRESULT_FAILED,NULL,LOGINERR_NONETWORK,0);
+ }
+ }
+ }
+ MraThreadClean();
+}
+
+
+void MraThreadClean()
+{
+ MraMPopSessionQueueFlush(masMraSettings.hMPopSessionQueue);
+ Netlib_CloseHandle(masMraSettings.hConnection);// called twice, if user set offline, its normal
+ masMraSettings.hConnection=NULL;
+ masMraSettings.dwCMDNum=0;
+
+ SleepEx(100,FALSE);// to prevent high CPU load by some status plugins like allwaysonline
+
+ masMraSettings.hThreadWorker=NULL;
+ InterlockedExchange((volatile LONG*)&masMraSettings.dwThreadWorkerRunning,FALSE);
+ MraSetStatus(ID_STATUS_OFFLINE,0);
+}
+
+
+
+DWORD MraGetNLBData(LPSTR lpszHost,SIZE_T dwHostBuffSize,WORD *pwPort)
+{
+ DWORD dwRetErrorCode;
+
+ BOOL bContinue=TRUE;
+ BYTE btBuff[MAX_PATH];
+ DWORD dwConnectReTryCount,dwCurConnectReTryCount;
+ LPSTR lpszPort;
+ SIZE_T dwBytesReceived,dwRcvBuffSizeUsed=0;
+ NETLIBSELECT nls={0};
+ NETLIBOPENCONNECTION nloc={0};
+
+
+ dwConnectReTryCount=DB_Mra_GetDword(NULL,"ConnectReTryCountNLB",MRA_DEFAULT_CONN_RETRY_COUNT_NLB);
+
+ nloc.cbSize=sizeof(nloc);
+ nloc.flags=NLOCF_V2;
+ if (DB_Mra_GetStaticStringA(NULL,"Server",(LPSTR)btBuff,SIZEOF(btBuff),NULL))
+ {
+ nloc.szHost=(LPSTR)btBuff;
+ }else{
+ nloc.szHost=MRA_DEFAULT_SERVER;
+ }
+
+ if (IsHTTPSProxyUsed(masMraSettings.hNetlibUser))
+ {// https 443
+ nloc.wPort=MRA_SERVER_PORT_HTTPS;
+ }else{
+ nloc.wPort=DB_Mra_GetWord(NULL,"ServerPort",MRA_DEFAULT_SERVER_PORT);
+ }
+ nloc.timeout=DB_Mra_GetDword(NULL,"TimeOutConnectNLB",MRA_DEFAULT_TIMEOUT_CONN_NLB);
+ if (nloc.timeout<MRA_TIMEOUT_CONN_MIN) nloc.timeout=MRA_TIMEOUT_CONN_MIN;
+ if (nloc.timeout>MRA_TIMEOUT_CONN_) nloc.timeout=MRA_TIMEOUT_CONN_;
+
+
+ dwCurConnectReTryCount=dwConnectReTryCount;
+ do{
+ InterlockedExchange((volatile LONG*)&masMraSettings.dwThreadWorkerLastPingTime,GetTickCount());
+ nls.hReadConns[0]=(HANDLE)CallService(MS_NETLIB_OPENCONNECTION,(WPARAM)masMraSettings.hNetlibUser,(LPARAM)&nloc);
+ }while(--dwCurConnectReTryCount && nls.hReadConns[0]==NULL);
+
+ if (nls.hReadConns[0])
+ {
+ nls.cbSize=sizeof(nls);
+ nls.dwTimeout=(1000*DB_Mra_GetDword(NULL,"TimeOutReceiveNLB",MRA_DEFAULT_TIMEOUT_RECV_NLB));
+ InterlockedExchange((volatile LONG*)&masMraSettings.dwThreadWorkerLastPingTime,GetTickCount());
+
+ while(MraGetStatus(0,0)!=ID_STATUS_OFFLINE && bContinue)
+ {
+ switch(CallService(MS_NETLIB_SELECT,0,(LPARAM)&nls)){
+ case SOCKET_ERROR:
+ case 0:// Time out
+ bContinue=FALSE;
+ break;
+ case 1:
+ dwBytesReceived=Netlib_Recv(nls.hReadConns[0],(LPSTR)(btBuff+dwRcvBuffSizeUsed),(SIZEOF(btBuff)-dwRcvBuffSizeUsed),0);
+ if (dwBytesReceived && dwBytesReceived!=SOCKET_ERROR)
+ {
+ dwRcvBuffSizeUsed+=dwBytesReceived;
+ }else{
+ bContinue=FALSE;
+ }
+ break;
+ }
+ InterlockedExchange((volatile LONG*)&masMraSettings.dwThreadWorkerLastPingTime,GetTickCount());
+ }
+ Netlib_CloseHandle(nls.hReadConns[0]);
+
+ if (dwRcvBuffSizeUsed)
+ {// received, work with data
+ lpszPort=(LPSTR)MemoryFindByte(0,btBuff,dwRcvBuffSizeUsed,':');
+ if (lpszPort)
+ {
+ (*lpszPort)=0;
+ lpszPort++;
+
+ lstrcpynA(lpszHost,(LPSTR)btBuff,dwHostBuffSize);
+ if (pwPort) (*pwPort)=(WORD)StrToUNum32(lpszPort,(dwRcvBuffSizeUsed-(lpszPort-(LPSTR)btBuff)));
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ dwRetErrorCode=ERROR_INVALID_USER_BUFFER;
+ ShowFormatedErrorMessage(L"NLB data corrupted",NO_ERROR);
+ }
+ }else{
+ dwRetErrorCode=GetLastError();
+ ShowFormatedErrorMessage(L"Can't get data for NLB, error",dwRetErrorCode);
+ }
+ }else{
+ dwRetErrorCode=GetLastError();
+ ShowFormatedErrorMessage(L"Can't connect to NLB server, error",dwRetErrorCode);
+ }
+return(dwRetErrorCode);
+}
+
+
+DWORD MraNetworkDispather()
+{
+ DWORD dwRetErrorCode=NO_ERROR;
+
+ BOOL bContinue=TRUE;
+ DWORD dwSelectRet,dwBytesReceived,dwDataCurrentBuffSize,dwDataCurrentBuffSizeUsed,dwPingPeriod=MAXDWORD,dwNextPingSendTickTime=MAXDWORD;
+ SIZE_T dwRcvBuffSize=BUFF_SIZE_RCV,dwRcvBuffSizeUsed=0,dwDataCurrentBuffOffset=0;
+ LPBYTE lpbBufferRcv;
+ NETLIBSELECT nls={0};
+ mrim_packet_header_t *pmaHeader;
+
+ nls.cbSize=sizeof(nls);
+ nls.dwTimeout=NETLIB_SELECT_TIMEOUT;
+ nls.hReadConns[0]=masMraSettings.hConnection;
+
+ lpbBufferRcv=(LPBYTE)MEMALLOC(dwRcvBuffSize);
+
+ masMraSettings.dwCMDNum=0;
+ MraSendCMD(MRIM_CS_HELLO,NULL,0);
+ InterlockedExchange((volatile LONG*)&masMraSettings.dwThreadWorkerLastPingTime,GetTickCount());
+ while(MraGetStatus(0,0)!=ID_STATUS_OFFLINE && bContinue)
+ {
+ dwSelectRet=CallService(MS_NETLIB_SELECT,0,(LPARAM)&nls);
+ switch(dwSelectRet){
+ case SOCKET_ERROR:
+ if (MraGetStatus(0,0)!=ID_STATUS_OFFLINE)
+ {
+ dwRetErrorCode=GetLastError();
+ ShowFormatedErrorMessage(L"Disconnected, socket error",dwRetErrorCode);
+ }
+ bContinue=FALSE;
+ break;
+ case 0:// Time out
+ case 1:
+ dwBytesReceived=GetTickCount();
+ InterlockedExchange((volatile LONG*)&masMraSettings.dwThreadWorkerLastPingTime,dwBytesReceived);
+ if (dwNextPingSendTickTime<=dwBytesReceived)
+ {// server ping
+ dwNextPingSendTickTime=(dwBytesReceived+(dwPingPeriod*1000));
+ MraSendCMD(MRIM_CS_PING,NULL,0);
+ }
+ {
+ DWORD dwCMDNum,dwFlags,dwAckType;
+ HANDLE hContact;
+ LPBYTE lpbData;
+ SIZE_T dwDataSize;
+ while (MraSendQueueFindOlderThan(masMraSettings.hSendQueueHandle,SEND_QUEUE_TIMEOUT,&dwCMDNum,&dwFlags,&hContact,&dwAckType,&lpbData,&dwDataSize)==NO_ERROR)
+ {
+ switch(dwAckType){
+ case ACKTYPE_ADDED:
+ case ACKTYPE_AUTHREQ:
+ case ACKTYPE_CONTACTS:
+ //nothink to do
+ break;
+ case ACKTYPE_MESSAGE:
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_FAILED,(HANDLE)dwCMDNum,(LPARAM)"Undefined message deliver error, time out",-1);
+ break;
+ case ACKTYPE_GETINFO:
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_FAILED,(HANDLE)1,(LPARAM)NULL,0);
+ break;
+ case ACKTYPE_SEARCH:
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_SUCCESS,(HANDLE)dwCMDNum,(LPARAM)NULL,0);
+ break;
+ case ICQACKTYPE_SMS:
+ MEMFREE(lpbData);
+ break;
+ }
+ MraSendQueueFree(masMraSettings.hSendQueueHandle,dwCMDNum);
+ }
+ }
+ if (dwSelectRet==0) break;// Time out
+
+
+ if ((dwRcvBuffSize-dwRcvBuffSizeUsed)<BUFF_SIZE_RCV_MIN_FREE)
+ {//
+ dwRcvBuffSize+=BUFF_SIZE_RCV;
+ lpbBufferRcv=(LPBYTE)MEMREALLOC(lpbBufferRcv,dwRcvBuffSize);
+ }
+
+ dwBytesReceived=Netlib_Recv(nls.hReadConns[0],(LPSTR)(lpbBufferRcv+dwRcvBuffSizeUsed),(dwRcvBuffSize-dwRcvBuffSizeUsed),0);
+ if (dwBytesReceived && dwBytesReceived!=SOCKET_ERROR)
+ {// connected
+ dwRcvBuffSizeUsed+=dwBytesReceived;
+
+ while(TRUE)
+ {//
+ dwDataCurrentBuffSize=(dwRcvBuffSize-dwDataCurrentBuffOffset);
+ dwDataCurrentBuffSizeUsed=(dwRcvBuffSizeUsed-dwDataCurrentBuffOffset);
+ pmaHeader=(mrim_packet_header_t*)(lpbBufferRcv+dwDataCurrentBuffOffset);
+ if (dwDataCurrentBuffSizeUsed>=sizeof(mrim_packet_header_t))
+ {// packet header received
+ if (pmaHeader->magic==CS_MAGIC)
+ {// packet OK
+ if ((dwDataCurrentBuffSizeUsed-sizeof(mrim_packet_header_t))>=pmaHeader->dlen)
+ {// full packet received, may be more than one
+
+ MraCommandDispather(pmaHeader,&dwPingPeriod,&dwNextPingSendTickTime,&bContinue);
+
+ if ((dwDataCurrentBuffSizeUsed-sizeof(mrim_packet_header_t))>pmaHeader->dlen)
+ {// move pointer to next packet in buffer
+ dwDataCurrentBuffOffset+=(sizeof(mrim_packet_header_t)+pmaHeader->dlen);
+ }else{// move pointer to begin of buffer
+ if (dwRcvBuffSize>BUFF_SIZE_RCV)
+ {//
+ dwRcvBuffSize=BUFF_SIZE_RCV;
+ lpbBufferRcv=(LPBYTE)MEMREALLOC(lpbBufferRcv,dwRcvBuffSize);
+ }
+ dwDataCurrentBuffOffset=0;
+ dwRcvBuffSizeUsed=0;
+ break;
+ }
+ }else{// not all packet received, continue receiving
+ if (dwDataCurrentBuffOffset)
+ {
+ memmove(lpbBufferRcv,(lpbBufferRcv+dwDataCurrentBuffOffset),dwDataCurrentBuffSizeUsed);
+ dwRcvBuffSizeUsed=dwDataCurrentBuffSizeUsed;
+ dwDataCurrentBuffOffset=0;
+ }
+ DebugPrintCRLFW(L"Not all packet received, continue receiving");
+ break;
+ }
+ }else{// bad packet
+ DebugPrintCRLFW(L"Bad packet");
+ dwDataCurrentBuffOffset=0;
+ dwRcvBuffSizeUsed=0;
+ break;
+ }
+ }else{// packet to small, continue receiving
+ DebugPrintCRLFW(L"Packet to small, continue receiving");
+ memmove(lpbBufferRcv,(lpbBufferRcv+dwDataCurrentBuffOffset),dwDataCurrentBuffSizeUsed);
+ dwRcvBuffSizeUsed=dwDataCurrentBuffSizeUsed;
+ dwDataCurrentBuffOffset=0;
+ break;
+ }
+ }
+ }else{// disconnected
+ if (MraGetStatus(0,0)!=ID_STATUS_OFFLINE)
+ {
+ dwRetErrorCode=GetLastError();
+ ShowFormatedErrorMessage(L"Disconnected, socket read error",dwRetErrorCode);
+ }
+ bContinue=FALSE;
+ }
+ break;
+ }// end switch
+ }// end while
+ MEMFREE(lpbBufferRcv);
+
+return(dwRetErrorCode);
+}
+
+
+DWORD MraCommandDispather(mrim_packet_header_t *pmaHeader,DWORD *pdwPingPeriod,DWORD *pdwNextPingSendTickTime,BOOL *pbContinue)
+{
+ WCHAR szBuff[4096]={0};
+ DWORD dwDataSize,dwTemp,dwAckType;
+ SIZE_T dwStringSize;
+ MRA_LPS lpsString={0},lpsEMail={0};
+ HANDLE hContact=NULL;
+ LPBYTE lpbData,lpbDataCurrent;
+
+ lpbData=((((LPBYTE)pmaHeader))+sizeof(mrim_packet_header_t));
+ lpbDataCurrent=lpbData;
+ dwDataSize=pmaHeader->dlen;
+
+
+ switch(pmaHeader->msg){
+ case MRIM_CS_HELLO_ACK:// // UL ## ping_period ## ( )
+ //CredUIPromptForCredentials
+ //CYPTPROTECTMEMORY_BLOCK_SIZE=RTL_ENCRYPT_MEMORY_SIZE=8
+ //CryptProtectMemory(szBuff,sizeof(szBuff),CRYPTPROTECTMEMORY_SAME_PROCESS);
+ if(GetPassDB((LPSTR)szBuff,SIZEOF(szBuff),&dwStringSize))
+ {//bit of a security hole here, since it's easy to extract a password from an edit box
+ CHAR szEMail[MAX_EMAIL_LEN],szSelfVersionString[MAX_PATH],szUserAgentFormated[USER_AGENT_MAX+MAX_PATH],szValueName[MAX_PATH];
+ WCHAR wszStatusTitle[STATUS_TITLE_MAX+4],wszStatusDesc[STATUS_DESC_MAX+4];
+ DWORD dwStatus,dwXStatus,dwXStatusMir,dwFutureFlags;
+ LPWSTR lpwszStatusTitle,lpwszStatusDesc;
+ SIZE_T dwEMailSize,dwSelfVersionSize,dwStatusTitleSize,dwStatusDescSize,dwUserAgentFormatedSize;
+
+ dwXStatusMir=MraGetXStatusInternal();
+ dwStatus=GetMraStatusFromMiradaStatus(masMraSettings.dwDesiredStatusMode,dwXStatusMir,&dwXStatus);
+ if (IsXStatusValid(dwXStatusMir))
+ {// xstatuses
+ mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%ldName",dwXStatusMir);
+ if (DB_Mra_GetStaticStringW(NULL,szValueName,wszStatusTitle,(STATUS_TITLE_MAX+1),&dwStatusTitleSize))
+ {// custom xstatus name
+ lpwszStatusTitle=wszStatusTitle;
+ }else{// default xstatus name
+ lpwszStatusTitle=TranslateW(lpcszXStatusNameDef[dwXStatusMir]);
+ dwStatusTitleSize=lstrlenW(lpwszStatusTitle);
+ }
+
+ mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%ldMsg",dwXStatusMir);
+ if (DB_Mra_GetStaticStringW(NULL,szValueName,wszStatusDesc,(STATUS_DESC_MAX+1),&dwStatusDescSize))
+ {// custom xstatus description
+ lpwszStatusDesc=wszStatusDesc;
+ }else{// default xstatus description
+ lpwszStatusDesc=NULL;
+ dwStatusDescSize=0;
+ }
+ }else{// not xstatuses
+ lpwszStatusTitle=GetStatusModeDescriptionW(masMraSettings.dwDesiredStatusMode);
+ dwStatusTitleSize=lstrlenW(lpwszStatusTitle);
+ lpwszStatusDesc=NULL;
+ dwStatusDescSize=0;
+ }
+
+ MraGetSelfVersionString(szSelfVersionString,SIZEOF(szSelfVersionString),&dwSelfVersionSize);
+ if (DB_Mra_GetStaticStringA(NULL,"MirVerCustom",szUserAgentFormated,SIZEOF(szUserAgentFormated),&dwUserAgentFormatedSize)==FALSE)
+ {
+ dwUserAgentFormatedSize=mir_snprintf(szUserAgentFormated,SIZEOF(szUserAgentFormated),"client=\"magent\" name=\"Miranda IM\" title=\"%s\" version=\"777.%lu.%lu.%lu\" build=\"%lu\" protocol=\"%lu.%lu\"",szSelfVersionString,(((PLUGIN_VERSION_DWORD)>>24)&0xFF),(((PLUGIN_VERSION_DWORD)>>16)&0xFF),(((PLUGIN_VERSION_DWORD)>>8)&0xFF),((PLUGIN_VERSION_DWORD)&0xFF),PROTO_MAJOR(PROTO_VERSION),PROTO_MINOR(PROTO_VERSION));// "client=\"magent\" version=\"9.3\" build=\"777\""
+ }
+
+ dwFutureFlags=((DB_Mra_GetByte(NULL,"RTFReceiveEnable",MRA_DEFAULT_RTF_RECEIVE_ENABLE)? FEATURE_FLAG_RTF_MESSAGE:0)|MRA_FEATURE_FLAGS);
+
+ if (DB_Mra_GetStaticStringA(NULL,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ MraSendCommand_Login2W(szEMail,dwEMailSize,(LPSTR)szBuff,dwStringSize,dwStatus,lpcszStatusUri[dwXStatus],lstrlenA(lpcszStatusUri[dwXStatus]),lpwszStatusTitle,dwStatusTitleSize,lpwszStatusDesc,dwStatusDescSize,dwFutureFlags,szUserAgentFormated,dwUserAgentFormatedSize,szSelfVersionString,dwSelfVersionSize);
+ }else{// no login
+ (*pbContinue)=FALSE;
+ }
+ SecureZeroMemory(szBuff,sizeof(szBuff));
+ }else{// no password
+ (*pbContinue)=FALSE;
+ }
+ (*pdwPingPeriod)=GetUL(&lpbDataCurrent);
+ break;
+ case MRIM_CS_LOGIN_ACK://
+ masMraSettings.bLoggedIn=TRUE;
+ (*pdwNextPingSendTickTime)=0;// force send ping
+ MraSendCMD(MRIM_CS_PING,NULL,0);
+ MraSetStatus(masMraSettings.dwDesiredStatusMode,masMraSettings.dwDesiredStatusMode);
+ //(*((LPBYTE)NULL))=1;// force exception
+ //while(TRUE) Sleep(1); // force infinite loop
+ MraAvatarsQueueGetAvatarSimple(masMraSettings.hAvatarsQueueHandle,GAIF_FORCE,NULL,0);
+ break;
+ case MRIM_CS_LOGIN_REJ:// //LPS ## reason ##
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,NULL,ACKTYPE_LOGIN,ACKRESULT_FAILED,NULL,LOGINERR_WRONGPASSWORD,0);
+
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ dwStringSize=MultiByteToWideChar(MRA_CODE_PAGE,0,lpsString.lpszData,lpsString.dwSize,szBuff,SIZEOF(szBuff));
+ szBuff[dwStringSize]=0;
+ MraPopupShowW(NULL,MRA_POPUP_TYPE_ERROR,0,TranslateW(L"Logon error: invalid login/password"),szBuff);
+ (*pbContinue)=FALSE;
+ break;
+ case MRIM_CS_MESSAGE_ACK://
+ {
+ DWORD dwMsgID,dwFlags;
+ MRA_LPS lpsText,lpsRTFText,lpsMultiChatData;
+
+ dwMsgID=GetUL(&lpbDataCurrent);
+ dwFlags=GetUL(&lpbDataCurrent);
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsEMail);//LPS ## from ##
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsText);//LPS ## message ##
+ //if (dwFlags&MESSAGE_FLAG_RTF)
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsRTFText);//LPS ## rtf-message ##
+ if (dwFlags&MESSAGE_FLAG_MULTICHAT) GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsMultiChatData); // LPS multichat_data
+
+ if (MraRecvCommand_Message((DWORD)_time32(NULL),dwFlags,&lpsEMail,&lpsText,&lpsRTFText,&lpsMultiChatData)==NO_ERROR)
+ {// ,
+ if ((dwFlags&MESSAGE_FLAG_NORECV)==0)
+ {// need send delivery status
+ MraSendCommand_MessageRecv(lpsEMail.lpszData,lpsEMail.dwSize,dwMsgID);
+ }
+ }
+ }
+ break;
+ case MRIM_CS_MESSAGE_STATUS:
+ if (MraSendQueueFind(masMraSettings.hSendQueueHandle,pmaHeader->seq,NULL,&hContact,&dwAckType,(LPBYTE*)&lpsString.lpszData,&lpsString.dwSize)==NO_ERROR)
+ {
+ dwTemp=GetUL(&lpbDataCurrent);
+ switch(dwTemp){
+ case MESSAGE_DELIVERED:// Message delivered directly to user
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_SUCCESS,(HANDLE)pmaHeader->seq,(LPARAM)NULL,0);
+ break;//***deb -
+ case MESSAGE_REJECTED_NOUSER:// Message rejected - no such user
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_FAILED,(HANDLE)pmaHeader->seq,(LPARAM)"Message rejected - no such user",-1);
+ break;
+ case MESSAGE_REJECTED_INTERR:// Internal server error
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_FAILED,(HANDLE)pmaHeader->seq,(LPARAM)"Internal server error",-1);
+ break;
+ case MESSAGE_REJECTED_LIMIT_EXCEEDED:// Offline messages limit exceeded
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_FAILED,(HANDLE)pmaHeader->seq,(LPARAM)"Offline messages limit exceeded",-1);
+ break;
+ case MESSAGE_REJECTED_TOO_LARGE:// Message is too large
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_FAILED,(HANDLE)pmaHeader->seq,(LPARAM)"Message is too large",-1);
+ break;
+ case MESSAGE_REJECTED_DENY_OFFMSG:// User does not accept offline messages
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_FAILED,(HANDLE)pmaHeader->seq,(LPARAM)"User does not accept offline messages",-1);
+ break;
+ case MESSAGE_REJECTED_DENY_OFFFLSH:// User does not accept offline flash animation
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_FAILED,(HANDLE)pmaHeader->seq,(LPARAM)"User does not accept offline flash animation",-1);
+ break;
+ default:
+ dwTemp=mir_snprintf((LPSTR)szBuff,SIZEOF(szBuff),"Undefined message deliver error, code: %lu",dwTemp);
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_FAILED,(HANDLE)pmaHeader->seq,(LPARAM)szBuff,dwTemp);
+ break;
+ }
+ MraSendQueueFree(masMraSettings.hSendQueueHandle,pmaHeader->seq);
+ }else{// not found in queue
+ if (GetUL(&lpbDataCurrent)!=MESSAGE_DELIVERED) MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG,0,TranslateW(L"MRIM_CS_MESSAGE_STATUS: not found in queue"));
+ }
+ break;
+ case MRIM_CS_CONNECTION_PARAMS://
+ (*pdwPingPeriod)=GetUL(&lpbDataCurrent);
+ (*pdwNextPingSendTickTime)=0;// force send ping
+ MraSendCMD(MRIM_CS_PING,NULL,0);
+ break;
+ case MRIM_CS_USER_INFO:
+ while (lpbDataCurrent<(lpbData+dwDataSize))
+ {
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"MESSAGES.TOTAL",14)==CSTR_EQUAL)
+ {
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ masMraSettings.dwEmailMessagesTotal=StrToUNum32(lpsString.lpszData,lpsString.dwSize);
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"MESSAGES.UNREAD",15)==CSTR_EQUAL)
+ {
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ masMraSettings.dwEmailMessagesUnRead=StrToUNum32(lpsString.lpszData,lpsString.dwSize);
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"MRIM.NICKNAME",13)==CSTR_EQUAL)
+ {
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ DB_Mra_SetLPSStringW(NULL,"Nick",&lpsString);
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"client.endpoint",15)==CSTR_EQUAL)
+ {
+ LPSTR lpszDelimiter;
+
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ dwStringSize=WideCharToMultiByte(MRA_CODE_PAGE,0,lpsString.lpwszData,lpsString.dwSize,(LPSTR)szBuff,sizeof(szBuff),NULL,NULL);
+ lpszDelimiter=(LPSTR)MemoryFind(0,szBuff,dwStringSize,":",1);
+ if (lpszDelimiter)
+ {
+ (*lpszDelimiter)=0;
+ lpszDelimiter=(LPSTR)szBuff;
+ DB_Mra_SetDword(NULL,"IP",HTONL(inet_addr(lpszDelimiter)));
+ }
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"connect.xml",11)==CSTR_EQUAL)
+ {
+ DebugPrintA(lpsString.lpszData);
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ DebugPrintCRLFW(lpsString.lpwszData);
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"micblog.show_title",18)==CSTR_EQUAL)
+ {
+ DebugPrintA(lpsString.lpszData);
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ DebugPrintCRLFW(lpsString.lpwszData);
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"micblog.status.id",17)==CSTR_EQUAL)
+ {
+ DWORDLONG dwBlogStatusID;
+
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ dwBlogStatusID=StrToUNum64(lpsString.lpszData,lpsString.dwSize);
+ DB_Mra_WriteContactSettingBlob(NULL,DBSETTING_BLOGSTATUSID,&dwBlogStatusID,sizeof(DWORDLONG));
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"micblog.status.time",19)==CSTR_EQUAL)
+ {
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ DB_Mra_SetDword(NULL,DBSETTING_BLOGSTATUSTIME,StrToUNum32(lpsString.lpszData,lpsString.dwSize));
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"micblog.status.text",19)==CSTR_EQUAL)
+ {
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ DB_Mra_SetLPSStringW(NULL,DBSETTING_BLOGSTATUS,&lpsString);
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"HAS_MYMAIL",10)==CSTR_EQUAL)
+ {// ???
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ //DB_Mra_SetDword(NULL,DBSETTING_BLOGSTATUSTIME,StrToUNum32(lpsString.lpszData,lpsString.dwSize));
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"mrim.status.open_search",23)==CSTR_EQUAL)
+ {// ???
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ //DB_Mra_SetDword(NULL,DBSETTING_BLOGSTATUSTIME,StrToUNum32(lpsString.lpszData,lpsString.dwSize));
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"rb.target.cookie",16)==CSTR_EQUAL)
+ {// ???
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ //DB_Mra_SetDword(NULL,DBSETTING_BLOGSTATUSTIME,StrToUNum32(lpsString.lpszData,lpsString.dwSize));
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"show_web_history_link",21)==CSTR_EQUAL)
+ {// ???
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ //DB_Mra_SetDword(NULL,DBSETTING_BLOGSTATUSTIME,StrToUNum32(lpsString.lpszData,lpsString.dwSize));
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"friends_suggest",15)==CSTR_EQUAL)
+ {// ???
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ //DB_Mra_SetDword(NULL,DBSETTING_BLOGSTATUSTIME,StrToUNum32(lpsString.lpszData,lpsString.dwSize));
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"timestamp",9)==CSTR_EQUAL)
+ {// ???
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ //DB_Mra_SetDword(NULL,DBSETTING_BLOGSTATUSTIME,StrToUNum32(lpsString.lpszData,lpsString.dwSize));
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsString.lpszData,lpsString.dwSize,"trusted_update",14)==CSTR_EQUAL)
+ {// ???
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ //DB_Mra_SetDword(NULL,DBSETTING_BLOGSTATUSTIME,StrToUNum32(lpsString.lpszData,lpsString.dwSize));
+ }else{
+ #ifdef _DEBUG
+ LPSTR lpszCurrentPos=(LPSTR)szBuff;
+ memmove(lpszCurrentPos,lpsString.lpszData,lpsString.dwSize);
+ lpszCurrentPos+=lpsString.dwSize;
+ (*((WORD*)lpszCurrentPos))=(*((WORD*)": "));
+ lpszCurrentPos+=sizeof(WORD);
+
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ memmove(lpszCurrentPos,lpsString.lpszData,lpsString.dwSize);
+ lpszCurrentPos+=lpsString.dwSize;
+ (*((WORD*)lpszCurrentPos))=(*((WORD*)szCRLF));
+ lpszCurrentPos+=sizeof(WORD);(*((WORD*)lpszCurrentPos))=0;
+
+ DebugPrintCRLFA((LPSTR)szBuff);
+ //MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG,0,szBuff);
+ DebugBreak();
+ #endif
+ }
+ }
+ MraUpdateEmailStatus(NULL,0,NULL,0,0,0);
+ break;
+ case MRIM_CS_OFFLINE_MESSAGE_ACK:// ,
+ {
+ DWORD dwTime,dwFlags;
+ MRA_LPS lpsText,lpsRTFText,lpsMultiChatData;
+ LPBYTE lpbBuff=NULL;
+ DWORDLONG dwMsgUIDL;
+
+ dwMsgUIDL=GetUIDL(&lpbDataCurrent);
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+
+ if (MraOfflineMessageGet(&lpsString,&dwTime,&dwFlags,&lpsEMail,&lpsText,&lpsRTFText,&lpsMultiChatData,&lpbBuff)==NO_ERROR)
+ {
+ dwTemp=MraRecvCommand_Message(dwTime,dwFlags,&lpsEMail,&lpsText,&lpsRTFText,&lpsMultiChatData);
+ if (dwTemp==NO_ERROR || dwTemp==ERROR_ACCESS_DENIED)
+ {// ,
+ MraSendCommand_OfflineMessageDel(dwMsgUIDL);
+ }else{
+ ShowFormatedErrorMessage(L"Offline message processing error, message will not deleted from server",NO_ERROR);
+ }
+ }else{
+ ShowFormatedErrorMessage(L"Offline message processing error, message will not deleted from server",NO_ERROR);
+ }
+ MEMFREE(lpbBuff);
+ }
+ break;
+ case MRIM_CS_AUTHORIZE_ACK://
+ {// , ,
+ BOOL bAdded;
+ BYTE btBuff[BUFF_SIZE_BLOB];
+ DBEVENTINFO dbei={0};
+
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsEMail);
+ hContact=MraHContactFromEmail(lpsEMail.lpszData,lpsEMail.dwSize,TRUE,TRUE,&bAdded);
+ if (bAdded) MraUpdateContactInfo(hContact);
+
+ if (IsEMailChatAgent(lpsEMail.lpszData,lpsEMail.dwSize)==FALSE)
+ {
+ dbei.cbSize=sizeof(dbei);
+ dbei.szModule=PROTOCOL_NAMEA;
+ dbei.timestamp=(DWORD)_time32(NULL);
+ dbei.flags=0;
+ dbei.eventType=EVENTTYPE_ADDED;
+ //dbei.cbBlob=0;
+ CreateBlobFromContact(hContact,NULL,0,(LPBYTE)&btBuff,SIZEOF(btBuff),&dwStringSize);
+ dbei.cbBlob=dwStringSize;
+ dbei.pBlob=btBuff;
+
+ CallService(MS_DB_EVENT_ADD,(WPARAM)NULL,(LPARAM)&dbei);
+ }
+
+ GetContactBasicInfoW(hContact,NULL,NULL,NULL,&dwTemp,NULL,NULL,0,NULL,NULL,0,NULL,NULL,0,NULL);
+ dwTemp&=~CONTACT_INTFLAG_NOT_AUTHORIZED;
+ SetContactBasicInfoW(hContact,SCBIFSI_LOCK_CHANGES_EVENTS,SCBIF_SERVER_FLAG,0,0,0,dwTemp,0,NULL,0,NULL,0,NULL,0);
+ DB_Mra_SetDword(hContact,"HooksLocked",TRUE);
+ DBDeleteContactSetting(hContact,"CList","NotOnList");
+ DB_Mra_SetDword(hContact,"HooksLocked",FALSE);
+ }
+ break;
+ case MRIM_CS_MPOP_SESSION:// web- //
+ if (GetUL(&lpbDataCurrent))
+ {
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ MraMPopSessionQueueSetNewMPopKey(masMraSettings.hMPopSessionQueue,lpsString.lpszData,lpsString.dwSize);
+ MraMPopSessionQueueStart(masMraSettings.hMPopSessionQueue);
+ }else{//error
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_WARNING,0,TranslateW(L"Server error: cant get MPOP key for web authorize"));
+ MraMPopSessionQueueFlush(masMraSettings.hMPopSessionQueue);
+ }
+ break;
+/////////////////////////////////////////////////////////////////////////////////////
+ case MRIM_CS_FILE_TRANSFER:
+ {
+ BOOL bAdded;
+ DWORD dwIDRequest,dwFilesTotalSize;
+ MRA_LPS lpsFiles={0},lpsFilesW={0},lpsAddreses={0};
+
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsEMail);// LPS TO/FROM ANSI
+ dwIDRequest=GetUL(&lpbDataCurrent);// DWORD id_request
+ dwFilesTotalSize=GetUL(&lpbDataCurrent);// DWORD FILESIZE
+ if (GetUL(&lpbDataCurrent))//LPS:
+ {
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsFiles);// LPS Files (FileName;FileSize;FileName;FileSize;) ANSI
+ if (GetUL(&lpbDataCurrent))// LPS DESCRIPTION
+ {
+ dwTemp=GetUL(&lpbDataCurrent);// ???
+ DebugBreakIf(dwTemp!=1);
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsFilesW);// LPS Files (FileName;FileSize;FileName;FileSize;) UNICODE
+ }
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsAddreses);// LPS Conn (IP:Port;IP:Port;) ANSI
+ }
+
+ hContact=MraHContactFromEmail(lpsEMail.lpszData,lpsEMail.dwSize,TRUE,TRUE,&bAdded);
+ if (bAdded) MraUpdateContactInfo(hContact);
+
+ bAdded=FALSE;
+ if (lpsFilesW.dwSize==0)
+ {
+ lpsFilesW.lpwszData=(LPWSTR)MEMALLOC((lpsFiles.dwSize+MAX_PATH)*sizeof(WCHAR));
+ if (lpsFilesW.lpwszData)
+ {
+ lpsFilesW.dwSize=MultiByteToWideChar(MRA_CODE_PAGE,0,lpsFiles.lpszData,lpsFiles.dwSize,lpsFilesW.lpwszData,(lpsFiles.dwSize+MAX_PATH));
+ bAdded=TRUE;
+ }
+ }
+
+ if (lpsFilesW.dwSize) MraFilesQueueAddReceive(masMraSettings.hFilesQueueHandle,0,hContact,dwIDRequest,lpsFilesW.lpwszData,lpsFilesW.dwSize,lpsAddreses.lpszData,lpsAddreses.dwSize);
+ if (bAdded) MEMFREE(lpsFilesW.lpwszData);
+ }
+ break;
+ case MRIM_CS_FILE_TRANSFER_ACK:
+ dwAckType=GetUL(&lpbDataCurrent);// DWORD status
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsEMail);// LPS TO/FROM
+ dwTemp=GetUL(&lpbDataCurrent);// DWORD id_request
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);// LPS DESCRIPTION
+
+ switch(dwAckType){
+ case FILE_TRANSFER_STATUS_OK:// , (),
+ //hContact=MraHContactFromEmail(lpsEMail.lpszData,lpsEMail.dwSize,TRUE,TRUE,NULL);
+ break;
+ case FILE_TRANSFER_STATUS_DECLINE:
+ MraFilesQueueCancel(masMraSettings.hFilesQueueHandle,dwTemp,FALSE);
+ break;
+ case FILE_TRANSFER_STATUS_ERROR:
+ ShowFormatedErrorMessage(L"File transfer: error",NO_ERROR);
+ MraFilesQueueCancel(masMraSettings.hFilesQueueHandle,dwTemp,FALSE);
+ break;
+ case FILE_TRANSFER_STATUS_INCOMPATIBLE_VERS:
+ ShowFormatedErrorMessage(L"File transfer: incompatible versions",NO_ERROR);
+ MraFilesQueueCancel(masMraSettings.hFilesQueueHandle,dwTemp,FALSE);
+ break;
+ case FILE_TRANSFER_MIRROR:
+ MraFilesQueueSendMirror(masMraSettings.hFilesQueueHandle,dwTemp,lpsString.lpszData,lpsString.dwSize);
+ break;
+ default:// ## unknown error
+ mir_sntprintf(szBuff,SIZEOF(szBuff),TranslateW(L"MRIM_CS_FILE_TRANSFER_ACK: unknown error, code: %lu"),dwAckType);
+ ShowFormatedErrorMessage(szBuff,NO_ERROR);
+ break;
+ }
+ break;
+/////////////////////////////////////////////////////////////////////////////////////
+ case MRIM_CS_USER_STATUS://
+ {
+ BOOL bAdded;
+ DWORD dwStatus,dwXStatus,dwFutureFlags;
+ MRA_LPS lpsSpecStatusUri,lpsStatusTitle,lpsStatusDesc,lpsUserAgentFormated;
+
+ dwStatus=GetUL(&lpbDataCurrent);
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsSpecStatusUri);
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsStatusTitle);
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsStatusDesc);
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsEMail);
+ dwFutureFlags=GetUL(&lpbDataCurrent);// com_support (>=1.14)
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsUserAgentFormated);
+
+
+ if ((hContact=MraHContactFromEmail(lpsEMail.lpszData,lpsEMail.dwSize,TRUE,TRUE,&bAdded)))
+ {
+ if (bAdded) MraUpdateContactInfo(hContact);
+
+ dwTemp=GetMiradaStatusFromMraStatus(dwStatus,GetMraXStatusIDFromMraUriStatus(lpsSpecStatusUri.lpszData,lpsSpecStatusUri.dwSize),&dwXStatus);
+
+ MraContactCapabilitiesSet(hContact,dwFutureFlags);
+ DB_Mra_SetByte(hContact,DBSETTING_XSTATUSID,(BYTE)dwXStatus);
+ DB_Mra_SetLPSStringW(hContact,DBSETTING_XSTATUSNAME,&lpsStatusTitle);
+ DB_Mra_SetLPSStringW(hContact,DBSETTING_XSTATUSMSG,&lpsStatusDesc);
+
+ if (dwTemp!=ID_STATUS_OFFLINE)// ,
+ {
+ if (lpsUserAgentFormated.dwSize)
+ {//
+ if (DB_Mra_GetByte(NULL,"MirVerRaw",MRA_DEFAULT_MIRVER_RAW)==FALSE)
+ {// , ...
+ MraGetVersionStringFromFormated(lpsUserAgentFormated.lpszData,lpsUserAgentFormated.dwSize,(LPSTR)szBuff,SIZEOF(szBuff),&dwStringSize);
+ lpsUserAgentFormated.lpszData=(LPSTR)szBuff;
+ lpsUserAgentFormated.dwSize=dwStringSize;
+ }
+ }else{//
+ lpsUserAgentFormated.lpszData=MIRVER_UNKNOWN;
+ lpsUserAgentFormated.dwSize=(sizeof(MIRVER_UNKNOWN)-1);
+ }
+ DB_Mra_SetLPSStringA(hContact,"MirVer",&lpsUserAgentFormated);
+ }
+
+ if (dwTemp==MraGetContactStatus(hContact))
+ {// , ? ;)
+ if (dwTemp==ID_STATUS_OFFLINE)
+ {// was/now invisible
+ WCHAR szEMail[MAX_EMAIL_LEN];
+
+ DB_Mra_GetStaticStringW(hContact,"e-mail",szEMail,SIZEOF(szEMail),NULL);
+ mir_sntprintf(szBuff,SIZEOF(szBuff),L"%s <%s> - %s",GetContactNameW(hContact),szEMail,TranslateW(L"invisible status changed"));
+ MraPopupShowFromContactW(hContact,MRA_POPUP_TYPE_INFORMATION,0,szBuff);
+
+ MraSetContactStatus(hContact,ID_STATUS_INVISIBLE);
+ }else{// server or miranda bug or status change
+ //DebugBreak();
+ }
+ }
+ MraSetContactStatus(hContact,dwTemp);
+ SetExtraIcons(hContact);
+ }
+ }
+ break;
+ case MRIM_CS_LOGOUT:// - .
+ if (GetUL(&lpbDataCurrent)==LOGOUT_NO_RELOGIN_FLAG) ShowFormatedErrorMessage(L"Another user connected with your login",NO_ERROR);
+ (*pbContinue)=FALSE;
+ break;
+ case MRIM_CS_ADD_CONTACT_ACK:
+ case MRIM_CS_MODIFY_CONTACT_ACK:
+ if (MraSendQueueFind(masMraSettings.hSendQueueHandle,pmaHeader->seq,NULL,&hContact,&dwAckType,(LPBYTE*)&lpsString.lpszData,&lpsString.dwSize)==NO_ERROR)
+ {
+ dwTemp=GetUL(&lpbDataCurrent);
+ switch(dwTemp){
+ case CONTACT_OPER_SUCCESS:// ##
+ if (pmaHeader->msg==MRIM_CS_ADD_CONTACT_ACK) SetContactBasicInfoW(hContact,0,(SCBIF_ID|SCBIF_SERVER_FLAG),GetUL(&lpbDataCurrent),0,0,CONTACT_INTFLAG_NOT_AUTHORIZED,0,NULL,0,NULL,0,NULL,0);
+ break;
+ case CONTACT_OPER_ERROR:// ##
+ ShowFormatedErrorMessage(L"Sended data is invalid",NO_ERROR);
+ break;
+ case CONTACT_OPER_INTERR:// ##
+ ShowFormatedErrorMessage(L"Internal server error",NO_ERROR);
+ break;
+ case CONTACT_OPER_NO_SUCH_USER:// ##
+ SetContactBasicInfoW(hContact,0,SCBIF_SERVER_FLAG,0,0,0,-1,0,NULL,0,NULL,0,NULL,0);
+ ShowFormatedErrorMessage(L"User does not registred",NO_ERROR);
+ break;
+ case CONTACT_OPER_INVALID_INFO:// ##
+ ShowFormatedErrorMessage(L"Invalid user name",NO_ERROR);
+ break;
+ case CONTACT_OPER_USER_EXISTS:// ## -
+ ShowFormatedErrorMessage(L"User allready added",NO_ERROR);
+ break;
+ case CONTACT_OPER_GROUP_LIMIT:// ## (20)
+ ShowFormatedErrorMessage(L"Group limit is 20",NO_ERROR);
+ break;
+ default:// ## unknown error
+ mir_sntprintf(szBuff,SIZEOF(szBuff),TranslateW(L"MRIM_CS_*_CONTACT_ACK: unknown server error, code: %lu"),dwTemp);
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG,0,szBuff);
+ break;
+ }
+ MraSendQueueFree(masMraSettings.hSendQueueHandle,pmaHeader->seq);
+ }else{// not found in queue
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG,0,TranslateW(L"MRIM_CS_*_CONTACT_ACK: not found in queue"));
+ }
+ break;
+ case MRIM_CS_ANKETA_INFO:
+ if (MraSendQueueFind(masMraSettings.hSendQueueHandle,pmaHeader->seq,NULL,&hContact,&dwAckType,(LPBYTE*)&lpsString.lpszData,&lpsString.dwSize)==NO_ERROR)
+ {
+ switch(GetUL(&lpbDataCurrent)){
+ case MRIM_ANKETA_INFO_STATUS_OK://
+ {
+ DWORD dwFeildsNum,dwMaxRows,dwServerTime,dwStatus;
+ SIZE_T i;
+ MRA_LPS *pmralpsFeilds,*pmralpsValues;
+
+ dwFeildsNum=GetUL(&lpbDataCurrent);
+ dwMaxRows=GetUL(&lpbDataCurrent);
+ dwServerTime=GetUL(&lpbDataCurrent);
+
+ pmralpsFeilds=(MRA_LPS*)MEMALLOC(((dwFeildsNum*2)+4)*sizeof(MRA_LPS));
+ if (pmralpsFeilds)
+ {
+ pmralpsValues=(pmralpsFeilds+dwFeildsNum);
+ // read headers name
+ for (i=0;i<dwFeildsNum;i++)
+ {
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&pmralpsFeilds[i]);
+ DebugPrintCRLFA(pmralpsFeilds[i].lpszData);
+ }
+
+ while (lpbDataCurrent<(lpbData+dwDataSize))
+ {
+ // read values
+ for (i=0;i<dwFeildsNum;i++) GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&pmralpsValues[i]);
+
+ if (dwAckType==ACKTYPE_GETINFO && hContact)
+ {// write to DB and exit loop
+ DB_Mra_SetDword(hContact,"InfoTS",(DWORD)_time32(NULL));
+ //MRA_LPS mralpsUsernameValue;
+ for (i=0;i<dwFeildsNum;i++)
+ {
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Username",8)==CSTR_EQUAL)
+ {
+ //mralpsUsernameValue=pmralpsValues[i];
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Domain",6)==CSTR_EQUAL)
+ {
+ //memmove(szBuff,mralpsUsernameValue.lpszData,mralpsUsernameValue.dwSize);
+ //(*((WORD*)&szBuff[mralpsUsernameValue.dwSize]))=(*((WORD*)"@"));
+ //memmove(&szBuff[mralpsUsernameValue.dwSize+1],pmralpsValues[i].lpszData,pmralpsValues[i].dwSize);
+ //(*((WORD*)&szBuff[pmralpsValues[i].dwSize+mralpsUsernameValue.dwSize+1]))=0;
+ //DB_Mra_SetStringA(hContact,"e-mail",pmralpsValues[i].lpszData);
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Flags",5)==CSTR_EQUAL)
+ {
+ //***
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Nickname",8)==CSTR_EQUAL)
+ {
+ DB_Mra_SetLPSStringW(hContact,"Nick",&pmralpsValues[i]);
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"FirstName",9)==CSTR_EQUAL)
+ {
+ DB_Mra_SetLPSStringW(hContact,"FirstName",&pmralpsValues[i]);
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"LastName",8)==CSTR_EQUAL)
+ {
+ DB_Mra_SetLPSStringW(hContact,"LastName",&pmralpsValues[i]);
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Sex",3)==CSTR_EQUAL)
+ {
+ switch(StrToUNum32(pmralpsValues[i].lpszData,pmralpsValues[i].dwSize)){
+ case 1://
+ DB_Mra_SetByte(hContact,"Gender",'M');
+ break;
+ case 2://
+ DB_Mra_SetByte(hContact,"Gender",'F');
+ break;
+ default://
+ DB_Mra_DeleteValue(hContact,"Gender");
+ break;
+ }
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Birthday",8)==CSTR_EQUAL)
+ {
+ if (pmralpsValues[i].dwSize>9)
+ {// calc "Age"
+ SYSTEMTIME stTime={0};
+
+ stTime.wYear=(WORD)StrToUNum32(pmralpsValues[i].lpszData,4);
+ stTime.wMonth=(WORD)StrToUNum32((pmralpsValues[i].lpszData+5),2);
+ stTime.wDay=(WORD)StrToUNum32((pmralpsValues[i].lpszData+8),2);
+ DB_Mra_SetWord(hContact,"BirthYear",stTime.wYear);
+ DB_Mra_SetByte(hContact,"BirthMonth",(BYTE)stTime.wMonth);
+ DB_Mra_SetByte(hContact,"BirthDay",(BYTE)stTime.wDay);
+
+ DB_Mra_SetWord(hContact,"Age",(WORD)GetYears(&stTime));
+ }else{
+ DB_Mra_DeleteValue(hContact,"BirthYear");
+ DB_Mra_DeleteValue(hContact,"BirthMonth");
+ DB_Mra_DeleteValue(hContact,"BirthDay");
+ DB_Mra_DeleteValue(hContact,"Age");
+ }
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"City_id",7)==CSTR_EQUAL)
+ {
+ dwTemp=StrToUNum32(pmralpsValues[i].lpszData,pmralpsValues[i].dwSize);
+ if (dwTemp)
+ {
+ for(SIZE_T j=0;mrapPlaces[j].lpszData;j++)
+ {
+ if (mrapPlaces[j].dwCityID==dwTemp)
+ {
+ DB_Mra_SetStringW(hContact,"City",mrapPlaces[j].lpszData);
+ break;
+ }
+ }
+ }else{
+ DB_Mra_DeleteValue(hContact,"City");
+ }
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Location",8)==CSTR_EQUAL)
+ {//***
+ DB_Mra_SetLPSStringW(hContact,"About",&pmralpsValues[i]);
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Zodiac",6)==CSTR_EQUAL)
+ {
+ //***
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"BMonth",6)==CSTR_EQUAL)
+ {// used Birthday
+ //if (pmralpsValues[i].dwSize) DB_Mra_SetByte(hContact,"BirthMonth",(BYTE)StrToUNum32(pmralpsValues[i].lpszData,pmralpsValues[i].dwSize));
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"BDay",4)==CSTR_EQUAL)
+ {// used Birthday
+ //if (pmralpsValues[i].dwSize) DB_Mra_SetByte(hContact,"BirthDay",(BYTE)StrToUNum32(pmralpsValues[i].lpszData,pmralpsValues[i].dwSize));
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Country_id",10)==CSTR_EQUAL)
+ {
+ dwTemp=StrToUNum32(pmralpsValues[i].lpszData,pmralpsValues[i].dwSize);
+ if (dwTemp)
+ {
+ for(SIZE_T j=0;mrapPlaces[j].lpszData;j++)
+ {
+ if (mrapPlaces[j].dwCountryID==dwTemp)
+ {
+ DB_Mra_SetStringW(hContact,"Country",mrapPlaces[j].lpszData);
+ break;
+ }
+ }
+ }else{
+ DB_Mra_DeleteValue(hContact,"Country");
+ }
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Phone",5)==CSTR_EQUAL)
+ {
+ DB_Mra_DeleteValue(hContact,"Phone");
+ DB_Mra_DeleteValue(hContact,"Cellular");
+ DB_Mra_DeleteValue(hContact,"Fax");
+
+ if (pmralpsValues[i].dwSize)
+ {
+ LPSTR lpszCurPos;
+
+ lpsString.lpszData=pmralpsValues[i].lpszData;
+ lpszCurPos=(LPSTR)MemoryFindByte(0,pmralpsValues[i].lpszData,pmralpsValues[i].dwSize,',');
+ if (lpszCurPos)
+ {
+ lpsString.dwSize=(lpszCurPos-lpsString.lpszData);
+ }else{
+ lpsString.dwSize=((pmralpsValues[i].lpszData+pmralpsValues[i].dwSize)-lpsString.lpszData);
+ }
+ DB_Mra_SetLPSStringA(hContact,"Phone",&lpsString);
+
+ if (lpszCurPos)
+ {
+ lpsString.lpszData=(++lpszCurPos);
+ lpszCurPos=(LPSTR)MemoryFindByte((lpszCurPos-pmralpsValues[i].lpszData),pmralpsValues[i].lpszData,pmralpsValues[i].dwSize,',');
+ if (lpszCurPos)
+ {
+ lpsString.dwSize=(lpszCurPos-lpsString.lpszData);
+ }else{
+ lpsString.dwSize=((pmralpsValues[i].lpszData+pmralpsValues[i].dwSize)-lpsString.lpszData);
+ }
+ DB_Mra_SetLPSStringA(hContact,"Cellular",&lpsString);
+ }
+
+ if (lpszCurPos)
+ {
+ lpsString.lpszData=(++lpszCurPos);
+ lpszCurPos=(LPSTR)MemoryFindByte((lpszCurPos-pmralpsValues[i].lpszData),pmralpsValues[i].lpszData,pmralpsValues[i].dwSize,',');
+ if (lpszCurPos)
+ {
+ lpsString.dwSize=(lpszCurPos-lpsString.lpszData);
+ }else{
+ lpsString.dwSize=((pmralpsValues[i].lpszData+pmralpsValues[i].dwSize)-lpsString.lpszData);
+ }
+ DB_Mra_SetLPSStringA(hContact,"Fax",&lpsString);
+ }
+ }
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"mrim_status",11)==CSTR_EQUAL)
+ {
+ if (pmralpsValues[i].dwSize)
+ {
+ DWORD dwID,dwContactSeverFlags;
+
+ GetContactBasicInfoW(hContact,&dwID,NULL,NULL,&dwContactSeverFlags,NULL,NULL,0,NULL,NULL,0,NULL,NULL,0,NULL);
+ if (dwID==-1 || dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED)
+ {//
+ dwStatus=StrHexToUNum32(pmralpsValues[i].lpszData,pmralpsValues[i].dwSize);
+ MraSetContactStatus(hContact,GetMiradaStatusFromMraStatus(dwStatus,MRA_MIR_XSTATUS_NONE,NULL));
+ DB_Mra_SetByte(hContact,DBSETTING_XSTATUSID,(BYTE)MRA_MIR_XSTATUS_NONE);
+ }
+ }
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"status_uri",10)==CSTR_EQUAL)
+ {
+ if (pmralpsValues[i].dwSize)
+ {
+ DWORD dwID,dwContactSeverFlags,dwXStatus;
+
+ GetContactBasicInfoW(hContact,&dwID,NULL,NULL,&dwContactSeverFlags,NULL,NULL,0,NULL,NULL,0,NULL,NULL,0,NULL);
+ if (dwID==-1 || dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED)
+ {//
+ MraSetContactStatus(hContact,GetMiradaStatusFromMraStatus(dwStatus,GetMraXStatusIDFromMraUriStatus(pmralpsValues[i].lpszData,pmralpsValues[i].dwSize),&dwXStatus));
+ DB_Mra_SetByte(hContact,DBSETTING_XSTATUSID,(BYTE)dwXStatus);
+ }
+ }
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"status_title",12)==CSTR_EQUAL)
+ {
+ if (pmralpsValues[i].dwSize)
+ {
+ DWORD dwID,dwContactSeverFlags;
+
+ GetContactBasicInfoW(hContact,&dwID,NULL,NULL,&dwContactSeverFlags,NULL,NULL,0,NULL,NULL,0,NULL,NULL,0,NULL);
+ if (dwID==-1 || dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED)
+ {//
+ DB_Mra_SetLPSStringW(hContact,DBSETTING_XSTATUSNAME,&pmralpsValues[i]);
+ }
+ }
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"status_desc",11)==CSTR_EQUAL)
+ {
+ if (pmralpsValues[i].dwSize)
+ {
+ DWORD dwID,dwContactSeverFlags;
+
+ GetContactBasicInfoW(hContact,&dwID,NULL,NULL,&dwContactSeverFlags,NULL,NULL,0,NULL,NULL,0,NULL,NULL,0,NULL);
+ if (dwID==-1 || dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED)
+ {//
+ DB_Mra_SetLPSStringW(hContact,DBSETTING_XSTATUSMSG,&pmralpsValues[i]);
+ }
+ }
+ }else{// for DEBUG ONLY
+ #ifdef _DEBUG
+ DebugPrintCRLFA(pmralpsFeilds[i].lpszData);
+ DebugPrintCRLFA(pmralpsValues[i].lpszData);
+ //DebugBreak();
+ #endif
+ }
+ }
+ }else
+ if (dwAckType==ACKTYPE_SEARCH)
+ {
+ WCHAR szNick[MAX_EMAIL_LEN]={0},
+ szFirstName[MAX_EMAIL_LEN]={0},
+ szLastName[MAX_EMAIL_LEN]={0},
+ szEMail[MAX_EMAIL_LEN]={0};
+ MRA_LPS mralpsUsernameValue={0};
+ PROTOSEARCHRESULT psr={0};
+
+ psr.cbSize=sizeof(psr);
+ psr.flags=PSR_UNICODE;
+ psr.nick=szNick;
+ psr.firstName=szFirstName;
+ psr.lastName=szLastName;
+ psr.email=szEMail;
+ psr.id=szEMail;
+
+ for (i=0;i<dwFeildsNum;i++)
+ {
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Username",8)==CSTR_EQUAL)
+ {
+ mralpsUsernameValue=pmralpsValues[i];
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Domain",6)==CSTR_EQUAL)
+ {//
+ dwStringSize=MultiByteToWideChar(MRA_CODE_PAGE,0,mralpsUsernameValue.lpszData,mralpsUsernameValue.dwSize,szEMail,SIZEOF(szEMail));
+
+ szEMail[dwStringSize]=(*((WCHAR*)L"@"));
+ dwStringSize++;
+
+ dwStringSize+=MultiByteToWideChar(MRA_CODE_PAGE,0,pmralpsValues[i].lpszData,pmralpsValues[i].dwSize,&szEMail[dwStringSize],(SIZEOF(szEMail)-(dwStringSize+1)));
+ szEMail[dwStringSize]=0;
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"Nickname",8)==CSTR_EQUAL)
+ {
+ dwStringSize=min((sizeof(szNick)-sizeof(WCHAR)),pmralpsValues[i].dwSize);
+ memmove(szNick,pmralpsValues[i].lpwszData,dwStringSize);
+ szNick[dwStringSize]=0;
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"FirstName",9)==CSTR_EQUAL)
+ {
+ dwStringSize=min((sizeof(szFirstName)-sizeof(WCHAR)),pmralpsValues[i].dwSize);
+ memmove(szFirstName,pmralpsValues[i].lpwszData,dwStringSize);
+ szFirstName[dwStringSize]=0;
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,pmralpsFeilds[i].lpszData,pmralpsFeilds[i].dwSize,"LastName",8)==CSTR_EQUAL)
+ {
+ dwStringSize=min((sizeof(szLastName)-sizeof(WCHAR)),pmralpsValues[i].dwSize);
+ memmove(szLastName,pmralpsValues[i].lpwszData,dwStringSize);
+ szLastName[dwStringSize]=0;
+ }
+ }// end for
+ ProtoBroadcastAck(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_DATA,(HANDLE)pmaHeader->seq,(LPARAM)&psr);
+ }
+ }// end while
+
+ MEMFREE(pmralpsFeilds);
+ }
+ }
+
+ switch(dwAckType){
+ case ACKTYPE_GETINFO:
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_SUCCESS,(HANDLE)1,(LPARAM)NULL,0);
+ break;
+ case ACKTYPE_SEARCH:
+ default:
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_SUCCESS,(HANDLE)pmaHeader->seq,(LPARAM)NULL,0);
+ break;
+ }
+ break;
+ case MRIM_ANKETA_INFO_STATUS_NOUSER://
+ SetContactBasicInfoW(hContact,0,SCBIF_SERVER_FLAG,0,0,0,-1,0,NULL,0,NULL,0,NULL,0);
+ case MRIM_ANKETA_INFO_STATUS_DBERR://
+ case MRIM_ANKETA_INFO_STATUS_RATELIMERR:// ,
+ switch(dwAckType){
+ case ACKTYPE_GETINFO:
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_FAILED,(HANDLE)1,(LPARAM)NULL,0);
+ break;
+ case ACKTYPE_SEARCH:
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,hContact,dwAckType,ACKRESULT_SUCCESS,(HANDLE)pmaHeader->seq,(LPARAM)NULL,0);
+ break;
+ default:
+ DebugBreak();
+ break;
+ }
+ break;
+ default:// unknown
+ DebugBreak();
+ break;
+ }
+ MraSendQueueFree(masMraSettings.hSendQueueHandle,pmaHeader->seq);
+ }else{// not found in queue
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG,0,TranslateW(L"MRIM_ANKETA_INFO: not found in queue"));
+ }
+ break;
+ case MRIM_CS_MAILBOX_STATUS:
+ dwTemp=GetUL(&lpbDataCurrent);
+ if (dwTemp > masMraSettings.dwEmailMessagesTotal) masMraSettings.dwEmailMessagesTotal+=(dwTemp-masMraSettings.dwEmailMessagesUnRead);
+
+ dwAckType=masMraSettings.dwEmailMessagesUnRead;// save old value
+ masMraSettings.dwEmailMessagesUnRead=dwTemp;// store new value
+ if (DB_Mra_GetByte(NULL,"IncrementalNewMailNotify",MRA_DEFAULT_INC_NEW_MAIL_NOTIFY)==0 || dwAckType<dwTemp || dwTemp==0)
+ {
+ MraUpdateEmailStatus(NULL,0,NULL,0,0,0);
+ }
+ break;
+ case MRIM_CS_GAME:
+ {
+ DWORD dwGameSessionID,dwGameMsg,dwGameMsgID;
+
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsEMail);//LPS to/from
+ dwGameSessionID=GetUL(&lpbDataCurrent);//DWORD session unique per game
+ dwGameMsg=GetUL(&lpbDataCurrent);//DWORD msg internal game message
+ dwGameMsgID=GetUL(&lpbDataCurrent);//DWORD msg_id id for ack
+ dwTemp=GetUL(&lpbDataCurrent);//DWORD time_send time of client
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);//LPS data
+
+ #ifdef _DEBUG
+ BYTE btBuff[1024]={0};
+ memmove(btBuff,lpsString.lpszData,lpsString.dwSize);
+ #endif
+
+ switch(dwGameMsg){
+ case GAME_CONNECTION_INVITE:
+ if (MraGetStatus(0,0)!=ID_STATUS_INVISIBLE) MraSendCommand_Game(lpsEMail.lpszData,lpsEMail.dwSize,dwGameSessionID,GAME_DECLINE,dwGameMsgID,lpsString.lpszData,lpsString.dwSize);
+ break;
+ case GAME_CONNECTION_ACCEPT:
+ break;
+ case GAME_DECLINE:
+ break;
+ case GAME_INC_VERSION:
+ break;
+ case GAME_NO_SUCH_GAME:// user invisible
+ if ((hContact=MraHContactFromEmail(lpsEMail.lpszData,lpsEMail.dwSize,FALSE,TRUE,NULL)))
+ if (MraGetContactStatus(hContact)==ID_STATUS_OFFLINE)
+ {
+ MraSetContactStatus(hContact,ID_STATUS_INVISIBLE);
+ }
+ break;
+ case GAME_JOIN:
+ break;
+ case GAME_CLOSE:
+ break;
+ case GAME_SPEED:
+ break;
+ case GAME_SYNCHRONIZATION:
+ break;
+ case GAME_USER_NOT_FOUND:
+ break;
+ case GAME_ACCEPT_ACK:
+ break;
+ case GAME_PING:
+ break;
+ case GAME_RESULT:
+ break;
+ case GAME_MESSAGES_NUMBER:
+ break;
+ default:
+ mir_sntprintf(szBuff,SIZEOF(szBuff),TranslateW(L"MRIM_CS_GAME: unknown internal game message code: %lu"),dwGameMsg);
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG,0,szBuff);
+ break;
+ }
+ }
+ break;
+ case MRIM_CS_CONTACT_LIST2:
+ dwTemp=GetUL(&lpbDataCurrent);
+ if (dwTemp==GET_CONTACTS_OK)
+ {//
+ BOOL bAdded;
+ char szGroupMask[MAX_PATH],szContactMask[MAX_PATH];
+ DWORD dwID,dwGroupFlags,dwContactFlag,dwGroupID,dwContactSeverFlags,dwStatus,dwXStatus,dwFutureFlags,dwBlogStatusTime;
+ MRA_LPS mralpsGroupName,mralpsNick,mralpsCustomPhones,lpsSpecStatusUri,lpsStatusTitle,lpsStatusDesc,lpsUserAgentFormated,lpsBlogStatus,lpsBlogStatusMusic;
+ SIZE_T i,j,dwGroupsCount,dwGroupMaskSize,dwContactMaskSize,dwControlParam;
+ ULARGE_INTEGER dwBlogStatusID;
+
+ dwGroupsCount=GetUL(&lpbDataCurrent);
+
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ dwGroupMaskSize=lpsString.dwSize;
+ memmove(szGroupMask,lpsString.lpszData,dwGroupMaskSize);(*(szGroupMask+dwGroupMaskSize))=0;
+
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ dwContactMaskSize=lpsString.dwSize;
+ memmove(szContactMask,lpsString.lpszData,dwContactMaskSize);(*(szContactMask+dwContactMaskSize))=0;
+
+ DebugPrintCRLFW(L"Groups:");
+ DebugPrintCRLFA(szGroupMask);
+ dwID=0;
+ for(i=0;i<dwGroupsCount;i++)//groups handle
+ {
+ dwControlParam=0;
+ for(j=0;j<dwGroupMaskSize;j++)//enumerating parameters
+ {
+ switch(szGroupMask[j]){
+ case 's'://LPS
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ break;
+ case 'u'://UL
+ dwTemp=GetUL(&lpbDataCurrent);
+ break;
+ case 'z'://sz
+ lpsString.lpszData=(LPSTR)lpbDataCurrent;
+ lpsString.dwSize=lstrlenA((LPSTR)lpbDataCurrent);
+ lpbDataCurrent+=lpsString.dwSize;
+ DebugBreak();
+ break;
+ }
+
+ if (j==0 && szGroupMask[j]=='u')
+ {// GroupFlags
+ dwGroupFlags=dwTemp;
+ dwControlParam++;
+ }else
+ if (j==1 && szGroupMask[j]=='s')
+ {// GroupName
+ mralpsGroupName=lpsString;
+ dwControlParam++;
+ }
+ }
+
+ // add/modify group
+ if (dwControlParam>1)// !
+ //if (dwGroupFlags&CONTACT_FLAG_GROUP && (dwGroupFlags&CONTACT_FLAG_REMOVED)==0)
+ {
+ #ifdef _DEBUG
+ memmove(szBuff,mralpsGroupName.lpszData,mralpsGroupName.dwSize);
+ szBuff[(mralpsGroupName.dwSize/sizeof(WCHAR))]=0;
+ DebugPrintW(szBuff);
+
+ mir_snprintf((LPSTR)szBuff,SIZEOF(szBuff),": flags: %lu (",dwGroupFlags);
+ DebugPrintA((LPSTR)szBuff);
+ if (dwGroupFlags&CONTACT_FLAG_REMOVED) DebugPrintA("CONTACT_FLAG_REMOVED, ");
+ if (dwGroupFlags&CONTACT_FLAG_GROUP) DebugPrintA("CONTACT_FLAG_GROUP, ");
+ if (dwGroupFlags&CONTACT_FLAG_INVISIBLE) DebugPrintA("CONTACT_FLAG_INVISIBLE, ");
+ if (dwGroupFlags&CONTACT_FLAG_VISIBLE) DebugPrintA("CONTACT_FLAG_VISIBLE, ");
+ if (dwGroupFlags&CONTACT_FLAG_IGNORE) DebugPrintA("CONTACT_FLAG_IGNORE, ");
+ if (dwGroupFlags&CONTACT_FLAG_SHADOW) DebugPrintA("CONTACT_FLAG_SHADOW, ");
+ if (dwGroupFlags&CONTACT_FLAG_AUTHORIZED) DebugPrintA("CONTACT_FLAG_AUTHORIZED, ");
+ if (dwGroupFlags&CONTACT_FLAG_MULTICHAT) DebugPrintA("CONTACT_FLAG_MULTICHAT, ");
+ if (dwGroupFlags&CONTACT_FLAG_UNICODE_NAME) DebugPrintA("CONTACT_FLAG_UNICODE_NAME, ");
+ if (dwGroupFlags&CONTACT_FLAG_PHONE) DebugPrintA("CONTACT_FLAG_PHONE, ");
+ DebugPrintCRLFA(")");
+ #endif//*/
+ }
+ dwID++;
+ }// end for (processing groups)
+
+
+ DebugPrintCRLFW(L"Contacts:");
+ DebugPrintCRLFA(szContactMask);
+ dwID=20;
+ while (lpbDataCurrent<(lpbData+dwDataSize))
+ {
+ dwControlParam=0;
+ for(j=0;j<dwContactMaskSize;j++)//enumerating parameters
+ {
+ switch(szContactMask[j]){
+ case 's'://LPS
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);
+ break;
+ case 'u'://UL
+ dwTemp=GetUL(&lpbDataCurrent);
+ break;
+ case 'z'://sz
+ lpsString.lpszData=(LPSTR)lpbDataCurrent;
+ lpsString.dwSize=lstrlenA((LPSTR)lpbDataCurrent);
+ lpbDataCurrent+=lpsString.dwSize;
+ DebugBreak();
+ break;
+ }
+
+ if (j==0 && szContactMask[j]=='u')
+ {// Flags
+ dwContactFlag=dwTemp;
+ dwControlParam++;
+ }else
+ if (j==1 && szContactMask[j]=='u')
+ {// Group id
+ dwGroupID=dwTemp;
+ dwControlParam++;
+ }else
+ if (j==2 && szContactMask[j]=='s')
+ {// Email
+ lpsEMail=lpsString;
+ dwControlParam++;
+ }else
+ if (j==3 && szContactMask[j]=='s')
+ {// Nick
+ mralpsNick=lpsString;
+ dwControlParam++;
+ }else
+ if (j==4 && szContactMask[j]=='u')
+ {// Server flags
+ dwContactSeverFlags=dwTemp;
+ dwControlParam++;
+ }else
+ if (j==5 && szContactMask[j]=='u')
+ {// Status
+ dwStatus=dwTemp;
+ dwControlParam++;
+ }else
+ if (j==6 && szContactMask[j]=='s')
+ {// Custom Phone number,
+ mralpsCustomPhones=lpsString;
+ dwControlParam++;
+ }else
+ if (j==7 && szContactMask[j]=='s')
+ {// spec_status_uri
+ lpsSpecStatusUri=lpsString;
+ dwControlParam++;
+ }else
+ if (j==8 && szContactMask[j]=='s')
+ {// status_title
+ lpsStatusTitle=lpsString;
+ dwControlParam++;
+ }else
+ if (j==9 && szContactMask[j]=='s')
+ {// status_desc
+ lpsStatusDesc=lpsString;
+ dwControlParam++;
+ }else
+ if (j==10 && szContactMask[j]=='u')
+ {// com_support (future flags)
+ dwFutureFlags=dwTemp;
+ dwControlParam++;
+ }else
+ if (j==11 && szContactMask[j]=='s')
+ {// user_agent (formated string)
+ lpsUserAgentFormated=lpsString;
+ dwControlParam++;
+ }else
+ if (j==12 && szContactMask[j]=='u')
+ {// BlogStatusID
+ dwBlogStatusID.LowPart=dwTemp;
+ dwControlParam++;
+ }else
+ if (j==13 && szContactMask[j]=='u')
+ {// BlogStatusID
+ dwBlogStatusID.HighPart=dwTemp;
+ dwControlParam++;
+ }else
+ if (j==14 && szContactMask[j]=='u')
+ {// BlogStatusTime
+ dwBlogStatusTime=dwTemp;
+ dwControlParam++;
+ }else
+ if (j==15 && szContactMask[j]=='s')
+ {// BlogStatus
+ lpsBlogStatus=lpsString;
+ dwControlParam++;
+ }else
+ if (j==16 && szContactMask[j]=='s')
+ {// BlogStatusMusic
+ lpsBlogStatusMusic=lpsString;
+ dwControlParam++;
+ }else
+ if (j==17 && szContactMask[j]=='s')
+ {// BlogStatusSender // ignory
+ lpsString=lpsString;
+ dwControlParam++;
+ }else
+ if (j==18 && szContactMask[j]=='s')
+ {// geo data ?
+ lpsString=lpsString;
+ dwControlParam++;
+ }else
+ if (j==19 && szContactMask[j]=='s')
+ {// ?????? ?
+ lpsString=lpsString;
+ dwControlParam++;
+ DebugBreakIf(lpsString.dwSize);
+ }else{
+ if (szContactMask[j]=='s')
+ {
+ if (lpsString.dwSize)
+ {
+ //DebugPrintCRLFA(lpsString.lpszData);
+ DebugPrintCRLFW(lpsString.lpwszData);
+ }
+ }else
+ if (szContactMask[j]=='u')
+ {
+ mir_snprintf((LPSTR)szBuff,SIZEOF(szBuff),"%lu, ",dwTemp);//;
+ DebugPrintCRLFA((LPSTR)szBuff);
+ }else{
+ DebugBreak();
+ }
+ }
+ }
+
+
+ #ifdef _DEBUG
+
+ mir_snprintf((LPSTR)szBuff,SIZEOF(szBuff),"ID: %lu, Group id: %lu, ",dwID,dwGroupID);
+ DebugPrintA((LPSTR)szBuff);
+
+
+ memmove(szBuff,lpsEMail.lpszData,lpsEMail.dwSize);
+ szBuff[(lpsEMail.dwSize/sizeof(WCHAR))]=0;
+ DebugPrintA((LPSTR)szBuff);
+
+ mir_snprintf((LPSTR)szBuff,SIZEOF(szBuff),": flags: %lu (",dwContactFlag);
+ DebugPrintA((LPSTR)szBuff);
+ if (dwContactFlag&CONTACT_FLAG_REMOVED) DebugPrintA("CONTACT_FLAG_REMOVED, ");
+ if (dwContactFlag&CONTACT_FLAG_GROUP) DebugPrintA("CONTACT_FLAG_GROUP, ");
+ if (dwContactFlag&CONTACT_FLAG_INVISIBLE) DebugPrintA("CONTACT_FLAG_INVISIBLE, ");
+ if (dwContactFlag&CONTACT_FLAG_VISIBLE) DebugPrintA("CONTACT_FLAG_VISIBLE, ");
+ if (dwContactFlag&CONTACT_FLAG_IGNORE) DebugPrintA("CONTACT_FLAG_IGNORE, ");
+ if (dwContactFlag&CONTACT_FLAG_SHADOW) DebugPrintA("CONTACT_FLAG_SHADOW, ");
+ if (dwContactFlag&CONTACT_FLAG_AUTHORIZED) DebugPrintA("CONTACT_FLAG_AUTHORIZED, ");
+ if (dwContactFlag&CONTACT_FLAG_MULTICHAT) DebugPrintA("CONTACT_FLAG_MULTICHAT, ");
+ if (dwContactFlag&CONTACT_FLAG_UNICODE_NAME)DebugPrintA("CONTACT_FLAG_UNICODE_NAME, ");
+ if (dwContactFlag&CONTACT_FLAG_PHONE) DebugPrintA("CONTACT_FLAG_PHONE, ");
+ DebugPrintA(")");
+
+ mir_snprintf((LPSTR)szBuff,SIZEOF(szBuff),": server flags: %lu (",dwContactSeverFlags);
+ DebugPrintA((LPSTR)szBuff);
+ if (dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED) DebugPrintA("CONTACT_INTFLAG_NOT_AUTHORIZED, ");
+ DebugPrintCRLFA(")");
+ #endif//*/
+
+
+ // add/modify contact
+ if (dwGroupID!=103)//***deb filtering phone/sms contats
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpsEMail.lpszData,lpsEMail.dwSize,"phone",5)!=CSTR_EQUAL)
+ if (dwControlParam>5)// !
+ if ((dwContactFlag&(CONTACT_FLAG_GROUP|CONTACT_FLAG_REMOVED))==0)
+ {
+ hContact=MraHContactFromEmail(lpsEMail.lpszData,lpsEMail.dwSize,TRUE,FALSE,&bAdded);
+ if (hContact)
+ {
+ if (GetContactBasicInfoW(hContact,&dwTemp,NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,NULL,0,NULL)==NO_ERROR && dwTemp!=-1)
+ {//deb , !!!!
+ dwTemp=dwTemp;
+ //MraSendCommand_ModifyContactW(hContact,dwID,CONTACT_FLAG_REMOVED,dwGroupID,lpsEMail.lpszData,lpsEMail.dwSize,mralpsNick.lpszData,mralpsNick.dwSize,mralpsCustomPhones.lpszData,mralpsCustomPhones.dwSize);
+ DebugBreak();
+ }else{
+ dwTemp=GetMiradaStatusFromMraStatus(dwStatus,GetMraXStatusIDFromMraUriStatus(lpsSpecStatusUri.lpszData,lpsSpecStatusUri.dwSize),&dwXStatus);
+ if((dwContactFlag&CONTACT_FLAG_UNICODE_NAME)) mralpsNick.dwSize/=sizeof(WCHAR);
+
+ if (bAdded)
+ {// update user info
+ SetContactBasicInfoW(hContact,SCBIFSI_LOCK_CHANGES_EVENTS,(SCBIF_ID|SCBIF_GROUP_ID|SCBIF_FLAG|SCBIF_SERVER_FLAG|SCBIF_STATUS|SCBIF_NICK|SCBIF_PHONES),dwID,dwGroupID,dwContactFlag,dwContactSeverFlags,dwTemp,NULL,0,mralpsNick.lpwszData,mralpsNick.dwSize,mralpsCustomPhones.lpszData,mralpsCustomPhones.dwSize);
+
+ // request user info from server
+ MraUpdateContactInfo(hContact);
+ }else{//****deb - check group ID param
+ SetContactBasicInfoW(hContact,SCBIFSI_LOCK_CHANGES_EVENTS,(SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS),dwID,dwGroupID,dwContactFlag,dwContactSeverFlags,dwTemp,NULL,0,mralpsNick.lpwszData,mralpsNick.dwSize,mralpsCustomPhones.lpszData,mralpsCustomPhones.dwSize);
+ if (mralpsNick.dwSize==0)
+ {//
+ lstrcpynW(szBuff,GetContactNameW(hContact),SIZEOF(szBuff));
+ mralpsNick.lpwszData=szBuff;
+ mralpsNick.dwSize=lstrlenW(mralpsNick.lpwszData);
+
+ MraSendCommand_ModifyContactW(hContact,dwID,dwContactFlag,dwGroupID,lpsEMail.lpszData,lpsEMail.dwSize,mralpsNick.lpwszData,mralpsNick.dwSize,mralpsCustomPhones.lpszData,mralpsCustomPhones.dwSize);
+ }
+ }
+
+ MraContactCapabilitiesSet(hContact,dwFutureFlags);
+ DB_Mra_SetByte(hContact,DBSETTING_XSTATUSID,(BYTE)dwXStatus);
+ DB_Mra_SetLPSStringW(hContact,DBSETTING_XSTATUSNAME,&lpsStatusTitle);
+ DB_Mra_SetLPSStringW(hContact,DBSETTING_XSTATUSMSG,&lpsStatusDesc);
+ DB_Mra_SetDword(hContact,DBSETTING_BLOGSTATUSTIME,dwBlogStatusTime);
+ DB_Mra_WriteContactSettingBlob(hContact,DBSETTING_BLOGSTATUSID,&dwBlogStatusID.QuadPart,sizeof(DWORDLONG));
+ DB_Mra_SetLPSStringW(hContact,DBSETTING_BLOGSTATUS,&lpsBlogStatus);
+ DB_Mra_SetLPSStringW(hContact,DBSETTING_BLOGSTATUSMUSIC,&lpsBlogStatusMusic);
+ if (IsXStatusValid(dwXStatus)) SetExtraIcons(hContact);
+
+ if (dwTemp!=ID_STATUS_OFFLINE)// ,
+ {
+ if (lpsUserAgentFormated.dwSize)
+ {//
+ if (DB_Mra_GetByte(NULL,"MirVerRaw",MRA_DEFAULT_MIRVER_RAW)==FALSE)
+ {
+ MraGetVersionStringFromFormated(lpsUserAgentFormated.lpszData,lpsUserAgentFormated.dwSize,(LPSTR)szBuff,SIZEOF(szBuff),&dwStringSize);
+ lpsUserAgentFormated.lpszData=(LPSTR)szBuff;
+ lpsUserAgentFormated.dwSize=dwStringSize;
+ }
+ }else{//
+ lpsUserAgentFormated.lpszData=MIRVER_UNKNOWN;
+ lpsUserAgentFormated.dwSize=(sizeof(MIRVER_UNKNOWN)-1);
+ }
+ DB_Mra_SetLPSStringA(hContact,"MirVer",&lpsUserAgentFormated);
+ }
+
+ if (dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED)
+ if (DB_Mra_GetByte(NULL,"AutoAuthRequestOnLogon",MRA_DEFAULT_AUTO_AUTH_REQ_ON_LOGON)) CallProtoService(PROTOCOL_NAMEA,MRA_REQ_AUTH,(WPARAM)hContact,0);
+ }
+ }
+ }
+ dwID++;
+ }// end while (processing contacts)
+
+ // post processing contact list
+ {
+ CHAR szEMail[MAX_EMAIL_LEN],szPhones[MAX_EMAIL_LEN];
+ WCHAR wszAuthMessage[MAX_PATH],wszNick[MAX_EMAIL_LEN];
+ SIZE_T dwEMailSize,dwNickSize,dwPhonesSize,dwAuthMessageSize;
+
+ if (DB_Mra_GetStaticStringW(NULL,"AuthMessage",wszAuthMessage,SIZEOF(wszAuthMessage),&dwAuthMessageSize)==FALSE)
+ {// def auth message
+ lstrcpynW(wszAuthMessage,TranslateW(MRA_DEFAULT_AUTH_MESSAGE),SIZEOF(wszAuthMessage));
+ dwAuthMessageSize=lstrlenW(wszAuthMessage);
+ }
+
+ for(hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ {
+ if (GetContactBasicInfoW(hContact,&dwID,NULL,NULL,NULL,NULL,szEMail,SIZEOF(szEMail),&dwEMailSize,NULL,0,NULL,NULL,0,NULL)==NO_ERROR)
+ if (dwID==-1)
+ {
+ if (IsEMailChatAgent(szEMail,dwEMailSize))
+ {// : , ,
+ DBDeleteContactSetting(hContact,"CList","Hidden");
+ DBDeleteContactSetting(hContact,"CList","NotOnList");
+ SetExtraIcons(hContact);
+ MraSetContactStatus(hContact,ID_STATUS_ONLINE);
+
+ lstrcpynW(szBuff,GetContactNameW(hContact),SIZEOF(szBuff));
+ MraSendCommand_AddContactW(hContact,(CONTACT_FLAG_VISIBLE|CONTACT_FLAG_MULTICHAT|CONTACT_FLAG_UNICODE_NAME),-1,szEMail,dwEMailSize,szBuff,lstrlenW(szBuff),NULL,0,NULL,0,0);
+ }else{
+ if (DBGetContactSettingByte(hContact,"CList","NotOnList",0)==0)
+ {// set extra icons and upload contact
+ SetExtraIcons(hContact);
+ if (DB_Mra_GetByte(NULL,"AutoAddContactsToServer",MRA_DEFAULT_AUTO_ADD_CONTACTS_TO_SERVER))
+ {//add all contacts to server
+ GetContactBasicInfoW(hContact,NULL,&dwGroupID,NULL,NULL,NULL,NULL,0,NULL,wszNick,SIZEOF(wszNick),&dwNickSize,szPhones,SIZEOF(szPhones),&dwPhonesSize);
+ MraSendCommand_AddContactW(hContact,(CONTACT_FLAG_VISIBLE|CONTACT_FLAG_UNICODE_NAME),dwGroupID,szEMail,dwEMailSize,wszNick,dwNickSize,szPhones,dwPhonesSize,wszAuthMessage,dwAuthMessageSize,0);
+ }
+ }
+ }
+ MraUpdateContactInfo(hContact);
+ }
+ }
+ }
+ }else{//
+ // offline id
+ for(HANDLE hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ {// MRA
+ SetContactBasicInfoW(hContact,SCBIFSI_LOCK_CHANGES_EVENTS,(SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS),-1,-2,0,0,ID_STATUS_OFFLINE,NULL,0,NULL,0,NULL,0);
+ // request user info from server
+ MraUpdateContactInfo(hContact);
+ }
+
+ if (dwTemp==GET_CONTACTS_ERROR)
+ {// -
+ ShowFormatedErrorMessage(L"MRIM_CS_CONTACT_LIST2: bad contact list",NO_ERROR);
+ }else
+ if (dwTemp==GET_CONTACTS_INTERR)
+ {//
+ ShowFormatedErrorMessage(L"MRIM_CS_CONTACT_LIST2: internal server error",NO_ERROR);
+ }else{
+ mir_sntprintf(szBuff,SIZEOF(szBuff),TranslateW(L"MRIM_CS_CONTACT_LIST2: unknown server error, code: %lu"),dwTemp);
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG,0,szBuff);
+ }
+ }
+ break;
+ case MRIM_CS_SMS_ACK:
+ dwTemp=GetUL(&lpbDataCurrent);
+ if (MraSendQueueFind(masMraSettings.hSendQueueHandle,pmaHeader->seq,NULL,&hContact,&dwAckType,(LPBYTE*)&lpsString.lpszData,&lpsString.dwSize)==NO_ERROR)
+ {
+ char szEMail[MAX_EMAIL_LEN];
+ LPSTR lpszPhone;
+ LPWSTR lpwszMessage;
+ SIZE_T dwEMailSize,dwPhoneSize,dwMessageSize;
+
+ if (DB_Mra_GetStaticStringA(NULL,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ dwPhoneSize=(*(DWORD*)lpsString.lpszData);
+ dwMessageSize=lpsString.dwSize-(dwPhoneSize+sizeof(DWORD)+2);
+ lpszPhone=(lpsString.lpszData+sizeof(DWORD));
+ lpwszMessage=(LPWSTR)(lpszPhone+dwPhoneSize+1);
+
+ dwTemp=mir_snprintf((LPSTR)szBuff,SIZEOF(szBuff),"<sms_response><source>Mail.ru</source><deliverable>Yes</deliverable><network>Mail.ru, Russia</network><message_id>%s-1-1955988055-%s</message_id><destination>%s</destination><messages_left>0</messages_left></sms_response>\r\n",szEMail,lpszPhone,lpszPhone);
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,NULL,dwAckType,ACKRESULT_SENTREQUEST,(HANDLE)pmaHeader->seq,(LPARAM)szBuff,dwTemp);
+ }
+
+ MEMFREE(lpsString.lpszData);
+ MraSendQueueFree(masMraSettings.hSendQueueHandle,pmaHeader->seq);
+ }else{// not found in queue
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG,0,TranslateW(L"MRIM_CS_SMS_ACK: not found in queue"));
+ }
+ break;
+ case MRIM_CS_PROXY:
+ {
+ DWORD dwIDRequest;
+ MRA_LPS lpsAddreses={0};
+ MRA_GUID mguidSessionID;
+
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsEMail);// LPS to
+ dwIDRequest=GetUL(&lpbDataCurrent);// DWORD id_request
+ dwAckType=GetUL(&lpbDataCurrent);// DWORD data_type
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);// LPS user_data
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsAddreses);// LPS lps_ip_port
+ mguidSessionID=GetGUID(&lpbDataCurrent);// DWORD session_id[4]
+
+ if (dwAckType==MRIM_PROXY_TYPE_FILES)
+ {// , on file recv
+ if (MraMrimProxySetData(MraFilesQueueItemProxyByID(masMraSettings.hFilesQueueHandle,dwIDRequest),lpsEMail.lpszData,lpsEMail.dwSize,dwIDRequest,dwAckType,lpsString.lpszData,lpsString.dwSize,lpsAddreses.lpszData,lpsAddreses.dwSize,&mguidSessionID)==NO_ERROR)
+ {// /proxy enabled// set proxy info to file transfer context
+ MraFilesQueueStartMrimProxy(masMraSettings.hFilesQueueHandle,dwIDRequest);
+ }else{// /
+ MraSendCommand_ProxyAck(PROXY_STATUS_ERROR,lpsEMail.lpszData,lpsEMail.dwSize,dwIDRequest,dwAckType,lpsString.lpszData,lpsString.dwSize,lpsAddreses.lpszData,lpsAddreses.dwSize,mguidSessionID);
+ DebugBreak();
+ }
+ }
+ //DebugBreak();
+ }
+ break;
+ case MRIM_CS_PROXY_ACK:
+ {
+ DWORD dwIDRequest;
+ HANDLE hMraMrimProxyData;
+ MRA_LPS lpsAddreses={0};
+ MRA_GUID mguidSessionID;
+
+ dwTemp=GetUL(&lpbDataCurrent);// DWORD status
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsEMail);// LPS to
+ dwIDRequest=GetUL(&lpbDataCurrent);// DWORD id_request
+ dwAckType=GetUL(&lpbDataCurrent);// DWORD data_type
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);// LPS user_data
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsAddreses);// LPS lps_ip_port
+ mguidSessionID=GetGUID(&lpbDataCurrent);// DWORD session_id[4]
+
+ if (dwAckType==MRIM_PROXY_TYPE_FILES)
+ {// , on file send
+ if ((hMraMrimProxyData=MraFilesQueueItemProxyByID(masMraSettings.hFilesQueueHandle,dwIDRequest)))
+ {// /proxy enabled
+ switch(dwTemp){
+ case PROXY_STATUS_DECLINE:
+ MraFilesQueueCancel(masMraSettings.hFilesQueueHandle,dwIDRequest,FALSE);
+ break;
+ case PROXY_STATUS_OK:
+ if (MraMrimProxySetData(hMraMrimProxyData,lpsEMail.lpszData,lpsEMail.dwSize,dwIDRequest,dwAckType,lpsString.lpszData,lpsString.dwSize,lpsAddreses.lpszData,lpsAddreses.dwSize,&mguidSessionID)==NO_ERROR)
+ {// set proxy info to file transfer context
+ MraFilesQueueStartMrimProxy(masMraSettings.hFilesQueueHandle,dwIDRequest);
+ }
+ break;
+ case PROXY_STATUS_ERROR:
+ ShowFormatedErrorMessage(L"Proxy File transfer: error",NO_ERROR);
+ MraFilesQueueCancel(masMraSettings.hFilesQueueHandle,dwIDRequest,FALSE);
+ break;
+ case PROXY_STATUS_INCOMPATIBLE_VERS:
+ ShowFormatedErrorMessage(L"Proxy File transfer: incompatible versions",NO_ERROR);
+ MraFilesQueueCancel(masMraSettings.hFilesQueueHandle,dwIDRequest,FALSE);
+ break;
+ case PROXY_STATUS_NOHARDWARE:
+ case PROXY_STATUS_MIRROR:
+ case PROXY_STATUS_CLOSED:
+ default:
+ DebugBreak();
+ break;
+ }
+ }else{// /
+ DebugBreak();
+ }
+ }
+
+ /*if (dwTemp!=2)
+ if ((hContact=MraHContactFromEmail(lpsEMail.lpszData,lpsEMail.dwSize,FALSE,TRUE,NULL)))
+ if (MraGetContactStatus(hContact)==ID_STATUS_OFFLINE)
+ {
+ MraSetContactStatus(hContact,ID_STATUS_INVISIBLE);
+ }*/
+
+ //DebugBreak();
+ }
+ break;
+ case MRIM_CS_PROXY_HELLO:
+ // DWORD[4] Session_id
+ DebugBreak();
+ break;
+ case MRIM_CS_PROXY_HELLO_ACK:
+ DebugBreak();
+ break;
+ case MRIM_CS_NEW_MAIL:
+ {
+ DWORD dwDate,dwUIDL;
+
+ dwTemp=GetUL(&lpbDataCurrent);// UL unread count
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsEMail);// LPS from
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);// LPS subject
+ dwDate=GetUL(&lpbDataCurrent);// UL date
+ dwUIDL=GetUL(&lpbDataCurrent);// UL uidl
+
+ if (dwTemp > masMraSettings.dwEmailMessagesTotal) masMraSettings.dwEmailMessagesTotal+=(dwTemp-masMraSettings.dwEmailMessagesUnRead);
+
+ dwAckType=masMraSettings.dwEmailMessagesUnRead;// save old value
+ masMraSettings.dwEmailMessagesUnRead=dwTemp;// store new value
+ if (DB_Mra_GetByte(NULL,"IncrementalNewMailNotify",MRA_DEFAULT_INC_NEW_MAIL_NOTIFY)==0 || dwAckType<dwTemp || dwTemp==0)
+ {
+ MraUpdateEmailStatus(lpsEMail.lpszData,lpsEMail.dwSize,lpsString.lpszData,lpsString.dwSize,dwDate,dwUIDL);
+ }
+ }
+ break;
+ case MRIM_CS_USER_BLOG_STATUS:
+ {
+ DWORD dwTime,dwFlags;
+ MRA_LPS lpsText;
+ LPBYTE lpbBuff=NULL;
+ DWORDLONG dwBlogStatusID;
+
+ dwFlags=GetUL(&lpbDataCurrent);// UL flags
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsEMail);// LPS user
+ dwBlogStatusID=GetUIDL(&lpbDataCurrent);// UINT64 id
+ dwTime=GetUL(&lpbDataCurrent);// UL time
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsText);// LPS text (MRIM_BLOG_STATUS_MUSIC: track)
+ GetLPS(lpbData,dwDataSize,&lpbDataCurrent,&lpsString);// LPS reply_user_nick
+
+ if ((hContact=MraHContactFromEmail(lpsEMail.lpszData,lpsEMail.dwSize,FALSE,TRUE,NULL)))
+ {
+ if (dwFlags&MRIM_BLOG_STATUS_MUSIC)
+ {
+ DB_Mra_SetLPSStringW(hContact,DBSETTING_BLOGSTATUSMUSIC,&lpsText);
+ }else{
+ DB_Mra_SetDword(hContact,DBSETTING_BLOGSTATUSTIME,dwTime);
+ DB_Mra_WriteContactSettingBlob(hContact,DBSETTING_BLOGSTATUSID,&dwBlogStatusID,sizeof(DWORDLONG));
+ DB_Mra_SetLPSStringW(hContact,DBSETTING_BLOGSTATUS,&lpsText);
+ }
+ }
+ }
+ break;
+
+ case MRIM_CS_UNKNOWN:
+ /*{
+ BYTE btBuff[8192]={0};
+ memmove(btBuff,lpbData,dwDataSize);
+ DebugBreak();
+ }*/
+ break;
+ case MRIM_CS_USER_GEO:
+ /*{
+ BYTE btBuff[8192]={0};
+ memmove(btBuff,lpbData,dwDataSize);
+ DebugBreak();
+ }*/
+ break;
+ case MRIM_CS_SERVER_SETTINGS:
+ /*{
+ BYTE btBuff[8192]={0};
+ memmove(btBuff,lpbData,dwDataSize);
+ DebugBreak();
+ }*/
+ break;
+ default:
+#ifdef _DEBUG
+ /*{
+ HANDLE hFile=CreateFile("C:\\Documents and Settings\\Ivan\\ \\MRIM_CS_CONTACT_LIST2.txt",GENERIC_WRITE,FILE_SHARE_READ,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
+
+ if (hFile!=INVALID_HANDLE_VALUE)
+ {
+ WriteFile(hFile,lpbData,dwDataSize,&dwTemp,NULL);
+ CloseHandle(hFile);
+ }
+ }//*/
+ {
+ BYTE btBuff[8192]={0};
+ memmove(btBuff,lpbData,dwDataSize);
+ DebugBreak();
+ }
+#endif
+ break;
+ }
+return(0);
+}
+
+
+DWORD MraRecvCommand_Message(DWORD dwTime,DWORD dwFlags,MRA_LPS *plpsFrom,MRA_LPS *plpsText,MRA_LPS *plpsRFTText,MRA_LPS *plpsMultiChatData)
+{//
+ BOOL bAdded;
+ DWORD dwRetErrorCode=NO_ERROR,dwBackColour;
+ LPSTR lpszMessageExt=NULL;
+ LPWSTR lpwszMessage=NULL;
+ SIZE_T dwMessageSize=0,dwMessageExtSize=0;
+ CCSDATA ccs={0};
+ PROTORECVEVENT pre={0};
+
+ //ccs.wParam=0;
+ ccs.lParam=(LPARAM)&pre;
+ pre.timestamp=dwTime;
+
+ // check flags and datas
+ if (dwFlags&MESSAGE_FLAG_RTF)
+ {
+ if (plpsRFTText)
+ {
+ if (plpsRFTText->lpszData==NULL || plpsRFTText->dwSize==0) dwFlags&=~MESSAGE_FLAG_RTF;
+ }else{
+ dwFlags&=~MESSAGE_FLAG_RTF;
+ }
+ }
+
+ if (dwFlags&MESSAGE_FLAG_MULTICHAT)
+ {
+ if (plpsMultiChatData)
+ {
+ if (plpsMultiChatData->lpszData==NULL || plpsMultiChatData->dwSize==0) dwFlags&=~MESSAGE_FLAG_MULTICHAT;
+ }else{
+ dwFlags&=~MESSAGE_FLAG_MULTICHAT;
+ }
+ }
+
+
+ // pre processing - extracting/decoding
+ if (dwFlags&MESSAGE_FLAG_AUTHORIZE)
+ {// extract auth message
+ SIZE_T dwAuthPartsCount,dwAuthBuffSize=(plpsText->dwSize+32),dwAuthDataSize;
+ LPBYTE lpbAuthData,lpbDataCurrent;
+ MRA_LPS lpsAuthFrom,lpsAuthMessage;
+
+ lpbAuthData=(LPBYTE)MEMALLOC(dwAuthBuffSize);
+ if (lpbAuthData)
+ {
+ BASE64DecodeFormated(plpsText->lpszData,plpsText->dwSize,lpbAuthData,dwAuthBuffSize,&dwAuthDataSize);
+
+ lpbDataCurrent=lpbAuthData;
+ dwAuthPartsCount=GetUL(&lpbDataCurrent);
+ if (GetLPS(lpbAuthData,dwAuthDataSize,&lpbDataCurrent,&lpsAuthFrom)==NO_ERROR)
+ if (GetLPS(lpbAuthData,dwAuthDataSize,&lpbDataCurrent,&lpsAuthMessage)==NO_ERROR)
+ {
+ if (dwFlags&MESSAGE_FLAG_v1p16 && (dwFlags&MESSAGE_FLAG_CP1251)==0)
+ {// unicode text
+ memmove(lpbAuthData,lpsAuthMessage.lpszData,lpsAuthMessage.dwSize);
+ lpwszMessage=(LPWSTR)lpbAuthData;
+ dwMessageSize=(lpsAuthMessage.dwSize/sizeof(WCHAR));
+ }else{//
+ lpwszMessage=(LPWSTR)MEMALLOC(((lpsAuthMessage.dwSize+MAX_PATH)*sizeof(WCHAR)));
+ if (lpwszMessage)
+ {
+ dwMessageSize=MultiByteToWideChar(MRA_CODE_PAGE,0,lpsAuthMessage.lpszData,lpsAuthMessage.dwSize,lpwszMessage,(lpsAuthMessage.dwSize+MAX_PATH));
+ (*(lpwszMessage+dwMessageSize))=0;
+ }else{//
+ dwRetErrorCode=GetLastError();
+ }
+ }
+ }
+ if (lpwszMessage!=(LPWSTR)lpbAuthData) MEMFREE(lpbAuthData);
+ }
+ }else{
+ /*//
+ if (dwFlags&MESSAGE_FLAG_v1p16 && dwFlags&MESSAGE_FLAG_CP1251)
+ {// ...... !
+ DebugPrintW(L"Unknown message encoding: ");
+ if (MemoryFindByte(0,plpsText->lpszData,(plpsText->dwSize-1),0))
+ {// !
+ dwFlags&=~MESSAGE_FLAG_CP1251;
+ DebugPrintCRLFW(plpsText->lpwszData);
+ }else{//
+ dwFlags&=~MESSAGE_FLAG_v1p16;
+ DebugPrintCRLFA(plpsText->lpszData);
+ }
+ }*/
+
+ if (dwFlags&(MESSAGE_FLAG_ALARM|MESSAGE_FLAG_FLASH|MESSAGE_FLAG_v1p16) && (dwFlags&MESSAGE_FLAG_CP1251)==0)
+ {// unicode text
+ lpwszMessage=plpsText->lpwszData;
+ dwMessageSize=(plpsText->dwSize/sizeof(WCHAR));
+ }else{//
+ lpwszMessage=(LPWSTR)MEMALLOC(((plpsText->dwSize+MAX_PATH)*sizeof(WCHAR)));
+ if (lpwszMessage)
+ {
+ dwMessageSize=MultiByteToWideChar(MRA_CODE_PAGE,0,plpsText->lpszData,plpsText->dwSize,lpwszMessage,(plpsText->dwSize+MAX_PATH));
+ (*(lpwszMessage+dwMessageSize))=0;
+ }else{//
+ dwRetErrorCode=GetLastError();
+ }
+ }
+
+ if (dwFlags&(MESSAGE_FLAG_CONTACT|MESSAGE_FLAG_NOTIFY|MESSAGE_FLAG_SMS|MESSAGE_SMS_DELIVERY_REPORT|MESSAGE_FLAG_ALARM))
+ {
+ // ,
+ }else{
+ if ((dwFlags&MESSAGE_FLAG_RTF) && plpsRFTText) //MESSAGE_FLAG_FLASH there
+ if (masMraSettings.lpfnUncompress)// only if uncompress function exist
+ if (plpsRFTText->lpszData && plpsRFTText->dwSize)
+ {// decode RTF
+ SIZE_T dwRTFPartsCount,dwCompressedSize,dwRFTBuffSize=((plpsRFTText->dwSize*16)+8192),dwRTFDataSize;
+ LPBYTE lpbRTFData,lpbCompressed,lpbDataCurrent;
+ MRA_LPS lpsRTFString,lpsBackColour,lpsString;
+
+ lpbRTFData=(LPBYTE)MEMALLOC(dwRFTBuffSize);
+ lpbCompressed=(LPBYTE)MEMALLOC((plpsRFTText->dwSize+32));
+ if (lpbRTFData && lpbCompressed)
+ {
+ BASE64DecodeFormated(plpsRFTText->lpszData,plpsRFTText->dwSize,lpbCompressed,(plpsRFTText->dwSize+32),&dwCompressedSize);
+ dwRTFDataSize=dwRFTBuffSize;
+ if ((PUNCOMPRESS(masMraSettings.lpfnUncompress))(lpbRTFData,(DWORD*)&dwRTFDataSize,lpbCompressed,dwCompressedSize)==Z_OK)
+ {
+ lpbDataCurrent=lpbRTFData;
+ dwRTFPartsCount=GetUL(&lpbDataCurrent);// 2, ,
+ if (GetLPS(lpbRTFData,dwRTFDataSize,&lpbDataCurrent,&lpsRTFString)==NO_ERROR)
+ if (GetLPS(lpbRTFData,dwRTFDataSize,&lpbDataCurrent,&lpsBackColour)==NO_ERROR)
+ {
+ dwBackColour=(*(DWORD*)lpsBackColour.lpszData);
+ if (dwFlags&MESSAGE_FLAG_FLASH)
+ {// // lpwszMessage=plpsText->lpwszData,
+ if (dwRTFPartsCount==3)
+ {//
+ DebugBreak();// , , 2008
+ GetLPS(lpbRTFData,dwRTFDataSize,&lpbDataCurrent,&lpsString);
+ lpwszMessage=(LPWSTR)MEMALLOC(((lpsString.dwSize+MAX_PATH)*sizeof(WCHAR)));
+ if (lpwszMessage)
+ {
+ memmove(lpwszMessage,lpsString.lpszData,lpsString.dwSize);
+ dwMessageSize=MultiByteToWideChar(MRA_CODE_PAGE,0,lpsString.lpszData,lpsString.dwSize,lpwszMessage,(lpsString.dwSize+MAX_PATH));
+ (*(lpwszMessage+dwMessageSize))=0;
+ }else{//
+ dwRetErrorCode=GetLastError();
+ }
+ }else
+ if (dwRTFPartsCount==4)
+ {
+ GetLPS(lpbRTFData,dwRTFDataSize,&lpbDataCurrent,&lpsString);
+ GetLPS(lpbRTFData,dwRTFDataSize,&lpbDataCurrent,&lpsString);
+ lpwszMessage=(LPWSTR)MEMALLOC(lpsString.dwSize);
+ if (lpwszMessage)
+ {
+ memmove(lpwszMessage,lpsString.lpszData,lpsString.dwSize);
+ dwMessageSize=lpsString.dwSize;
+ }else{//
+ dwRetErrorCode=GetLastError();
+ }
+ }else{
+ DebugBreak();
+ }
+ }else{//
+ if (dwRTFPartsCount>2)
+ {
+ GetLPS(lpbRTFData,dwRTFDataSize,&lpbDataCurrent,&lpsString);
+ DebugBreak();
+ }
+
+ lpszMessageExt=(LPSTR)MEMALLOC(lpsRTFString.dwSize);
+ if (lpszMessageExt)
+ {
+ memmove(lpszMessageExt,lpsRTFString.lpszData,lpsRTFString.dwSize);
+ dwMessageExtSize=lpsRTFString.dwSize;
+ }else{//
+ //dwRetErrorCode=GetLastError(); // !
+ DebugBreak();
+ }
+ }
+ }
+ }else{
+ MEMFREE(lpszMessageExt);
+ dwMessageExtSize=0;
+ DebugBreak();
+ }
+ }
+ MEMFREE(lpbCompressed);
+ MEMFREE(lpbRTFData);
+ }
+ }
+ }
+
+
+ // processing
+ if (dwRetErrorCode==NO_ERROR)
+ if (MraAntiSpamReceivedMessageW(plpsFrom->lpszData,plpsFrom->dwSize,dwFlags,lpwszMessage,dwMessageSize)==MESSAGE_NOT_SPAM)
+ {
+ if (dwFlags&(MESSAGE_FLAG_SMS|MESSAGE_SMS_DELIVERY_REPORT))
+ {// SMS //if (IsPhone(plpsFrom->lpszData,plpsFrom->dwSize))
+ char szPhone[MAX_EMAIL_LEN],szEMail[MAX_EMAIL_LEN],szTime[MAX_PATH];
+ LPSTR lpszMessageUTF,lpszBuff;
+ LPWSTR lpwszMessageXMLEncoded;
+ SIZE_T dwBuffLen,dwMessageXMLEncodedSize;
+ INTERNET_TIME itTime;
+
+ dwBuffLen=((dwMessageSize+MAX_PATH)*6);
+ lpszMessageUTF=(LPSTR)MEMALLOC(dwBuffLen);
+ lpwszMessageXMLEncoded=(LPWSTR)MEMALLOC((dwBuffLen*sizeof(WCHAR)));
+ if (lpszMessageUTF && lpwszMessageXMLEncoded)
+ {
+ InternetTimeGetCurrentTime(&itTime);
+ InternetTimeGetString(&itTime,szTime,SIZEOF(szTime),NULL);
+ CopyNumber(szPhone,plpsFrom->lpszData,plpsFrom->dwSize);
+ DB_Mra_GetStaticStringA(NULL,"e-mail",szEMail,SIZEOF(szEMail),NULL);
+
+ EncodeXML(lpwszMessage,dwMessageSize,lpwszMessageXMLEncoded,dwBuffLen,&dwMessageXMLEncodedSize);
+ WideCharToMultiByte(CP_UTF8,0,lpwszMessageXMLEncoded,dwMessageXMLEncodedSize,lpszMessageUTF,dwBuffLen,NULL,NULL);
+ lpszBuff=(LPSTR)lpwszMessageXMLEncoded;
+
+ if (dwFlags&MESSAGE_SMS_DELIVERY_REPORT)
+ {//
+ dwBuffLen=mir_snprintf(lpszBuff,(dwBuffLen*sizeof(WCHAR)),"<sms_delivery_receipt><message_id>%s-1-1955988055-%s</message_id><destination>%s</destination><delivered>No</delivered><submition_time>%s</submition_time><error_code>0</error_code><error><id>15</id><params><param>%s</param></params></error></sms_delivery_receipt>",szEMail,szPhone,szPhone,szTime,lpszMessageUTF);
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,NULL,ICQACKTYPE_SMS,ACKRESULT_FAILED,(HANDLE)0,(LPARAM)lpszBuff,dwBuffLen);
+ }else{// !!!
+ dwBuffLen=mir_snprintf(lpszBuff,(dwBuffLen*sizeof(WCHAR)),"<sms_message><source>Mail.ru</source><destination_UIN>%s</destination_UIN><sender>%s</sender><senders_network>Mail.ru</senders_network><text>%s</text><time>%s</time></sms_message>",szEMail,szPhone,lpszMessageUTF,szTime);
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,NULL,ICQACKTYPE_SMS,ACKRESULT_SUCCESS,(HANDLE)0,(LPARAM)lpszBuff,dwBuffLen);
+ }
+ }else{//
+ dwRetErrorCode=GetLastError();
+ }
+ MEMFREE(lpwszMessageXMLEncoded);
+ MEMFREE(lpszMessageUTF);
+ }else{
+ ccs.hContact=MraHContactFromEmail(plpsFrom->lpszData,plpsFrom->dwSize,TRUE,TRUE,&bAdded);
+ if (bAdded) MraUpdateContactInfo(ccs.hContact);
+
+ if (dwFlags&MESSAGE_FLAG_NOTIFY)
+ {// user typing
+ CallService(MS_PROTO_CONTACTISTYPING,(WPARAM)ccs.hContact,MAILRU_CONTACTISTYPING_TIMEOUT);
+ }else{// text/contact/auth // typing OFF
+ CallService(MS_PROTO_CONTACTISTYPING,(WPARAM)ccs.hContact,PROTOTYPE_CONTACTTYPING_OFF);
+
+ if (dwFlags&MESSAGE_FLAG_MULTICHAT)
+ {// MULTICHAT
+ LPBYTE lpbMultiChatData,lpbDataCurrent;
+ SIZE_T dwMultiChatDataSize;
+ DWORD dwMultiChatEventType;
+ MRA_LPS lpsEMailInMultiChat,lpsString,lpsMultichatName;
+
+ lpbMultiChatData=(LPBYTE)plpsMultiChatData->lpszData;
+ dwMultiChatDataSize=plpsMultiChatData->dwSize;
+ lpbDataCurrent=lpbMultiChatData;
+
+ dwMultiChatEventType=GetUL(&lpbDataCurrent);// type
+ GetLPS(lpbMultiChatData,dwMultiChatDataSize,&lpbDataCurrent,&lpsMultichatName);// multichat_name
+ GetLPS(lpbMultiChatData,dwMultiChatDataSize,&lpbDataCurrent,&lpsEMailInMultiChat);
+
+ switch(dwMultiChatEventType){
+ case MULTICHAT_MESSAGE:
+ MraChatSessionMessageAdd(ccs.hContact,lpsEMailInMultiChat.lpszData,lpsEMailInMultiChat.dwSize,lpwszMessage,dwMessageSize,dwTime);// LPS sender
+ break;
+ case MULTICHAT_ADD_MEMBERS:
+ MraChatSessionMembersAdd(ccs.hContact,lpsEMailInMultiChat.lpszData,lpsEMailInMultiChat.dwSize,dwTime);// LPS sender
+ GetLPS(lpbMultiChatData,dwMultiChatDataSize,&lpbDataCurrent,&lpsString);// CLPS members
+ MraChatSessionSetIviter(ccs.hContact,lpsEMailInMultiChat.lpszData,lpsEMailInMultiChat.dwSize);
+ case MULTICHAT_MEMBERS:
+ {
+ LPBYTE lpbMultiChatDataLocal,lpbDataCurrentLocal;
+ SIZE_T i,dwMultiChatMembersCount,dwMultiChatDataLocalSize;
+
+ if (dwMultiChatEventType==MULTICHAT_MEMBERS) lpsString=lpsEMailInMultiChat;
+
+ lpbMultiChatDataLocal=(LPBYTE)lpsString.lpszData;
+ dwMultiChatDataLocalSize=lpsString.dwSize;
+ lpbDataCurrentLocal=lpbMultiChatDataLocal;
+
+ dwMultiChatMembersCount=GetUL(&lpbDataCurrentLocal);// count
+ for (i=0;i<dwMultiChatMembersCount;i++)
+ {
+ if (GetLPS(lpbMultiChatDataLocal,dwMultiChatDataLocalSize,&lpbDataCurrentLocal,&lpsString)==NO_ERROR)
+ {// CLPS members
+ MraChatSessionJoinUser(ccs.hContact,lpsString.lpszData,lpsString.dwSize,((dwMultiChatEventType==MULTICHAT_MEMBERS)? 0:dwTime));
+ }
+ }
+
+ if (dwMultiChatEventType==MULTICHAT_MEMBERS)
+ {
+ GetLPS(lpbMultiChatData,dwMultiChatDataSize,&lpbDataCurrent,&lpsEMailInMultiChat);// [ LPS owner ]
+ MraChatSessionSetOwner(ccs.hContact,lpsEMailInMultiChat.lpszData,lpsEMailInMultiChat.dwSize);
+ }
+ }
+ break;
+ case MULTICHAT_ATTACHED:
+ MraChatSessionJoinUser(ccs.hContact,lpsEMailInMultiChat.lpszData,lpsEMailInMultiChat.dwSize,dwTime);// LPS member
+ break;
+ case MULTICHAT_DETACHED:
+ MraChatSessionLeftUser(ccs.hContact,lpsEMailInMultiChat.lpszData,lpsEMailInMultiChat.dwSize,dwTime);// LPS member
+ break;
+ case MULTICHAT_INVITE:
+ MraChatSessionInvite(ccs.hContact,lpsEMailInMultiChat.lpszData,lpsEMailInMultiChat.dwSize,dwTime);// LPS sender
+ MraSendCommand_AddContactW(ccs.hContact,(CONTACT_FLAG_VISIBLE|CONTACT_FLAG_MULTICHAT|CONTACT_FLAG_UNICODE_NAME),-1,plpsFrom->lpszData,plpsFrom->dwSize,lpsMultichatName.lpwszData,(lpsMultichatName.dwSize/sizeof(WCHAR)),NULL,0,NULL,0,0);
+ break;
+ default:
+ DebugBreak();
+ break;
+ }
+ }else
+ if (dwFlags&MESSAGE_FLAG_AUTHORIZE)
+ {// auth request
+ BYTE btBuff[BUFF_SIZE_BLOB];
+ BOOL bAutoGrandAuth=FALSE;
+
+ if (IsEMailChatAgent(plpsFrom->lpszData,plpsFrom->dwSize))
+ {
+ bAutoGrandAuth=FALSE;
+ }else{
+ if (DBGetContactSettingByte(ccs.hContact,"CList","NotOnList",0))
+ {//
+ if (DB_Mra_GetByte(NULL,"AutoAuthGrandNewUsers",MRA_DEFAULT_AUTO_AUTH_GRAND_NEW_USERS)) bAutoGrandAuth=TRUE;
+ }else{//
+ if (DB_Mra_GetByte(NULL,"AutoAuthGrandUsersInCList",MRA_DEFAULT_AUTO_AUTH_GRAND_IN_CLIST)) bAutoGrandAuth=TRUE;
+ }
+ }
+
+ if (bAdded) DBWriteContactSettingByte(ccs.hContact,"CList","Hidden",1);
+ if (bAutoGrandAuth)
+ {// auto grand auth
+ DBEVENTINFO dbei={0};
+
+ dbei.cbSize=sizeof(dbei);
+ dbei.szModule=PROTOCOL_NAMEA;
+ dbei.timestamp=_time32(NULL);
+ dbei.flags=DBEF_READ;
+ dbei.eventType=EVENTTYPE_AUTHREQUEST;
+ dbei.pBlob=(PBYTE)btBuff;
+
+ CreateBlobFromContact(ccs.hContact,lpwszMessage,dwMessageSize,btBuff,SIZEOF(btBuff),(SIZE_T*)&dbei.cbBlob);
+ CallService(MS_DB_EVENT_ADD,(WPARAM)NULL,(LPARAM)&dbei);
+ MraSendCommand_Authorize(plpsFrom->lpszData,plpsFrom->dwSize);
+ }else{
+ ccs.szProtoService=PSR_AUTH;
+ pre.szMessage=(LPSTR)btBuff;
+ CreateBlobFromContact(ccs.hContact,lpwszMessage,dwMessageSize,btBuff,SIZEOF(btBuff),(SIZE_T*)&pre.lParam);
+ CallService(MS_PROTO_CHAINRECV,0,(LPARAM)&ccs);
+ }
+ }else{
+ DBDeleteContactSetting(ccs.hContact,"CList","Hidden");
+
+ if (dwFlags&MESSAGE_FLAG_CONTACT)
+ {// contacts received
+ LPBYTE lpbBuffer,lpbBufferCurPos;
+
+ lpbBuffer=(LPBYTE)MEMALLOC((dwMessageSize+MAX_PATH));
+ if (lpbBuffer)
+ {
+ ccs.szProtoService=PSR_CONTACTS;
+ pre.flags=0;
+ pre.szMessage=(LPSTR)lpbBuffer;
+ pre.lParam=WideCharToMultiByte(MRA_CODE_PAGE,0,lpwszMessage,dwMessageSize,(LPSTR)lpbBuffer,(dwMessageSize+MAX_PATH),NULL,NULL);
+
+ lpbBufferCurPos=lpbBuffer;
+ while(TRUE)
+ {// ; 0
+ lpbBufferCurPos=(LPBYTE)MemoryFindByte((lpbBufferCurPos-lpbBuffer),lpbBuffer,pre.lParam,';');
+ if (lpbBufferCurPos)
+ {// founded
+ (*lpbBufferCurPos)=0;
+ lpbBufferCurPos++;
+ }else{
+ break;
+ }
+ }
+ CallService(MS_PROTO_CHAINRECV,0,(LPARAM)&ccs);
+ MEMFREE(lpbBuffer);
+ }else{//
+ dwRetErrorCode=GetLastError();
+ }
+ }else
+ if (dwFlags&MESSAGE_FLAG_ALARM)
+ {// alarm
+ if (masMraSettings.heNudgeReceived)
+ {
+ NotifyEventHooks(masMraSettings.heNudgeReceived,(WPARAM)ccs.hContact,NULL);
+ }else{
+ pre.flags=0;
+ pre.szMessage=(LPSTR)TranslateTS(MRA_ALARM_MESSAGE);
+ //pre.lParam=lstrlenA(pre.szMessage);
+ ccs.szProtoService=PSR_MESSAGE;
+ CallService(MS_PROTO_CHAINRECV,0,(LPARAM)&ccs);
+ }
+ }else{// standart message// flash animation
+ if ((dwFlags&MESSAGE_FLAG_RTF) && (dwFlags&MESSAGE_FLAG_FLASH)==0 && lpszMessageExt && dwMessageExtSize && DB_Mra_GetByte(NULL,"RTFReceiveEnable",MRA_DEFAULT_RTF_RECEIVE_ENABLE))
+ {// ANSI, RTF
+ pre.flags=0;
+ pre.szMessage=lpszMessageExt;
+ //pre.lParam=dwMessageExtSize;
+ ccs.szProtoService=PSR_MESSAGE;
+ CallService(MS_PROTO_CHAINRECV,0,(LPARAM)&ccs);
+ }else{
+ LPSTR lpszMessageUTF;// some plugins can change pre.szMessage pointer and we failed to free it
+
+ lpszMessageUTF=(LPSTR)MEMALLOC(((dwMessageSize+MAX_PATH)*sizeof(WCHAR)));
+ if (lpszMessageUTF)
+ {
+ pre.szMessage=lpszMessageUTF;
+ pre.flags=PREF_UTF;
+ //pre.lParam=
+ WideCharToMultiByte(CP_UTF8,0,lpwszMessage,dwMessageSize,lpszMessageUTF,((dwMessageSize+MAX_PATH)*sizeof(WCHAR)),NULL,NULL);
+ ccs.szProtoService=PSR_MESSAGE;
+ CallService(MS_PROTO_CHAINRECV,0,(LPARAM)&ccs);
+ MEMFREE(lpszMessageUTF);
+ }else{//
+ dwRetErrorCode=GetLastError();
+ }
+ }
+ if (dwFlags&MESSAGE_FLAG_SYSTEM)
+ {
+ MraPopupShowW(ccs.hContact,MRA_POPUP_TYPE_INFORMATION,0,TranslateW(L"Mail.ru System notify"),(LPWSTR)pre.szMessage);
+ }
+ }
+ }
+ }
+ }
+ }else{// spam blocked
+ if (DB_Mra_GetByte(NULL,"AntiSpamSendSpamReportToSrv",MRA_ANTISPAM_DEFAULT_SEND_SPAM_REPORT_TO_SERVER))
+ {//
+ //MraSendCommand_MessageAskW(1,(dwFlags|MESSAGE_FLAG_SPAMF_SPAM),plpsFrom->lpszData,plpsFrom->dwSize,plpsText->lpwszData,plpsText->dwSize,plpsRFTText->lpszData,plpsRFTText->dwSize);
+ }
+ dwRetErrorCode=ERROR_ACCESS_DENIED;
+ }
+
+ if (lpwszMessage!=plpsText->lpwszData && lpwszMessage!=(LPWSTR)lpszMessageExt) MEMFREE(lpwszMessage);
+ MEMFREE(lpszMessageExt);
+
+return(dwRetErrorCode);
+}
+
+
+
+
+
+DWORD GetMraXStatusIDFromMraUriStatus(LPSTR lpszStatusUri,SIZE_T dwStatusUriSize)
+{
+ DWORD dwRet=MRA_XSTATUS_UNKNOWN;
+
+ if (lpszStatusUri)
+ {
+ for(SIZE_T i=0;lpcszStatusUri[i];i++)
+ {
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpcszStatusUri[i],-1,lpszStatusUri,dwStatusUriSize)==CSTR_EQUAL)
+ {
+ dwRet=i;
+ break;
+ }
+ }
+ }
+return(dwRet);
+}
+
+
+DWORD GetMraStatusFromMiradaStatus(DWORD dwMirandaStatus,DWORD dwXStatusMir,DWORD *pdwXStatusMra)
+{
+ DWORD dwRet;
+
+ if (IsXStatusValid(dwXStatusMir))
+ {
+ if (pdwXStatusMra) (*pdwXStatusMra)=(dwXStatusMir+MRA_XSTATUS_INDEX_OFFSET-1);
+ dwRet=STATUS_USER_DEFINED;
+ }else{
+ switch(dwMirandaStatus){
+ case ID_STATUS_OFFLINE:
+ if (pdwXStatusMra) (*pdwXStatusMra)=MRA_XSTATUS_OFFLINE;
+ dwRet=STATUS_OFFLINE;
+ break;
+ case ID_STATUS_ONLINE:
+ if (pdwXStatusMra) (*pdwXStatusMra)=MRA_XSTATUS_ONLINE;
+ dwRet=STATUS_ONLINE;
+ break;
+ case ID_STATUS_AWAY:
+ case ID_STATUS_NA:
+ case ID_STATUS_ONTHEPHONE:
+ case ID_STATUS_OUTTOLUNCH:
+ if (pdwXStatusMra) (*pdwXStatusMra)=MRA_XSTATUS_AWAY;
+ dwRet=STATUS_AWAY;
+ break;
+ case ID_STATUS_DND:
+ case ID_STATUS_OCCUPIED:
+ if (pdwXStatusMra) (*pdwXStatusMra)=MRA_XSTATUS_DND;
+ dwRet=STATUS_USER_DEFINED;
+ break;
+ case ID_STATUS_FREECHAT:
+ if (pdwXStatusMra) (*pdwXStatusMra)=MRA_XSTATUS_CHAT;
+ dwRet=STATUS_USER_DEFINED;
+ break;
+ case ID_STATUS_INVISIBLE:
+ if (pdwXStatusMra) (*pdwXStatusMra)=MRA_XSTATUS_INVISIBLE;
+ dwRet=(STATUS_ONLINE|STATUS_FLAG_INVISIBLE);
+ break;
+ default:
+ if (pdwXStatusMra) (*pdwXStatusMra)=MRA_XSTATUS_OFFLINE;
+ dwRet=STATUS_OFFLINE;
+ break;
+ }
+ }
+return(dwRet);
+}
+
+
+DWORD GetMiradaStatusFromMraStatus(DWORD dwMraStatus,DWORD dwXStatusMra,DWORD *pdwXStatusMir)
+{
+ DWORD dwRet;
+
+ if (pdwXStatusMir) (*pdwXStatusMir)=0;
+
+ switch(dwMraStatus){
+ case STATUS_OFFLINE:
+ dwRet=ID_STATUS_OFFLINE;
+ break;
+ case STATUS_ONLINE:
+ dwRet=ID_STATUS_ONLINE;
+ break;
+ case STATUS_AWAY:
+ dwRet=ID_STATUS_AWAY;
+ break;
+ case STATUS_UNDETERMINATED:
+ dwRet=ID_STATUS_OFFLINE;
+ break;
+ case STATUS_USER_DEFINED:
+ switch(dwXStatusMra){
+ //case MRA_XSTATUS_OFFLINE: dwRet=ID_STATUS_OFFLINE; break;
+ //case MRA_XSTATUS_ONLINE: dwRet=ID_STATUS_ONLINE; break;
+ //case MRA_XSTATUS_AWAY: dwRet=ID_STATUS_AWAY; break;
+ //case MRA_XSTATUS_INVISIBLE: dwRet=ID_STATUS_INVISIBLE; break;
+ case MRA_XSTATUS_DND: dwRet=ID_STATUS_DND; break;
+ case MRA_XSTATUS_CHAT: dwRet=ID_STATUS_FREECHAT; break;
+ case MRA_XSTATUS_UNKNOWN:
+ if (pdwXStatusMir) (*pdwXStatusMir)=MRA_MIR_XSTATUS_UNKNOWN;
+ dwRet=ID_STATUS_ONLINE;
+ break;
+ default:
+ if (pdwXStatusMir) (*pdwXStatusMir)=(dwXStatusMra-MRA_XSTATUS_INDEX_OFFSET+1);
+ dwRet=ID_STATUS_ONLINE;
+ break;
+ }
+ break;
+ default:// STATUS_FLAG_INVISIBLE
+ if (dwMraStatus&STATUS_FLAG_INVISIBLE)
+ {
+ dwRet=ID_STATUS_INVISIBLE;
+ }else{
+ dwRet=ID_STATUS_OFFLINE;
+ DebugBreak();
+ }
+ break;
+ }
+return(dwRet);
+}
+
+
+DWORD GetUL(LPBYTE *plpData)
+{
+ DWORD dwRet=(*(DWORD*)(*plpData));
+ (*plpData)+=sizeof(DWORD);
+return(dwRet);
+}
+
+
+DWORDLONG GetUIDL(LPBYTE *plpData)
+{
+ DWORDLONG dwRet=(*(DWORDLONG*)(*plpData));
+ (*plpData)+=sizeof(DWORDLONG);
+return(dwRet);
+}
+
+
+MRA_GUID GetGUID(LPBYTE *plpData)
+{
+ MRA_GUID guidRet=(*(MRA_GUID*)(*plpData));
+ (*plpData)+=sizeof(MRA_GUID);
+return(guidRet);
+}
+
+
+DWORD GetLPS(LPBYTE lpbData,DWORD dwDataSize,LPBYTE *plpCurrentData,MRA_LPS *plpsString)
+{
+ DWORD dwRetErrorCode;
+ LPBYTE lpbDataEnd=(lpbData+dwDataSize);
+
+ if (lpbDataEnd>=((*plpCurrentData)+sizeof(DWORD)))
+ {//
+ if (lpbDataEnd>=((*plpCurrentData)+sizeof(DWORD)+(*(DWORD*)(*plpCurrentData))))
+ {//
+ plpsString->dwSize=(*(DWORD*)(*plpCurrentData));
+ plpsString->lpszData=(LPSTR)((*plpCurrentData)+sizeof(DWORD));
+ (*plpCurrentData)+=(sizeof(DWORD)+plpsString->dwSize);
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ plpsString->dwSize=0;
+ plpsString->lpszData=NULL;
+ dwRetErrorCode=ERROR_INVALID_USER_BUFFER;
+ }
+ }else{
+ plpsString->dwSize=0;
+ plpsString->lpszData=NULL;
+ dwRetErrorCode=ERROR_INVALID_USER_BUFFER;
+ }
+return(dwRetErrorCode);
+}
+
+
diff --git a/protocols/MRA/Mra_svcs.cpp b/protocols/MRA/Mra_svcs.cpp
new file mode 100644
index 0000000000..55621e4bce
--- /dev/null
+++ b/protocols/MRA/Mra_svcs.cpp
@@ -0,0 +1,2302 @@
+#include "Mra.h"
+#include "proto.h"
+
+
+
+
+
+INT_PTR MraXStatusMenu (WPARAM wParam,LPARAM lParam,LPARAM param);
+
+int MraContactDeleted (WPARAM wParam,LPARAM lParam);
+int MraDbSettingChanged (WPARAM wParam,LPARAM lParam);
+int MraRebuildContactMenu (WPARAM wParam,LPARAM lParam);
+int MraExtraIconsApply (WPARAM wParam,LPARAM lParam);
+int MraExtraIconsRebuild (WPARAM wParam,LPARAM lParam);
+int MraRebuildStatusMenu (WPARAM wParam,LPARAM lParam);
+int MraMusicChanged (WPARAM wParam,LPARAM lParam);
+
+DWORD MraSendNewStatus (DWORD dwStatusMir,DWORD dwXStatusMir,LPWSTR lpwszStatusTitle,SIZE_T dwStatusTitleSize,LPWSTR lpwszStatusDesc,SIZE_T dwStatusDescSize);
+
+
+HANDLE AddToListByEmail (MRA_LPS *plpsEMail,MRA_LPS *plpsNick,MRA_LPS *plpsFirstName,MRA_LPS *plpsLastName,DWORD dwFlags);
+
+
+
+INT_PTR LoadServices(void)
+{
+ CHAR szServiceFunction[MAX_PATH],*pszServiceFunctionName;
+
+ memmove(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
+ pszServiceFunctionName=szServiceFunction+PROTOCOL_NAME_LEN;
+
+ // Service creation
+ for (SIZE_T i=0;i<SIZEOF(siPluginServices);i++)
+ {
+ memmove(pszServiceFunctionName,siPluginServices[i].lpszName,(lstrlenA(siPluginServices[i].lpszName)+1));
+ CreateServiceFunction(szServiceFunction,siPluginServices[i].lpFunc);
+ }
+
+ DebugPrintCRLFW(L"MRA/LoadServices - DONE");
+return(0);
+}
+
+
+INT_PTR LoadModules(void)
+{
+ CHAR szServiceFunction[MAX_PATH],*pszServiceFunctionName;
+
+ memmove(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
+ pszServiceFunctionName=szServiceFunction+PROTOCOL_NAME_LEN;
+
+ IconsLoad();
+ masMraSettings.hExtraXstatusIcon=ExtraIcon_Register("MRAXstatus","Mail.ru Xstatus","MRA_xstatus25",MraExtraIconsRebuild,MraExtraIconsApply,NULL,NULL);
+ masMraSettings.hExtraInfo=ExtraIcon_Register("MRAStatus","Mail.ru extra info","MRA_xstatus49",MraExtraIconsRebuild,MraExtraIconsApply,NULL,NULL);
+
+
+ masMraSettings.hHookOptInitialize=HookEvent(ME_OPT_INITIALISE,OptInit);
+ masMraSettings.hHookContactDeleted=HookEvent(ME_DB_CONTACT_DELETED,MraContactDeleted);
+ masMraSettings.hHookSettingChanged=HookEvent(ME_DB_CONTACT_SETTINGCHANGED,MraDbSettingChanged);
+ masMraSettings.hHookRebuildCMenu=HookEvent(ME_CLIST_PREBUILDCONTACTMENU,MraRebuildContactMenu);
+ if (ServiceExists(MS_NUDGE_SEND))
+ {
+ memmove(pszServiceFunctionName,MS_NUDGE,sizeof(MS_NUDGE));
+ masMraSettings.heNudgeReceived=CreateHookableEvent(szServiceFunction);
+ }
+ masMraSettings.hHookExtraIconsApply=HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY,MraExtraIconsApply);
+ masMraSettings.hHookExtraIconsRebuild=HookEvent(ME_CLIST_EXTRA_LIST_REBUILD,MraExtraIconsRebuild);
+
+
+ // Main menu initialization
+ CListCreateMenu(2000060000,500085000,(HANDLE)LoadImage(masMraSettings.hInstance,MAKEINTRESOURCE(IDI_MRA),IMAGE_ICON,0,0,LR_SHARED),NULL,MS_CLIST_ADDMAINMENUITEM,gdiMenuItems,masMraSettings.hMainMenuIcons,SIZEOF(gdiMenuItems),masMraSettings.hMainMenuItems);
+
+ // Contact menu initialization
+ CListCreateMenu(2000060000,-500050000,NULL,NULL,MS_CLIST_ADDCONTACTMENUITEM,gdiContactMenuItems,masMraSettings.hContactMenuIcons,(SIZEOF(gdiContactMenuItems) - ((masMraSettings.heNudgeReceived==NULL)? 0:1)),masMraSettings.hContactMenuItems);
+
+ // xstatus menu
+ if (ServiceExists(MS_CLIST_ADDSTATUSMENUITEM))
+ {
+ InitXStatusIcons();
+ for(SIZE_T i=0;i<MRA_XSTATUS_COUNT;i++)
+ {
+ mir_snprintf(pszServiceFunctionName,(SIZEOF(szServiceFunction)-PROTOCOL_NAME_LEN),"/menuXStatus%ld",i);
+ CreateServiceFunctionParam(szServiceFunction,MraXStatusMenu,i);
+ }
+
+ masMraSettings.bHideXStatusUI=FALSE;
+ masMraSettings.dwXStatusMode=DB_Mra_GetByte(NULL,DBSETTING_XSTATUSID,MRA_MIR_XSTATUS_NONE);
+ if (IsXStatusValid(masMraSettings.dwXStatusMode)==FALSE) masMraSettings.dwXStatusMode=MRA_MIR_XSTATUS_NONE;
+
+ masMraSettings.hHookRebuildStatusMenu=HookEvent(ME_CLIST_PREBUILDSTATUSMENU,MraRebuildStatusMenu);
+ MraRebuildStatusMenu(0,0);
+ }
+
+ MraExtraIconsRebuild(0,0);
+
+ masMraSettings.hWATrack=HookEvent(ME_WAT_NEWSTATUS,MraMusicChanged);
+
+
+ mir_snprintf(masMraSettings.szNewMailSound,SIZEOF(masMraSettings.szNewMailSound),"%s: %s",PROTOCOL_NAMEA,MRA_SOUND_NEW_EMAIL);
+ SkinAddNewSoundEx(masMraSettings.szNewMailSound,PROTOCOL_NAMEA,MRA_SOUND_NEW_EMAIL);
+
+ masMraSettings.bChatExist=MraChatRegister();
+
+
+ DebugPrintCRLFW(L"MRA/LoadModules - DONE");
+return(0);
+}
+
+
+void UnloadModules()
+{
+ CHAR szServiceFunction[MAX_PATH],*pszServiceFunctionName;
+
+ memmove(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
+ pszServiceFunctionName=szServiceFunction+PROTOCOL_NAME_LEN;
+
+ if (masMraSettings.bChatExist)
+ {// destroy all chat sessions
+ MraChatSessionDestroy(NULL);
+ }
+
+ // xstatus menu destroy
+ if (ServiceExists(MS_CLIST_ADDSTATUSMENUITEM))
+ {
+ if (masMraSettings.hHookRebuildStatusMenu) {UnhookEvent(masMraSettings.hHookRebuildStatusMenu); masMraSettings.hHookRebuildStatusMenu=NULL;}
+
+ memset(masMraSettings.hXStatusMenuItems, 0, sizeof(masMraSettings.hXStatusMenuItems));
+ // Service deletion
+ for(SIZE_T i=0;i<MRA_XSTATUS_COUNT;i++)
+ {
+ mir_snprintf(pszServiceFunctionName,(SIZEOF(szServiceFunction)-PROTOCOL_NAME_LEN),"/menuXStatus%ld",i);
+ DestroyServiceFunction(szServiceFunction);
+ }
+ DestroyXStatusIcons();
+ }
+
+ // Main menu destroy
+ CListDestroyMenu(gdiMenuItems,SIZEOF(gdiMenuItems));
+ memset(masMraSettings.hMainMenuItems, 0, sizeof(masMraSettings.hMainMenuItems));
+
+ // Contact menu destroy
+ CListDestroyMenu(gdiContactMenuItems,(SIZEOF(gdiContactMenuItems) - ((masMraSettings.heNudgeReceived==NULL)? 0:1)));
+ memset(masMraSettings.hContactMenuItems, 0, sizeof(masMraSettings.hContactMenuItems));
+
+ if (masMraSettings.heNudgeReceived) {DestroyHookableEvent(masMraSettings.heNudgeReceived); masMraSettings.heNudgeReceived=NULL;}
+ if (masMraSettings.hWATrack) {UnhookEvent(masMraSettings.hWATrack); masMraSettings.hWATrack=NULL;}
+ if (masMraSettings.hHookIconsChanged) {UnhookEvent(masMraSettings.hHookIconsChanged); masMraSettings.hHookIconsChanged=NULL;}
+ if (masMraSettings.hHookExtraIconsRebuild) {UnhookEvent(masMraSettings.hHookExtraIconsRebuild); masMraSettings.hHookExtraIconsRebuild=NULL;}
+ if (masMraSettings.hHookExtraIconsApply) {UnhookEvent(masMraSettings.hHookExtraIconsApply); masMraSettings.hHookExtraIconsApply=NULL;}
+ if (masMraSettings.hHookRebuildCMenu) {UnhookEvent(masMraSettings.hHookRebuildCMenu); masMraSettings.hHookRebuildCMenu=NULL;}
+ if (masMraSettings.hHookSettingChanged) {UnhookEvent(masMraSettings.hHookSettingChanged); masMraSettings.hHookSettingChanged=NULL;}
+ if (masMraSettings.hHookContactDeleted) {UnhookEvent(masMraSettings.hHookContactDeleted); masMraSettings.hHookContactDeleted=NULL;}
+ if (masMraSettings.hHookOptInitialize) {UnhookEvent(masMraSettings.hHookOptInitialize); masMraSettings.hHookOptInitialize=NULL;}
+
+ IconsUnLoad();
+
+
+ DebugPrintCRLFW(L"MRA/UnloadModules - DONE");
+}
+
+
+void UnloadServices()
+{
+ CHAR szServiceFunction[MAX_PATH],*pszServiceFunctionName;
+
+ memmove(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
+ pszServiceFunctionName=szServiceFunction+PROTOCOL_NAME_LEN;
+
+
+ // destroy plugin services
+ for (SIZE_T i=0;i<SIZEOF(siPluginServices);i++)
+ {
+ memmove(pszServiceFunctionName,siPluginServices[i].lpszName,(lstrlenA(siPluginServices[i].lpszName)+1));
+ DestroyServiceFunction(szServiceFunction);
+ }
+
+ DebugPrintCRLFW(L"MRA/UnloadServices - DONE");
+}
+
+
+
+void SetExtraIcons(HANDLE hContact)
+{
+ if(masMraSettings.hHookExtraIconsApply)
+ {
+ DWORD dwID,dwGroupID,dwContactSeverFlags;
+
+ if (GetContactBasicInfoW(hContact,&dwID,&dwGroupID,NULL,&dwContactSeverFlags,NULL,NULL,0,NULL,NULL,0,NULL,NULL,0,NULL)==NO_ERROR)
+ {
+ DWORD dwIconID=-1;
+ DWORD dwXStatus=MRA_MIR_XSTATUS_NONE;
+
+ if(masMraSettings.bLoggedIn)
+ {
+ dwXStatus=DB_Mra_GetByte(hContact,DBSETTING_XSTATUSID,MRA_MIR_XSTATUS_NONE);
+
+ if(dwID==-1)
+ {
+ if(dwContactSeverFlags==-1)
+ {
+ dwIconID=ADV_ICON_DELETED;
+ }else{
+ dwIconID=ADV_ICON_NOT_ON_SERVER;
+ }
+ }else{
+ if (dwGroupID==103)
+ {//***deb
+ dwIconID=ADV_ICON_PHONE;
+ }else{
+ if(dwContactSeverFlags)
+ if(dwContactSeverFlags==-1)
+ {
+ dwIconID=ADV_ICON_DELETED;
+ }else{
+ dwIconID=ADV_ICON_NOT_AUTHORIZED;
+ }
+ }
+ }
+ }
+
+ if (dwIconID==-1)
+ {
+ SIZE_T dwBlogStatusMsgSize=0;
+
+ DB_Mra_GetStaticStringW(hContact,DBSETTING_BLOGSTATUS,NULL,0,&dwBlogStatusMsgSize);
+ if (dwBlogStatusMsgSize) dwIconID=ADV_ICON_BLOGSTATUS;
+ }
+
+ ExtraSetIcon(masMraSettings.hExtraXstatusIcon,hContact,((IsXStatusValid(dwXStatus) || dwXStatus==MRA_MIR_XSTATUS_UNKNOWN)? masMraSettings.hXStatusAdvancedStatusItems[dwXStatus]:NULL),EXTRA_ICON_ADV1);
+ ExtraSetIcon(masMraSettings.hExtraInfo,hContact,((dwIconID!=-1)? masMraSettings.hAdvancedStatusItems[dwIconID]:NULL),EXTRA_ICON_ADV2);
+ }
+ }
+}
+
+
+
+INT_PTR MraXStatusMenu(WPARAM wParam,LPARAM lParam,LPARAM param)
+{
+ if (MraRequestXStatusDetails(param)==FALSE) MraSetXStatusInternal(param);
+return(0);
+}
+
+
+INT_PTR MraGotoInbox(WPARAM wParam,LPARAM lParam)
+{
+ MraMPopSessionQueueAddUrl(masMraSettings.hMPopSessionQueue,MRA_WIN_INBOX_URL,sizeof(MRA_WIN_INBOX_URL));
+return(0);
+}
+
+INT_PTR MraShowInboxStatus(WPARAM wParam,LPARAM lParam)
+{
+ MraUpdateEmailStatus(NULL,0,NULL,0,0,0);
+return(0);
+}
+
+INT_PTR MraSendSMS(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=0;
+
+ if (masMraSettings.bLoggedIn && wParam && lParam)
+ {
+ LPSTR lpszMessageUTF;
+ LPWSTR lpwszMessageXMLEncoded,lpwszMessageXMLDecoded;
+ SIZE_T dwMessageUTFSize,dwBuffLen,dwMessageXMLEncodedSize,dwMessageXMLDecodedSize;
+
+ lpszMessageUTF=(LPSTR)lParam;
+ dwMessageUTFSize=lstrlenA(lpszMessageUTF);
+ dwBuffLen=(dwMessageUTFSize+MAX_PATH);
+ lpwszMessageXMLEncoded=(LPWSTR)MEMALLOC((dwBuffLen*sizeof(WCHAR)));
+ lpwszMessageXMLDecoded=(LPWSTR)MEMALLOC((dwBuffLen*sizeof(WCHAR)));
+ if (lpwszMessageXMLEncoded && lpwszMessageXMLDecoded)
+ {
+ dwMessageXMLEncodedSize=MultiByteToWideChar(CP_UTF8,0,lpszMessageUTF,dwMessageUTFSize,lpwszMessageXMLEncoded,dwBuffLen);
+ DecodeXML(lpwszMessageXMLEncoded,dwMessageXMLEncodedSize,lpwszMessageXMLDecoded,dwBuffLen,&dwMessageXMLDecodedSize);
+
+ if (dwMessageXMLDecodedSize)
+ {
+ iRet=MraSendCommand_SMSW(NULL,(LPSTR)wParam,lstrlenA((LPSTR)wParam),lpwszMessageXMLDecoded,dwMessageXMLDecodedSize);
+ /*{//
+ char szBuff[16384];
+ DWORD dwFlags;
+ MRA_LPS lpsEMail,lpsText,lpsRTFText={0};
+
+ dwFlags=(MESSAGE_FLAG_SMS|MESSAGE_FLAG_CP1251);
+ lpsEMail.lpszData=(LPSTR)wParam;
+ lpsEMail.dwSize=lstrlenA(lpsEMail.lpszData);
+ lpsText.lpszData=szBuff;//LPS ## message ##
+ lpsText.dwSize=WideCharToMultiByte(MRA_CODE_PAGE,0,lpwszMessageXMLDecoded,dwMessageXMLDecodedSize,szBuff,sizeof(szBuff),NULL,NULL);
+
+ MraRecvCommand_Message((DWORD)_time32(NULL),dwFlags,&lpsEMail,&lpsText,&lpsRTFText,NULL);
+ }//*/
+ }else{// conversion failed?
+ DebugBreak();
+ }
+ }
+ MEMFREE(lpwszMessageXMLDecoded);
+ MEMFREE(lpwszMessageXMLEncoded);
+ }
+return(iRet);
+}
+
+INT_PTR MraEditProfile(WPARAM wParam,LPARAM lParam)
+{
+ MraMPopSessionQueueAddUrl(masMraSettings.hMPopSessionQueue,MRA_EDIT_PROFILE_URL,sizeof(MRA_EDIT_PROFILE_URL));
+return(0);
+}
+
+INT_PTR MyAlbum(WPARAM wParam,LPARAM lParam)
+{
+return(MraViewAlbum(0,0));
+}
+
+INT_PTR MyBlog(WPARAM wParam,LPARAM lParam)
+{
+return(MraReadBlog(0,0));
+}
+
+INT_PTR MyBlogStatus(WPARAM wParam,LPARAM lParam)
+{
+return(MraReplyBlogStatus(0,0));
+}
+
+INT_PTR MyVideo(WPARAM wParam,LPARAM lParam)
+{
+return(MraViewVideo(0,0));
+}
+
+INT_PTR MyAnswers(WPARAM wParam,LPARAM lParam)
+{
+return(MraAnswers(0,0));
+}
+
+INT_PTR MyWorld(WPARAM wParam,LPARAM lParam)
+{
+return(MraWorld(0,0));
+}
+
+INT_PTR MraZhuki(WPARAM wParam,LPARAM lParam)
+{
+ MraMPopSessionQueueAddUrl(masMraSettings.hMPopSessionQueue,MRA_ZHUKI_URL,sizeof(MRA_ZHUKI_URL));
+return(0);
+}
+
+INT_PTR MraChat(WPARAM wParam,LPARAM lParam)
+{
+ MraMPopSessionQueueAddUrl(masMraSettings.hMPopSessionQueue,MRA_CHAT_URL,sizeof(MRA_CHAT_URL));
+return(0);
+}
+
+INT_PTR MraWebSearch(WPARAM wParam,LPARAM lParam)
+{
+ CallService(MS_UTILS_OPENURL,TRUE,(LPARAM)MRA_SEARCH_URL);
+return(0);
+}
+
+INT_PTR MraUpdateAllUsersInfo(WPARAM wParam,LPARAM lParam)
+{
+ if (MessageBox(NULL,TranslateW(L"Are you sure?"),TranslateW(MRA_UPD_ALL_USERS_INFO_STR),(MB_YESNO|MB_ICONQUESTION))==IDYES)
+ {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ SIZE_T dwEMailSize;
+ HANDLE hContact;
+
+ for(hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ {
+ if (IsContactMra(hContact))
+ if (DB_Mra_GetStaticStringA(hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ MraSendCommand_WPRequestByEMail(hContact,ACKTYPE_GETINFO,szEMail,dwEMailSize);
+ }
+ }
+ }
+return(0);
+}
+
+INT_PTR MraCheckUpdatesUsersAvt(WPARAM wParam,LPARAM lParam)
+{
+ if (MessageBox(NULL,TranslateW(L"Are you sure?"),TranslateW(MRA_CHK_UPDATES_USERS_AVATARS_STR),(MB_YESNO|MB_ICONQUESTION))==IDYES)
+ {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ SIZE_T dwEMailSize;
+ HANDLE hContact;
+
+ for(hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ {
+ if (IsContactMra(hContact))
+ if (DB_Mra_GetStaticStringA(hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ if (IsEMailChatAgent(szEMail,dwEMailSize)==FALSE)// , MraAvatarsQueueGetAvatarSimple
+ {
+ MraAvatarsQueueGetAvatarSimple(masMraSettings.hAvatarsQueueHandle,0/*GAIF_FORCE*/,hContact,0);
+ }
+ }
+ }
+return(0);
+}
+
+INT_PTR MraRequestAuthForAll(WPARAM wParam,LPARAM lParam)
+{
+ if (MessageBox(NULL,TranslateW(L"Are you sure?"),TranslateW(MRA_REQ_AUTH_FOR_ALL_STR),(MB_YESNO|MB_ICONQUESTION))==IDYES)
+ {
+ DWORD dwContactSeverFlags;
+ HANDLE hContact;
+
+ for(hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ {
+ if (GetContactBasicInfoW(hContact,NULL,NULL,NULL,&dwContactSeverFlags,NULL,NULL,0,NULL,NULL,0,NULL,NULL,0,NULL)==NO_ERROR)
+ if (dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED && dwContactSeverFlags!=-1)
+ {
+ MraRequestAuthorization((WPARAM)hContact,0);
+ }
+
+ /*if (IsContactMra(hContact))// inviz check
+ //if ((MraContactCapabilitiesGet(hContact)&MRACCF_INVIS_ALLOWED)==0)
+ if (MraGetContactStatus(hContact)==ID_STATUS_OFFLINE || MraGetContactStatus(hContact)==ID_STATUS_INVISIBLE)
+ {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ SIZE_T dwEMailSize;
+
+ if (DB_Mra_GetStaticStringA(hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ MraSetContactStatus(hContact,ID_STATUS_OFFLINE);
+ MraSendCommand_Game(szEMail,dwEMailSize,111,GAME_CONNECTION_INVITE,222,NULL,0);
+ }
+ }*/
+ }
+ }
+return(0);
+}
+
+
+
+
+INT_PTR MraRequestAuthorization(WPARAM wParam,LPARAM lParam)
+{//**deb add dialog?
+ INT_PTR iRet=0;
+
+ if (wParam)
+ {
+ WCHAR wszAuthMessage[MAX_PATH];
+ CCSDATA cs={0};
+
+ if (DB_Mra_GetStaticStringW(NULL,"AuthMessage",wszAuthMessage,SIZEOF(wszAuthMessage),NULL)==FALSE)
+ {// def auth message
+ lstrcpynW(wszAuthMessage,TranslateW(MRA_DEFAULT_AUTH_MESSAGE),SIZEOF(wszAuthMessage));
+ }
+
+ cs.hContact=(HANDLE)wParam;
+ cs.szProtoService=PSS_AUTHREQUESTW;
+ cs.wParam=PREF_UNICODE;
+ cs.lParam=(LPARAM)wszAuthMessage;
+ iRet=MraSendAuthRequest(0,(LPARAM)&cs);
+ }
+return(iRet);
+}
+
+INT_PTR MraGrantAuthorization(WPARAM wParam,LPARAM lParam)
+{
+ if (masMraSettings.bLoggedIn && wParam)
+ {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ SIZE_T dwEMailSize;
+
+ if (DB_Mra_GetStaticStringA((HANDLE)wParam,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {// send without reason, do we need any ?
+ MraSendCommand_Authorize(szEMail,dwEMailSize);
+
+ //MraChatSessionJoinUser((HANDLE)wParam,"123",3,(DWORD)_time32(NULL));
+
+ /*//if ((MraContactCapabilitiesGet((HANDLE)wParam)&MRACCF_INVIS_ALLOWED)==0)
+ if (MraGetContactStatus((HANDLE)wParam)==ID_STATUS_OFFLINE || MraGetContactStatus((HANDLE)wParam)==ID_STATUS_INVISIBLE)
+ {// inviz check
+ MraSetContactStatus((HANDLE)wParam,ID_STATUS_OFFLINE);
+ MraSendCommand_Game(szEMail,dwEMailSize,111,GAME_CONNECTION_INVITE,222,NULL,0);
+ }*/
+
+ /*MRA_GUID mguidSessionID={0};
+ for(DWORD i=0;i<8;i++)
+ {
+ MraSendCommand_Proxy(szEMail,dwEMailSize,211+i,MRIM_PROXY_TYPE_FILES,"1.txt;111;",10,"172.0.0.1:111;",15,mguidSessionID);
+ MraSendCommand_ProxyAck(j,szEMail,dwEMailSize,111+i,MRIM_PROXY_TYPE_FILES,"1.txt;111;",10,"127.0.0.1:111;",15,mguidSessionID);
+ }//*/
+ }
+ }
+return(0);
+}
+
+INT_PTR MraSendPostcard(WPARAM wParam,LPARAM lParam)
+{
+ if (masMraSettings.bLoggedIn)
+ {
+ DWORD dwContactEMailCount=GetContactEMailCount((HANDLE)wParam,FALSE);
+
+ if (dwContactEMailCount)
+ if (dwContactEMailCount==1)
+ {
+ SIZE_T dwUrlSize,dwEMailSize;
+ CHAR szUrl[BUFF_SIZE_URL],szEMail[MAX_EMAIL_LEN];
+
+ if (GetContactFirstEMail((HANDLE)wParam,FALSE,szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ BuffToLowerCase(szEMail,szEMail,dwEMailSize);
+ dwUrlSize=mir_snprintf(szUrl,SIZEOF(szUrl),"http://cards.mail.ru/event.html?rcptname=%s&rcptemail=%s",GetContactNameA((HANDLE)wParam),szEMail);
+ MraMPopSessionQueueAddUrl(masMraSettings.hMPopSessionQueue,szUrl,dwUrlSize);
+ }
+ }else{// show dialog box
+ MraSelectEMailDlgShow((HANDLE)wParam,MRA_SELECT_EMAIL_TYPE_SEND_POSTCARD);
+ }
+ }
+return(0);
+}
+
+INT_PTR MraViewAlbum(WPARAM wParam,LPARAM lParam)
+{
+ if (masMraSettings.bLoggedIn)
+ {
+ DWORD dwContactEMailMRCount=GetContactEMailCount((HANDLE)wParam,TRUE);
+
+ if (dwContactEMailMRCount)
+ if (dwContactEMailMRCount==1)
+ {
+ SIZE_T dwEMailSize;
+ CHAR szEMail[MAX_EMAIL_LEN];
+
+ if (GetContactFirstEMail((HANDLE)wParam,TRUE,szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ MraMPopSessionQueueAddUrlAndEMail(masMraSettings.hMPopSessionQueue,MRA_FOTO_URL,sizeof(MRA_FOTO_URL),szEMail,dwEMailSize);
+ }
+ }else{// show dialog box
+ MraSelectEMailDlgShow((HANDLE)wParam,MRA_SELECT_EMAIL_TYPE_VIEW_ALBUM);
+ }
+ }
+return(0);
+}
+
+INT_PTR MraReadBlog(WPARAM wParam,LPARAM lParam)
+{
+ if (masMraSettings.bLoggedIn)
+ {
+ DWORD dwContactEMailMRCount=GetContactEMailCount((HANDLE)wParam,TRUE);
+
+ if (dwContactEMailMRCount)
+ if (dwContactEMailMRCount==1)
+ {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ SIZE_T dwEMailSize;
+
+ if (GetContactFirstEMail((HANDLE)wParam,TRUE,szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ MraMPopSessionQueueAddUrlAndEMail(masMraSettings.hMPopSessionQueue,MRA_BLOGS_URL,sizeof(MRA_BLOGS_URL),szEMail,dwEMailSize);
+ }
+ }else{// show dialog box
+ MraSelectEMailDlgShow((HANDLE)wParam,MRA_SELECT_EMAIL_TYPE_READ_BLOG);
+ }
+ }
+return(0);
+}
+
+INT_PTR MraReplyBlogStatus(WPARAM wParam,LPARAM lParam)
+{
+ if (masMraSettings.bLoggedIn)
+ {
+ SIZE_T dwBlogStatusMsgSize=0;
+
+ DB_Mra_GetStaticStringW((HANDLE)wParam,DBSETTING_BLOGSTATUS,NULL,0,&dwBlogStatusMsgSize);
+ if (dwBlogStatusMsgSize || wParam==0)
+ {
+ MraSendReplyBlogStatus((HANDLE)wParam);
+ }
+ }
+return(0);
+}
+
+INT_PTR MraViewVideo(WPARAM wParam,LPARAM lParam)
+{
+ if (masMraSettings.bLoggedIn)
+ {
+ DWORD dwContactEMailMRCount=GetContactEMailCount((HANDLE)wParam,TRUE);
+
+ if (dwContactEMailMRCount)
+ if (dwContactEMailMRCount==1)
+ {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ SIZE_T dwEMailSize;
+
+ if (GetContactFirstEMail((HANDLE)wParam,TRUE,szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ MraMPopSessionQueueAddUrlAndEMail(masMraSettings.hMPopSessionQueue,MRA_VIDEO_URL,sizeof(MRA_VIDEO_URL),szEMail,dwEMailSize);
+ }
+ }else{// show dialog box
+ MraSelectEMailDlgShow((HANDLE)wParam,MRA_SELECT_EMAIL_TYPE_VIEW_VIDEO);
+ }
+ }
+return(0);
+}
+
+INT_PTR MraAnswers(WPARAM wParam,LPARAM lParam)
+{
+ if (masMraSettings.bLoggedIn)
+ {
+ DWORD dwContactEMailMRCount=GetContactEMailCount((HANDLE)wParam,TRUE);
+
+ if (dwContactEMailMRCount)
+ if (dwContactEMailMRCount==1)
+ {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ SIZE_T dwEMailSize;
+
+ if (GetContactFirstEMail((HANDLE)wParam,TRUE,szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ MraMPopSessionQueueAddUrlAndEMail(masMraSettings.hMPopSessionQueue,MRA_ANSWERS_URL,sizeof(MRA_ANSWERS_URL),szEMail,dwEMailSize);
+ }
+ }else{// show dialog box
+ MraSelectEMailDlgShow((HANDLE)wParam,MRA_SELECT_EMAIL_TYPE_ANSWERS);
+ }
+ }
+return(0);
+}
+
+INT_PTR MraWorld(WPARAM wParam,LPARAM lParam)
+{
+ if (masMraSettings.bLoggedIn)
+ {
+ DWORD dwContactEMailMRCount=GetContactEMailCount((HANDLE)wParam,TRUE);
+
+ if (dwContactEMailMRCount)
+ if (dwContactEMailMRCount==1)
+ {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ SIZE_T dwEMailSize;
+
+ if (GetContactFirstEMail((HANDLE)wParam,TRUE,szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ MraMPopSessionQueueAddUrlAndEMail(masMraSettings.hMPopSessionQueue,MRA_WORLD_URL,sizeof(MRA_WORLD_URL),szEMail,dwEMailSize);
+ }
+ }else{// show dialog box
+ MraSelectEMailDlgShow((HANDLE)wParam,MRA_SELECT_EMAIL_TYPE_WORLD);
+ }
+ }
+return(0);
+}
+
+
+
+
+
+
+
+int MraContactDeleted(WPARAM wParam,LPARAM lParam)
+{
+ if (masMraSettings.bLoggedIn && wParam)
+ {
+ HANDLE hContact=(HANDLE)wParam;
+ if (IsContactMra(hContact))
+ {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ DWORD dwID,dwGroupID;
+ SIZE_T dwEMailSize;
+
+ GetContactBasicInfoW(hContact,&dwID,&dwGroupID,NULL,NULL,NULL,szEMail,SIZEOF(szEMail),&dwEMailSize,NULL,0,NULL,NULL,0,NULL);
+
+ MraSetContactStatus(hContact,ID_STATUS_OFFLINE);
+ if (DBGetContactSettingByte(hContact,"CList","NotOnList",0)==0 || dwID!=-1) MraSendCommand_ModifyContactW(hContact,dwID,CONTACT_FLAG_REMOVED,dwGroupID,szEMail,dwEMailSize,NULL,0,NULL,0);
+ MraAvatarsDeleteContactAvatarFile(masMraSettings.hAvatarsQueueHandle,hContact);
+ }
+ }
+return(0);
+}
+
+
+int MraDbSettingChanged(WPARAM wParam,LPARAM lParam)
+{
+ if (masMraSettings.bLoggedIn && lParam)
+ {
+ HANDLE hContact=(HANDLE)wParam;
+ DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
+
+ if (hContact)
+ {
+ if (IsContactMra(hContact) && DBGetContactSettingByte(hContact,"CList","NotOnList",0)==0 && DB_Mra_GetDword(hContact,"HooksLocked",FALSE)==FALSE)
+ {// , ( )
+ CHAR szEMail[MAX_EMAIL_LEN],szPhones[MAX_EMAIL_LEN];
+ WCHAR wszNick[MAX_EMAIL_LEN];
+ DWORD dwID,dwGroupID,dwContactFlag;
+ SIZE_T dwEMailSize,dwNickSize,dwPhonesSize;
+
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,cws->szModule,-1,"CList",5)==CSTR_EQUAL)
+ {// CList section
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,cws->szSetting,-1,"MyHandle",8)==CSTR_EQUAL)
+ {// MyHandle setting
+ LPWSTR lpwszNewNick;
+
+ if (cws->value.type==DBVT_DELETED)
+ {// allways store custom nick
+ lstrcpynW(wszNick,GetContactNameW(hContact),SIZEOF(wszNick));
+ lpwszNewNick=wszNick;
+ dwNickSize=lstrlenW(lpwszNewNick);
+ DB_SetStringExW(hContact,"CList","MyHandle",lpwszNewNick,dwNickSize);
+ }else{
+ if (cws->value.pszVal)
+ {
+ switch(cws->value.type){
+ case DBVT_WCHAR:
+ lpwszNewNick=cws->value.pwszVal;
+ dwNickSize=lstrlenW(lpwszNewNick);
+ break;
+ case DBVT_UTF8:
+ lpwszNewNick=wszNick;
+ dwNickSize=MultiByteToWideChar(CP_UTF8,0,cws->value.pszVal,-1,wszNick,SIZEOF(wszNick));
+ break;
+ case DBVT_ASCIIZ:
+ lpwszNewNick=wszNick;
+ dwNickSize=MultiByteToWideChar(MRA_CODE_PAGE,0,cws->value.pszVal,-1,wszNick,SIZEOF(wszNick));
+ break;
+ default:
+ lpwszNewNick=NULL;
+ dwNickSize=0;
+ break;
+ }
+ if (lpwszNewNick)
+ if (GetContactBasicInfoW(hContact,&dwID,&dwGroupID,&dwContactFlag,NULL,NULL,szEMail,SIZEOF(szEMail),&dwEMailSize,NULL,0,NULL,szPhones,SIZEOF(szPhones),&dwPhonesSize)==NO_ERROR)
+ {
+ MraSendCommand_ModifyContactW(hContact,dwID,dwContactFlag,dwGroupID,szEMail,dwEMailSize,lpwszNewNick,dwNickSize,szPhones,dwPhonesSize);
+ }
+ }
+ }
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,cws->szSetting,-1,"Group",5)==CSTR_EQUAL)
+ {// Group setting //***deb
+ if (TRUE)
+ {// manage group on server
+ switch(cws->value.type){
+ case DBVT_ASCIIZ:
+
+ break;
+ case DBVT_DELETED:
+
+ break;
+ }
+ }
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,cws->szSetting,-1,"NotOnList",9)==CSTR_EQUAL)
+ {// NotOnList setting // Has a temporary contact just been added permanently?
+ if (cws->value.type==DBVT_DELETED || (cws->value.type==DBVT_BYTE && cws->value.bVal==0))
+ {
+ WCHAR wszAuthMessage[MAX_PATH];
+ SIZE_T dwAuthMessageSize;
+
+ if (DB_Mra_GetStaticStringW(NULL,"AuthMessage",wszAuthMessage,SIZEOF(wszAuthMessage),&dwAuthMessageSize)==FALSE)
+ {// def auth message
+ lstrcpynW(wszAuthMessage,TranslateW(MRA_DEFAULT_AUTH_MESSAGE),SIZEOF(wszAuthMessage));
+ dwAuthMessageSize=lstrlenW(wszAuthMessage);
+ }
+
+ DBDeleteContactSetting(hContact,"CList","Hidden");
+ GetContactBasicInfoW(hContact,NULL,&dwGroupID,&dwContactFlag,NULL,NULL,szEMail,SIZEOF(szEMail),&dwEMailSize,wszNick,SIZEOF(wszNick),&dwNickSize,szPhones,SIZEOF(szPhones),&dwPhonesSize);
+ MraSendCommand_AddContactW(hContact,dwContactFlag,dwGroupID,szEMail,dwEMailSize,wszNick,dwNickSize,szPhones,dwPhonesSize,wszAuthMessage,dwAuthMessageSize,0);
+ }
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,cws->szSetting,-1,"Hidden",6)==CSTR_EQUAL)
+ {// Hidden setting
+ GetContactBasicInfoW(hContact,&dwID,&dwGroupID,&dwContactFlag,NULL,NULL,szEMail,SIZEOF(szEMail),&dwEMailSize,wszNick,SIZEOF(wszNick),&dwNickSize,szPhones,SIZEOF(szPhones),&dwPhonesSize);
+ if(cws->value.type==DBVT_DELETED || (cws->value.type==DBVT_BYTE && cws->value.bVal==0))
+ {
+ dwContactFlag&=~CONTACT_FLAG_SHADOW;
+ }else{
+ dwContactFlag|=CONTACT_FLAG_SHADOW;
+ }
+ MraSendCommand_ModifyContactW(hContact,dwID,dwContactFlag,dwGroupID,szEMail,dwEMailSize,wszNick,dwNickSize,szPhones,dwPhonesSize);
+ }
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,cws->szModule,-1,"Ignore",6)==CSTR_EQUAL)
+ {// Ignore section
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,cws->szSetting,-1,"Mask1",5)==CSTR_EQUAL)
+ {
+ GetContactBasicInfoW(hContact,&dwID,&dwGroupID,&dwContactFlag,NULL,NULL,szEMail,SIZEOF(szEMail),&dwEMailSize,wszNick,SIZEOF(wszNick),&dwNickSize,szPhones,SIZEOF(szPhones),&dwPhonesSize);
+ if(cws->value.type==DBVT_DELETED || (cws->value.type==DBVT_DWORD && cws->value.dVal&IGNOREEVENT_MESSAGE)==0)
+ {
+ dwContactFlag&=~CONTACT_FLAG_IGNORE;
+ }else{
+ dwContactFlag|=CONTACT_FLAG_IGNORE;
+ }
+ MraSendCommand_ModifyContactW(hContact,dwID,dwContactFlag,dwGroupID,szEMail,dwEMailSize,wszNick,dwNickSize,szPhones,dwPhonesSize);
+ }
+ }else
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,cws->szModule,-1,"UserInfo",8)==CSTR_EQUAL)
+ {// User info section
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,cws->szSetting,-1,"MyPhone0",8)==CSTR_EQUAL
+ || CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,cws->szSetting,-1,"MyPhone1",8)==CSTR_EQUAL
+ || CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,cws->szSetting,-1,"MyPhone2",8)==CSTR_EQUAL)
+ {
+ //if(cws->value.type!=DBVT_DELETED)
+ {
+ GetContactBasicInfoW(hContact,&dwID,&dwGroupID,&dwContactFlag,NULL,NULL,szEMail,SIZEOF(szEMail),&dwEMailSize,wszNick,SIZEOF(wszNick),&dwNickSize,szPhones,SIZEOF(szPhones),&dwPhonesSize);
+ MraSendCommand_ModifyContactW(hContact,dwID,dwContactFlag,dwGroupID,szEMail,dwEMailSize,wszNick,dwNickSize,szPhones,dwPhonesSize);
+ }
+ }
+ }
+ }
+ }else{// not contact
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,cws->szModule,-1,"CListGroups",11)==CSTR_EQUAL)
+ {// CList section //***deb
+ if (TRUE)
+ {// manage group on server
+ switch(cws->value.type){
+ case DBVT_ASCIIZ:
+
+ break;
+ case DBVT_DELETED:
+
+ break;
+ }
+ }
+ }
+ }
+
+
+ /*if ( hContact == NULL && MyOptions.ManageServer && !strcmp( cws->szModule, "CListGroups" )) {
+ int iNumber = atol( cws->szSetting );
+ LPCSTR szId = MSN_GetGroupByNumber( iNumber );
+ if ( szId != NULL ) {
+ if ( cws->value.type == DBVT_DELETED ) {
+ msnNsThread->sendPacket( "RMG", szId );
+ }
+ else if ( cws->value.type == DBVT_ASCIIZ ) {
+ LPCSTR oldId = MSN_GetGroupByName( cws->value.pszVal+1 );
+ if ( oldId == NULL ) {
+ CHAR* p = Utf8Encode( cws->value.pszVal+1 ), szNewName[ 200 ];
+ UrlEncode( p, szNewName, sizeof szNewName );
+ msnNsThread->sendPacket( "REG", "%s %s", szId, szNewName );
+ free( p );
+ }
+ else MSN_SetGroupNumber( oldId, iNumber );
+ } }
+ else if ( cws->value.type == DBVT_ASCIIZ )
+ MSN_AddServerGroup( cws->value.pszVal+1 );
+
+ return 0;
+ }
+
+ if ( !strcmp( cws->szModule, "CList" ) && MyOptions.ManageServer ) {
+ CHAR* szProto = ( CHAR* )MSN_CallService( MS_PROTO_GETCONTACTBASEPROTO, ( WPARAM ) hContact, 0 );
+ if ( szProto == NULL || strcmp( szProto, msnProtocolName ))
+ return 0;
+
+ if ( !strcmp( cws->szSetting, "Group" )) {
+ if ( cws->value.type == DBVT_DELETED )
+ MSN_MoveContactToGroup( hContact, NULL );
+ else if ( cws->value.type == DBVT_ASCIIZ ) {
+ LPCSTR p = MSN_GetGroupByName( cws->value.pszVal );
+ if ( p == NULL )
+ MSN_AddServerGroup( cws->value.pszVal );
+
+ MSN_MoveContactToGroup( hContact, cws->value.pszVal );
+ }
+ return 0;
+ }
+
+ } }*/
+
+ }
+return(0);
+}
+
+
+int MraRebuildContactMenu(WPARAM wParam,LPARAM lParam)
+{
+ BOOL bIsContactMRA,bHasEMail,bHasEMailMR,bChatAgent;
+ DWORD dwContactSeverFlags=0;
+ SIZE_T dwBlogStatusMsgSize=0;
+ HANDLE hContact=(HANDLE)wParam;
+
+ bIsContactMRA=IsContactMra(hContact);
+ if (bIsContactMRA)//**deb !
+ {// proto own contact
+ bHasEMail=TRUE;
+ bHasEMailMR=TRUE;
+ bChatAgent=IsContactChatAgent(hContact);
+ GetContactBasicInfoW(hContact,NULL,NULL,NULL,&dwContactSeverFlags,NULL,NULL,0,NULL,NULL,0,NULL,NULL,0,NULL);
+ DB_Mra_GetStaticStringW(hContact,DBSETTING_BLOGSTATUS,NULL,0,&dwBlogStatusMsgSize);
+ }else{// non proto contact
+ bHasEMail=FALSE;
+ bHasEMailMR=FALSE;
+ bChatAgent=FALSE;
+ if (DB_Mra_GetByte(NULL,"HideMenuItemsForNonMRAContacts",MRA_DEFAULT_HIDE_MENU_ITEMS_FOR_NON_MRA)==FALSE)
+ if (IsContactMraProto(hContact)==FALSE)// MRA
+ if (GetContactEMailCount(hContact,FALSE))
+ {
+ bHasEMail=TRUE;
+ if (GetContactEMailCount(hContact,TRUE)) bHasEMailMR=TRUE;
+ }
+ }
+
+ //"Request authorization"
+ CListShowMenuItem(masMraSettings.hContactMenuItems[0],(masMraSettings.bLoggedIn && bIsContactMRA));// && (dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED)
+
+ //"Grant authorization"
+ CListShowMenuItem(masMraSettings.hContactMenuItems[1],(masMraSettings.bLoggedIn && bIsContactMRA && bChatAgent==FALSE));
+
+ //"&Send postcard"
+ CListShowMenuItem(masMraSettings.hContactMenuItems[2],(masMraSettings.bLoggedIn && bHasEMail && bChatAgent==FALSE));
+
+ //"&View Album"
+ CListShowMenuItem(masMraSettings.hContactMenuItems[3],(masMraSettings.bLoggedIn && bHasEMailMR && bChatAgent==FALSE));
+
+ //"&Read Blog"
+ CListShowMenuItem(masMraSettings.hContactMenuItems[4],(masMraSettings.bLoggedIn && bHasEMailMR && bChatAgent==FALSE));
+
+ //"Reply Blog Status"
+ CListShowMenuItem(masMraSettings.hContactMenuItems[5],(masMraSettings.bLoggedIn && dwBlogStatusMsgSize && bChatAgent==FALSE));
+
+ //"View Video"
+ CListShowMenuItem(masMraSettings.hContactMenuItems[6],(masMraSettings.bLoggedIn && bHasEMailMR && bChatAgent==FALSE));
+
+ //"Answers"
+ CListShowMenuItem(masMraSettings.hContactMenuItems[7],(masMraSettings.bLoggedIn && bHasEMailMR && bChatAgent==FALSE));
+
+ //"World"
+ CListShowMenuItem(masMraSettings.hContactMenuItems[8],(masMraSettings.bLoggedIn && bHasEMailMR && bChatAgent==FALSE));
+
+ //"Send &Nudge"
+ if (masMraSettings.heNudgeReceived==NULL)
+ {
+ CListShowMenuItem(masMraSettings.hContactMenuItems[9],(masMraSettings.bLoggedIn && bIsContactMRA));
+ }
+
+return(0);
+}
+
+
+int MraExtraIconsApply(WPARAM wParam,LPARAM lParam)
+{
+ SetExtraIcons((HANDLE)wParam);
+return(0);
+}
+
+
+int MraExtraIconsRebuild(WPARAM wParam,LPARAM lParam)
+{
+ for(SIZE_T i=0;i<ADV_ICON_MAX;i++) masMraSettings.hAdvancedStatusItems[i]=(HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON,(WPARAM)IconLibGetIcon(masMraSettings.hAdvancedStatusIcons[i]),0);
+ for(SIZE_T i=0;i<(MRA_XSTATUS_COUNT+1);i++) masMraSettings.hXStatusAdvancedStatusItems[i]=(HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON,(WPARAM)IconLibGetIcon(masMraSettings.hXStatusAdvancedStatusIcons[i]),0);
+
+return(0);
+}
+
+int MraRebuildStatusMenu(WPARAM wParam,LPARAM lParam)
+{
+ CHAR szServiceFunction[MAX_PATH*2],*pszServiceFunctionName,szValueName[MAX_PATH];
+ WCHAR szItem[MAX_PATH+64],szStatusTitle[STATUS_TITLE_MAX+4];
+ HANDLE hXStatusRoot;
+ CLISTMENUITEM mi={0};
+
+ memmove(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
+ pszServiceFunctionName=szServiceFunction+PROTOCOL_NAME_LEN;
+ //memmove(pszServiceFunctionName,MRA_XSTATUS_MENU,sizeof(MRA_XSTATUS_MENU));
+
+ mir_sntprintf(szItem,SIZEOF(szItem),L"%s Custom Status",PROTOCOL_NAMEW);
+ mi.cbSize=sizeof(mi);
+ mi.position=2000060000;
+ mi.popupPosition=500085000;
+ mi.ptszPopupName=szItem;
+ //mi.ptszName=szStatusTitle;
+ mi.flags=(CMIF_UNICODE|CMIF_ICONFROMICOLIB);
+ mi.pszService=szServiceFunction;
+ mi.pszContactOwner=PROTOCOL_NAMEA;
+
+ for(SIZE_T i=0;i<MRA_XSTATUS_COUNT;i++)
+ {
+ mir_snprintf(pszServiceFunctionName,(SIZEOF(szServiceFunction)-PROTOCOL_NAME_LEN),"/menuXStatus%ld",i);
+ mi.position++;
+ if (i)
+ {
+ mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%ldName",i);
+ if (DB_Mra_GetStaticStringW(NULL,szValueName,szStatusTitle,(STATUS_TITLE_MAX+1),NULL))
+ {
+ szStatusTitle[STATUS_TITLE_MAX]=0;
+ mi.ptszName=szStatusTitle;
+ }else{// default xstatus name
+ mi.ptszName=lpcszXStatusNameDef[i];
+ }
+ mi.icolibItem=masMraSettings.hXStatusAdvancedStatusIcons[i];
+ }else{
+ mi.ptszName=lpcszXStatusNameDef[i];
+ mi.hIcon=NULL;
+ }
+ masMraSettings.hXStatusMenuItems[i]=(HANDLE)CallService(MS_CLIST_ADDSTATUSMENUITEM,(WPARAM)&hXStatusRoot,(LPARAM)&mi);
+ }
+return(0);
+}
+
+
+INT_PTR MraSetListeningTo(WPARAM wParam,LPARAM lParam)
+{
+ LISTENINGTOINFO *pliInfo=(LISTENINGTOINFO*)lParam;
+
+ if ( pliInfo == NULL || pliInfo->cbSize != sizeof(LISTENINGTOINFO) )
+ {
+ MraSendCommand_ChangeUserBlogStatus(MRIM_BLOG_STATUS_MUSIC,NULL,0,0);
+ DB_Mra_DeleteValue(NULL,DBSETTING_BLOGSTATUSMUSIC);
+ }else
+ if (pliInfo->dwFlags & LTI_UNICODE)
+ {
+ LPWSTR pwszListeningTo;
+ WCHAR wszListeningTo[MICBLOG_STATUS_MAX+4];
+ SIZE_T dwListeningToSize;
+
+ if (ServiceExists(MS_LISTENINGTO_GETPARSEDTEXT))
+ {
+ pwszListeningTo=(LPWSTR)CallService(MS_LISTENINGTO_GETPARSEDTEXT,(WPARAM)L"%track%. %title% - %artist% - %player%",(LPARAM)pliInfo);
+ dwListeningToSize=lstrlenW(pwszListeningTo);
+ }else{
+ pwszListeningTo=wszListeningTo;
+ dwListeningToSize=mir_sntprintf(pwszListeningTo,SIZEOF(wszListeningTo),L"%s. %s - %s - %s", pliInfo->ptszTrack?pliInfo->ptszTrack:L"", pliInfo->ptszTitle?pliInfo->ptszTitle:L"", pliInfo->ptszArtist?pliInfo->ptszArtist:L"", pliInfo->ptszPlayer?pliInfo->ptszPlayer:L"");
+ }
+
+ DB_Mra_SetStringExW(NULL,DBSETTING_BLOGSTATUSMUSIC,pwszListeningTo,dwListeningToSize);
+ MraSendCommand_ChangeUserBlogStatus(MRIM_BLOG_STATUS_MUSIC,pwszListeningTo,dwListeningToSize,0);
+
+ if (pwszListeningTo!=wszListeningTo) mir_free(pwszListeningTo);
+ }
+
+return(0);
+}
+
+
+int MraMusicChanged(WPARAM wParam,LPARAM lParam)
+{
+ switch (wParam){
+ case WAT_EVENT_PLAYERSTATUS:
+ if (1==lParam)
+ {// stopped
+ DB_Mra_DeleteValue(NULL,DBSETTING_BLOGSTATUSMUSIC);
+ MraSendCommand_ChangeUserBlogStatus(MRIM_BLOG_STATUS_MUSIC,NULL,0,0);
+ }
+ break;
+ case WAT_EVENT_NEWTRACK:
+ {
+ SONGINFO *psiSongInfo;
+
+ if (WAT_RES_OK==CallService(MS_WAT_GETMUSICINFO,WAT_INF_UNICODE,(LPARAM)&psiSongInfo))
+ {
+ WCHAR wszMusic[MICBLOG_STATUS_MAX+4];
+ SIZE_T dwMusicSize;
+
+ dwMusicSize=mir_sntprintf(wszMusic,SIZEOF(wszMusic),L"%ld. %s - %s - %s",psiSongInfo->track,psiSongInfo->artist,psiSongInfo->title,psiSongInfo->player);
+ DB_Mra_SetStringExW(NULL,DBSETTING_BLOGSTATUSMUSIC,wszMusic,dwMusicSize);
+ MraSendCommand_ChangeUserBlogStatus(MRIM_BLOG_STATUS_MUSIC,wszMusic,dwMusicSize,0);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+
+return(0);
+}
+
+
+INT_PTR MraGetCaps(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet;
+
+ switch(wParam){
+ case PFLAGNUM_1:
+ iRet=PF1_IM|PF1_FILE|PF1_MODEMSG|PF1_SERVERCLIST|PF1_AUTHREQ|PF1_ADDED|PF1_VISLIST|PF1_INVISLIST|PF1_INDIVSTATUS|PF1_PEER2PEER|/*PF1_NEWUSER|*/PF1_CHAT|PF1_BASICSEARCH|PF1_EXTSEARCH|PF1_CANRENAMEFILE|PF1_FILERESUME|PF1_ADDSEARCHRES|PF1_CONTACT|PF1_SEARCHBYEMAIL|PF1_USERIDISEMAIL|PF1_SEARCHBYNAME|PF1_EXTSEARCHUI;
+ break;
+ case PFLAGNUM_2:
+ iRet=PF2_ONLINE|PF2_INVISIBLE|PF2_SHORTAWAY|PF2_HEAVYDND|PF2_FREECHAT;
+ break;
+ case PFLAGNUM_3:
+ iRet=PF2_ONLINE|PF2_INVISIBLE|PF2_SHORTAWAY|PF2_HEAVYDND|PF2_FREECHAT;
+ break;
+ case PFLAGNUM_4:
+ iRet=PF4_FORCEAUTH|PF4_FORCEADDED|/*PF4_NOCUSTOMAUTH|*/PF4_SUPPORTTYPING|PF4_AVATARS|PF4_IMSENDUTF;
+ break;
+ case PFLAG_UNIQUEIDTEXT:
+ iRet=(INT_PTR)Translate("E-mail address");
+ break;
+ case PFLAG_MAXCONTACTSPERPACKET:
+ iRet=MRA_MAXCONTACTSPERPACKET;
+ break;
+ case PFLAG_UNIQUEIDSETTING:
+ iRet=(INT_PTR)"e-mail";
+ break;
+ case PFLAG_MAXLENOFMESSAGE:
+ iRet=MRA_MAXLENOFMESSAGE;
+ break;
+ default:
+ iRet=0;
+ break;
+ }
+return(iRet);
+}
+
+
+INT_PTR MraGetName(WPARAM wParam,LPARAM lParam)
+{
+ lstrcpynA((LPSTR)lParam,PROTOCOL_DISPLAY_NAMEA,wParam);
+return(0);
+}
+
+
+INT_PTR MraLoadIcon(WPARAM wParam,LPARAM lParam)
+{
+ UINT id;
+
+ switch(wParam&0xFFFF){
+ case PLI_PROTOCOL:id=IDI_MRA;break;// IDI_TM is the main icon for the protocol
+ default:return(0);
+ }
+return((INT_PTR)LoadImage(masMraSettings.hInstance,MAKEINTRESOURCE(id),IMAGE_ICON,GetSystemMetrics((wParam&PLIF_SMALL)?SM_CXSMICON:SM_CXICON),GetSystemMetrics((wParam&PLIF_SMALL)?SM_CYSMICON:SM_CYICON),0));
+}
+
+
+INT_PTR MraSetStatus(WPARAM wParam,LPARAM lParam)
+{
+ // remap global statuses to local supported
+ switch(wParam){
+ case ID_STATUS_OFFLINE:
+ wParam=ID_STATUS_OFFLINE;
+ break;
+ case ID_STATUS_ONLINE:
+ wParam=ID_STATUS_ONLINE;
+ break;
+ case ID_STATUS_AWAY:
+ wParam=ID_STATUS_AWAY;
+ break;
+ case ID_STATUS_DND:
+ case ID_STATUS_OCCUPIED:
+ wParam=ID_STATUS_DND;
+ break;
+ case ID_STATUS_FREECHAT:
+ wParam=ID_STATUS_FREECHAT;
+ break;
+ case ID_STATUS_INVISIBLE:
+ wParam=ID_STATUS_INVISIBLE;
+ break;
+ case ID_STATUS_NA:
+ case ID_STATUS_ONTHEPHONE:
+ case ID_STATUS_OUTTOLUNCH:
+ wParam=ID_STATUS_AWAY;
+ break;
+ default:
+ wParam=ID_STATUS_OFFLINE;
+ break;
+ }
+
+
+ if (InterlockedExchangeAdd((volatile LONG*)&masMraSettings.dwStatusMode,0)==wParam && wParam!=lParam)
+ {// nothink to change
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,NULL,ACKTYPE_STATUS,ACKRESULT_SUCCESS,(HANDLE)wParam,wParam,0);
+ }else{
+ DWORD dwOldStatusMode;
+
+ if ((masMraSettings.dwDesiredStatusMode=wParam)==ID_STATUS_OFFLINE)
+ {//set all contacts to offline
+ masMraSettings.bLoggedIn=FALSE;
+ dwOldStatusMode=InterlockedExchange((volatile LONG*)&masMraSettings.dwStatusMode,masMraSettings.dwDesiredStatusMode);
+
+ if (dwOldStatusMode>ID_STATUS_OFFLINE)
+ {// offline,
+ for(HANDLE hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);hContact!=NULL;hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ {// MRA
+ SetContactBasicInfoW(hContact,SCBIFSI_LOCK_CHANGES_EVENTS,(SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS),-1,-1,0,0,ID_STATUS_OFFLINE,NULL,0,NULL,0,NULL,0);
+ }
+ }
+ Netlib_CloseHandle(masMraSettings.hConnection);
+ }else{
+ // offline connecting, offline
+ dwOldStatusMode=InterlockedCompareExchange((volatile LONG*)&masMraSettings.dwStatusMode,ID_STATUS_CONNECTING,ID_STATUS_OFFLINE);
+
+ switch(dwOldStatusMode){
+ case ID_STATUS_OFFLINE:// offline, connecting
+ if (StartConnect()!=NO_ERROR)
+ {//err
+ masMraSettings.bLoggedIn=FALSE;
+ masMraSettings.dwDesiredStatusMode=ID_STATUS_OFFLINE;
+ dwOldStatusMode=InterlockedExchange((volatile LONG*)&masMraSettings.dwStatusMode,masMraSettings.dwDesiredStatusMode);
+ }
+ break;
+ case ID_STATUS_ONLINE:// connected, change status
+ case ID_STATUS_AWAY:
+ case ID_STATUS_DND:
+ case ID_STATUS_FREECHAT:
+ case ID_STATUS_INVISIBLE:
+ MraSendNewStatus(masMraSettings.dwDesiredStatusMode,MraGetXStatusInternal(),NULL,0,NULL,0);
+ case ID_STATUS_CONNECTING:
+ if (dwOldStatusMode==ID_STATUS_CONNECTING && wParam!=lParam)
+ {// ( offline) connecting,
+ break;
+ }
+ default:
+ dwOldStatusMode=InterlockedExchange((volatile LONG*)&masMraSettings.dwStatusMode,masMraSettings.dwDesiredStatusMode);
+ //MraSendNewStatus(masMraSettings.dwDesiredStatusMode,MraGetXStatusInternal(),NULL,0,NULL,0);
+ break;
+ }
+ }
+ MraSetContactStatus(NULL,masMraSettings.dwStatusMode);
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,NULL,ACKTYPE_STATUS,ACKRESULT_SUCCESS,(HANDLE)dwOldStatusMode,masMraSettings.dwStatusMode,0);
+ }
+return(0);
+}
+
+
+INT_PTR MraGetStatus(WPARAM wParam,LPARAM lParam)
+{
+return(InterlockedExchangeAdd((volatile LONG*)&masMraSettings.dwStatusMode,0));
+}
+
+
+DWORD MraSetXStatusInternal(DWORD dwXStatus)
+{
+ DWORD dwOldStatusMode;
+
+ if (IsXStatusValid(dwXStatus))
+ {
+ CHAR szValueName[MAX_PATH];
+ WCHAR szBuff[4096];
+ SIZE_T dwBuffSize;
+
+ // obsolete (TODO: remove in next version)
+ mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%ldName",dwXStatus);
+ if (DB_Mra_GetStaticStringW(NULL,szValueName,szBuff,SIZEOF(szBuff),&dwBuffSize)==FALSE)
+ {// default xstatus name
+ lstrcpynW(szBuff,lpcszXStatusNameDef[dwXStatus],SIZEOF(szBuff));
+ dwBuffSize=lstrlenW(szBuff);
+ }
+ if (dwBuffSize>STATUS_TITLE_MAX) dwBuffSize=STATUS_TITLE_MAX;
+ DB_Mra_SetStringExW(NULL,DBSETTING_XSTATUSNAME,szBuff,dwBuffSize);
+
+ // obsolete (TODO: remove in next version)
+ mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%ldMsg",dwXStatus);
+ if (DB_Mra_GetStaticStringW(NULL,szValueName,szBuff,SIZEOF(szBuff),&dwBuffSize))
+ {// custom xstatus description
+ if (dwBuffSize>STATUS_DESC_MAX) dwBuffSize=STATUS_DESC_MAX;
+ DB_Mra_SetStringExW(NULL,DBSETTING_XSTATUSMSG,szBuff,dwBuffSize);
+ }else{// default xstatus description
+ DB_Mra_DeleteValue(NULL,DBSETTING_XSTATUSMSG);
+ }
+ }else{
+ DB_Mra_DeleteValue(NULL,DBSETTING_XSTATUSNAME);
+ DB_Mra_DeleteValue(NULL,DBSETTING_XSTATUSMSG);
+ dwXStatus=MRA_MIR_XSTATUS_NONE;
+ }
+
+ dwOldStatusMode=InterlockedExchange((volatile LONG*)&masMraSettings.dwXStatusMode,dwXStatus);
+ DB_Mra_SetByte(NULL,DBSETTING_XSTATUSID,(BYTE)dwXStatus);
+
+ MraSendNewStatus(MraGetStatus(0,0),dwXStatus,NULL,0,NULL,0);
+
+return(dwOldStatusMode);
+}
+
+DWORD MraGetXStatusInternal()
+{
+return(InterlockedExchangeAdd((volatile LONG*)&masMraSettings.dwXStatusMode,0));
+}
+
+
+
+INT_PTR MraSetXStatus(WPARAM wParam,LPARAM lParam)
+{// obsolete (TODO: remove in next version)
+ INT_PTR iRet=0;
+
+ if (IsXStatusValid(wParam) || wParam==MRA_MIR_XSTATUS_NONE)
+ {
+ MraSetXStatusInternal(wParam);
+ iRet=wParam;
+ }
+return(iRet);
+}
+
+INT_PTR MraSetXStatusEx(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=1;
+ DWORD dwXStatus;
+ ICQ_CUSTOM_STATUS *pData=(ICQ_CUSTOM_STATUS*)lParam;
+
+ if (pData->cbSize>=sizeof(ICQ_CUSTOM_STATUS))
+ {
+ iRet=0;
+
+ if (pData->flags&CSSF_MASK_STATUS)
+ {// fill status member
+ dwXStatus=(*pData->status);
+ if (IsXStatusValid(dwXStatus)==FALSE && dwXStatus!=MRA_MIR_XSTATUS_NONE) iRet=1;
+ }else{
+ dwXStatus=MraGetXStatusInternal();
+ }
+
+ if (pData->flags&(CSSF_MASK_NAME|CSSF_MASK_MESSAGE) && iRet==0)
+ {//
+ if (IsXStatusValid(dwXStatus) || dwXStatus==MRA_MIR_XSTATUS_NONE)
+ {
+ CHAR szValueName[MAX_PATH];
+ SIZE_T dwBuffSize;
+
+ if (pData->flags&CSSF_MASK_NAME)
+ {// set custom status name
+ mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%ldName",dwXStatus);
+ if (pData->flags&CSSF_UNICODE)
+ {
+ dwBuffSize=lstrlenW(pData->pwszName);
+ if (dwBuffSize>STATUS_TITLE_MAX) dwBuffSize=STATUS_TITLE_MAX;
+
+ DB_Mra_SetStringExW(NULL,szValueName,pData->pwszName,dwBuffSize);
+ DB_Mra_SetStringExW(NULL,DBSETTING_XSTATUSNAME,pData->pwszName,dwBuffSize);
+ }else{
+ dwBuffSize=lstrlenA(pData->pszName);
+ if (dwBuffSize>STATUS_TITLE_MAX) dwBuffSize=STATUS_TITLE_MAX;
+
+ DB_Mra_SetStringExA(NULL,szValueName,pData->pszName,dwBuffSize);
+ DB_Mra_SetStringExA(NULL,DBSETTING_XSTATUSNAME,pData->pszName,dwBuffSize);
+ }
+ }
+
+ if (pData->flags&CSSF_MASK_MESSAGE)
+ {// set custom status message
+ mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%ldMsg",dwXStatus);
+ if (pData->flags&CSSF_UNICODE)
+ {
+ dwBuffSize=lstrlenW(pData->pwszMessage);
+ if (dwBuffSize>STATUS_TITLE_MAX) dwBuffSize=STATUS_DESC_MAX;
+
+ DB_Mra_SetStringExW(NULL,szValueName,pData->pwszMessage,dwBuffSize);
+ DB_Mra_SetStringExW(NULL,DBSETTING_XSTATUSMSG,pData->pwszMessage,dwBuffSize);
+ }else{
+ dwBuffSize=lstrlenA(pData->pszMessage);
+ if (dwBuffSize>STATUS_TITLE_MAX) dwBuffSize=STATUS_DESC_MAX;
+
+ DB_Mra_SetStringExA(NULL,szValueName,pData->pszMessage,dwBuffSize);
+ DB_Mra_SetStringExA(NULL,DBSETTING_XSTATUSMSG,pData->pszMessage,dwBuffSize);
+ }
+ }
+ }else{// ""
+ if ((pData->flags&CSSF_MASK_STATUS)==0) iRet=1;
+ }
+ }
+
+ if (pData->flags&(CSSF_MASK_STATUS|CSSF_MASK_NAME|CSSF_MASK_MESSAGE) && iRet==0)
+ {// set/update xstatus code and/or message
+ MraSetXStatusInternal(dwXStatus);
+ }
+
+ if (pData->flags&CSSF_DISABLE_UI)
+ {// hide menu items
+ masMraSettings.bHideXStatusUI=(*pData->wParam)? FALSE:TRUE;
+ for (DWORD i=0;i<MRA_XSTATUS_COUNT;i++) CListShowMenuItem(masMraSettings.hXStatusMenuItems[i],!masMraSettings.bHideXStatusUI);
+ }
+ }
+return(iRet);
+}
+
+INT_PTR MraGetXStatus(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet;
+
+ if (masMraSettings.bLoggedIn)
+ {
+ if (wParam) *((CHAR**)wParam)=DBSETTING_XSTATUSNAME;
+ if (lParam) *((CHAR**)lParam)=DBSETTING_XSTATUSMSG;
+ iRet=MraGetXStatusInternal();
+ }else{
+ iRet=0;
+ }
+
+return(iRet);
+}
+
+INT_PTR MraGetXStatusEx(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=1;
+ HANDLE hContact=(HANDLE)wParam;
+ ICQ_CUSTOM_STATUS *pData=(ICQ_CUSTOM_STATUS*)lParam;
+
+ if (pData->cbSize>=sizeof(ICQ_CUSTOM_STATUS))
+ {
+ DWORD dwXStatus;
+
+ iRet=0;
+
+ if (pData->flags&CSSF_MASK_STATUS)
+ {// fill status member
+ *pData->status=MraGetXStatusInternal();
+ }
+
+ if (pData->flags&CSSF_MASK_NAME)
+ {// fill status name member
+ if (pData->flags&CSSF_DEFAULT_NAME)
+ {
+ dwXStatus=(*pData->wParam);
+ if (IsXStatusValid(dwXStatus))
+ {
+ if (pData->flags&CSSF_UNICODE)
+ {
+ lstrcpynW(pData->pwszName,lpcszXStatusNameDef[dwXStatus],(STATUS_TITLE_MAX+1));
+ }else{
+ SIZE_T dwStatusTitleSize;
+
+ dwStatusTitleSize=lstrlenW(lpcszXStatusNameDef[dwXStatus]);
+ if (dwStatusTitleSize>STATUS_TITLE_MAX) dwStatusTitleSize=STATUS_TITLE_MAX;
+
+ WideCharToMultiByte(MRA_CODE_PAGE,0,lpcszXStatusNameDef[dwXStatus],dwStatusTitleSize,pData->pszName,MAX_PATH,NULL,NULL );
+ (*((CHAR*)(pData->pszName+dwStatusTitleSize)))=0;
+ }
+ }else{// failure
+ iRet=1;
+ }
+ }else{
+ if (pData->flags&CSSF_UNICODE)
+ {
+ DB_Mra_GetStaticStringW(hContact,DBSETTING_XSTATUSNAME,pData->pwszName,(STATUS_TITLE_MAX+1),NULL);
+ }else{
+ DB_Mra_GetStaticStringA(hContact,DBSETTING_XSTATUSNAME,pData->pszName,(STATUS_TITLE_MAX+1),NULL);
+ }
+ }
+ }
+
+ if (pData->flags&CSSF_MASK_MESSAGE)
+ {// fill status message member
+ if (pData->flags&CSSF_UNICODE)
+ {
+ DB_Mra_GetStaticStringW(hContact,DBSETTING_XSTATUSMSG,pData->pwszMessage,(STATUS_DESC_MAX+1),NULL);
+ }else{
+ DB_Mra_GetStaticStringA(hContact,DBSETTING_XSTATUSMSG,pData->pszMessage,(STATUS_DESC_MAX+1),NULL);
+ }
+ }
+
+ if (pData->flags&CSSF_DISABLE_UI)
+ {
+ if (pData->wParam) (*pData->wParam)=masMraSettings.bHideXStatusUI;
+ }
+
+ if (pData->flags&CSSF_STATUSES_COUNT)
+ {
+ if (pData->wParam) (*pData->wParam)=(MRA_XSTATUS_COUNT-1);
+ }
+
+ if (pData->flags&CSSF_STR_SIZES)
+ {//**deb ,
+ if (pData->wParam) DB_Mra_GetStaticStringW(hContact,DBSETTING_XSTATUSNAME,NULL,0,(SIZE_T*)pData->wParam);
+ if (pData->lParam) DB_Mra_GetStaticStringW(hContact,DBSETTING_XSTATUSMSG,NULL,0,(SIZE_T*)pData->lParam);
+ }
+ }
+return(iRet);
+}
+
+INT_PTR MraGetXStatusIcon(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet;
+
+ if (wParam==0) wParam=MraGetXStatusInternal();
+ iRet=(INT_PTR)IconLibGetIconEx(masMraSettings.hXStatusAdvancedStatusIcons[wParam],lParam);
+
+return(iRet);
+}
+
+
+DWORD MraSendNewStatus(DWORD dwStatusMir,DWORD dwXStatusMir,LPWSTR lpwszStatusTitle,SIZE_T dwStatusTitleSize,LPWSTR lpwszStatusDesc,SIZE_T dwStatusDescSize)
+{
+ if (masMraSettings.bLoggedIn)
+ {
+ CHAR szValueName[MAX_PATH];
+ WCHAR wszStatusTitle[STATUS_TITLE_MAX+4],wszStatusDesc[STATUS_DESC_MAX+4];
+ DWORD dwStatus,dwXStatus;
+
+ dwStatus=GetMraStatusFromMiradaStatus(dwStatusMir,dwXStatusMir,&dwXStatus);
+ if (IsXStatusValid(dwXStatusMir))
+ {// xstatuses
+ if (lpwszStatusTitle==NULL || dwStatusTitleSize==0)
+ {
+ mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%ldName",dwXStatusMir);
+ if (DB_Mra_GetStaticStringW(NULL,szValueName,wszStatusTitle,(STATUS_TITLE_MAX+1),&dwStatusTitleSize))
+ {// custom xstatus name
+ lpwszStatusTitle=wszStatusTitle;
+ }else{// default xstatus name
+ lpwszStatusTitle=TranslateW(lpcszXStatusNameDef[dwXStatusMir]);
+ dwStatusTitleSize=lstrlenW(lpwszStatusTitle);
+ }
+ }
+
+ if (lpwszStatusDesc==NULL || dwStatusDescSize==0)
+ {
+ mir_snprintf(szValueName,SIZEOF(szValueName),"XStatus%ldMsg",dwXStatusMir);
+ if (DB_Mra_GetStaticStringW(NULL,szValueName,wszStatusDesc,(STATUS_DESC_MAX+1),&dwStatusDescSize))
+ {// custom xstatus description
+ lpwszStatusDesc=wszStatusDesc;
+ }else{// default xstatus description
+ lpwszStatusDesc=NULL;
+ dwStatusDescSize=0;
+ }
+ }
+ }else{// not xstatuses
+ if (lpwszStatusTitle==NULL || dwStatusTitleSize==0)
+ {
+ lpwszStatusTitle=GetStatusModeDescriptionW(dwStatusMir);
+ dwStatusTitleSize=lstrlenW(lpwszStatusTitle);
+ }
+ }
+
+ MraSendCommand_ChangeStatusW(dwStatus,lpcszStatusUri[dwXStatus],lstrlenA(lpcszStatusUri[dwXStatus]),lpwszStatusTitle,dwStatusTitleSize,lpwszStatusDesc,dwStatusDescSize,((DB_Mra_GetByte(NULL,"RTFReceiveEnable",MRA_DEFAULT_RTF_RECEIVE_ENABLE)? FEATURE_FLAG_RTF_MESSAGE:0)|MRA_FEATURE_FLAGS));
+ }
+
+return(0);
+}
+
+
+
+INT_PTR MraSetAwayMsgA(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=1;
+
+ if (masMraSettings.bLoggedIn)
+ {
+ WCHAR wszStatusDesc[STATUS_DESC_MAX+1];
+ SIZE_T dwStatusDescSize;
+
+ if (lParam)
+ {
+ dwStatusDescSize=MultiByteToWideChar(MRA_CODE_PAGE,0,(LPSTR)lParam,-1,wszStatusDesc,(SIZEOF(wszStatusDesc)-1));
+ }else{
+ dwStatusDescSize=0;
+ }
+ wszStatusDesc[dwStatusDescSize]=0;
+
+ iRet=MraSetAwayMsg(wParam,(LPARAM)wszStatusDesc);
+ }
+return(iRet);
+}
+
+INT_PTR MraSetAwayMsg(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=1;
+
+ if (masMraSettings.bLoggedIn)
+ {
+ LPWSTR lpwszStatusDesc;
+ DWORD dwStatus,dwXStatus;
+ SIZE_T dwStatusDescSize;
+
+ lpwszStatusDesc=(LPWSTR)lParam;
+ dwStatusDescSize=lstrlenW(lpwszStatusDesc);
+ dwStatus=MraGetStatus(0,0);
+ dwXStatus=MraGetXStatusInternal();
+
+ if (dwStatus!=ID_STATUS_ONLINE || IsXStatusValid(dwXStatus)==FALSE)
+ {// ,
+ dwStatusDescSize=min(dwStatusDescSize,STATUS_DESC_MAX);
+ MraSendNewStatus(dwStatus,dwXStatus,NULL,0,lpwszStatusDesc,dwStatusDescSize);
+ }
+ iRet=0;
+ }
+return(iRet);
+}
+
+
+INT_PTR MraGetAwayMsg(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=0;
+
+ if (masMraSettings.bLoggedIn && lParam)
+ {
+ CHAR szStatusDesc[MICBLOG_STATUS_MAX+MICBLOG_STATUS_MAX+MAX_PATH],szBlogStatus[MICBLOG_STATUS_MAX+4],szTime[64];
+ DWORD dwTime;
+ SIZE_T dwStatusDescSize;
+ CCSDATA* ccs=(CCSDATA*)lParam;
+ SYSTEMTIME stBlogStatusTime={0};
+
+ if (DB_Mra_GetStaticStringA(ccs->hContact,DBSETTING_BLOGSTATUS,szBlogStatus,SIZEOF(szBlogStatus),NULL))
+ {
+ dwTime=DB_Mra_GetDword(ccs->hContact,DBSETTING_BLOGSTATUSTIME,0);
+ if (dwTime && MakeLocalSystemTimeFromTime32(dwTime,&stBlogStatusTime))
+ {
+ mir_snprintf(szTime,SIZEOF(szTime),"%04ld.%02ld.%02ld %02ld:%02ld: ",stBlogStatusTime.wYear,stBlogStatusTime.wMonth,stBlogStatusTime.wDay,stBlogStatusTime.wHour,stBlogStatusTime.wMinute);
+ }else{
+ szTime[0]=0;
+ }
+
+ dwStatusDescSize=mir_snprintf(szStatusDesc,SIZEOF(szStatusDesc),"%s%s",szTime,szBlogStatus);
+
+ iRet=GetTickCount();
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,ccs->hContact,ACKTYPE_AWAYMSG,ACKRESULT_SUCCESS,(HANDLE)iRet,(LPARAM)szStatusDesc,dwStatusDescSize);
+ }
+ }
+return(iRet);
+}
+
+
+INT_PTR MraAuthAllow(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=1;
+
+ if (masMraSettings.bLoggedIn)
+ {
+ DBEVENTINFO dbei={0};
+
+ dbei.cbSize=sizeof(dbei);
+ if ((dbei.cbBlob=CallService(MS_DB_EVENT_GETBLOBSIZE,wParam,0))!=-1)
+ {
+ dbei.pBlob=(PBYTE)MEMALLOC(dbei.cbBlob);
+ if (dbei.pBlob)
+ {
+ if (CallService(MS_DB_EVENT_GET,wParam,(LPARAM)&dbei)==0)
+ if (dbei.eventType==EVENTTYPE_AUTHREQUEST)
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,dbei.szModule,-1,PROTOCOL_NAMEA,PROTOCOL_NAME_LEN)==CSTR_EQUAL)
+ {
+ LPSTR lpszNick,lpszFirstName,lpszLastName,lpszEMail,lpszRequestReason;
+
+ lpszNick=(LPSTR)(dbei.pBlob+sizeof(DWORD)*2);
+ lpszFirstName=lpszNick+lstrlenA(lpszNick)+1;
+ lpszLastName=lpszFirstName+lstrlenA(lpszFirstName)+1;
+ lpszEMail=lpszLastName+lstrlenA(lpszLastName)+1;
+ lpszRequestReason=lpszEMail+lstrlenA(lpszEMail)+1;
+
+ MraSendCommand_Authorize(lpszEMail,lstrlenA(lpszEMail));
+ iRet=0;
+ }
+ MEMFREE(dbei.pBlob);
+ }
+ }
+ }
+return(iRet);
+}
+
+
+INT_PTR MraAuthDeny(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=1;
+
+ if (lParam && masMraSettings.bLoggedIn)
+ {
+ DBEVENTINFO dbei={0};
+
+ dbei.cbSize=sizeof(dbei);
+ if ((dbei.cbBlob=CallService(MS_DB_EVENT_GETBLOBSIZE,wParam,0))!=-1)
+ {
+ dbei.pBlob=(PBYTE)MEMALLOC(dbei.cbBlob);
+ if (dbei.pBlob)
+ {
+ if (CallService(MS_DB_EVENT_GET,wParam,(LPARAM)&dbei)==0)
+ if (dbei.eventType==EVENTTYPE_AUTHREQUEST)
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,dbei.szModule,-1,PROTOCOL_NAMEA,PROTOCOL_NAME_LEN)==CSTR_EQUAL)
+ {
+ LPSTR lpszNick,lpszFirstName,lpszLastName,lpszEMail,lpszRequestReason;
+ SIZE_T dwEMailSize,dwRequestReasonSize;
+ //HANDLE hContact;
+
+ lpszNick=(LPSTR)(dbei.pBlob+sizeof(DWORD)*2);
+ lpszFirstName=lpszNick+lstrlenA(lpszNick)+1;
+ lpszLastName=lpszFirstName+lstrlenA(lpszFirstName)+1;
+ lpszEMail=lpszLastName+lstrlenA(lpszLastName)+1;
+ dwEMailSize=lstrlenA(lpszEMail);
+ lpszRequestReason=(LPSTR)lParam;
+ dwRequestReasonSize=lstrlenA(lpszRequestReason);
+
+ if (dwRequestReasonSize) MraSendCommand_MessageW(FALSE,NULL,0,0,lpszEMail,dwEMailSize,(LPWSTR)lpszRequestReason,dwRequestReasonSize,NULL,0);
+ //hContact=MraHContactFromEmail(lpszEMail,dwEMailSize,FALSE,TRUE,NULL);
+ //if (DBGetContactSettingByte(hContact,"CList","NotOnList",0)) CallService(MS_DB_CONTACT_DELETE,(WPARAM)hContact,0);
+
+ iRet=0;
+ }
+ MEMFREE(dbei.pBlob);
+ }
+ }
+ }
+return(iRet);
+}
+
+
+
+HANDLE AddToListByEmail(MRA_LPS *plpsEMail,MRA_LPS *plpsNick,MRA_LPS *plpsFirstName,MRA_LPS *plpsLastName,DWORD dwFlags)
+{
+ HANDLE hContact=NULL;
+
+ if (plpsEMail)
+ if (plpsEMail->dwSize)
+ {
+ BOOL bAdded;
+
+ hContact=MraHContactFromEmail(plpsEMail->lpszData,plpsEMail->dwSize,TRUE,TRUE,&bAdded);
+ if (hContact)
+ {
+ if (plpsNick)
+ if (plpsNick->dwSize)
+ {
+ DB_Mra_SetLPSStringA(hContact,"Nick",plpsNick);
+ if (bAdded)
+ {// ///***deb
+ //SetContactBasicInfoW(hContact,SCBIFSI_LOCK_CHANGES_EVENTS,SCBIF_NICK,0,0,0,0,0,NULL,0,plpsNick->lpszData,plpsNick->dwSize,NULL,0);
+ }
+ }
+
+ if (plpsFirstName)
+ if (plpsFirstName->dwSize) DB_Mra_SetLPSStringA(hContact,"FirstName",plpsFirstName);
+
+ if (plpsLastName)
+ if (plpsLastName->dwSize) DB_Mra_SetLPSStringA(hContact,"LastName",plpsLastName);
+
+ if (dwFlags&PALF_TEMPORARY)
+ {
+ DBWriteContactSettingByte(hContact,"CList","Hidden",1);
+ }else{
+ DBDeleteContactSetting(hContact,"CList","NotOnList");
+ }
+
+ if (bAdded) MraUpdateContactInfo(hContact);
+ }
+ }
+return(hContact);
+}
+
+
+INT_PTR MraAddToList(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet;
+ PROTOSEARCHRESULT *psr=(PROTOSEARCHRESULT*)lParam;
+
+ if (psr->cbSize==sizeof(PROTOSEARCHRESULT))
+ {
+ MRA_LPS lpsEMail,lpsNick,lpsFirstName,lpsLastName;
+
+ lpsEMail.dwSize=lstrlenA((LPSTR)psr->email);
+ lpsEMail.lpwszData=psr->email;
+ lpsNick.dwSize=lstrlenA((LPSTR)psr->nick);
+ lpsNick.lpwszData=psr->nick;
+ lpsFirstName.dwSize=lstrlenA((LPSTR)psr->firstName);
+ lpsFirstName.lpwszData=psr->firstName;
+ lpsLastName.dwSize=lstrlenA((LPSTR)psr->lastName);
+ lpsLastName.lpwszData=psr->lastName;
+
+ iRet=(INT_PTR)AddToListByEmail(&lpsEMail,&lpsNick,&lpsFirstName,&lpsLastName,wParam);
+ }else{
+ iRet=0;
+ }
+return(iRet);
+}
+
+
+INT_PTR MraAddToListByEvent(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=0;
+ DBEVENTINFO dbei={0};
+
+ dbei.cbSize=sizeof(dbei);
+ if ((dbei.cbBlob=CallService(MS_DB_EVENT_GETBLOBSIZE,lParam,0))!=-1)
+ {
+ dbei.pBlob=(PBYTE)MEMALLOC(dbei.cbBlob);
+ if (dbei.pBlob)
+ {
+ if (CallService(MS_DB_EVENT_GET,lParam,(LPARAM)&dbei)==0)
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,dbei.szModule,-1,PROTOCOL_NAMEA,PROTOCOL_NAME_LEN)==CSTR_EQUAL)
+ if (dbei.eventType==EVENTTYPE_AUTHREQUEST || dbei.eventType==EVENTTYPE_CONTACTS)
+ {
+ LPSTR lpszRequestReason;
+ MRA_LPS lpsEMail,lpsNick,lpsFirstName,lpsLastName;
+
+ lpsNick.lpszData=(LPSTR)(dbei.pBlob+ ((dbei.eventType==EVENTTYPE_AUTHREQUEST)?(sizeof(DWORD)*2):0) );
+ lpsNick.dwSize=lstrlenA(lpsNick.lpszData);
+ lpsFirstName.lpszData=lpsNick.lpszData+lpsNick.dwSize+1;
+ lpsFirstName.dwSize=lstrlenA(lpsFirstName.lpszData);
+ lpsLastName.lpszData=lpsFirstName.lpszData+lpsFirstName.dwSize+1;
+ lpsLastName.dwSize=lstrlenA(lpsLastName.lpszData);
+ lpsEMail.lpszData=lpsLastName.lpszData+lpsLastName.dwSize+1;
+ lpsEMail.dwSize=lstrlenA(lpsEMail.lpszData);
+ lpszRequestReason=lpsEMail.lpszData+lpsEMail.dwSize+1;
+
+ iRet=(INT_PTR)AddToListByEmail(&lpsEMail,&lpsNick,&lpsFirstName,&lpsLastName,0);
+ }else{
+ dbei.eventType=dbei.eventType;
+ DebugBreak();
+ }
+ MEMFREE(dbei.pBlob);
+ }
+ }
+return(iRet);
+}
+
+
+/*
+ ---------------------------------
+ | Receiving |
+ ---------------------------------
+*/
+INT_PTR MraRecvMessage(WPARAM wParam,LPARAM lParam)
+{
+ CallService(MS_PROTO_RECVMSG,0,(LPARAM)lParam);
+return(0);
+}
+
+
+INT_PTR MraRecvContacts(WPARAM wParam,LPARAM lParam)
+{
+ CCSDATA* ccs=(CCSDATA*)lParam;
+ DBEVENTINFO dbei={0};
+ PROTORECVEVENT* pre=(PROTORECVEVENT*)ccs->lParam;
+
+ dbei.cbSize=sizeof(dbei);
+ dbei.szModule=PROTOCOL_NAMEA;
+ dbei.timestamp=pre->timestamp;
+ dbei.flags=(pre->flags&PREF_CREATEREAD)?DBEF_READ:0;
+ dbei.eventType=EVENTTYPE_CONTACTS;
+ dbei.cbBlob=pre->lParam;
+ dbei.pBlob=(PBYTE)pre->szMessage;
+
+ CallService(MS_DB_EVENT_ADD,(WPARAM)ccs->hContact,(LPARAM)&dbei);
+return(0);
+}
+
+
+INT_PTR MraRecvFile(WPARAM wParam,LPARAM lParam)
+{
+ CCSDATA* ccs=(CCSDATA*)lParam;
+ PROTORECVFILET* pre=(PROTORECVFILET*)ccs->lParam;
+
+ CallService(MS_PROTO_RECVFILET,0,(LPARAM)lParam);
+return(0);
+}
+
+
+INT_PTR MraRecvAuth(WPARAM wParam,LPARAM lParam)
+{
+ CCSDATA* ccs=(CCSDATA*)lParam;
+ DBEVENTINFO dbei={0};
+ PROTORECVEVENT* pre=(PROTORECVEVENT*)ccs->lParam;
+
+ dbei.cbSize=sizeof(dbei);
+ dbei.szModule=PROTOCOL_NAMEA;
+ dbei.timestamp=pre->timestamp;
+ dbei.flags=(pre->flags&PREF_CREATEREAD)?DBEF_READ:0;
+ dbei.eventType=EVENTTYPE_AUTHREQUEST;
+ dbei.cbBlob=pre->lParam;
+ dbei.pBlob=(PBYTE)pre->szMessage;
+
+ CallService(MS_DB_EVENT_ADD,(WPARAM)NULL,(LPARAM)&dbei);
+return(0);
+}
+
+
+/*
+ ---------------------------------
+ | Sending |
+ ---------------------------------
+*/
+INT_PTR MraSendAuthRequest(WPARAM wParam,LPARAM lParam)
+{// internal only
+ INT_PTR iRet=1;
+
+ if (masMraSettings.bLoggedIn && lParam)
+ {
+ BOOL bSlowSend;
+ CHAR szEMail[MAX_EMAIL_LEN];
+ LPWSTR lpwszMessage;
+ SIZE_T dwEMailSize,dwMessageSize;
+ CCSDATA* ccs=(CCSDATA*)lParam;
+
+ if (ccs->wParam&PREF_UNICODE)//flags
+ {
+ lpwszMessage=(LPWSTR)ccs->lParam;
+ dwMessageSize=lstrlenW(lpwszMessage);
+ }else{
+ dwEMailSize=lstrlenA((LPSTR)ccs->lParam);
+ lpwszMessage=(LPWSTR)MEMALLOC(((dwEMailSize+MAX_PATH)*sizeof(WCHAR)));
+ if (lpwszMessage)
+ {
+ dwMessageSize=MultiByteToWideChar(MRA_CODE_PAGE,0,(LPSTR)ccs->lParam,dwEMailSize,lpwszMessage,(dwEMailSize+MAX_PATH));
+ }
+ }
+
+ if (lpwszMessage)
+ {
+ if (DB_Mra_GetStaticStringA(ccs->hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ bSlowSend=DB_Mra_GetByte(NULL,"SlowSend",MRA_DEFAULT_SLOW_SEND);
+ iRet=MraSendCommand_MessageW(bSlowSend,ccs->hContact,ACKTYPE_AUTHREQ,MESSAGE_FLAG_AUTHORIZE,szEMail,dwEMailSize,lpwszMessage,dwMessageSize,NULL,0);
+ if (bSlowSend==FALSE)
+ {
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,ccs->hContact,ACKTYPE_AUTHREQ,ACKRESULT_SUCCESS,(HANDLE)iRet,(LPARAM)NULL,0);
+ }
+ iRet=0;
+ }
+
+ if (lpwszMessage!=(LPWSTR)ccs->lParam) MEMFREE(lpwszMessage);
+ }
+ }
+return(iRet);
+}
+
+
+INT_PTR MraSendMessage(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=0;
+ CCSDATA* ccs=(CCSDATA*)lParam;
+
+ if (masMraSettings.bLoggedIn)
+ {
+ BOOL bSlowSend,bMemAllocated=FALSE;
+ CHAR szEMail[MAX_EMAIL_LEN];
+ DWORD dwFlags=0;
+ LPSTR lpszMessage;
+ LPWSTR lpwszMessage=NULL;
+ SIZE_T dwEMailSize,dwMessageSize=0;
+
+ lpszMessage=(LPSTR)ccs->lParam;
+ dwMessageSize=lstrlenA(lpszMessage);
+ if (ccs->wParam&PREF_UNICODE)//flags
+ {
+ lpwszMessage=(LPWSTR)(lpszMessage+dwMessageSize+1);
+ }else
+ if (ccs->wParam&PREF_UTF){// convert to unicode from utf8
+ lpwszMessage=(LPWSTR)MEMALLOC(((dwMessageSize+MAX_PATH)*sizeof(WCHAR)));
+ if (lpwszMessage)
+ {
+ dwMessageSize=MultiByteToWideChar(CP_UTF8,0,lpszMessage,dwMessageSize,lpwszMessage,(dwMessageSize+MAX_PATH));
+ bMemAllocated=TRUE;
+ }
+ }else{// convert to unicode from ansi
+ MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG,0,TranslateW(L"Send ANSI"));
+ lpwszMessage=(LPWSTR)MEMALLOC(((dwMessageSize+MAX_PATH)*sizeof(WCHAR)));
+ if (lpwszMessage)
+ {
+ dwMessageSize=MultiByteToWideChar(MRA_CODE_PAGE,0,lpszMessage,dwMessageSize,lpwszMessage,(dwMessageSize+MAX_PATH));
+ bMemAllocated=TRUE;
+ }
+ }
+
+ if (lpwszMessage)
+ {
+ if (DB_Mra_GetStaticStringA(ccs->hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ bSlowSend=DB_Mra_GetByte(NULL,"SlowSend",MRA_DEFAULT_SLOW_SEND);
+
+ if (DB_Mra_GetByte(NULL,"RTFSendEnable",MRA_DEFAULT_RTF_SEND_ENABLE) && (MraContactCapabilitiesGet(ccs->hContact)&FEATURE_FLAG_RTF_MESSAGE))
+ {
+ dwFlags|=MESSAGE_FLAG_RTF;
+ }
+
+ iRet=MraSendCommand_MessageW(bSlowSend,ccs->hContact,ACKTYPE_MESSAGE,dwFlags,szEMail,dwEMailSize,lpwszMessage,dwMessageSize,NULL,0);
+ if (bSlowSend==FALSE)
+ {
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,ccs->hContact,ACKTYPE_MESSAGE,ACKRESULT_SUCCESS,(HANDLE)iRet,(LPARAM)NULL,0);
+ }
+ }
+
+ if (bMemAllocated) MEMFREE(lpwszMessage);
+ }else{
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,ccs->hContact,ACKTYPE_MESSAGE,ACKRESULT_FAILED,NULL,(LPARAM)"Cant allocate buffer for convert to unicode.",-1);
+ }
+ }else{
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,ccs->hContact,ACKTYPE_MESSAGE,ACKRESULT_FAILED,NULL,(LPARAM)"You cannot send when you are offline.",-1);
+ }
+return(iRet);
+}
+
+
+INT_PTR MraSendContacts(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=0;
+ CCSDATA* ccs=(CCSDATA*)lParam;
+
+ if (masMraSettings.bLoggedIn && lParam)
+ {
+ BOOL bSlowSend;
+ CHAR szEMail[MAX_EMAIL_LEN];
+ LPWSTR lpwszData,lpwszDataCurrent,lpwszNick;
+ SIZE_T i,dwContacts,dwDataBuffSize,dwEMailSize,dwStringSize,dwNickSize;
+ HANDLE *hContactsList=(HANDLE*)ccs->lParam;
+
+ dwContacts=HIWORD(ccs->wParam);
+ dwDataBuffSize=(dwContacts*(MAX_EMAIL_LEN*2));
+ lpwszData=(LPWSTR)MEMALLOC((dwDataBuffSize*sizeof(WCHAR)));
+ if (lpwszData)
+ {
+ lpwszDataCurrent=lpwszData;
+ if (DB_Mra_GetStaticStringA(ccs->hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ for(i=0;i<dwContacts;i++)
+ {
+ if (IsContactMra(hContactsList[i]))
+ if (DB_Mra_GetStaticStringW(hContactsList[i],"e-mail",lpwszDataCurrent,(dwDataBuffSize-(lpwszDataCurrent-lpwszData)),&dwStringSize))
+ {
+ lpwszDataCurrent+=dwStringSize;
+ (*lpwszDataCurrent)=';';
+ lpwszDataCurrent++;
+
+ lpwszNick=GetContactNameW(hContactsList[i]);
+ dwNickSize=lstrlenW(lpwszNick);
+ memmove(lpwszDataCurrent,lpwszNick,(dwNickSize*sizeof(WCHAR)));
+ lpwszDataCurrent+=dwNickSize;
+ (*lpwszDataCurrent)=';';
+ lpwszDataCurrent++;
+ }
+ }
+
+ bSlowSend=DB_Mra_GetByte(NULL,"SlowSend",MRA_DEFAULT_SLOW_SEND);
+ iRet=MraSendCommand_MessageW(bSlowSend,ccs->hContact,ACKTYPE_CONTACTS,MESSAGE_FLAG_CONTACT,szEMail,dwEMailSize,lpwszData,(lpwszDataCurrent-lpwszData),NULL,0);
+ if (bSlowSend==FALSE)
+ {
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,ccs->hContact,ACKTYPE_CONTACTS,ACKRESULT_SUCCESS,(HANDLE)iRet,(LPARAM)NULL,0);
+ }
+ }
+ MEMFREE(lpwszData);
+ }
+ }else{
+ ProtoBroadcastAckAsynchEx(PROTOCOL_NAMEA,ccs->hContact,ACKTYPE_CONTACTS,ACKRESULT_FAILED,NULL,(LPARAM)"You cannot send when you are offline.",-1);
+ }
+return(iRet);
+}
+
+
+INT_PTR MraSendUserIsTyping(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=1;
+
+ if (masMraSettings.bLoggedIn && wParam && lParam!=PROTOTYPE_SELFTYPING_OFF)
+ {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ SIZE_T dwEMailSize;
+ HANDLE hContact=(HANDLE)wParam;
+
+ if (MraGetContactStatus(hContact)!=ID_STATUS_OFFLINE && MraGetStatus(0,0)!=ID_STATUS_INVISIBLE)
+ if (DB_Mra_GetStaticStringA(hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ if (MraSendCommand_MessageW(FALSE,hContact,0,MESSAGE_FLAG_NOTIFY,szEMail,dwEMailSize,L" ",1,NULL,0)) iRet=0;
+ }
+ }
+return(iRet);
+}
+
+
+INT_PTR MraSendNudge(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=1;
+
+ if (masMraSettings.bLoggedIn && wParam)
+ {
+ CHAR szEMail[MAX_EMAIL_LEN];
+ LPWSTR lpwszAlarmMessage=TranslateW(MRA_ALARM_MESSAGE);
+ SIZE_T dwEMailSize;
+ HANDLE hContact=(HANDLE)wParam;
+
+ if (DB_Mra_GetStaticStringA(hContact,"e-mail",szEMail,SIZEOF(szEMail),&dwEMailSize))
+ {
+ if (MraSendCommand_MessageW(FALSE,hContact,0,(MESSAGE_FLAG_RTF|MESSAGE_FLAG_ALARM),szEMail,dwEMailSize,lpwszAlarmMessage,lstrlenW(lpwszAlarmMessage),NULL,0)) iRet=0;
+ }
+ }
+return(iRet);
+}
+
+
+INT_PTR MraSetApparentMode(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=1;
+
+ if (masMraSettings.bLoggedIn && lParam)
+ {
+ CCSDATA *ccs=(CCSDATA*)lParam;
+
+ if (ccs->hContact && ccs->wParam==0 || ccs->wParam==ID_STATUS_ONLINE || ccs->wParam==ID_STATUS_OFFLINE)
+ {// Only 3 modes are supported
+ DWORD dwOldMode=DB_Mra_GetWord(ccs->hContact,"ApparentMode",0);
+
+ // Dont send redundant updates
+ if (ccs->wParam!=dwOldMode)
+ {
+ CHAR szEMail[MAX_EMAIL_LEN],szPhones[MAX_EMAIL_LEN];
+ WCHAR wszNick[MAX_EMAIL_LEN];
+ DWORD dwID,dwGroupID,dwContactFlag=0;
+ SIZE_T dwEMailSize,dwNickSize,dwPhonesSize;
+
+ GetContactBasicInfoW(ccs->hContact,&dwID,&dwGroupID,&dwContactFlag,NULL,NULL,szEMail,SIZEOF(szEMail),&dwEMailSize,wszNick,SIZEOF(wszNick),&dwNickSize,szPhones,SIZEOF(szPhones),&dwPhonesSize);
+
+ dwContactFlag&=~(CONTACT_FLAG_INVISIBLE|CONTACT_FLAG_VISIBLE);
+ switch(ccs->wParam){
+ case ID_STATUS_OFFLINE:
+ dwContactFlag|=CONTACT_FLAG_INVISIBLE;
+ break;
+ case ID_STATUS_ONLINE:
+ dwContactFlag|=CONTACT_FLAG_VISIBLE;
+ break;
+ }
+
+ if (MraSendCommand_ModifyContactW(ccs->hContact,dwID,dwContactFlag,dwGroupID,szEMail,dwEMailSize,wszNick,dwNickSize,szPhones,dwPhonesSize))
+ {
+ SetContactBasicInfoW(ccs->hContact,0,SCBIF_FLAG,0,0,dwContactFlag,0,0,NULL,0,NULL,0,NULL,0);
+ iRet=0;// Success
+ }
+ }
+ }
+ }
+return(iRet);
+}
+
+
+INT_PTR MraGetInfo(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=1;
+
+ if (MraUpdateContactInfo(((CCSDATA*)lParam)->hContact))
+ {
+ iRet=0;
+ }
+return(iRet);
+}
+
+
+INT_PTR MraGetAvatarCaps(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=0;
+
+ switch(wParam){
+ case AF_MAXSIZE:
+ iRet=-1;
+ break;
+ case AF_PROPORTION:
+ iRet=PIP_NONE;
+ break;
+ case AF_FORMATSUPPORTED:
+ iRet=0;// no formats to set
+ break;
+ case AF_ENABLED:
+ iRet=1;// allways on
+ break;
+ case AF_DONTNEEDDELAYS:
+ iRet=0;// need delay
+ break;
+ case AF_MAXFILESIZE:
+ iRet=0;//
+ break;
+ case AF_DELAYAFTERFAIL:
+ iRet=5000;
+ break;
+ }
+
+return(iRet);
+}
+
+
+INT_PTR MraGetAvatarInfo(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=GAIR_NOAVATAR;
+
+ if (lParam)
+ {//(DWORD)wParam&GAIF_FORCE
+ PROTO_AVATAR_INFORMATION *ppai=(PROTO_AVATAR_INFORMATION*)lParam;
+ iRet=(INT_PTR)MraAvatarsQueueGetAvatar(masMraSettings.hAvatarsQueueHandle,(DWORD)wParam,ppai->hContact,NULL,(DWORD*)&ppai->format,ppai->filename);
+ }
+return(iRet);
+}
+
+
+INT_PTR MraGetMyAvatar(WPARAM wParam,LPARAM lParam)
+{// need call MS_AV_REPORTMYAVATARCHANGED hook
+ INT_PTR iRet=1;
+
+ if (MraAvatarsGetFileName(masMraSettings.hAvatarsQueueHandle,NULL,GetContactAvatarFormat(NULL,PA_FORMAT_DEFAULT),(LPSTR)wParam,(SIZE_T)lParam,NULL)==NO_ERROR)
+ {
+ LPSTR lpsz=(LPSTR)wParam;
+ iRet=0;
+ }
+return(iRet);
+}
+
+
+INT_PTR MraBasicSearch(WPARAM wParam,LPARAM lParam)
+{
+return(MraSearchByEmail(wParam,lParam));
+}
+
+INT_PTR MraSearchByEmail(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=0;
+
+ if (masMraSettings.bLoggedIn && lParam)
+ {
+ CHAR szEMail[MAX_EMAIL_LEN]={0};
+ SIZE_T dwEMailSize;
+
+ dwEMailSize=(WideCharToMultiByte(MRA_CODE_PAGE,0,(LPWSTR)lParam,-1,szEMail,SIZEOF(szEMail),NULL,NULL)-1);
+ iRet=MraSendCommand_WPRequestByEMail(NULL,ACKTYPE_SEARCH,szEMail,dwEMailSize);
+ }
+return(iRet);
+}
+
+INT_PTR MraSearchByName(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=0;
+
+ if (masMraSettings.bLoggedIn && lParam)
+ {
+ PROTOSEARCHBYNAME *psbn=(PROTOSEARCHBYNAME*)lParam;
+
+ if (psbn->pszNick || psbn->pszFirstName || psbn->pszLastName)
+ {
+ DWORD dwRequestFlags=0;
+ SIZE_T dwNickSize=0,dwFirstNameSize=0,dwLastNameSize=0;
+
+ if (psbn->pszNick) dwNickSize=lstrlenW(psbn->pszNick);
+ if (psbn->pszFirstName) dwFirstNameSize=lstrlenW(psbn->pszFirstName);
+ if (psbn->pszLastName) dwLastNameSize=lstrlenW(psbn->pszLastName);
+
+ if (dwNickSize) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_NICKNAME);
+ if (dwFirstNameSize) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_FIRSTNAME);
+ if (dwLastNameSize) SetBit(dwRequestFlags,MRIM_CS_WP_REQUEST_PARAM_LASTNAME);
+
+ iRet=MraSendCommand_WPRequestW(NULL,ACKTYPE_SEARCH,dwRequestFlags,NULL,0,NULL,0,psbn->pszNick,dwNickSize,psbn->pszFirstName,dwFirstNameSize,psbn->pszLastName,dwLastNameSize,0,0,0,0,0,0,0,0,0);
+ }
+ }
+return(iRet);
+}
+
+INT_PTR MraCreateAdvSearchUI(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=0;
+
+ if (masMraSettings.hInstance && lParam)
+ {
+ iRet=(INT_PTR)CreateDialogParam(masMraSettings.hInstance,MAKEINTRESOURCE(IDD_MRAADVANCEDSEARCH),(HWND)lParam,AdvancedSearchDlgProc,0);
+ }
+return(iRet);
+}
+
+INT_PTR MraSearchByAdvanced(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=0;
+
+ if (masMraSettings.bLoggedIn && lParam)
+ {
+ iRet=(INT_PTR)AdvancedSearchFromDlg((HWND)lParam);
+ }
+return(iRet);
+}
+
+
+
+
+
+INT_PTR MraFileResume(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=1;
+
+ if (wParam && lParam)
+ {
+ PROTOFILERESUME *pfr=(PROTOFILERESUME*)lParam;
+ //icq_sendFileResume((filetransfer*)wParam,pfr->action,pfr->szFilename);
+ iRet=0;// Success
+ }
+return(iRet);
+}
+
+INT_PTR MraFileAllow(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=0;
+
+ if (lParam)
+ if (((CCSDATA*)lParam)->wParam)
+ {
+ LPWSTR lpwszPath;
+ SIZE_T dwPathSize;
+ CCSDATA *pcds=(CCSDATA*)lParam;
+ PROTORECVEVENT *prce=(PROTORECVEVENT*)pcds->lParam;
+ PROTORECVFILET *prcf=(PROTORECVFILET*)pcds->lParam;
+
+ lpwszPath=(LPWSTR)((CCSDATA*)lParam)->lParam;
+ dwPathSize=lstrlenW(lpwszPath);
+
+ if (MraFilesQueueAccept(masMraSettings.hFilesQueueHandle,((CCSDATA*)lParam)->wParam,lpwszPath,dwPathSize)==NO_ERROR)
+ {
+ iRet=((CCSDATA*)lParam)->wParam; // Success
+ }
+ }
+return(iRet);
+}
+
+INT_PTR MraFileDenyCancel(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=1;
+
+ if (lParam)
+ if (((CCSDATA*)lParam)->wParam)
+ {// description: (LPSTR)((CCSDATA*)lParam)->lParam
+ MraFilesQueueCancel(masMraSettings.hFilesQueueHandle,((CCSDATA*)lParam)->wParam,TRUE);
+ iRet=0; // Success
+ }
+return(iRet);
+}
+
+
+
+INT_PTR MraFileSend(WPARAM wParam,LPARAM lParam)
+{
+ INT_PTR iRet=0;
+
+ if (masMraSettings.bLoggedIn && wParam && lParam)
+ if (((CCSDATA*)lParam)->hContact && ((CCSDATA*)lParam)->lParam)
+ {// (LPSTR)((CCSDATA*)lParam)->wParam,lstrlenA((LPSTR)((CCSDATA*)lParam)->wParam) - description
+ LPWSTR *plpwszFiles=(LPWSTR*)((CCSDATA*)lParam)->lParam;
+ SIZE_T dwFilesCount;
+
+ for(dwFilesCount=0;plpwszFiles[dwFilesCount];dwFilesCount++);
+
+ MraFilesQueueAddSend(masMraSettings.hFilesQueueHandle,0,((CCSDATA*)lParam)->hContact,plpwszFiles,dwFilesCount,(DWORD*)&iRet);
+ }
+return(iRet);
+}
diff --git a/protocols/MRA/Readme_MRA.txt b/protocols/MRA/Readme_MRA.txt
new file mode 100644
index 0000000000..a0904565a9
--- /dev/null
+++ b/protocols/MRA/Readme_MRA.txt
@@ -0,0 +1,502 @@
+Mail.ru Miranda IM
+
+Copyright (C) 2006-2011
+
+
+ Mail.ru .
+
+
+ !
+ !
+ ,
+ , ,
+ , .
+
+ .
+
+ .
+ - , API .
+ ( - )
+
+
+
+
+ , mail.ru MRA
+ PopUp - , , .
+ mToolTip/Tipper - . .
+ SMS (sms.dll) - . history++
+ Nudge (nudge.dll) - . , .
+ WATrack (watrack.dll) - MRA . .
+
+
+
+ RTF ( )
+ :
+- zlib.dll, , ( )
+- tabsramm history++ , tabsramm history++ ,
+ history++ RTF
+
+
+ :
+
+ look-in , , MRA ICQ.
+ look-in MRA ICQ.
+
+ , ;)
+
+ , , /.
+
+ Updater .
+
+ (Network), :
+ .
+
+ , .
+ ,
+ ,
+,
+ , , .
+ , , . Mail.ru .
+
+ , Deny, , .
+
+ You were added - .
+
+ , ( : , ).
+
+
+ :
+ "MRA"
+"NLBFailDirectConnect"(byte)=0
+ NLB mrim1.mail.ru - mrim8.mail.ru
+ .
+
+"UseDisplayModuleName"(byte)=1
+
+ .
+ .
+
+"MirVerCustom"(str)=NULL
+ ( ), :
+{client="magent" version="5.3" build="2544"}
+{client="jagent" version="2.1.8"}
+{client="QIP Infium" version="2.0" build="9024"}
+{client="magent" name="Miranda IM" title="Miranda IM 0.8.0.27 Unicode (MRA v1.16.0.4), version: 1.16" version="777.1.16.0" build="4" protocol="1.16"}
+( {} )
+
+"MirVerRaw"(byte)=0
+ "MirVer" , , .
+ .
+
+"ConnectReTryCountMRIM"(dword)=2
+
+
+"ConnectReTryCountNLB"(dword)=3
+
+
+"ConnectReTryCountFileSend"(dword)=2
+
+
+"ConnectReTryCountMRIMProxy"(dword)=3
+
+
+"TimeOutConnectMRIM"(dword)=16 * 1
+ ,
+2-16 .
+
+"TimeOutConnectNLB"(dword)=16 * 1
+ ,
+2-16 .
+
+"TimeOutReceiveNLB"(dword)=20 * 1
+ ,
+ 20 .
+
+"TimeOutConnectFileSend"(dword)=auto * 1
+ ,
+ 30 , .
+ , .
+2-16 .
+ auto (= 30/ ).
+
+"TimeOutReceiveFileData"(dword)=600 * 1
+ ,
+ , .
+ 600 .
+
+* 1: / ( GPRS) .
+ , , 5 .
+0 -
+
+* 2: =30 ,
+ , 2 .
+ MRIM .
+ (MRIM, NLB, Avatars)
+ .
+
+
+
+ "MRA Avatars"
+"DefaultAvatarFileName"(str)="_default.jpg"
+ , .
+
+"WorkThreadsCount"(dword)=4
+ .
+ : 1 64.
+ 4.
+
+"ConnectReTryCount"(dword)=3
+
+
+"TimeOutConnect"(dword)=16
+ ,
+ , .
+2-16 .
+
+"TimeOutReceive"(dword)=30
+ ,
+ 30 .
+
+
+
+ mToolTip:
+%sicon%photo
+%#%lsstatus|%%%%|, %lsday|%%%%|.%lsmonth|%%%%|.%lsyear|%%%%| @ %lshours|%%%%|:%lsminutes|%%%%|:%lsseconds|%%%%|
+%#<b>%lname|%%%%|</b> (%first|%%%%| %last|%%%%|%gender|, %%%%|)
+%#<b>Online since:</b>%tab%logondate|%%%%| @ %logontime|%%%%| (%logonsince|%%%%|)
+%%<b>Email:</b>%tab%tab%mail|%%%%|
+%%<b>Phone:</b>%tab%phone|%%%%|
+%%<b>Cellular:</b>%tab%cell|%%%%|
+%#<b>Age:</b>%tab%tab%age|%%%%| (%bday|%%%%|.%bmonth|%%%%|.%byear|%%%%|)%dtb|, to birthday: %%%%|
+%%<b>Location:</b>%tab%user_About|%%%%|
+%#<b>lient:</b>%tab%tab%mver|%%%%|
+%#<b>IP:</b>%tab%tab%ip|%%%% |%realip|(%%%%)|
+%#<b>Last info time:</b>%infodate|%%%%| @ %infotime|%%%%|
+%%<b>Avatar upd time:</b> %user_MRAAvatarLastModifiedTime|%%%%|
+%#%smsg||%user_XStatusName||%user_XStatusMsg||%line%
+%%%user_XStatusName||
+%%<b>X-Status:</b> %user_XStatusName|%%%%|
+%%<b>X-status message:</b> %user_XStatusMsg|%%%%|
+%%<b>Blog message:</b> %smsg||%smsg|%%%%|
+%%<b>Listening:</b> %user_ListeningTo|%%%%|
+%%%notes||
+%%<b>Notes:</b>%notes||
+%%%notes|%%%%|
+%%Logging:%tab%ilog|%%%%|
+%#%lastmsg||%lastmsgdate||%lastmsgtime||
+%#<b>Last message (%lastmsgdate|%%%%| @ %lastmsgtime|%%%%|):%lastmsg||</b>
+%#%lastmsg|%%%%|%lastmsgdate||%lastmsgtime||
+
+ mToolTip.ini :
+[MRAAvatarLastCheckTime]
+DBSet=AvatarLastCheckTime
+DBTrans=1
+
+[MRAAvatarLastModifiedTime]
+DBSet=AvatarLastModifiedTime
+DBTrans=1
+
+[MRABlogStatus]
+DBSet=BlogStatus
+
+[ListeningTo]
+DBSet=ListeningTo
+
+[XStatusName]
+DBSet=XStatusName
+
+[XStatusMsg]
+DBSet=XStatusMsg
+
+[About]
+DBSet=About
+
+
+
+ Tipper YM Black Roland ( http://www.rozhuk.org.ru/forum/index.php?action=profile;u=142 )
+http://www.rozhuk.org.ru/forum/index.php?topic=3.msg840#msg840
+
+
+
+Change Log:
+
+Version 1.20.0.1 // 2008.10
+ - x64
+ - ( mode message)
+ - : ,
+ - ()
+ - ,
+ - :
+ - Extra Icons Service (extraicons.dll)
+ - WATrack (watrack.dll)
+ - ListeningTo /
+ - 4
+ -
+ - ,
+ - , ( )
+ - WatchDog: - ,
+ -
+ -
+ - : %miranda_avatarcache%; , ,
+ - (zlib.dll, xstatus_MRA.dll)
+ -
+ - ,
+ - IcoLib
+ - IcoLib
+ - - IcoLib
+ - - ,
+ - "BlogStatusMusic" "ListeningTo"
+ - ,
+ - CRT ,
+ -
+ - QueueUserAPC ,
+ -
+ - ,
+ - : -
+ - : ,
+ - : ,
+ - : , -
+ - : xstatus_MRA.dll (demon_lite)
+ - :
+ - :
+ - : 0.8.0.30
+ - : () , :
+ - : / SMS XML
+ - : MirVerCustom
+ - :
+
+Version 1.16.0.3 // 2008.09.16
+ - Unicode
+ - Folders
+ - :
+ - IP
+ -
+ - , .
+ - ,
+ -
+ -
+ - ,
+ - :
+ -
+ -
+
+
+Version 1.14.0.6 // 2008.02
+ - Unicode
+
+Version 1.14.0.5 // 2008.01.30
+ - 0.8
+ - :
+ - : "" " "
+ -
+
+Version 1.14.0.3 // 2008.01.20
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ - SMS
+ - (User agent),
+ -
+
+Version 1.13.29.1 // 2007.08.10
+ - mail.ru
+ -
+ - : ,
+ -
+ - Click to Inbox ( )
+ - zlib: ( )
+ - zlib: (9, 6)
+ - : , : , , / ,
+ - clist_modern
+ - :
+ - ,
+ - /
+ - HTTPS , 443 ( )
+ -
+ -
+ - :
+
+
+Version 1.8.0.27 // 2007.02.24
+ - RTF
+ - :
+ - :
+
+Version 1.8.0.25 // 2007.02.20
+ - ( 0.6.0.100 )
+ - :
+ - ( :) )
+ - ,
+ - : Smart RTF - ( RTF)
+ -
+ -
+ -
+ -
+ - , Secure IM
+ -
+ - ,
+
+Version 1.8.0.23
+ -
+ - RTF , http://community.livejournal.com/ru_mirandaim/494383.html
+ - RTF: BB ( MadBrozzeR)
+ - ( Nudge ) ( )
+ - Nudge ( )
+ -
+ - "UseDisplayModuleName"
+ - ( - 1000 )
+ - ( )
+ - : ,
+
+Version 1.8.0.21
+ - SMS ( SMS.dll 0.2.4.9 , )
+ - ,
+ -
+ -
+ - StartupStatus
+ -
+ -
+ -
+ - : / 100%,
+ - :
+ - : , MRA
+ - :
+
+Version 1.8.0.19 // 2006.07.19
+ - IcoLib
+ - ( )
+ -
+ - "View Alboom" "View Album"
+ - ,
+ - ""
+ - ( )
+ -
+
+Version 1.8.0.17 // 2006.07.14
+ - , !
+ - e-mail
+ - e-mail
+ -
+ -
+ - 1251
+
+Version 1.8.0.15
+ - , MRA
+ - , () MRA
+ - ( , clist_mw.dll, clist_modern.dll - .)
+ - , (NewStatusNotify )
+ - email
+ - , email mail.ru
+ - ( - )
+ - : =primary, . 1=, . 2=
+
+Version 1.8.0.13 // 2006.06.23
+ -
+ - -
+
+Version 1.8.0.11 // 2006.06.16
+ -
+ -
+ - /
+
+Version 1.8.0.9 // 2006.06.12
+ -
+ -
+
+Version 1.8.0.7 // 2006.05.28
+ -
+ - , ,
+ -
+ -
+ - , ,
+
+Version 1.8.0.5 // 2006.05.26
+ - : NLB mrim1.mail.ru - mrim8.mail.ru
+
+Version 1.8.0.3 // 2006.04.03
+ -
+ -
+ -
+ - IP ( 192.168.0.1:26775, )
+ - ( NAT )
+ - ( / , )
+
+Version 1.8.0.1 // 2006.03.16
+ -
+ -
+
+Version 1.0.0.33 // 2006.03.11
+ -
+ - "MirVer", fingerprint
+ -
+
+Version 1.0.0.31 // 2006.03.05
+ -
+ - "Undefined message deliver error" -
+
+Version 1.0.0.29 // 2006.02.17
+ -
+ - ( Yuri Ermakov)
+ -
+
+Version 1.0.0.27 // 2006.01.27
+ -
+ -
+
+Version 1.0.0.25 // 2006.01.17
+ - , : MRA\_default.jpg
+ -
+ - msvcr70.dll
+
+Version 1.0.0.23 // 2006.01.16
+ - .
+
+Version 1.0.0.21 // 2006.01.15
+ - ,
+
+Version 1.0.0.19 // 2006.01.15
+ - RTF ,
+ -
+ -
+ - ( NLB )
+ - " " " "
+ -
+
+Version 1.0.0.17 // 2006.01.13
+ -
+
+Version 1.0.0.15 // 2006.01.10
+ - : " " ( 1.0.0.11)
+
+Version 1.0.0.11 // 2006.01.10
+ -
+ - Zhuki.mail.ru
+ -
+ - /
+
+Version 1.0.0.9 // 2006.01.07
+ - TzSpecificLocalTimeToSystemTime , Microsoft Windows 2000
+
+Version 1.0.0.7 // 2006.01.06
+ - ( / )
+ -
+ - ,
+ -
+ - Mail.ru
+ - , :
+ - :
+
+Version 1.0.0.5 // 2006.01.03
+ - .
+ - .
+ - .
+ - "MRA_proto.dll" "proto_MRA.dll".
+ - .
+
+Version 1.0.0.3 // 2005.12.31
+ - \ No newline at end of file
diff --git a/protocols/MRA/Sdk/Base64.h b/protocols/MRA/Sdk/Base64.h
new file mode 100644
index 0000000000..f371399a06
--- /dev/null
+++ b/protocols/MRA/Sdk/Base64.h
@@ -0,0 +1,380 @@
+/*
+ * Copyright (c) 2003 Rozhuk Ivan <rozhuk.im@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+
+#if !defined(AFX_BASE64__H__INCLUDED_)
+#define AFX_BASE64__H__INCLUDED_
+
+
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+
+//typedef unsigned char BYTE;
+//
+// BASE64 coding:
+// 214 46 138
+// 11010100 00101110 10001010
+// ! ! !
+// ---------->>> convert 3 8bit to 4 6bit
+// 110101 000010 111010 001010
+// 53 2 58 10
+// this numbers is offset in array coding below...
+//
+ //01234567890123456789012345
+static BYTE *pbtCodingTableBASE64=(BYTE*)"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; //52...63
+static BYTE btDeCodingTableBASE64[256]={64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,62,64,64,64,63,52,53,54,55,56,57,58,59,60,61,64,64,64,64,64,64,64,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,64,64,64,64,64,64,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64};
+
+
+
+
+__inline void BASE64CopyUnSafe(LPCVOID lpcSource,LPCVOID lpcDestination,SIZE_T dwSize,SIZE_T *pdwCopyedSize)
+{// 64
+ LPBYTE lpbSource,lpbDestination;
+
+ lpbSource=(LPBYTE)lpcSource;
+ lpbDestination=(LPBYTE)lpcDestination;
+ while(dwSize--)
+ {
+ if ((*lpbSource)>32 && (*lpbSource)<128) (*lpbDestination++)=(*lpbSource);
+ lpbSource++;
+ }
+ if (pdwCopyedSize) (*pdwCopyedSize)=((SIZE_T)lpbDestination-(SIZE_T)lpcDestination);
+}
+
+
+
+__inline DWORD BASE64EncodeUnSafe(LPCVOID lpcSource,SIZE_T dwSourceSize,LPCVOID lpcDestination,SIZE_T dwDestinationSize,SIZE_T *pdwEncodedSize)
+{// BASE64
+ DWORD dwRetErrorCode;
+ SIZE_T dwEncodedSize=((dwSourceSize*4+11)/12*4+1);//(((dwSourceSize+2)/3)*4);
+
+ if ((dwDestinationSize<dwEncodedSize))
+ {//
+ dwRetErrorCode=ERROR_INSUFFICIENT_BUFFER;
+ }else{//
+ dwEncodedSize=0;
+ if(lpcSource && lpcDestination && dwSourceSize)
+ {
+#ifdef _WIN64
+ LPBYTE lpbtSource=(LPBYTE)lpcSource,lpbtDestination=(LPBYTE)lpcDestination;
+ SIZE_T i;
+
+ for (i=0;i<dwSourceSize;i+=3)
+ {
+ *(lpbtDestination++)=pbtCodingTableBASE64[(*lpbtSource)>>2]; // c1
+ *(lpbtDestination++)=pbtCodingTableBASE64[(((*lpbtSource)<<4)&060) | ((lpbtSource[1]>>4)&017)]; // c2
+ *(lpbtDestination++)=pbtCodingTableBASE64[((lpbtSource[1]<<2)&074) | ((lpbtSource[2]>>6)&03)]; // c3
+ *(lpbtDestination++)=pbtCodingTableBASE64[lpbtSource[2] & 077]; // c4
+ lpbtSource+=3;
+ }
+
+ // If dwSourceSize was not a multiple of 3, then we have encoded too many characters. Adjust appropriately.
+ if(i==(dwSourceSize+1))
+ {// There were only 2 bytes in that last group
+ lpbtDestination[-1]='=';
+ }else
+ if(i==(dwSourceSize+2))
+ {// There was only 1 byte in that last group
+ lpbtDestination[-1]='=';
+ lpbtDestination[-2]='=';
+ }
+
+ (*lpbtDestination)=0;
+ dwEncodedSize=(lpbtDestination-((LPBYTE)lpcDestination));
+
+#else
+ __asm{
+ push ebx //
+ push edi //
+ push esi //
+
+ mov ebx,pbtCodingTableBASE64// ebx =
+ mov ecx,dwSourceSize // ecx =
+ mov edi,lpcDestination // edi =
+ mov esi,lpcSource // esi =
+ cld
+ jmp short read_loop_cmp
+
+ //////////Code function///////////////////////////////////////////
+ //
+ // eax - , 3 //in buff, 3 byte used
+ // eax - , 4 //out buff, 4 byte used
+ code_func:
+ // ,
+ //
+ bswap eax
+ rol eax,6
+ shl al,2
+ ror eax,10
+ shr ax,2
+ shr al,2
+ xlat
+ rol eax,8
+ xlat
+ rol eax,8
+ xlat
+ rol eax,8
+ xlat
+ rol eax,8
+ bswap eax// 188-235
+ ret
+ //////////////////////////////////////////////////////////////////
+
+ /////////////Read & converting cycle//////////////////////////////
+ read_loop:
+ lodsd // 4
+ dec esi // 3
+ and eax,0x00FFFFFF
+ //====================================================
+ // ,
+ //
+ bswap eax
+ rol eax,6
+ shl al,2
+ ror eax,10
+ shr ax,2
+ shr al,2
+ xlat
+ rol eax,8
+ xlat
+ rol eax,8
+ xlat
+ rol eax,8
+ xlat
+ rol eax,8
+ bswap eax
+ //====================================================
+ stosd
+ sub ecx,3
+
+ read_loop_cmp:
+ cmp ecx,3 // , 4
+ jg short read_loop // 3 ,
+
+ /////////////////////////////////////////////////////////////////
+ xor eax,eax //
+ cmp ecx,3 // 3
+ je short tree_byte_tail// 3 ,
+ cmp ecx,2 // 2
+ je short two_byte_tail // 2 ,
+ // , 1
+ //////////tail 1 byte////////////////////////////////////////////
+ mov al,byte ptr [esi] // 1
+ call code_func //
+ and eax,0x0000FFFF //
+ or eax,0x3D3D0000 // 61("=")
+ jmp short end_tail_handler //
+
+ //////////tail 2 byte////////////////////////////////////////////
+ two_byte_tail:
+ mov ax,word ptr [esi] // 2
+ call code_func //
+ and eax,0x00FFFFFF //
+ or eax,0x3D000000 // 61("=")
+ jmp short end_tail_handler //
+
+ //////////tail 3 byte////////////////////////////////////////////
+ tree_byte_tail:
+ lodsw
+ ror eax,16
+ mov al,byte ptr [esi] // 1
+ rol eax,16
+ call code_func //
+
+ end_tail_handler:
+ stosd // 4 ,
+
+ sub edi,lpcDestination // ,
+ mov dwEncodedSize,edi //
+ pop esi //
+ pop edi //
+ pop ebx //
+ }
+#endif
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+ }
+ if (pdwEncodedSize) (*pdwEncodedSize)=dwEncodedSize;
+
+return(dwRetErrorCode);
+}
+
+
+__inline DWORD BASE64Encode(LPCVOID lpcSource,SIZE_T dwSourceSize,LPCVOID lpcDestination,SIZE_T dwDestinationSize,SIZE_T *pdwEncodedSize)
+{// BASE64
+ DWORD dwRetErrorCode;
+
+ __try
+ {
+ dwRetErrorCode=BASE64EncodeUnSafe(lpcSource,dwSourceSize,lpcDestination,dwDestinationSize,pdwEncodedSize);
+ }__except(EXCEPTION_EXECUTE_HANDLER){
+ dwRetErrorCode=ERROR_INVALID_ADDRESS;
+ }
+return(dwRetErrorCode);
+}
+
+
+
+__inline DWORD BASE64DecodeUnSafe(LPCVOID lpcSource,SIZE_T dwSourceSize,LPCVOID lpcDestination,SIZE_T dwDestinationSize,SIZE_T *pdwDecodedSize)
+{// BASE64
+ DWORD dwRetErrorCode;
+ SIZE_T dwDecodedSize=((dwSourceSize>>2)*3);// ((dwSourceSize/4)*3);
+
+ if ((dwDestinationSize<dwDecodedSize))
+ {//
+ dwRetErrorCode=ERROR_INSUFFICIENT_BUFFER;
+ }else{//
+ dwDecodedSize=0;
+ if(lpcSource && lpcDestination)
+ {//
+ if (dwSourceSize>3)
+ {
+#ifdef _WIN64
+ LPBYTE lpbtSource=(LPBYTE)lpcSource,lpbtDestination=(LPBYTE)lpcDestination;
+
+ for(SIZE_T i=0;i<dwSourceSize;i+=4)
+ {
+ *(lpbtDestination++)=(unsigned char) (btDeCodingTableBASE64[(*lpbtSource)] << 2 | btDeCodingTableBASE64[lpbtSource[1]] >> 4);
+ *(lpbtDestination++)=(unsigned char) (btDeCodingTableBASE64[lpbtSource[1]] << 4 | btDeCodingTableBASE64[lpbtSource[2]] >> 2);
+ *(lpbtDestination++)=(unsigned char) (btDeCodingTableBASE64[lpbtSource[2]] << 6 | btDeCodingTableBASE64[lpbtSource[3]]);
+ lpbtSource+=4;
+ }
+
+ dwDecodedSize=(lpbtDestination-((LPBYTE)lpcDestination));
+ if((*((BYTE*)lpcSource+(dwSourceSize-1)))=='=') dwDecodedSize--;
+ if((*((BYTE*)lpcSource+(dwSourceSize-2)))=='=') dwDecodedSize--;
+
+
+#else
+ __asm{
+ push ebx //
+ push edi //
+ push esi //
+
+ mov ebx,offset btDeCodingTableBASE64// ebx =
+ mov ecx,dwSourceSize // ecx =
+ mov edi,lpcDestination // edi =
+ mov esi,lpcSource // esi =
+ cld
+
+ read_loop:
+ lodsd // 4
+ //===============bit conversion====================================
+ // eax - , 4 //in buff, 4 byte used
+ // eax - , 3 //out buff, 3 byte used
+ //
+ bswap eax
+
+ ror eax,8
+ xlat
+
+ ror eax,8
+ xlat
+
+ ror eax,8
+ xlat
+
+ ror eax,8
+ xlat
+
+ shl al,2
+ shl ax,2
+ rol eax,10
+ shr al,2
+ ror eax,6
+ bswap eax
+ mov edx,eax
+ //234-250
+ //===============================================================
+ stosd
+ dec edi
+ sub ecx,4
+ cmp ecx,3
+ jg short read_loop
+
+ sub edi,lpcDestination // ,
+ mov dwDecodedSize,edi //
+ pop esi //
+ pop edi //
+ pop ebx //
+ }
+
+ if((*((BYTE*)lpcSource+(dwSourceSize-1)))=='=') dwDecodedSize--;
+ if((*((BYTE*)lpcSource+(dwSourceSize-2)))=='=') dwDecodedSize--;
+#endif
+ dwRetErrorCode=NO_ERROR;
+ }else{//
+ dwRetErrorCode=ERROR_INSUFFICIENT_BUFFER;
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+ }
+
+ if (pdwDecodedSize) (*pdwDecodedSize)=dwDecodedSize;
+return(dwRetErrorCode);
+}
+
+
+__inline DWORD BASE64Decode(LPCVOID lpcSource,SIZE_T dwSourceSize,LPCVOID lpcDestination,SIZE_T dwDestinationSize,SIZE_T *pdwDecodedSize)
+{// BASE64
+ DWORD dwRetErrorCode;
+
+ __try
+ {
+ dwRetErrorCode=BASE64DecodeUnSafe(lpcSource,dwSourceSize,lpcDestination,dwDestinationSize,pdwDecodedSize);
+ }__except(EXCEPTION_EXECUTE_HANDLER){
+ dwRetErrorCode=ERROR_INVALID_ADDRESS;
+ }
+return(dwRetErrorCode);
+}
+
+
+__inline DWORD BASE64DecodeFormated(LPCVOID lpcSource,SIZE_T dwSourceSize,LPCVOID lpcDestination,SIZE_T dwDestinationSize,SIZE_T *pdwDecodedSize)
+{// BASE64
+ DWORD dwRetErrorCode;
+
+ if (dwSourceSize<=dwDestinationSize)
+ {
+ BASE64CopyUnSafe(lpcSource,lpcDestination,dwSourceSize,&dwSourceSize);
+ dwRetErrorCode=BASE64DecodeUnSafe(lpcDestination,dwSourceSize,lpcDestination,dwDestinationSize,pdwDecodedSize);
+ }else{//
+ dwRetErrorCode=ERROR_INSUFFICIENT_BUFFER;
+ }
+
+return(dwRetErrorCode);
+}
+
+
+
+#endif // !defined(AFX_BASE64__H__INCLUDED_)
diff --git a/protocols/MRA/Sdk/BuffToLowerCase.h b/protocols/MRA/Sdk/BuffToLowerCase.h
new file mode 100644
index 0000000000..0cb0eb3cc1
--- /dev/null
+++ b/protocols/MRA/Sdk/BuffToLowerCase.h
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2003 Rozhuk Ivan <rozhuk.im@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+
+#if !defined(AFX_BUFFTOLOWERCASE__H__INCLUDED_)
+#define AFX_BUFFTOLOWERCASE__H__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+
+__inline BOOL BuffToLowerCase(LPCVOID lpcOutBuff,LPCVOID lpcBuff,SIZE_T dwLen)
+{
+ BOOL bRet=TRUE;
+
+#if defined(_WIN64) || !defined(_WIN32)
+ if (lpcOutBuff && lpcBuff && dwLen)
+ {
+ BYTE bt;
+ LPBYTE lpbtIn=(LPBYTE)lpcBuff,lpbtOut=(LPBYTE)lpcOutBuff;
+
+ for(SIZE_T i=dwLen;i;i--)
+ {
+ bt=(*(lpbtIn++));
+ if (bt>='A' && bt<='Z') bt|=32;
+ (*(lpbtOut++))=bt;
+ }
+ }
+#else
+ __asm
+ {
+ mov ecx,dwLen
+ test ecx,ecx
+ jz short end_func
+
+ push ebx //
+ push edi //
+ push esi //
+ mov esi,lpcBuff
+ mov edi,lpcOutBuff
+ mov bl,'A'
+ mov bh,'Z'
+ mov ah,32
+ cld
+
+ lowcaseloop:
+ lodsb
+ cmp al,bl
+ jl short savebyte
+ cmp al,bh
+ jg short savebyte
+ or al,ah
+
+ savebyte:
+ stosb
+
+ dec ecx
+ jnz short lowcaseloop
+
+ pop esi //
+ pop edi //
+ pop ebx //
+ end_func:
+ }
+#endif
+return(bRet);
+}
+
+
+
+
+#endif // !defined(AFX_BUFFTOLOWERCASE__H__INCLUDED_) \ No newline at end of file
diff --git a/protocols/MRA/Sdk/DebugFunctions.h b/protocols/MRA/Sdk/DebugFunctions.h
new file mode 100644
index 0000000000..6bd9df5b5a
--- /dev/null
+++ b/protocols/MRA/Sdk/DebugFunctions.h
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2004 Rozhuk Ivan <rozhuk.im@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+
+
+#if !defined(AFX_DEBUG_FUNCTIONS__H__INCLUDED_)
+#define AFX_DEBUG_FUNCTIONS__H__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#ifndef szCRLF
+#define szCRLF TEXT("\r\n")
+#endif
+//////////////////////////////////////////////////////////////////////////
+////////////////////////////DebugPrint////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+// DebugBuildPrint(Helo world);
+// Debug
+#ifdef _DEBUG
+ #define DebugPrintA(szText) OutputDebugStringA((szText))
+ #define DebugPrintW(szText) OutputDebugStringW((szText))
+ #define DebugPrintCRLFA(szText) OutputDebugStringA((szText));OutputDebugStringA("\r\n")
+ #define DebugPrintCRLFW(szText) OutputDebugStringW((szText));OutputDebugStringW(L"\r\n")
+#else
+ #define DebugPrintA(szText)
+ #define DebugPrintW(szText)
+ #define DebugPrintCRLFA(szText)
+ #define DebugPrintCRLFW(szText)
+#endif //_DEBUG
+
+
+#ifdef UNICODE
+ #define DebugPrint DebugPrintW
+ #define DebugPrintCRLF DebugPrintCRLFW
+#else
+ #define DebugPrint DebugPrintA
+ #define DebugPrintCRLF DebugPrintCRLFA
+#endif
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+
+
+
+
+//////////////////////////////////////////////////////////////////////////
+////////////////////////////DebugBuildPrint///////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+// #pragma DebugBuildPrint(Helo world);
+// Build
+#ifdef _DEBUG
+ #pragma warning(disable:4081)
+ #define chSTR2(x) #x
+ #define chSTR(x) chSTR2(x)
+ #define DebugBuildPrint(szText) message(__FILE__ "(" chSTR(__LINE__) "): " #szText)
+ #pragma warning(default:4081)
+#else
+ #define DebugBuildPrint(szText)
+#endif //_DEBUG
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+
+
+
+
+//////////////////////////////////////////////////////////////////////////
+////////////////////////////DebugBufferFill///////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+// DebugBufferFill(szString,sizeof(szString));
+// "A",
+// .
+#ifdef _DEBUG
+ #define DebugBufferFill(lpBuffer,dwSize) memset(lpBuffer,'A',dwSize)
+#else
+ #define DebugBufferFill(lpBuffer,dwSize)
+#endif //_DEBUG
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+
+
+
+
+//////////////////////////////////////////////////////////////////////////
+////////////////////////////DebugBreak////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+// DebugBreak();
+// , API
+#if defined(_DEBUG)
+ #if defined(_X86_)
+ #define DebugBreak() _asm{int 3}
+ #else
+ #include <intrin.h>
+ #define DebugBreak() __debugbreak()
+ #endif
+#else
+ #define DebugBreak()
+#endif //_DEBUG
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+
+
+//////////////////////////////////////////////////////////////////////////
+////////////////////////////DebugBreakIf//////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+// DebugBreakIf();
+// , API,
+#if defined(_DEBUG)
+ #define DebugBreakIf(a) if ((a)) DebugBreak();
+#else
+ #define DebugBreakIf(a)
+#endif //_DEBUG
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+
+
+
+
+#endif // !defined(AFX_DEBUG_FUNCTIONS__H__INCLUDED_)
diff --git a/protocols/MRA/Sdk/FIFOMT.h b/protocols/MRA/Sdk/FIFOMT.h
new file mode 100644
index 0000000000..f0776cba1e
--- /dev/null
+++ b/protocols/MRA/Sdk/FIFOMT.h
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2003 Rozhuk Ivan <rozhuk.im@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+
+
+#if !defined(AFX_FIFO_MT__H__INCLUDED_)
+#define AFX_FIFO_MT__H__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+#include <ListMT.h>
+#include <InterlockedFunctions.h>
+
+
+
+
+
+typedef LIST_MT FIFO_MT, *PFIFO_MT, *LPFIFO_MT;
+typedef PCLIST_MT PCFIFO_MT, LPCFIFO_MT;
+
+typedef LIST_MT_ITEM FIFO_MT_ITEM, *PFIFO_MT_ITEM, *LPFIFO_MT_ITEM;
+typedef PCLIST_MT_ITEM PCFIFO_MT_ITEM, LPCFIFO_MT_ITEM;
+
+typedef LIST_MT_ITERATOR FIFO_MT_ITERATOR, *PFIFO_MT_ITERATOR, *LPFIFO_MT_ITERATOR;
+typedef PCLIST_MT_ITERATOR PCFIFO_MT_ITERATOR, LPCFIFO_MT_ITERATOR;
+
+
+
+
+
+
+#define FifoMTInitialize(pcpmtFifoMT,dwSpinCount) ListMTInitialize(pcpmtFifoMT,dwSpinCount)
+#define FifoMTDestroy(pcpmtFifoMT) ListMTDestroy(pcpmtFifoMT)
+
+
+__inline SIZE_T FifoMTItemPush(PCFIFO_MT pcpmtFifoMT,PCFIFO_MT_ITEM pcffmtiFifoItem,LPVOID lpData)
+{
+ SIZE_T dwRet;
+
+ ListMTLock(pcpmtFifoMT);
+ dwRet=ListMTItemAdd(pcpmtFifoMT,pcffmtiFifoItem,lpData);
+ ListMTUnLock(pcpmtFifoMT);
+
+return(dwRet);
+}
+
+
+__inline DWORD FifoMTItemPop(PCFIFO_MT pcpmtFifoMT,PFIFO_MT_ITEM *ppffmtiFifoItem,LPVOID *plpData)
+{
+ DWORD dwRetErrorCode;
+ PLIST_MT_ITEM plmtiItem;
+
+ ListMTLock(pcpmtFifoMT);
+ if ((dwRetErrorCode=ListMTItemGetFirst(pcpmtFifoMT,&plmtiItem,plpData))==NO_ERROR)
+ {
+ if (ppffmtiFifoItem) (*ppffmtiFifoItem)=plmtiItem;
+ dwRetErrorCode=ListMTItemDelete(pcpmtFifoMT,plmtiItem);
+ }
+ ListMTUnLock(pcpmtFifoMT);
+
+return(dwRetErrorCode);
+}
+
+
+__inline DWORD FifoMTItemGetFirst(PCFIFO_MT pcpmtFifoMT,PFIFO_MT_ITEM *ppffmtiFifoItem,LPVOID *plpData)
+{
+ DWORD dwRetErrorCode;
+
+ ListMTLock(pcpmtFifoMT);
+ dwRetErrorCode=ListMTItemGetFirst(pcpmtFifoMT,ppffmtiFifoItem,plpData);
+ ListMTUnLock(pcpmtFifoMT);
+
+return(dwRetErrorCode);
+}
+
+
+__inline DWORD FifoMTItemGetLast(PCFIFO_MT pcpmtFifoMT,PFIFO_MT_ITEM *ppffmtiFifoItem,LPVOID *plpData)
+{
+ DWORD dwRetErrorCode;
+
+ ListMTLock(pcpmtFifoMT);
+ dwRetErrorCode=ListMTItemGetLast(pcpmtFifoMT,ppffmtiFifoItem,plpData);
+ ListMTUnLock(pcpmtFifoMT);
+
+return(dwRetErrorCode);
+}
+
+
+#define FifoMTGetCount(pcpmtFifoMT) ListMTGetCount(pcpmtFifoMT)
+
+#define FifoMTTryLock(pcpmtFifoMT) ListMTTryLock(pcpmtFifoMT)
+#define FifoMTLock(pcpmtFifoMT) ListMTLock(pcpmtFifoMT)
+#define FifoMTUnLock(pcpmtFifoMT) ListMTUnLock(pcpmtFifoMT)
+
+#define FifoMTItemSwap(pcpmtFifoMT,pcffmtiFifoItem1,pcffmtiFifoItem2) ListMTItemSwap(pcpmtFifoMT,pcffmtiFifoItem1,pcffmtiFifoItem2)
+
+#define FifoMTIteratorMoveFirst(pcpmtFifoMT,pffmtiIterator) ListMTIteratorMoveFirst(pcpmtFifoMT,pffmtiIterator)
+#define FifoMTIteratorMoveLast(pcpmtFifoMT,pffmtiIterator) ListMTIteratorMoveLast(pcpmtFifoMT,pffmtiIterator)
+#define FifoMTIteratorMovePrev(pffmtiIterator) ListMTIteratorMovePrev(pffmtiIterator)
+#define FifoMTIteratorMoveNext(pffmtiIterator) ListMTIteratorMoveNext(pffmtiIterator)
+#define FifoMTIteratorGet(pffmtiIterator,ppffmtiFifoItem,plpData) ListMTIteratorGet(pffmtiIterator,ppffmtiFifoItem,plpData)
+
+
+
+
+#endif // !defined(AFX_FIFO_MT__H__INCLUDED_)
diff --git a/protocols/MRA/Sdk/InterlockedFunctions.h b/protocols/MRA/Sdk/InterlockedFunctions.h
new file mode 100644
index 0000000000..742f904944
--- /dev/null
+++ b/protocols/MRA/Sdk/InterlockedFunctions.h
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2003 Rozhuk Ivan <rozhuk.im@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+
+
+#if !defined(AFX_INTERLOCKED_FUNCTIONS__H__INCLUDED_)
+#define AFX_INTERLOCKED_FUNCTIONS__H__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+
+
+
+#ifdef InterlockedCompareExchange
+#ifndef InterlockedAnd
+LONG FORCEINLINE InterlockedAnd(LONG volatile *Destination,LONG Value)
+{
+ LONG Old;
+
+ do
+ {
+ Old=*Destination;
+ }while(InterlockedCompareExchange(Destination,(Old&Value),Old)!=Old);
+return(Old);
+}
+#endif //InterlockedAnd
+
+
+#ifndef InterlockedOr
+LONG FORCEINLINE InterlockedOr(LONG volatile *Destination,LONG Value)
+{
+ LONG Old;
+
+ do
+ {
+ Old=*Destination;
+ }while(InterlockedCompareExchange(Destination,(Old|Value),Old)!=Old);
+return(Old);
+}
+#endif //InterlockedOr
+
+
+#ifndef InterlockedXor
+LONG FORCEINLINE InterlockedXor(LONG volatile *Destination,LONG Value)
+{
+ LONG Old;
+
+ do
+ {
+ Old=*Destination;
+ }while(InterlockedCompareExchange(Destination,(Old^Value),Old)!=Old);
+return(Old);
+}
+#endif //InterlockedXor
+#endif //InterlockedCompareExchange
+
+
+
+
+
+#ifdef InterlockedCompareExchange64
+#ifndef InterlockedAnd64
+LONGLONG FORCEINLINE InterlockedAnd64(LONGLONG volatile *Destination,LONGLONG Value)
+{
+ LONGLONG Old;
+
+ do
+ {
+ Old=*Destination;
+ }while(InterlockedCompareExchange64(Destination,(Old&Value),Old)!=Old);
+return(Old);
+}
+#endif //InterlockedAnd64
+
+
+#ifndef InterlockedOr64
+LONGLONG FORCEINLINE InterlockedOr64(LONGLONG volatile *Destination,LONGLONG Value)
+{
+ LONGLONG Old;
+
+ do
+ {
+ Old=*Destination;
+ }while(InterlockedCompareExchange64(Destination,(Old|Value),Old)!=Old);
+return(Old);
+}
+#endif //InterlockedOr64
+
+
+#ifndef InterlockedXor64
+LONGLONG FORCEINLINE InterlockedXor64(LONGLONG volatile *Destination,LONGLONG Value)
+{
+ LONGLONG Old;
+
+ do
+ {
+ Old=*Destination;
+ }while(InterlockedCompareExchange64(Destination,(Old^Value),Old)!=Old);
+return(Old);
+}
+#endif //InterlockedXor64
+#endif //InterlockedCompareExchange64
+
+
+
+
+
+#ifndef InterlockedIncrementPointer
+#if defined(_WIN64)
+#define InterlockedIncrementPointer(lpAddend) (LPVOID)InterlockedIncrement64((LONGLONG volatile*)lpAddend)
+#else
+#define InterlockedIncrementPointer(lpAddend) (LPVOID)InterlockedIncrement((LONG volatile*)lpAddend)
+#endif
+#endif //InterlockedIncrementPointer
+
+
+#ifndef InterlockedDecrementPointer
+#if defined(_WIN64)
+#define InterlockedDecrementPointer(lpAddend) (LPVOID)InterlockedDecrement64((LONGLONG volatile*)lpAddend)
+#else
+#define InterlockedDecrementPointer(lpAddend) (LPVOID)InterlockedDecrement((LONG volatile*)lpAddend)
+#endif
+#endif //InterlockedDecrementPointer
+
+
+
+
+
+#endif // !defined(AFX_INTERLOCKED_FUNCTIONS__H__INCLUDED_)
diff --git a/protocols/MRA/Sdk/InternetTime.h b/protocols/MRA/Sdk/InternetTime.h
new file mode 100644
index 0000000000..9999119e6a
--- /dev/null
+++ b/protocols/MRA/Sdk/InternetTime.h
@@ -0,0 +1,473 @@
+/*
+ * Copyright (c) 2003 Rozhuk Ivan <rozhuk.im@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+
+
+#if !defined(AFX_INTERNET_TIME_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
+#define AFX_INTERNET_TIME_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_
+
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+#include <StrToNum.h>
+#include <MemoryFind.h>
+#include <MemoryFindByte.h>
+
+
+
+typedef struct
+{
+ LONG lTimeZone;
+ SYSTEMTIME stTime;
+} INTERNET_TIME;
+
+
+static LPCSTR lpcszenmMonthEnum[13]= {"---","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
+static LPCSTR lpcszenmDayOfWeakEnum[7]= {"Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
+
+#define CRLF "\r\n"
+#define LF "\n"
+//WSP++
+#define LWSHT "\r\n\t"
+#define LWSSP "\r\n "
+//WSP--
+
+//FWS++
+#define FWSHT LWSHT
+#define FWSSP LWSSP
+//FWS--
+
+#define SEPARATOR "\r\n\r\n"
+
+
+//DWORD InternetTimeGetTime (LPCSTR lpszTime,SIZE_T dwTimeSize,INTERNET_TIME *pitTime);
+//BOOL SkeepSPWSP (LPCSTR lpszBuff,SIZE_T dwBuffSize,LPSTR *plpszRetBuff,SIZE_T *pdwRetBuffSize);
+//BOOL WSP2SP (LPCSTR lpszBuff,SIZE_T dwBuffSize,LPSTR lpszRetBuff,SIZE_T *pdwRetBuffSize);
+
+
+
+
+
+__inline BOOL SkeepSPWSP(LPCSTR lpszBuff,SIZE_T dwBuffSize,LPSTR *plpszRetBuff,SIZE_T *pdwRetBuffSize)
+{
+ BOOL bRet=TRUE;
+
+ if (lpszBuff && dwBuffSize && (plpszRetBuff || pdwRetBuffSize))
+ {
+ while ((*lpszBuff)<33 && dwBuffSize)
+ {
+ dwBuffSize--;
+ lpszBuff++;
+ }
+
+ if (plpszRetBuff) (*plpszRetBuff)=(LPSTR)lpszBuff;
+ if (pdwRetBuffSize) (*pdwRetBuffSize)=dwBuffSize;
+ }else{
+ bRet=FALSE;
+ }
+return(bRet);
+}
+
+
+__inline BOOL WSP2SP(LPCSTR lpszBuff,SIZE_T dwBuffSize,LPSTR lpszRetBuff,SIZE_T *pdwRetBuffSize)
+{// WSP->SP
+ BOOL bRet=TRUE;
+
+ if (lpszBuff && dwBuffSize && lpszRetBuff)
+ {
+ LPSTR lpszCurReadPos,pCRLF,lpszCurWritePos;
+ SIZE_T dwToCopy,dwRetBuffSize;
+
+ pCRLF=(LPSTR)lpszBuff;
+ lpszCurReadPos=(LPSTR)lpszBuff;
+ lpszCurWritePos=lpszRetBuff;
+ dwRetBuffSize=0;
+
+ while(pCRLF)
+ {
+ pCRLF=(LPSTR)MemoryFind((pCRLF-lpszBuff),lpszBuff,(dwBuffSize-1),CRLF,2);
+ if (pCRLF)
+ {
+ pCRLF+=2;
+ if ((*pCRLF)==9 || (*pCRLF)==32)// LWS: <US-ASCII HT, horizontal-tab (9)> || <US-ASCII SP, space (32)>
+ {
+ dwToCopy=((pCRLF-2)-lpszCurReadPos);
+ pCRLF++;
+
+ memmove((LPVOID)lpszCurWritePos,(CONST VOID*)lpszCurReadPos,dwToCopy);
+ dwRetBuffSize+=(dwToCopy+1);
+ lpszCurWritePos+=dwToCopy;
+ lpszCurWritePos[0]=32;
+ lpszCurWritePos++;
+ lpszCurReadPos=pCRLF;
+ }
+ }else{
+ dwToCopy=((lpszBuff+dwBuffSize)-lpszCurReadPos);
+ dwRetBuffSize+=dwToCopy;
+ memmove((LPVOID)lpszCurWritePos,(CONST VOID*)lpszCurReadPos,dwToCopy);
+ }
+ }
+
+ if (pdwRetBuffSize) (*pdwRetBuffSize)=dwRetBuffSize;
+ }else{
+ bRet=FALSE;
+ }
+return(bRet);
+}
+
+
+
+__inline BOOL HT2SP(LPCSTR lpszBuff,SIZE_T dwBuffSize,LPSTR lpszRetBuff,SIZE_T *pdwRetBuffSize)
+{// HT->SP
+ BOOL bRet=TRUE;
+
+ if (lpszBuff && dwBuffSize && lpszRetBuff)
+ {
+ LPSTR lpszCurReadPos,pHT,lpszCurWritePos;
+ SIZE_T dwToCopy,dwRetBuffSize;
+
+ pHT=(LPSTR)lpszBuff;
+ lpszCurReadPos=(LPSTR)lpszBuff;
+ lpszCurWritePos=lpszRetBuff;
+ dwRetBuffSize=0;
+
+ while(pHT)
+ {
+ pHT=(LPSTR)MemoryFind((pHT-lpszBuff),lpszBuff,dwBuffSize,"\t",1);
+ if (pHT)
+ {
+ dwToCopy=(pHT-lpszCurReadPos);
+ pHT++;
+
+ dwRetBuffSize+=(dwToCopy+1);
+ memmove((LPVOID)lpszCurWritePos,(CONST VOID*)lpszCurReadPos,dwToCopy);
+ lpszCurWritePos+=dwToCopy;
+ lpszCurWritePos[0]=32;
+ lpszCurWritePos++;
+ lpszCurReadPos=pHT;
+ }else{
+ dwToCopy=((lpszBuff+dwBuffSize)-lpszCurReadPos);
+ dwRetBuffSize+=dwToCopy;
+ memmove((LPVOID)lpszCurWritePos,(CONST VOID*)lpszCurReadPos,dwToCopy);
+ }
+ }
+
+ if (pdwRetBuffSize) (*pdwRetBuffSize)=dwRetBuffSize;
+ }else{
+ bRet=FALSE;
+ }
+return(bRet);
+}
+
+
+
+
+__inline BOOL CleanUnneededSP(LPCSTR lpszBuff,SIZE_T dwBuffSize,LPSTR lpszRetBuff,SIZE_T *pdwRetBuffSize)
+{// nSP->SP, SPCRLF->CRLF, CRLFSP->CRLF
+ BOOL bRet=TRUE;
+
+ if (lpszBuff && dwBuffSize && lpszRetBuff)
+ {
+ LPSTR lpszCurReadPos,pSP,pSPStart,pSPEnd,lpszCurWritePos,pEnd;
+ SIZE_T dwToCopy,dwRetBuffSize;
+
+ pSP=(LPSTR)lpszBuff;
+ lpszCurReadPos=(LPSTR)lpszBuff;
+ lpszCurWritePos=lpszRetBuff;
+ pEnd=((LPSTR)lpszBuff+dwBuffSize);
+ dwRetBuffSize=0;
+
+ while(pSP)
+ {
+ pSP=(LPSTR)MemoryFind((pSP-lpszBuff),lpszBuff,dwBuffSize," ",1);
+ if (pSP)
+ {
+ dwToCopy=(pSP-lpszCurReadPos);
+ pSPStart=pSP;
+ pSPEnd=pSP;
+ while((*pSPEnd)==32 && pSPEnd<pEnd) pSPEnd++;
+
+ // check SP on line start
+ if ((pSPStart-1)>lpszBuff)
+ {
+ if ((*((WORD*)(pSPStart-2)))!=(*((WORD*)CRLF))) dwToCopy++;
+ }else{// buff start
+ if (pSPStart>lpszBuff) dwToCopy++;
+ }
+
+ // check SP on line end
+ if ((pSPEnd+1)<=pEnd)
+ {
+ if ((*((WORD*)pSPEnd))!=(*((WORD*)CRLF))) dwToCopy++;
+ }else{// buff start
+ if (pSPEnd>lpszBuff) dwToCopy++;
+ }
+
+ memmove((LPVOID)lpszCurWritePos,(CONST VOID*)lpszCurReadPos,dwToCopy);
+ lpszCurWritePos+=dwToCopy;
+ dwRetBuffSize+=dwToCopy;
+ lpszCurReadPos=pSPEnd;
+ pSP=pSPEnd;
+ }else{
+ dwToCopy=((lpszBuff+dwBuffSize)-lpszCurReadPos);
+ dwRetBuffSize+=dwToCopy;
+ memmove((LPVOID)lpszCurWritePos,(CONST VOID*)lpszCurReadPos,dwToCopy);
+ }
+ }
+
+ if (pdwRetBuffSize) (*pdwRetBuffSize)=dwRetBuffSize;
+ }else{
+ bRet=FALSE;
+ }
+return(bRet);
+}
+
+
+
+
+__inline SIZE_T CopyText(LPVOID lpOutBuff,LPCVOID lpcBuff,SIZE_T dwLen)
+{
+ SIZE_T dwRet=0;
+
+ if (lpOutBuff && lpcBuff && dwLen)
+ {
+ BYTE bt;
+ LPBYTE lpbtIn=(LPBYTE)lpcBuff,lpbtOut=(LPBYTE)lpOutBuff;
+
+ for(SIZE_T i=dwLen;i;i--)
+ {
+ bt=(*(lpbtIn++));
+ if (bt<127 && (bt>31 || bt==9 || bt==10 || bt==13))
+ {
+ (*(lpbtOut++))=bt;
+ dwRet++;
+ }
+ }
+ }
+return(dwRet);
+}
+
+
+__inline void InternetTimeGetCurrentTime(INTERNET_TIME *pitTime)
+{
+ TIME_ZONE_INFORMATION tzi={0};
+ GetTimeZoneInformation(&tzi);
+ pitTime->lTimeZone=tzi.Bias;
+ GetSystemTime(&pitTime->stTime);
+}
+
+
+__inline DWORD InternetTimeGetString(INTERNET_TIME *pitTime,LPSTR lpszBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSizeRet)
+{// MAILTIME
+ DWORD dwRet=NO_ERROR;
+
+ if (dwBuffSize>31)
+ {
+ LPSTR lpszCurPos=lpszBuff;
+ SIZE_T dwTimeLen=0,dwtm;
+
+ // day of weak// date of mounth// mounth name// year// hours // minutes// seconds
+ dwtm=wsprintfA(lpszCurPos,"%s, %02lu %s %04lu %02lu:%02lu:%02lu ",lpcszenmDayOfWeakEnum[pitTime->stTime.wDayOfWeek],pitTime->stTime.wDay,lpcszenmMonthEnum[pitTime->stTime.wMonth],pitTime->stTime.wYear,pitTime->stTime.wHour,pitTime->stTime.wMinute,pitTime->stTime.wSecond);
+ lpszCurPos+=dwtm;
+ dwTimeLen+=dwtm;
+
+ // time zone
+ if (pitTime->lTimeZone)
+ {
+ if (pitTime->lTimeZone < 0)
+ {// ,
+ (*((BYTE*)lpszCurPos))='+';
+ lpszCurPos++;
+ dwTimeLen++;
+ }
+
+ dwtm=wsprintfA(lpszCurPos,"%04ld",-(((pitTime->lTimeZone/60)*100)+pitTime->lTimeZone%60));
+ lpszCurPos+=dwtm;
+ dwTimeLen+=dwtm;
+ }else{
+ dwtm=wsprintfA(lpszCurPos,"GMT");
+ lpszCurPos+=dwtm;
+ dwTimeLen+=dwtm;
+ }
+
+ if (pdwBuffSizeRet) (*pdwBuffSizeRet)=dwTimeLen;
+ }else{//
+ if (pdwBuffSizeRet) (*pdwBuffSizeRet)=32;
+ dwRet=ERROR_INSUFFICIENT_BUFFER;
+ }
+return(dwRet);
+}
+
+
+
+__inline DWORD InternetTimeGetTime(LPCSTR lpszTime,SIZE_T dwTimeSize,INTERNET_TIME *pitTime)
+{// INTERNET_TIME
+ DWORD dwRet=NO_ERROR;
+
+ if (lpszTime && dwTimeSize && dwTimeSize<4097 && pitTime)
+ {// = Thu, 21 May 1998 05:33:29 -0700 =
+ char sztmBuff[4096];
+ LPSTR lpszCurPos=sztmBuff,lpszTemp;
+ SIZE_T i,dwCurSize=4096,dwTemp;
+
+ memset(pitTime, 0, sizeof(INTERNET_TIME));
+ WSP2SP((LPSTR)lpszTime,dwTimeSize,lpszCurPos,&dwCurSize);
+
+ if (dwCurSize>3)
+ {//
+ if (lpszCurPos[3]==',')
+ {
+ for (i=0;i<8;i++)
+ {
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpcszenmDayOfWeakEnum[i],3,lpszCurPos,3)==CSTR_EQUAL)
+ {
+ pitTime->stTime.wDayOfWeek=(unsigned short)i;
+ break;
+ }
+ }
+
+ lpszCurPos+=4;
+ dwCurSize-=4;
+ }
+
+ if (dwCurSize>2)
+ {//
+ SkeepSPWSP(lpszCurPos,dwCurSize,&lpszCurPos,&dwCurSize);
+ if ((lpszTemp=(LPSTR)MemoryFindByte(0,lpszCurPos,dwCurSize,' ')))
+ {
+ dwTemp=(lpszTemp-lpszCurPos);
+ pitTime->stTime.wDay=(unsigned short)StrToUNum32(lpszCurPos,dwTemp);
+
+ lpszCurPos=(lpszTemp+1);
+ dwCurSize-=(dwTemp+1);
+
+ if (dwCurSize>3)
+ {//
+ SkeepSPWSP(lpszCurPos,dwCurSize,&lpszCurPos,&dwCurSize);
+
+ for (i=1;i<14;i++)
+ {
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpcszenmMonthEnum[i],3,lpszCurPos,3)==CSTR_EQUAL)
+ {
+ pitTime->stTime.wMonth=(unsigned short)i;
+ break;
+ }
+ }
+
+ lpszCurPos+=3;
+ dwCurSize-=3;
+
+
+ if (dwCurSize>3)
+ {//
+ SkeepSPWSP(lpszCurPos,dwCurSize,&lpszCurPos,&dwCurSize);
+ if ((lpszTemp=(LPSTR)MemoryFindByte(0,lpszCurPos,dwCurSize,' ')))
+ {
+ dwTemp=(lpszTemp-lpszCurPos);
+ pitTime->stTime.wYear=(unsigned short)StrToUNum32(lpszCurPos,dwTemp);
+
+ lpszCurPos=(lpszTemp+1);
+ dwCurSize-=(dwTemp+1);
+
+ if (dwCurSize>2)
+ { //
+ SkeepSPWSP(lpszCurPos,dwCurSize,&lpszCurPos,&dwCurSize);
+ if ((lpszTemp=(LPSTR)MemoryFindByte(0,lpszCurPos,dwCurSize,':')))
+ {
+ dwTemp=(lpszTemp-lpszCurPos);
+ pitTime->stTime.wHour=(unsigned short)StrToUNum32(lpszCurPos,dwTemp);
+
+ lpszCurPos=(lpszTemp+1);
+ dwCurSize-=(dwTemp+1);
+
+ if (dwCurSize>2)
+ {//
+ SkeepSPWSP(lpszCurPos,dwCurSize,&lpszCurPos,&dwCurSize);
+ if ((lpszTemp=(LPSTR)MemoryFindByte(0,lpszCurPos,dwCurSize,':')))
+ {
+ dwTemp=(lpszTemp-lpszCurPos);
+ pitTime->stTime.wMinute=(unsigned short)StrToUNum32(lpszCurPos,dwTemp);
+
+ lpszCurPos=(lpszTemp+1);
+ dwCurSize-=(dwTemp+1);
+
+ if (dwCurSize>2)
+ {// ,
+ if ((lpszTemp=(LPSTR)MemoryFindByte(0,lpszCurPos,dwCurSize,' ')))
+ {
+ dwTemp=(lpszTemp-lpszCurPos);
+ pitTime->stTime.wSecond=(unsigned short)StrToUNum32(lpszCurPos,dwTemp);
+
+ lpszCurPos=(lpszTemp+1);
+ dwCurSize-=(dwTemp+1);
+ }
+ }else{//
+ if (dwCurSize)
+ {
+ pitTime->stTime.wSecond=(unsigned short)StrToUNum32(lpszCurPos,dwCurSize);
+ lpszCurPos+=dwCurSize;
+ dwCurSize=0;
+ }
+ }
+ }else{
+ if ((lpszTemp=(LPSTR)MemoryFindByte(0,lpszCurPos,dwCurSize,' ')))
+ {
+ dwTemp=(lpszTemp-lpszCurPos);
+ pitTime->stTime.wMinute=(unsigned short)StrToUNum32(lpszCurPos,dwTemp);
+
+ lpszCurPos=(lpszTemp+1);
+ dwCurSize-=(dwTemp+1);
+ }
+ }
+
+ if (dwCurSize)
+ {//
+ SkeepSPWSP(lpszCurPos,dwCurSize,&lpszCurPos,&dwCurSize);
+ pitTime->lTimeZone=(LONG)StrToNum(lpszCurPos,dwCurSize);
+ if (pitTime->lTimeZone>1300 || pitTime->lTimeZone<-1200) pitTime->lTimeZone=2400;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }else{
+ dwRet=ERROR_INVALID_HANDLE;
+ }
+return(dwRet);
+}
+
+
+
+#endif // !defined(AFX_INTERNET_TIME_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/Sdk/ListMT.h b/protocols/MRA/Sdk/ListMT.h
new file mode 100644
index 0000000000..66e118867d
--- /dev/null
+++ b/protocols/MRA/Sdk/ListMT.h
@@ -0,0 +1,358 @@
+/*
+ * Copyright (c) 2003 Rozhuk Ivan <rozhuk.im@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+
+
+#if !defined(AFX_LIST_MT__H__INCLUDED_)
+#define AFX_LIST_MT__H__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+#include <InterlockedFunctions.h>
+
+#if defined(_MSC_VER)
+#if _MSC_VER >= 800
+#if _MSC_VER >= 1200
+#pragma warning(push)
+#endif
+#pragma warning(disable:4312) // warning C4312: 'type cast' : conversion from 'LONG' to 'PVOID' of greater size
+#endif
+#endif
+
+
+// ,
+typedef struct _LIST_MT_ITEM
+{
+#ifdef __cplusplus
+ _LIST_MT_ITEM *plmtiPrev; // *
+ _LIST_MT_ITEM *plmtiNext; // *
+#else
+ LPVOID *plmtiPrev; // *
+ LPVOID *plmtiNext; // *
+#endif
+ LPVOID lpListMT; // ,
+ LPVOID lpData; // ,
+}LIST_MT_ITEM, *PLIST_MT_ITEM, *LPLIST_MT_ITEM;
+typedef CONST PLIST_MT_ITEM PCLIST_MT_ITEM, LPCLIST_MT_ITEM;
+
+
+// ,
+typedef struct _LIST_MT
+{
+ SIZE_T nCount; // *
+ PLIST_MT_ITEM plmtiFirst; // *
+ PLIST_MT_ITEM plmtiLast; // *
+ CRITICAL_SECTION cs; // *section for exclysive access to List
+}LIST_MT, *PLIST_MT, *LPLIST_MT;
+typedef CONST PLIST_MT PCLIST_MT, LPCLIST_MT;
+
+
+//
+typedef struct _LIST_MT_ITERATOR
+{
+ PLIST_MT_ITEM plmtListMTItem;
+}LIST_MT_ITERATOR, *PLIST_MT_ITERATOR, *LPLIST_MT_ITERATOR;
+//typedef LIST_MT_ITEM LIST_MT_ITERATOR, *PLIST_MT_ITERATOR, *LPLIST_MT_ITERATOR;
+typedef CONST PLIST_MT_ITERATOR PCLIST_MT_ITERATOR, LPCLIST_MT_ITERATOR;
+
+
+
+
+__inline DWORD ListMTInitialize(PCLIST_MT pclmtListMT,DWORD dwSpinCount)
+{
+ DWORD dwRetErrorCode;
+
+#if (_WIN32_WINNT >= 0x0403)
+ if (InitializeCriticalSectionAndSpinCount(&pclmtListMT->cs,((dwSpinCount)? (dwSpinCount | 0x80000000):0L)))
+#else
+ InitializeCriticalSection(&pclmtListMT->cs);
+ if (TRUE)
+#endif
+ {
+ InterlockedExchangePointer((volatile PVOID*)&pclmtListMT->nCount,NULL);
+ pclmtListMT->plmtiFirst=NULL;
+ pclmtListMT->plmtiLast=NULL;
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ dwRetErrorCode=GetLastError();
+ }
+return(dwRetErrorCode);
+}
+
+
+__inline void ListMTDestroy(PCLIST_MT pclmtListMT)
+{
+ InterlockedExchangePointer((volatile PVOID*)&pclmtListMT->nCount,NULL);
+ pclmtListMT->plmtiFirst=NULL;
+ pclmtListMT->plmtiLast=NULL;
+ DeleteCriticalSection(&pclmtListMT->cs);
+ SecureZeroMemory(&pclmtListMT->cs,sizeof(CRITICAL_SECTION));
+}
+
+
+__inline BOOL ListMTTryLock(PCLIST_MT pclmtListMT)
+{
+#if (_WIN32_WINNT >= 0x0400)
+ return(TryEnterCriticalSection(&pclmtListMT->cs));
+#else
+ return(FALSE);
+#endif
+}
+
+
+__inline void ListMTLock(PCLIST_MT pclmtListMT)
+{
+ EnterCriticalSection(&pclmtListMT->cs);
+}
+
+
+__inline void ListMTUnLock(PCLIST_MT pclmtListMT)
+{
+ LeaveCriticalSection(&pclmtListMT->cs);
+}
+
+
+__inline SIZE_T ListMTGetCount(PCLIST_MT pclmtListMT)
+{
+ return((SIZE_T)InterlockedCompareExchangePointer((LPVOID*)&pclmtListMT->nCount,NULL,NULL));
+}
+
+
+__inline SIZE_T ListMTItemAdd(PCLIST_MT pclmtListMT,PCLIST_MT_ITEM pclmtListMTItem,LPVOID lpData)
+{
+ SIZE_T dwRet=(SIZE_T)InterlockedIncrementPointer(&pclmtListMT->nCount);//pclmtListMT->nCount++;
+ pclmtListMTItem->lpData=lpData;
+ pclmtListMTItem->lpListMT=pclmtListMT;
+
+ if (pclmtListMT->plmtiLast)
+ {// add node to end of list
+ pclmtListMTItem->plmtiPrev=pclmtListMT->plmtiLast;
+ pclmtListMTItem->plmtiNext=NULL;
+ pclmtListMT->plmtiLast->plmtiNext=pclmtListMTItem;
+ pclmtListMT->plmtiLast=pclmtListMTItem;
+ }else{// add the first node to the linked list
+ pclmtListMTItem->plmtiPrev=NULL;
+ pclmtListMTItem->plmtiNext=NULL;
+ pclmtListMT->plmtiFirst=pclmtListMTItem;
+ pclmtListMT->plmtiLast=pclmtListMTItem;
+ }
+
+return(dwRet);
+}
+
+
+__inline DWORD ListMTItemDelete(PCLIST_MT pclmtListMT,PCLIST_MT_ITEM pclmtListMTItem)
+{
+ DWORD dwRetErrorCode;
+
+ if (pclmtListMTItem->lpListMT==pclmtListMT && pclmtListMT)
+ {// , .
+ PLIST_MT_ITEM plmtiPrevNode=pclmtListMTItem->plmtiPrev,plmtiNextNode=pclmtListMTItem->plmtiNext;
+
+ if (plmtiPrevNode || plmtiNextNode)
+ {
+ if (plmtiPrevNode && plmtiNextNode==NULL)
+ {// This is the start node in the list to delete
+ //
+ plmtiPrevNode->plmtiNext=NULL;
+ pclmtListMT->plmtiLast=plmtiPrevNode;
+ }else{
+ if (plmtiPrevNode==NULL && plmtiNextNode)
+ {// This is the end node in the list to delete
+ //
+ plmtiNextNode->plmtiPrev=NULL;
+ pclmtListMT->plmtiFirst=plmtiNextNode;
+ }else{//
+ //if (plmtiPrev && plmtiNext)
+ {// Neither start node nor end node in the list
+ plmtiPrevNode->plmtiNext=plmtiNextNode;
+ plmtiNextNode->plmtiPrev=plmtiPrevNode;
+ }
+ }
+ }
+ }else{// This is the only node in the list to delete
+ pclmtListMT->plmtiFirst=NULL;
+ pclmtListMT->plmtiLast=NULL;
+ }
+
+ pclmtListMTItem->lpListMT=NULL;
+ InterlockedDecrementPointer(&pclmtListMT->nCount);// pclmtListMT->nCount--;
+ dwRetErrorCode=NO_ERROR;
+ }else{//
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+__inline LPVOID ListMTItemDataGet(PCLIST_MT_ITEM pclmtListMTItem)
+{
+ return(pclmtListMTItem->lpData);
+}
+
+
+__inline void ListMTItemDataSet(PCLIST_MT_ITEM pclmtListMTItem, LPVOID lpData)
+{
+ pclmtListMTItem->lpData=lpData;
+}
+
+
+__inline DWORD ListMTItemGetFirst(PCLIST_MT pclmtListMT,PLIST_MT_ITEM *pplmtListMTItem,LPVOID *plpData)
+{// , ListMTLock ListMTUnLock
+ DWORD dwRetErrorCode;
+
+ if (pclmtListMT->plmtiFirst)
+ {
+ if (pplmtListMTItem) (*pplmtListMTItem)=pclmtListMT->plmtiFirst;
+ if (plpData) (*plpData)=pclmtListMT->plmtiFirst->lpData;
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ dwRetErrorCode=ERROR_NO_MORE_ITEMS;
+ }
+return(dwRetErrorCode);
+}
+
+
+__inline DWORD ListMTItemGetLast(PCLIST_MT pclmtListMT,PLIST_MT_ITEM *pplmtListMTItem,LPVOID *plpData)
+{// , ListMTLock ListMTUnLock
+ DWORD dwRetErrorCode;
+
+ if (pclmtListMT->plmtiLast)
+ {
+ if (pplmtListMTItem) (*pplmtListMTItem)=pclmtListMT->plmtiLast;
+ if (plpData) (*plpData)=pclmtListMT->plmtiLast->lpData;
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ dwRetErrorCode=ERROR_NO_MORE_ITEMS;
+ }
+return(dwRetErrorCode);
+}
+
+
+
+__inline void ListMTItemSwap(PCLIST_MT pclmtListMT,PCLIST_MT_ITEM pclmtListMTItem1,PCLIST_MT_ITEM pclmtListMTItem2)
+{// ,
+
+ if (pclmtListMTItem1!=pclmtListMTItem2)
+ {//
+ PLIST_MT_ITEM lpTemp;
+
+ lpTemp=pclmtListMTItem1->plmtiPrev;
+ if ((pclmtListMTItem1->plmtiPrev=pclmtListMTItem2->plmtiPrev)==NULL)
+ {// pclmtListMTItem2 , , pclmtListMTItem1
+ pclmtListMT->plmtiFirst=pclmtListMTItem1;
+ }
+
+ if ((pclmtListMTItem2->plmtiPrev=lpTemp)==NULL)
+ {// pclmtListMTItem1 , , pclmtListMTItem2
+ pclmtListMT->plmtiFirst=pclmtListMTItem2;
+ }
+
+
+ lpTemp=pclmtListMTItem1->plmtiNext;
+ if ((pclmtListMTItem1->plmtiNext=pclmtListMTItem2->plmtiNext)==NULL)
+ {// pclmtListMTItem2 , , pclmtListMTItem1
+ pclmtListMT->plmtiLast=pclmtListMTItem1;
+ }
+
+ if ((pclmtListMTItem2->plmtiNext=lpTemp)==NULL)
+ {// pclmtListMTItem1 , , pclmtListMTItem2
+ pclmtListMT->plmtiLast=pclmtListMTItem2;
+ }
+ }
+}
+
+
+__inline BOOL ListMTIteratorMoveFirst(PCLIST_MT pclmtListMT,PCLIST_MT_ITERATOR pclmtiIterator)
+{// , ListMTLock ListMTUnLock
+ return((pclmtiIterator->plmtListMTItem=pclmtListMT->plmtiFirst)? TRUE:FALSE);
+}
+
+
+__inline BOOL ListMTIteratorMoveLast(PCLIST_MT pclmtListMT,PCLIST_MT_ITERATOR pclmtiIterator)
+{// , ListMTLock ListMTUnLock
+ return((pclmtiIterator->plmtListMTItem=pclmtListMT->plmtiLast)? TRUE:FALSE);
+}
+
+
+__inline BOOL ListMTIteratorMovePrev(PCLIST_MT_ITERATOR pclmtiIterator)
+{// , ListMTLock ListMTUnLock
+ BOOL bRet=FALSE;
+
+ if (pclmtiIterator->plmtListMTItem)
+ {
+ if (pclmtiIterator->plmtListMTItem=pclmtiIterator->plmtListMTItem->plmtiPrev) bRet=TRUE;
+ }
+return(bRet);
+}
+
+
+__inline BOOL ListMTIteratorMoveNext(PCLIST_MT_ITERATOR pclmtiIterator)
+{// , ListMTLock ListMTUnLock
+ BOOL bRet=FALSE;
+
+ if (pclmtiIterator->plmtListMTItem)
+ {
+ if (pclmtiIterator->plmtListMTItem=pclmtiIterator->plmtListMTItem->plmtiNext) bRet=TRUE;
+ }
+return(bRet);
+}
+
+
+__inline DWORD ListMTIteratorGet(PCLIST_MT_ITERATOR pclmtiIterator,PLIST_MT_ITEM *pplmtListMTItem,LPVOID *plpData)
+{// , ListMTLock ListMTUnLock
+ DWORD dwRetErrorCode;
+
+ if (pclmtiIterator->plmtListMTItem)
+ {
+ if (pplmtListMTItem) (*pplmtListMTItem)=pclmtiIterator->plmtListMTItem;
+ if (plpData) (*plpData)=pclmtiIterator->plmtListMTItem->lpData;
+ dwRetErrorCode=NO_ERROR;
+ }else{
+ dwRetErrorCode=ERROR_NO_MORE_ITEMS;
+ }
+return(dwRetErrorCode);
+}
+
+
+
+#if defined(_MSC_VER)
+#if _MSC_VER >= 800
+#if _MSC_VER >= 1200
+#pragma warning(pop)
+#else
+#pragma warning(default:4312) // warning C4312: 'type cast' : conversion from 'LONG' to 'PVOID' of greater size
+#endif
+#endif
+#endif
+
+
+
+#endif // !defined(AFX_LIST_MT__H__INCLUDED_)
diff --git a/protocols/MRA/Sdk/MemoryCompare.h b/protocols/MRA/Sdk/MemoryCompare.h
new file mode 100644
index 0000000000..17ef96f35a
--- /dev/null
+++ b/protocols/MRA/Sdk/MemoryCompare.h
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2003 Rozhuk Ivan <rozhuk.im@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+
+
+#if !defined(AFX_MEMORYCOMPARE__H__INCLUDED_)
+#define AFX_MEMORYCOMPARE__H__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+// If the string pointed to by lpString1 is less than the string pointed
+// to by lpString2, the return value is negative.
+// If the string pointed to by lpString1 is greater than the string pointed
+// to by lpString2, the return value is positive.
+// If the strings are equal, the return value is zero.
+//
+// lpString1<lpString2 >> ret=1=CSTR_LESS_THAN
+// lpString1=lpString2 >> ret=2=CSTR_EQUAL
+// lpString1>lpString2 >> ret=3=CSTR_GREATER_THAN
+
+#define CMEM_EQUAL 0
+#define CMEM_GREATER_THAN 1
+#define CMEM_LESS_THAN 2
+
+
+__inline unsigned int MemoryCompare(const void *pBuff1,size_t dwBuff1Size,const void *pBuff2,size_t dwBuff2Size)
+{
+ unsigned int uiRet;
+
+ if (dwBuff1Size==dwBuff2Size)
+ {
+ if (pBuff1==pBuff2)
+ {
+ uiRet=CMEM_EQUAL;
+ }else{
+ if (pBuff1 && pBuff2)
+ {
+ int iRet;
+
+ iRet=memcmp(pBuff1,pBuff2,dwBuff1Size);
+ if (iRet==0)
+ {
+ uiRet=CMEM_EQUAL;
+ }else{
+ if (iRet<0)
+ {
+ uiRet=CMEM_GREATER_THAN;
+ }else{
+ uiRet=CMEM_LESS_THAN;
+ }
+ }
+ }else{
+ if (pBuff1)
+ {//pBuff2==NULL
+ uiRet=CMEM_GREATER_THAN;
+ }else{//pBuff1==NULL
+ uiRet=CMEM_LESS_THAN;
+ }
+ }
+ }
+ }else{
+ if (dwBuff1Size<dwBuff2Size)
+ {
+ uiRet=CMEM_LESS_THAN;
+ }else{
+ uiRet=CMEM_GREATER_THAN;
+ }
+ }
+return(uiRet);
+}
+
+
+
+#endif // !defined(AFX_MEMORYCOMPARE__H__INCLUDED_)
diff --git a/protocols/MRA/Sdk/MemoryFind.h b/protocols/MRA/Sdk/MemoryFind.h
new file mode 100644
index 0000000000..860c5ce20a
--- /dev/null
+++ b/protocols/MRA/Sdk/MemoryFind.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2003 Rozhuk Ivan <rozhuk.im@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+
+#if !defined(AFX_MEMORYFIND__H__INCLUDED_)
+#define AFX_MEMORYFIND__H__INCLUDED_
+
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+
+__inline void *MemoryFind(size_t dwFrom,const void *pBuff,size_t dwBuffSize,const void *pWhatFind,size_t dwWhatFindSize)
+{
+ void *pRet=NULL;
+
+ if (pBuff && dwBuffSize && pWhatFind && dwWhatFindSize && (dwFrom+dwWhatFindSize)<=dwBuffSize)
+ {
+ if (dwWhatFindSize==1)
+ {// MemoryFindByte
+ pRet=(void*)memchr((const void*)(((size_t)pBuff)+dwFrom),(*((unsigned char*)pWhatFind)),(dwBuffSize-dwFrom));
+ }else{
+ void *pCurPos;
+
+ pCurPos=(void*)(((size_t)pBuff)+dwFrom);
+
+ if ((dwFrom+dwWhatFindSize)==dwBuffSize)
+ {// only MemoryCompare
+ if (memcmp(pCurPos,pWhatFind,dwWhatFindSize)==0) pRet=pCurPos;
+ }else{
+ dwBuffSize-=(dwWhatFindSize-1);
+
+ while(pCurPos)
+ {
+ pCurPos=memchr(pCurPos,(*((unsigned char*)pWhatFind)),(dwBuffSize-(((size_t)pCurPos)-((size_t)pBuff))));
+ if (pCurPos)
+ {
+ if (memcmp(pCurPos,pWhatFind,dwWhatFindSize)==0)
+ {
+ pRet=pCurPos;
+ break;
+ }else{
+ pCurPos=(void*)(((size_t)pCurPos)+1);
+ }
+ }
+ }
+ }
+ }
+ }
+return(pRet);
+}
+
+
+#endif // !defined(AFX_MEMORYFIND__H__INCLUDED_)
diff --git a/protocols/MRA/Sdk/MemoryFindByte.h b/protocols/MRA/Sdk/MemoryFindByte.h
new file mode 100644
index 0000000000..a18a721b9d
--- /dev/null
+++ b/protocols/MRA/Sdk/MemoryFindByte.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2003 Rozhuk Ivan <rozhuk.im@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+
+
+#if !defined(AFX_MEMORYFINDBYTE__H__INCLUDED_)
+#define AFX_MEMORYFINDBYTE__H__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+
+__inline void *MemoryFindByte(size_t dwFrom,const void *pBuff,size_t dwBuffSize,unsigned char chWhatFind)
+{
+ void *pRet=NULL;
+
+ if (pBuff && dwBuffSize && dwFrom<dwBuffSize)
+ {
+ pRet=(void*)memchr((const void*)(((size_t)pBuff)+dwFrom),chWhatFind,(dwBuffSize-dwFrom));
+ }
+return(pRet);
+}
+
+
+#ifndef _WIN64
+__inline void *MemoryFindByteReverse(size_t dwFrom,const void *pBuff,size_t dwBuffSize,unsigned char chWhatFind)
+{
+ void *pRet=NULL;
+
+ __asm
+ {
+ push ebx //
+ push edi //
+ push esi //
+
+ mov ecx,dwBuffSize
+ test ecx,ecx //; , !=0
+ je short end_func
+
+ mov edi,pBuff //; di = string
+ test edi,edi //; , !=0
+ jz short end_func
+
+ mov eax,dwFrom
+
+/////////////////////////////////////////////
+ cmp eax,ecx //; ecx(=len)=>dwFrom
+ jae short end_func
+
+ std //; count 'up' on string this time
+ sub ecx,eax //; dwFrom( )
+ add edi,ecx //; dwSourceSize( )
+ mov al,chWhatFind //; al=search byte
+ repne scasb //; find that byte
+ inc edi //; di points to byte which stopped scan
+ cmp [edi],al //; see if we have a hit
+ jne short end_func //; yes, point to byte
+ mov pRet,edi //; ax=pointer to byte
+ end_func:
+
+ cld
+ pop esi //
+ pop edi //
+ pop ebx //
+ }
+return(pRet);
+}
+#endif
+
+
+#endif // !defined(AFX_MEMORYFINDBYTE__H__INCLUDED_)
diff --git a/protocols/MRA/Sdk/MemoryReplace.h b/protocols/MRA/Sdk/MemoryReplace.h
new file mode 100644
index 0000000000..c911ccfbe1
--- /dev/null
+++ b/protocols/MRA/Sdk/MemoryReplace.h
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2010 Rozhuk Ivan <rozhuk.im@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+
+#if !defined(AFX_MEMORY_REPLACE__H__INCLUDED_)
+#define AFX_MEMORY_REPLACE__H__INCLUDED_
+
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+#ifndef DebugBreak
+#define DebugBreak()
+#endif
+
+
+#ifdef MEMALLOC
+#define MEMORY_REPLACE_MEMALLOC(Size) MEMALLOC(Size)
+#define MEMORY_REPLACE_MEMFREE(Mem) MEMFREE(Mem)
+#else
+#define MEMORY_REPLACE_MEMALLOC(Size) malloc(((Size)+sizeof(void*)))
+#define MEMORY_REPLACE_MEMFREE(Mem) if ((Mem)) {free((void*)(Mem));(Mem)=NULL;}
+#endif
+
+
+// 0 - all ok
+// -1 - bad params
+// -2 - small dst buff
+// -3 - memory allocation failed
+
+__inline int MemoryReplaceEx(void *pSrcBuff,size_t dwSrcBuffSize,size_t dwReplaceItemsCount,void **ppInReplaceItems,size_t *pdwInReplaceItemsCounts,void **ppOutReplaceItems,size_t *pdwOutReplaceItemsCounts,void *pDstBuff,size_t dwDstBuffSize,size_t *pdwDstBuffSize,size_t *pdwReplacesCount)
+{
+ int iRet=-1;
+
+ if (pSrcBuff && dwSrcBuffSize && (dwReplaceItemsCount==0 || (dwReplaceItemsCount && ppInReplaceItems && pdwInReplaceItemsCounts && ppOutReplaceItems && pdwOutReplaceItemsCounts)) && pDstBuff && dwDstBuffSize)
+ {
+ if (dwReplaceItemsCount==0)
+ {// no replace, copy mem
+ if (dwDstBuffSize>=dwSrcBuffSize)
+ {
+ memmove(pDstBuff,pSrcBuff,dwSrcBuffSize);
+ if (pdwDstBuffSize) (*pdwDstBuffSize)=dwSrcBuffSize;
+ if (pdwReplacesCount) (*pdwReplacesCount)=0;
+ iRet=0;
+ }else{// small dst buff
+ iRet=-2;
+ }
+ }else{
+ unsigned char **ppFounded;
+
+ ppFounded=(unsigned char**)MEMORY_REPLACE_MEMALLOC((sizeof(unsigned char*)*dwReplaceItemsCount));
+ if (ppFounded)
+ {
+ unsigned char *pDstBuffCur,*pSrcBuffCur,*pSrcBuffCurPrev,*pDstBuffMax;
+ size_t i,dwFirstFoundedIndex,dwFoundedCount,dwMemPartToCopy,dwReplacesCount;
+
+ pSrcBuffCurPrev=(unsigned char*)pSrcBuff;
+ pDstBuffCur=(unsigned char*)pDstBuff;
+ pDstBuffMax=(((unsigned char*)pDstBuff)+dwDstBuffSize);
+ dwFirstFoundedIndex=0;
+ dwFoundedCount=0;
+ dwReplacesCount=0;
+
+ for(i=0;i<dwReplaceItemsCount;i++)
+ {// loking for in first time
+ ppFounded[i]=(unsigned char*)MemoryFind((pSrcBuffCurPrev-(unsigned char*)pSrcBuff),pSrcBuff,dwSrcBuffSize,ppInReplaceItems[i],pdwInReplaceItemsCounts[i]);
+ if (ppFounded[i]) dwFoundedCount++;
+ }
+
+ while(dwFoundedCount)
+ {
+ for(i=0;i<dwReplaceItemsCount;i++)
+ {// looking for first to replace
+ if (ppFounded[i] && (ppFounded[i]<ppFounded[dwFirstFoundedIndex] || ppFounded[dwFirstFoundedIndex]==NULL)) dwFirstFoundedIndex=i;
+ }
+
+ if (ppFounded[dwFirstFoundedIndex])
+ {// in founded
+ dwMemPartToCopy=(ppFounded[dwFirstFoundedIndex]-pSrcBuffCurPrev);
+ if (pDstBuffMax>(pDstBuffCur+(dwMemPartToCopy+pdwInReplaceItemsCounts[dwFirstFoundedIndex])))
+ {
+ dwReplacesCount++;
+ memmove(pDstBuffCur,pSrcBuffCurPrev,dwMemPartToCopy);pDstBuffCur+=dwMemPartToCopy;
+ memmove(pDstBuffCur,ppOutReplaceItems[dwFirstFoundedIndex],pdwOutReplaceItemsCounts[dwFirstFoundedIndex]);pDstBuffCur+=pdwOutReplaceItemsCounts[dwFirstFoundedIndex];
+ pSrcBuffCurPrev=(ppFounded[dwFirstFoundedIndex]+pdwInReplaceItemsCounts[dwFirstFoundedIndex]);
+
+ for(i=0;i<dwReplaceItemsCount;i++)
+ {// loking for in next time // update founded records
+ if (ppFounded[i] && ppFounded[i]<pSrcBuffCurPrev)
+ {
+ ppFounded[i]=(unsigned char*)MemoryFind((pSrcBuffCurPrev-(unsigned char*)pSrcBuff),pSrcBuff,dwSrcBuffSize,ppInReplaceItems[i],pdwInReplaceItemsCounts[i]);
+ if (ppFounded[i]==NULL) dwFoundedCount--;
+ }
+ }
+ }else{// ERROR_BUFFER_OVERFLOW
+ iRet=-2;
+ DebugBreak();
+ break;
+ }
+ }else{// , .
+ DebugBreak();
+ break;
+ }
+ }
+ pSrcBuffCur=(((unsigned char*)pSrcBuff)+dwSrcBuffSize);
+ memmove(pDstBuffCur,pSrcBuffCurPrev,(pSrcBuffCur-pSrcBuffCurPrev));
+ pDstBuffCur+=(pSrcBuffCur-pSrcBuffCurPrev);
+ (*((unsigned short*)pDstBuffCur))=0;
+
+ MEMORY_REPLACE_MEMFREE(ppFounded);
+
+ if (pdwDstBuffSize) (*pdwDstBuffSize)=(pDstBuffCur-((unsigned char*)pDstBuff));
+ if (pdwReplacesCount) (*pdwReplacesCount)=dwReplacesCount;
+ iRet=0;
+ }else{
+ iRet=-3;
+ }
+ }
+ }
+return(iRet);
+}
+
+
+#endif // !defined(AFX_MEMORY_REPLACE__H__INCLUDED_)
diff --git a/protocols/MRA/Sdk/RC4.h b/protocols/MRA/Sdk/RC4.h
new file mode 100644
index 0000000000..82e1da0de4
--- /dev/null
+++ b/protocols/MRA/Sdk/RC4.h
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2007 Rozhuk Ivan <rozhuk.im@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+
+
+#if !defined(AFX_RC4__H__INCLUDED_)
+#define AFX_RC4__H__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+
+__inline void RC4(LPBYTE lpBuff,SIZE_T dwBuffSize,LPBYTE lpKey,SIZE_T dwKeySize)
+{// RC4
+// www.codeproject.com/cpp/crypt_routine.asp%3Fdf%3D100%26forumid%3D4418%26exp%3D0%26select%3D251879+RC4+c%2B%2B+source+DWORD&hl=ru&gl=ru&ct=clnk&cd=2
+// http://www.thecodeproject.com/cpp/crypt_routine.asp
+// http://forum.ixbt.com/topic.cgi?id=40:3020
+
+ //we will consider size of sbox 256 bytes
+ //(extra byte are only to prevent any mishep just in case)
+ BYTE temp;
+ BYTE Sbox[260]={0},Sbox2[260]={0};
+ SIZE_T i,j,t,x;
+
+ i=j=t=x=0;
+ temp=0;
+
+ //initialize sbox i
+ for(i=0;i<256;i++) Sbox[i]=(BYTE)i;
+
+ j=0;
+ //whether user has sent any inpur lpKey
+ //initialize the sbox2 with user lpKey
+ for(i=0;i<256;i++)
+ {
+ if (j==dwKeySize) j=0;
+ Sbox2[i]=lpKey[j++];
+ }
+
+ j=0; //Initialize j
+ //scramble sbox1 with sbox2
+ for(i=0;i<256;i++)
+ {
+ j=(j+(unsigned long)Sbox[i]+(unsigned long)Sbox2[i]) % 256U;
+ temp=Sbox[i];
+ Sbox[i]=Sbox[j];
+ Sbox[j]=temp;
+ }
+
+ i=j=0;
+ for(x=0;x<dwBuffSize;x++)
+ {
+ //increment i
+ i=(i+1U)%256U;
+ //increment j
+ j=(j+(unsigned long)Sbox[i])%256U;
+
+ //Scramble SBox #1 further so encryption routine will
+ //will repeat itself at great interval
+ temp=Sbox[i];
+ Sbox[i]=Sbox[j];
+ Sbox[j]=temp;
+
+ //Get ready to create pseudo random byte for encryption lpKey
+ t=((unsigned long)Sbox[i]+(unsigned long)Sbox[j])%256U;
+
+ //get the random byte
+ //xor with the data and done
+ lpBuff[x]=(lpBuff[x]^Sbox[t]);
+ }
+}
+
+
+
+#endif // !defined(AFX_RC4__H__INCLUDED_)
+
+
diff --git a/protocols/MRA/Sdk/SHA1.h b/protocols/MRA/Sdk/SHA1.h
new file mode 100644
index 0000000000..9a35d78c85
--- /dev/null
+++ b/protocols/MRA/Sdk/SHA1.h
@@ -0,0 +1,596 @@
+/*
+ * Copyright (c) 2003 Rozhuk Ivan <rozhuk.im@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+
+#if !defined(AFX__SHA1_H__INCLUDED_)
+#define AFX__SHA1_H__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+
+// see
+// RFC 3174 - SHA1
+// RFC 2104 - HMAC
+// RFC 2617 - CvtHex
+
+
+
+#define SHA1HashSize 20
+#define SHA1HashHexSize 40
+
+/* This structure will hold context information for the SHA-1 hashing operation */
+typedef struct SHA1Context
+{
+ DWORD Intermediate_Hash[SHA1HashSize/4];/* Message Digest */
+ ULARGE_INTEGER Length; /* Message length in bits */
+ BYTE Message_Block[64]; /* 512-bit message blocks */
+ BOOL Computed; /* Is the digest computed? */
+} SHA1Context;
+
+
+#ifdef UNICODE
+ #define SHA1HMACGetString SHA1HMACGetStringW
+ #define SHA1GetStringDigest SHA1GetStringDigestW
+ #define SHA1CvtString SHA1CvtStringW
+#else
+ #define SHA1HMACGetString SHA1HMACGetStringA
+ #define SHA1GetStringDigest SHA1GetStringDigestA
+ #define SHA1CvtString SHA1CvtStringA
+#endif
+
+
+#ifndef SHA1_MAX_SPEED
+ #ifdef SecureZeroMemory
+ #define SHA1SecureZeroMemory SecureZeroMemory
+ #else
+ #define SHA1SecureZeroMemory bzero
+ #endif
+#else
+ #define SHA1SecureZeroMemory
+#endif
+
+
+/*
+ * Description:
+ * This file implements the Secure Hashing Algorithm 1 as
+ * defined in FIPS PUB 180-1 published April 17, 1995.
+ *
+ * The SHA-1, produces a 160-bit message digest for a given
+ * data stream. It should take about 2**n steps to find a
+ * message with the same digest as a given message and
+ * 2**(n/2) to find any two messages with the same digest,
+ * when n is the digest size in bits. Therefore, this
+ * algorithm can serve as a means of providing a
+ * "fingerprint" for a message.
+ *
+ * Portability Issues:
+ * SHA-1 is defined in terms of 32-bit "words". This code
+ * uses <stdint.h> (included via "sha1.h" to define 32 and 8
+ * bit unsigned integer types. If your C compiler does not
+ * support 32 bit unsigned integers, this code is not
+ * appropriate.
+ *
+ * Caveats:
+ * SHA-1 is designed to work with messages less than 2^64 bits
+ * long. Although SHA-1 allows a message digest to be generated
+ * for messages of any number of bits less than 2^64, this
+ * implementation only works with messages with a length that is
+ * a multiple of the size of an 8-bit character.
+ *
+ */
+
+
+
+/* Define the SHA1 circular left shift macro */
+#define SHA1CircularShift(bits,word) (((word) << (bits)) | ((word) >> (32-(bits))))
+
+/* Local Function Prototyptes */
+//void SHA1PadMessage(SHA1Context *);
+//void SHA1ProcessMessageBlock(SHA1Context *);
+
+
+__inline DWORD BSWAP(DWORD dwIn)
+{
+return((((dwIn<<8) & 0x00ff0000) | (dwIn<<24) | ((dwIn>>8) & 0x0000ff00) | (dwIn>>24)));
+}
+
+__inline void CopyMemoryReverseDWORD(LPCVOID lpcDestination,LPCVOID lpcSource,SIZE_T dwSize)
+{
+#ifdef _WIN64
+ BYTE *pDestination=(BYTE*)lpcDestination,*pSource=(BYTE*)lpcSource;
+
+ //for(SIZE_T i=0;i<dwSize;i++) pDestination[i]=pSource[(i&~0x00000003)+(3-(i&0x00000003))];
+ for(SIZE_T i=0;i<dwSize;i+=4) (*((DWORD*)(pDestination+i)))=BSWAP((*((DWORD*)(pSource+i))));
+
+#else
+ __asm{
+ push edi //
+ push esi //
+
+ mov ecx,dwSize // ecx =
+ mov edi,lpcDestination // edi =
+ mov esi,lpcSource // esi =
+ cld
+
+ read_loop:
+ lodsd // 4
+ bswap eax
+ stosd
+ sub ecx,4
+ jg short read_loop // 3 ,
+
+ pop esi //
+ pop edi //
+ }
+#endif
+}
+
+
+
+/*
+* SHA1ProcessMessageBlock
+*
+* Description:
+* This function will process the next 512 bits of the message
+* stored in the Message_Block array.
+*
+* Parameters:
+* None.
+*
+* Returns:
+* Nothing.
+*
+* Comments:
+* Many of the variable names in this code, especially the
+* single character names, were used because those were the
+* names used in the publication.
+*
+*
+*/
+__inline void SHA1ProcessMessageBlock(SHA1Context *context,BYTE *Message_Block)
+{
+ /* Constants defined in SHA-1 */
+ const DWORD K[]={0x5A827999,0x6ED9EBA1,0x8F1BBCDC,0xCA62C1D6};
+ DWORD t; /* Loop counter */
+ DWORD temp; /* Temporary word value */
+ DWORD W[80]; /* Word sequence */
+ DWORD A=context->Intermediate_Hash[0],/* Word buffers */
+ B=context->Intermediate_Hash[1],
+ C=context->Intermediate_Hash[2],
+ D=context->Intermediate_Hash[3],
+ E=context->Intermediate_Hash[4];
+
+ /* Initialize the first 16 words in the array W */
+ CopyMemoryReverseDWORD(W,Message_Block,64);
+
+ for(t=16;t<80;t++)
+ {
+ W[t]=SHA1CircularShift(1,W[t-3]^W[t-8]^W[t-14]^W[t-16]);
+ }
+
+ for(t=0;t<20;t++)
+ {
+ temp=SHA1CircularShift(5,A) + ((B&C) | ((~B)&D)) + E + W[t] + K[0];
+ E=D;
+ D=C;
+ C=SHA1CircularShift(30,B);
+ B=A;
+ A=temp;
+ }
+
+ for(t=20;t<40;t++)
+ {
+ temp=SHA1CircularShift(5,A) + (B^C^D) + E + W[t] + K[1];
+ E=D;
+ D=C;
+ C=SHA1CircularShift(30,B);
+ B=A;
+ A=temp;
+ }
+
+ for(t=40;t<60;t++)
+ {
+ temp=SHA1CircularShift(5,A) + ((B&C) | (B&D) | (C&D)) + E + W[t] + K[2];
+ E=D;
+ D=C;
+ C=SHA1CircularShift(30,B);
+ B=A;
+ A=temp;
+ }
+
+ for(t=60;t<80;t++)
+ {
+ temp=SHA1CircularShift(5,A) + (B^C^D) + E + W[t] + K[3];
+ E=D;
+ D=C;
+ C=SHA1CircularShift(30,B);
+ B=A;
+ A=temp;
+ }
+
+ context->Intermediate_Hash[0]+=A;
+ context->Intermediate_Hash[1]+=B;
+ context->Intermediate_Hash[2]+=C;
+ context->Intermediate_Hash[3]+=D;
+ context->Intermediate_Hash[4]+=E;
+
+ /* Zeroize sensitive information.*/
+ SHA1SecureZeroMemory(W,sizeof(W));
+}
+
+
+/*
+* SHA1PadMessage
+*
+* Description:
+* According to the standard, the message must be padded to an even
+* 512 bits. The first padding bit must be a '1'. The last 64
+* bits represent the length of the original message. All bits in
+* between should be 0. This function will pad the message
+* according to those rules by filling the Message_Block array
+* accordingly. It will also call the ProcessMessageBlock function
+* provided appropriately. When it returns, it can be assumed that
+* the message digest has been computed.
+*
+* Parameters:
+* context: [in/out]
+* The context to pad
+* ProcessMessageBlock: [in]
+* The appropriate SHA*ProcessMessageBlock function
+* Returns:
+* Nothing.
+*
+*/
+__inline void SHA1PadMessage(SHA1Context *context)
+{
+ /*
+ * Check to see if the current message block is too small to hold
+ * the initial padding bits and length. If so, we will pad the
+ * block, process it, and then continue padding into a second
+ * block.
+ */
+ SIZE_T Message_Block_Index=(SIZE_T)((context->Length.LowPart>>3) & 0x3F);
+ context->Message_Block[Message_Block_Index++]=0x80;
+ if (Message_Block_Index>56)
+ {
+ memset(&context->Message_Block[Message_Block_Index], 0, (64-Message_Block_Index));
+ SHA1ProcessMessageBlock(context,context->Message_Block);
+ memset(&context->Message_Block, 0, 56);
+ }else{
+ memset(&context->Message_Block[Message_Block_Index], 0, (56-Message_Block_Index));
+ }
+
+ /* Store the message length as the last 8 octets */
+ context->Message_Block[56]=(BYTE)(context->Length.HighPart>>24);
+ context->Message_Block[57]=(BYTE)(context->Length.HighPart>>16);
+ context->Message_Block[58]=(BYTE)(context->Length.HighPart>>8);
+ context->Message_Block[59]=(BYTE)(context->Length.HighPart);
+ context->Message_Block[60]=(BYTE)(context->Length.LowPart>>24);
+ context->Message_Block[61]=(BYTE)(context->Length.LowPart>>16);
+ context->Message_Block[62]=(BYTE)(context->Length.LowPart>>8);
+ context->Message_Block[63]=(BYTE)(context->Length.LowPart);
+
+ SHA1ProcessMessageBlock(context,context->Message_Block);
+}
+
+
+
+/*
+* SHA1Reset
+*
+* Description:
+* This function will initialize the SHA1Context in preparation
+* for computing a new SHA1 message digest.
+*
+* Parameters:
+* context: [in/out]
+* The context to reset.
+*
+* Returns:
+* sha Error Code.
+*
+*/
+__inline DWORD SHA1Reset(SHA1Context *context)
+{
+ context->Intermediate_Hash[0]=0x67452301;
+ context->Intermediate_Hash[1]=0xEFCDAB89;
+ context->Intermediate_Hash[2]=0x98BADCFE;
+ context->Intermediate_Hash[3]=0x10325476;
+ context->Intermediate_Hash[4]=0xC3D2E1F0;
+ context->Length.QuadPart=0;
+ context->Computed=FALSE;
+
+return(NO_ERROR);
+}
+
+/*
+* SHA1Result
+*
+* Description:
+* This function will return the 160-bit message digest into the
+* Message_Digest array provided by the caller.
+* NOTE: The first octet of hash is stored in the 0th element,
+* the last octet of hash in the 19th element.
+*
+* Parameters:
+* context: [in/out]
+* The context to use to calculate the SHA-1 hash.
+* Message_Digest: [out]
+* Where the digest is returned.
+*
+* Returns:
+* sha Error Code.
+*
+*/
+__inline DWORD SHA1Result(SHA1Context *context,BYTE *Message_Digest)
+{
+ if (context->Computed==FALSE)
+ {
+ SHA1PadMessage(context);
+ SHA1SecureZeroMemory(context->Message_Block,64);/* message may be sensitive, clear it out */
+ context->Length.QuadPart=0; /* and clear length */
+ context->Computed=TRUE;
+ }
+
+ CopyMemoryReverseDWORD(Message_Digest,context->Intermediate_Hash,SHA1HashSize);
+
+return(NO_ERROR);
+}
+
+/*
+* SHA1Input
+*
+* Description:
+* This function accepts an array of octets as the next portion
+* of the message.
+*
+* Parameters:
+* context: [in/out]
+* The SHA context to update
+* message_array: [in]
+* An array of characters representing the next portion of
+* the message.
+* length: [in]
+* The length of the message in message_array
+*
+* Returns:
+* sha Error Code.
+*
+*/
+__inline DWORD SHA1Input(SHA1Context *context,const BYTE *message_array,SIZE_T length)
+{
+ if (context->Computed==TRUE) return(ERROR_INVALID_HANDLE_STATE);
+
+ if ((context->Length.QuadPart+(length<<3))>=(length<<3))
+ {
+ SIZE_T i,Message_Block_Index,partLen;
+ /* Compute number of bytes mod 64 */
+ Message_Block_Index=(SIZE_T)((context->Length.LowPart>>3) & 0x3F);
+ /* Update number of bits */
+ context->Length.QuadPart+=(((ULONGLONG)length)<<3);
+ partLen=(64-Message_Block_Index);
+ /* Transform as many times as possible.*/
+ if (length>=partLen)
+ {
+ memmove(&context->Message_Block[Message_Block_Index],message_array,partLen);
+ SHA1ProcessMessageBlock(context,context->Message_Block);
+ for (i=partLen;(i+63)<length;i+=64) SHA1ProcessMessageBlock(context,(BYTE*)&message_array[i]);
+ Message_Block_Index=0;
+ }else{
+ i=0;
+ }
+ /* Buffer remaining input */
+ memmove(&context->Message_Block[Message_Block_Index],&message_array[i],(length-i));
+ }else{
+ return(RPC_S_STRING_TOO_LONG);/* Message is too long */
+ }
+return(NO_ERROR);
+}
+////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////
+//////////////////////////////RFC 2104//////////////////////////////
+////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////
+__inline void hmac_sha1(BYTE *text,SIZE_T text_len,BYTE *key,SIZE_T key_len,BYTE *digest)
+{
+//BYTE* text; /* pointer to data stream */
+//int text_len; /* length of data stream */
+//BYTE* key; /* pointer to authentication key */
+//int key_len; /* length of authentication key */
+//HASH digest; /* caller digest to be filled in */
+ SHA1Context context;
+ BYTE k_ipad[65]; /* inner padding - key XORd with ipad */
+ BYTE k_opad[65]; /* outer padding - key XORd with opad */
+ BYTE tk[SHA1HashSize];
+ /* if key is longer than 64 bytes reset it to key=SHA1(key) */
+ if (key_len>64)
+ {
+ SHA1Context tctx;
+
+ SHA1Reset(&tctx);
+ SHA1Input(&tctx,key,key_len);
+ SHA1Result(&tctx,(BYTE*)&tk);
+
+ key=tk;
+ key_len=SHA1HashSize;
+ }
+
+ /*
+ * the HMAC_SHA1 transform looks like:
+ *
+ * SHA1(K XOR opad, SHA1(K XOR ipad, text))
+ *
+ * where K is an n byte key
+ * ipad is the byte 0x36 repeated 64 times
+ * opad is the byte 0x5c repeated 64 times
+ * and text is the data being protected
+ */
+
+ /* start out by storing key in pads */
+ memmove(&k_ipad,key,key_len);
+ memmove(&k_opad,key,key_len);
+ memset(&k_ipad[key_len], 0, (sizeof(k_ipad)-key_len));
+ memset(&k_opad[key_len], 0 , (sizeof(k_opad)-key_len));
+
+ /* XOR key with ipad and opad values */
+ for (SIZE_T i=0;i<(64/sizeof(ULONGLONG));i++)
+ {
+ ((ULONGLONG*)k_ipad)[i]^=0x3636363636363636;
+ ((ULONGLONG*)k_opad)[i]^=0x5C5C5C5C5C5C5C5C;
+ }
+ /* perform inner SHA1 */
+ SHA1Reset(&context); /* init context for 1st pass */
+ SHA1Input(&context,k_ipad,64); /* start with inner pad */
+ SHA1Input(&context,text,text_len); /* then text of datagram */
+ SHA1Result(&context,digest); /* finish up 1st pass */
+ /* perform outer SHA1 */
+ SHA1Reset(&context); /* init context for 2nd pass */
+ SHA1Input(&context,k_opad,64); /* start with outer pad */
+ SHA1Input(&context,(BYTE*)digest,SHA1HashSize); /* then results of 1st hash */
+ SHA1Result(&context,digest); /* finish up 2nd pass */
+
+ SHA1SecureZeroMemory(k_ipad,sizeof(k_ipad));
+ SHA1SecureZeroMemory(k_opad,sizeof(k_opad));
+ SHA1SecureZeroMemory(tk,sizeof(tk));
+}
+////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////
+//////////////////////////////RFC 2617//////////////////////////////
+////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////
+__inline void SHA1CvtHex(BYTE *Bin,BYTE *Hex)
+{
+ BYTE j;
+
+ for (SIZE_T i=0;i<SHA1HashSize;i++)
+ {
+ j=(Bin[i]>>4)&0xf;
+ if(j<=9)
+ {
+ Hex[(i*2)]=(j+'0');
+ }else{
+ Hex[(i*2)]=(j+'a'-10);
+ }
+
+ j=Bin[i]&0xf;
+ if(j<=9)
+ {
+ Hex[(i*2+1)]=(j+'0');
+ }else{
+ Hex[(i*2+1)]=(j+'a'-10);
+ }
+ };
+ Hex[SHA1HashHexSize]=0;
+};
+
+////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////
+__inline void SHA1CvtStringA(BYTE *digest,LPSTR lpszDigest)
+{
+ SHA1CvtHex(digest,(BYTE*)lpszDigest);
+};
+
+
+__inline void SHA1CvtStringW(BYTE *digest,LPWSTR lpszDigest)
+{
+ SIZE_T i,p=0;
+ for (i=0;i<SHA1HashSize;i++,p+=2)
+ {
+ wsprintfW((LPWSTR)(lpszDigest+p),L"%02x",digest[i]);
+ }
+ lpszDigest[SHA1HashHexSize]=0;
+};
+////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////
+__inline void SHA1HMACGetDigest(LPVOID lpBuff,SIZE_T dwBuffSize,LPVOID lpKey,SIZE_T dwKeySize,BYTE *digest)
+{
+ hmac_sha1((BYTE*)lpBuff,dwBuffSize,(BYTE*)lpKey,dwKeySize,digest);
+}
+
+
+__inline void SHA1HMACGetStringA(LPSTR lpszBuff,SIZE_T dwBuffSize,LPSTR lpszKey,SIZE_T dwKeySize,LPSTR lpszDigest)
+{
+ BYTE digest[SHA1HashSize];
+ hmac_sha1((BYTE*)lpszBuff,dwBuffSize,(BYTE*)lpszKey,dwKeySize,digest);
+ SHA1CvtHex(digest,(BYTE*)lpszDigest);
+}
+
+
+__inline void SHA1HMACGetStringW(LPWSTR lpszBuff,SIZE_T dwBuffSize,LPWSTR lpszKey,SIZE_T dwKeySize,LPWSTR lpszDigest)
+{
+ BYTE digest[SHA1HashSize];
+ hmac_sha1((BYTE*)lpszBuff,dwBuffSize,(BYTE*)lpszKey,dwKeySize,digest);
+ SHA1CvtStringW(digest,lpszDigest);
+}
+
+
+
+__inline void SHA1GetDigest(LPVOID lpBuff,SIZE_T dwBuffSize,BYTE *digest)
+{
+ SHA1Context sha;
+
+ SHA1Reset(&sha);
+ SHA1Input(&sha,(BYTE*)lpBuff,dwBuffSize);
+ SHA1Result(&sha,digest);
+}
+
+
+__inline void SHA1GetStringDigestA(LPSTR lpszBuff,SIZE_T dwBuffSize,LPSTR lpszDigest)
+{
+ SHA1Context sha;
+ BYTE digest[SHA1HashSize];
+
+ SHA1Reset(&sha);
+ SHA1Input(&sha,(BYTE*)lpszBuff,dwBuffSize);
+ SHA1Result(&sha,digest);
+
+ SHA1CvtHex(digest,(BYTE*)lpszDigest);
+}
+
+
+__inline void SHA1GetStringDigestW(LPWSTR lpszBuff,SIZE_T dwBuffSize,LPWSTR lpszDigest)
+{
+ SHA1Context sha;
+ BYTE digest[SHA1HashSize];
+
+ SHA1Reset(&sha);
+ SHA1Input(&sha,(BYTE*)lpszBuff,dwBuffSize);
+ SHA1Result(&sha,digest);
+
+ SHA1CvtStringW(digest,lpszDigest);
+}
+
+
+
+
+#endif //AFX__SHA1_H__INCLUDED_ \ No newline at end of file
diff --git a/protocols/MRA/Sdk/SocketFunctions.h b/protocols/MRA/Sdk/SocketFunctions.h
new file mode 100644
index 0000000000..480b5beccb
--- /dev/null
+++ b/protocols/MRA/Sdk/SocketFunctions.h
@@ -0,0 +1,485 @@
+/*
+ * Copyright (c) 2003 Rozhuk Ivan <rozhuk.im@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+
+
+#if !defined(AFX_SOCKET_FUNCTIONS__H__INCLUDED_)
+#define AFX_SOCKET_FUNCTIONS__H__INCLUDED_
+
+#if(_WIN32_WINNT >= 0x0501)
+static LPFN_CONNECTEX ConnectEx=NULL;
+static LPFN_DISCONNECTEX DisconnectEx=NULL;
+static LPFN_TRANSMITPACKETS TransmitPackets=NULL;
+#endif
+
+
+#ifndef NTOHS
+
+__inline u_short USHORT_FLIP(u_short usIn)
+{
+return(((usIn<<8) | (usIn>>8)));
+}
+#define NTOHS(in) USHORT_FLIP(in)
+#define HTONS(in) USHORT_FLIP(in)
+
+#endif
+
+
+
+#ifndef NTOHL
+
+__inline u_long ULONG_FLIP(u_long ulIn)
+{
+#if defined (_M_IA64) || defined (_M_AMD64)
+return((((ulIn<<8) & 0x00ff0000) | (ulIn<<24) | ((ulIn>>8) & 0x0000ff00) | (ulIn>>24)));
+#else
+ __asm
+ {
+ mov eax,ulIn
+ bswap eax
+ mov ulIn,eax
+ };
+return(ulIn);
+#endif
+}
+
+#define NTOHL(in) ULONG_FLIP(in)
+#define HTONL(in) ULONG_FLIP(in)
+
+#endif
+
+
+
+
+
+#define CLOSE_SOCKET(skt) if (skt) {closesocket(skt);skt=INVALID_SOCKET;}
+
+
+
+__inline BOOL SocketGetACCEPTCONN(SOCKET skt)
+{
+ BOOL bRet;
+ int iSize=sizeof(BOOL);
+ if (getsockopt(skt,SOL_SOCKET,SO_ACCEPTCONN,(char*)&bRet,(int*)&iSize)!=NO_ERROR) bRet=FALSE;
+return(bRet);
+}
+
+
+__inline BOOL SocketGetBROADCAST(SOCKET skt)
+{
+ BOOL bRet;
+ int iSize=sizeof(BOOL);
+ if (getsockopt(skt,SOL_SOCKET,SO_BROADCAST,(char*)&bRet,(int*)&iSize)!=NO_ERROR) bRet=FALSE;
+return(bRet);
+}
+
+__inline int SocketSetBROADCAST(SOCKET skt,BOOL bBroadcast)
+{
+return(setsockopt(skt,SOL_SOCKET,SO_BROADCAST,(const char*)&bBroadcast,sizeof(BOOL)));
+}
+
+
+
+__inline int SocketGetCONNECT_TIME(SOCKET skt)
+{
+ int iSeconds,iSize=sizeof(int);
+ if (getsockopt(skt,SOL_SOCKET,SO_CONNECT_TIME,(char*)&iSeconds,(int*)&iSize)!=NO_ERROR) iSeconds=-1;
+return(iSeconds);
+}
+
+
+__inline BOOL SocketGetKEEPALIVE(SOCKET skt)
+{
+ BOOL bRet;
+ int iSize=sizeof(BOOL);
+ if (getsockopt(skt,SOL_SOCKET,SO_KEEPALIVE,(char*)&bRet,(int*)&iSize)!=NO_ERROR) bRet=FALSE;
+return(bRet);
+}
+
+__inline int SocketSetKEEPALIVE(SOCKET skt,BOOL bKeepAlive)
+{
+return(setsockopt(skt,SOL_SOCKET,SO_KEEPALIVE,(const char*)&bKeepAlive,sizeof(BOOL)));
+}
+
+
+
+__inline int SocketGetMAX_MSG_SIZE(SOCKET skt)
+{
+ int iMaxMsgSize,iSize=sizeof(int);
+ if (getsockopt(skt,SOL_SOCKET,SO_MAX_MSG_SIZE,(char*)&iMaxMsgSize,(int*)&iSize)!=NO_ERROR) iMaxMsgSize=-1;
+return(iMaxMsgSize);
+}
+
+
+__inline int SocketSetEXCLUSIVEADDRUSE(SOCKET skt,BOOL bExclusiveAddrUse)
+{
+return(setsockopt(skt,SOL_SOCKET,SO_EXCLUSIVEADDRUSE,(const char*)&bExclusiveAddrUse,sizeof(BOOL)));
+}
+
+
+__inline BOOL SocketGetREUSEADDR(SOCKET skt)
+{
+ BOOL bRet;
+ int iSize=sizeof(BOOL);
+ if (getsockopt(skt,SOL_SOCKET,SO_REUSEADDR,(char*)&bRet,(int*)&iSize)!=NO_ERROR) bRet=FALSE;
+return(bRet);
+}
+
+__inline int SocketSetREUSEADDR(SOCKET skt,BOOL bReuseAddr)
+{
+return(setsockopt(skt,SOL_SOCKET,SO_REUSEADDR,(const char*)&bReuseAddr,sizeof(BOOL)));
+}
+
+
+__inline int SocketSetRCVBUF(SOCKET skt,unsigned int uiBuffSize)
+{
+return(setsockopt(skt,SOL_SOCKET,SO_RCVBUF,(const char*)&uiBuffSize,sizeof(int)));
+}
+
+
+__inline int SocketSetSNDBUF(SOCKET skt,unsigned int uiBuffSize)
+{
+return(setsockopt(skt,SOL_SOCKET,SO_SNDBUF,(const char*)&uiBuffSize,sizeof(int)));
+}
+
+
+
+__inline int SocketSetUPDATE_ACCEPT_CONTEXT(SOCKET skt,SOCKET sktAccept)
+{
+return(setsockopt(skt,SOL_SOCKET,SO_UPDATE_ACCEPT_CONTEXT,(char*)&sktAccept,sizeof(SOCKET)));
+}
+
+
+#if(_WIN32_WINNT >= 0x0501)
+__inline int SocketSetUPDATE_CONNECT_CONTEXT(SOCKET skt)
+{
+return(setsockopt(skt,SOL_SOCKET,SO_UPDATE_CONNECT_CONTEXT,NULL,0));
+}
+#endif
+
+
+
+
+__inline BOOL SocketGetHDRINCL(SOCKET skt)
+{
+ BOOL bRet;
+ int iSize=sizeof(BOOL);
+ if (getsockopt(skt,IPPROTO_IP,IP_HDRINCL,(char*)&bRet,(int*)&iSize)!=NO_ERROR) bRet=FALSE;
+return(bRet);
+}
+
+__inline int SocketSetHDRINCL(SOCKET skt,BOOL bProvideIPHdr)
+{
+return(setsockopt(skt,IPPROTO_IP,IP_HDRINCL,(const char*)&bProvideIPHdr,sizeof(DWORD)));
+}
+
+
+#define TOS_DEFAULT 0
+#define TOS_MIN_MONETARY_COST 2
+#define TOS_MIN_RELIABILITY 4
+#define TOS_MAX_THROUGHPUT 8
+#define TOS_MIN_DELAY 16
+#define TOS_MAX_SECURITY 30
+
+__inline int SocketSetTOS(SOCKET skt,DWORD dwTOS)
+{
+return(setsockopt(skt,IPPROTO_IP,IP_TOS,(const char*)&dwTOS,sizeof(DWORD)));
+}
+
+
+__inline int SocketSetTTL(SOCKET skt,UINT iTTL)
+{
+return(setsockopt(skt,IPPROTO_IP,IP_TTL,(const char*)&iTTL,sizeof(DWORD)));
+}
+
+
+__inline int SocketSetTCP_NODELAY(SOCKET skt,BOOL bTCPNoDelay)
+{
+return(setsockopt(skt,IPPROTO_TCP,TCP_NODELAY,(const char*)&bTCPNoDelay,sizeof(DWORD)));
+}
+
+/*
+int // OUT: whatever setsockopt() returns
+join_source_group(int sd, u_int32 grpaddr,
+ u_int32 srcaddr, u_int32 iaddr)
+{
+ struct ip_mreq_source imr;
+
+ imr.imr_multiaddr.s_addr = grpaddr;
+ imr.imr_sourceaddr.s_addr = srcaddr;
+ imr.imr_interface.s_addr = iaddr;
+ return setsockopt(sd, IPPROTO_IP, IP_ADD_SOURCE_MEMBERSHIP, &imr, sizeof(imr));
+}
+
+int
+leave_source_group(int sd, u_int32 grpaddr,
+ u_int32 srcaddr, u_int32 iaddr)
+{
+ struct ip_mreq_source imr;
+
+ imr.imr_multiaddr.s_addr = grpaddr;
+ imr.imr_sourceaddr.s_addr = srcaddr;
+ imr.imr_interface.s_addr = iaddr;
+ return setsockopt(sd, IPPROTO_IP, IP_DROP_SOURCE_MEMBERSHIP, &imr, sizeof(imr));
+}*/
+
+
+////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
+__inline BOOL WINAPI DisconnectExTF(SOCKET hSocket,LPOVERLAPPED lpOverlapped,DWORD dwFlags,DWORD reserved)
+{
+ reserved=0;
+ dwFlags&=TF_REUSE_SOCKET;
+ dwFlags|=TF_DISCONNECT;
+return(TransmitFile(hSocket,NULL,0,0,lpOverlapped,NULL,dwFlags));
+}
+
+
+
+__inline DWORD SocketsInitialize()
+{
+ DWORD dwRetErrorCode;
+ WSADATA wsaData;
+
+ if ((dwRetErrorCode=WSAStartup(MAKEWORD(1,1),&wsaData))==NO_ERROR)
+ {// version 1.1 OK
+ WSACleanup();
+
+ dwRetErrorCode=WSAStartup(wsaData.wHighVersion,&wsaData);
+ }
+return(dwRetErrorCode);
+}
+
+
+#if(_WIN32_WINNT >= 0x0501)
+__inline DWORD SocketsInitializeEx(DWORD dwFlags)
+{
+ DWORD dwRetErrorCode;
+ WSADATA wsaData;
+
+ dwFlags=0;
+ if ((dwRetErrorCode=WSAStartup(MAKEWORD(1,1),&wsaData))==NO_ERROR)
+ {// version 1.1 OK
+ WSACleanup();
+ if ((dwRetErrorCode=WSAStartup(wsaData.wHighVersion,&wsaData))==NO_ERROR)
+ {// max version initialized
+ SOCKET skt;
+
+ if ((skt=WSASocket(AF_INET,SOCK_STREAM,IPPROTO_TCP,0,0,WSA_FLAG_OVERLAPPED))!=INVALID_SOCKET)
+ {
+ DWORD dwSize;
+ GUID ExtensionGuidCONNECTEX=WSAID_CONNECTEX;
+ GUID ExtensionGuidDISCONNECTEX=WSAID_DISCONNECTEX;
+ GUID ExtensionGuidTRANSMITPACKETS=WSAID_TRANSMITPACKETS;
+
+ dwRetErrorCode=NO_ERROR;
+
+ if (WSAIoctl(skt,SIO_GET_EXTENSION_FUNCTION_POINTER,&ExtensionGuidCONNECTEX,sizeof(GUID),&ConnectEx,sizeof(FARPROC),&dwSize,NULL,NULL)==0)
+ {
+ if (ConnectEx==NULL) dwRetErrorCode=WSAGetLastError();
+ }else{
+ dwRetErrorCode=WSAGetLastError();
+ }
+
+
+ if (WSAIoctl(skt,SIO_GET_EXTENSION_FUNCTION_POINTER,&ExtensionGuidDISCONNECTEX,sizeof(GUID),&DisconnectEx,sizeof(FARPROC),&dwSize,NULL,NULL)==0)
+ {
+ if (DisconnectEx==NULL)
+ {
+ DisconnectEx=DisconnectExTF;
+ //dwRetErrorCode=WSAGetLastError();
+ }
+ }else{
+ dwRetErrorCode=WSAGetLastError();
+ }
+
+ if (WSAIoctl(skt,SIO_GET_EXTENSION_FUNCTION_POINTER,&ExtensionGuidTRANSMITPACKETS,sizeof(GUID),&TransmitPackets,sizeof(FARPROC),&dwSize,NULL,NULL)==0)
+ {
+ if (TransmitPackets==NULL) dwRetErrorCode=WSAGetLastError();
+ }else{
+ dwRetErrorCode=WSAGetLastError();
+ }
+
+ closesocket(skt);
+ }else{
+ dwRetErrorCode=WSAGetLastError();
+ }
+ }
+ }
+return(dwRetErrorCode);
+}
+#endif
+
+
+
+////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
+///////////////////////////SOCKADDR_STORAGE/////////////////////////////
+////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
+#if(_WIN32_WINNT >= 0x0501)
+
+__inline DWORD SockAddrInDataSet(LPCVOID lpcsasSockAddrStorage,DWORD dwPort,LPCVOID lpcAddress,SIZE_T dwAddressSize)
+{
+ DWORD dwRetErrorCode=NO_ERROR;
+
+ if (lpcsasSockAddrStorage && lpcAddress)
+ {
+ switch(dwAddressSize){
+ case sizeof(in_addr):
+ ((sockaddr_in*)lpcsasSockAddrStorage)->sin_family=AF_INET;
+ ((sockaddr_in*)lpcsasSockAddrStorage)->sin_port=HTONS((WORD)dwPort);
+ (*((DWORD*)&(((sockaddr_in*)lpcsasSockAddrStorage)->sin_addr)))=(*((DWORD*)lpcAddress));
+ break;
+ case sizeof(in6_addr):
+ ((sockaddr_in6*)lpcsasSockAddrStorage)->sin6_family=AF_INET6;
+ ((sockaddr_in6*)lpcsasSockAddrStorage)->sin6_port=HTONS((WORD)dwPort);
+ memmove(&(((sockaddr_in6*)lpcsasSockAddrStorage)->sin6_addr),lpcAddress,sizeof(in6_addr));
+ break;
+ default:
+ dwRetErrorCode=ERROR_INVALID_PARAMETER;
+ break;
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+__inline DWORD SockAddrInPortSet(LPCVOID lpcsasSockAddrStorage,DWORD dwPort)
+{
+ DWORD dwRetErrorCode=NO_ERROR;
+
+ if (lpcsasSockAddrStorage)
+ {
+ switch(((SOCKADDR_STORAGE*)lpcsasSockAddrStorage)->ss_family){
+ case AF_INET:
+ ((sockaddr_in*)lpcsasSockAddrStorage)->sin_port=HTONS((WORD)dwPort);
+ break;
+ case AF_INET6:
+ ((sockaddr_in6*)lpcsasSockAddrStorage)->sin6_port=HTONS((WORD)dwPort);
+ break;
+ default:
+ dwRetErrorCode=ERROR_INVALID_PARAMETER;
+ break;
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+__inline DWORD SockAddrInAddressSet(LPCVOID lpcsasSockAddrStorage,LPCVOID lpcAddress,SIZE_T dwAddressSize)
+{
+ DWORD dwRetErrorCode=NO_ERROR;
+
+ if (lpcsasSockAddrStorage && lpcAddress)
+ {
+ switch(dwAddressSize){
+ case sizeof(in_addr):
+ ((sockaddr_in*)lpcsasSockAddrStorage)->sin_family=AF_INET;
+ (*((DWORD*)&(((sockaddr_in*)lpcsasSockAddrStorage)->sin_addr)))=(*((DWORD*)lpcAddress));
+ break;
+ case sizeof(in6_addr):
+ ((sockaddr_in6*)lpcsasSockAddrStorage)->sin6_family=AF_INET6;
+ memmove(&(((sockaddr_in6*)lpcsasSockAddrStorage)->sin6_addr),lpcAddress,sizeof(in6_addr));
+ break;
+ default:
+ dwRetErrorCode=ERROR_INVALID_PARAMETER;
+ break;
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+__inline DWORD SockAddrAddressSet(LPCVOID lpcsasSockAddrStorage,LPCVOID lpcAddress,SIZE_T dwAddressSize)
+{
+ DWORD dwRetErrorCode=NO_ERROR;
+
+ if (lpcsasSockAddrStorage && lpcAddress)
+ {
+ switch(dwAddressSize){
+ case sizeof(in_addr):
+ ((sockaddr*)lpcsasSockAddrStorage)->sa_family=AF_INET;
+ (*((DWORD*)&(((sockaddr*)lpcsasSockAddrStorage)->sa_data)))=(*((DWORD*)lpcAddress));
+ break;
+ case sizeof(in6_addr):
+ ((sockaddr*)lpcsasSockAddrStorage)->sa_family=AF_INET6;
+ memmove(&(((sockaddr*)lpcsasSockAddrStorage)->sa_data),lpcAddress,sizeof(in6_addr));
+ break;
+ default:
+ dwRetErrorCode=ERROR_INVALID_PARAMETER;
+ break;
+ }
+ }else{
+ dwRetErrorCode=ERROR_INVALID_HANDLE;
+ }
+return(dwRetErrorCode);
+}
+
+
+__inline SIZE_T SockAddrGetSize(LPCVOID lpcsasSockAddrStorage)
+{
+ SIZE_T dwRet;
+
+ if (lpcsasSockAddrStorage)
+ {
+ switch(((SOCKADDR_STORAGE*)lpcsasSockAddrStorage)->ss_family){
+ case AF_INET:
+ dwRet=sizeof(sockaddr_in);
+ break;
+ case AF_INET6:
+ dwRet=sizeof(sockaddr_in6);
+ break;
+ default:
+ dwRet=sizeof(SOCKADDR_STORAGE);
+ break;
+ }
+ }else{
+ dwRet=0;
+ }
+return(dwRet);
+}
+
+
+#endif
+////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
+
+
+#endif //AFX_SOCKET_FUNCTIONS__H__INCLUDED_ \ No newline at end of file
diff --git a/protocols/MRA/Sdk/StrHexToNum.h b/protocols/MRA/Sdk/StrHexToNum.h
new file mode 100644
index 0000000000..60b5801efb
--- /dev/null
+++ b/protocols/MRA/Sdk/StrHexToNum.h
@@ -0,0 +1,634 @@
+/*
+ * Copyright (c) 2005 Rozhuk Ivan <rozhuk.im@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+
+
+#if !defined(AFX_STRHEXTONUM__H__INCLUDED_)
+#define AFX_STRHEXTONUM__H__INCLUDED_
+
+
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+
+
+__inline SIZE_T StrHexToUNum(LPCSTR lpcszString,SIZE_T dwStringLen)
+{
+ SIZE_T dwNum=0;
+ BYTE bCurentFigure;
+
+ while(dwStringLen)
+ {
+ bCurentFigure=(*lpcszString);
+ if ('0'<=bCurentFigure && bCurentFigure<='9')
+ {
+ bCurentFigure-='0';
+ }else
+ if ('a'<=bCurentFigure && bCurentFigure<='f')
+ {
+ bCurentFigure-=('a'+10);
+ }else
+ if ('A'<=bCurentFigure && bCurentFigure<='F')
+ {
+ bCurentFigure-=('A'+10);
+ }else{
+ bCurentFigure=255;
+ }
+
+ if (bCurentFigure!=255)
+ {
+ dwNum*=16;//
+ dwNum+=bCurentFigure;//
+ }
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+return(dwNum);
+}
+
+__inline DWORD StrHexToUNum32(LPCSTR lpcszString,SIZE_T dwStringLen)
+{
+ DWORD dwNum=0;
+ BYTE bCurentFigure;
+
+
+ while(dwStringLen)
+ {
+ bCurentFigure=(*lpcszString);
+ if ('0'<=bCurentFigure && bCurentFigure<='9')
+ {
+ bCurentFigure-='0';
+ }else
+ if ('a'<=bCurentFigure && bCurentFigure<='f')
+ {
+ bCurentFigure-=('a'+10);
+ }else
+ if ('A'<=bCurentFigure && bCurentFigure<='F')
+ {
+ bCurentFigure-=('A'+10);
+ }else{
+ bCurentFigure=255;
+ }
+
+ if (bCurentFigure!=255)
+ {
+ dwNum*=16;//
+ dwNum+=bCurentFigure;//
+ }
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+return(dwNum);
+}
+
+__inline DWORDLONG StrHexToUNum64(LPCSTR lpcszString,SIZE_T dwStringLen)
+{
+ DWORDLONG dwlNum=0;
+ BYTE bCurentFigure;
+
+
+ while(dwStringLen)
+ {
+ bCurentFigure=(*lpcszString);
+ if ('0'<=bCurentFigure && bCurentFigure<='9')
+ {
+ bCurentFigure-='0';
+ }else
+ if ('a'<=bCurentFigure && bCurentFigure<='f')
+ {
+ bCurentFigure-=('a'+10);
+ }else
+ if ('A'<=bCurentFigure && bCurentFigure<='F')
+ {
+ bCurentFigure-=('A'+10);
+ }else{
+ bCurentFigure=255;
+ }
+
+ if (bCurentFigure!=255)
+ {
+ dwlNum*=16;//
+ dwlNum+=bCurentFigure;//
+ }
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+return(dwlNum);
+}
+
+
+
+__inline DWORD StrHexToUNumEx(LPCSTR lpcszString,SIZE_T dwStringLen,SIZE_T *pdwNum)
+{
+ DWORD dwRetErrorCode;
+ SIZE_T dwNum=0,dwProcessed=0;
+ BYTE bCurentFigure;
+
+
+ while(dwStringLen)
+ {
+ bCurentFigure=(*lpcszString);
+ if ('0'<=bCurentFigure && bCurentFigure<='9')
+ {
+ bCurentFigure-='0';
+ }else
+ if ('a'<=bCurentFigure && bCurentFigure<='f')
+ {
+ bCurentFigure-=('a'+10);
+ }else
+ if ('A'<=bCurentFigure && bCurentFigure<='F')
+ {
+ bCurentFigure-=('A'+10);
+ }else{
+ bCurentFigure=255;
+ }
+
+ if (bCurentFigure!=255)
+ {
+ dwNum*=16;//
+ dwNum+=bCurentFigure;//
+ dwProcessed++;//
+ }
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+ if (dwProcessed)
+ {//
+ if (pdwNum) (*pdwNum)=dwNum;
+ if (dwProcessed==dwStringLen)
+ {// , // .
+ dwRetErrorCode=NO_ERROR;
+ }else{// // .
+ dwRetErrorCode=ERROR_MORE_DATA;
+ }
+ }else{// // .
+ dwRetErrorCode=ERROR_INVALID_DATA;
+ }
+return(dwRetErrorCode);
+}
+
+
+__inline DWORD StrHexToUNumEx32(LPCSTR lpcszString,SIZE_T dwStringLen,DWORD *pdwNum)
+{
+ DWORD dwRetErrorCode;
+ DWORD dwNum=0,dwProcessed=0;
+ BYTE bCurentFigure;
+
+
+ while(dwStringLen)
+ {
+ bCurentFigure=(*lpcszString);
+ if ('0'<=bCurentFigure && bCurentFigure<='9')
+ {
+ bCurentFigure-='0';
+ }else
+ if ('a'<=bCurentFigure && bCurentFigure<='f')
+ {
+ bCurentFigure-=('a'+10);
+ }else
+ if ('A'<=bCurentFigure && bCurentFigure<='F')
+ {
+ bCurentFigure-=('A'+10);
+ }else{
+ bCurentFigure=255;
+ }
+
+ if (bCurentFigure!=255)
+ {
+ dwNum*=16;//
+ dwNum+=bCurentFigure;//
+ dwProcessed++;//
+ }
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+ if (dwProcessed)
+ {//
+ if (pdwNum) (*pdwNum)=dwNum;
+ if (dwProcessed==dwStringLen)
+ {// , // .
+ dwRetErrorCode=NO_ERROR;
+ }else{// // .
+ dwRetErrorCode=ERROR_MORE_DATA;
+ }
+ }else{// // .
+ dwRetErrorCode=ERROR_INVALID_DATA;
+ }
+return(dwRetErrorCode);
+}
+
+
+__inline DWORD StrHexToUNumEx64(LPCSTR lpcszString,SIZE_T dwStringLen,DWORDLONG *pdwlNum)
+{
+ DWORD dwRetErrorCode;
+ DWORDLONG dwlNum=0;
+ SIZE_T dwProcessed=0;
+ BYTE bCurentFigure;
+
+
+ while(dwStringLen)
+ {
+ bCurentFigure=(*lpcszString);
+ if ('0'<=bCurentFigure && bCurentFigure<='9')
+ {
+ bCurentFigure-='0';
+ }else
+ if ('a'<=bCurentFigure && bCurentFigure<='f')
+ {
+ bCurentFigure-=('a'+10);
+ }else
+ if ('A'<=bCurentFigure && bCurentFigure<='F')
+ {
+ bCurentFigure-=('A'+10);
+ }else{
+ bCurentFigure=255;
+ }
+
+ if (bCurentFigure!=255)
+ {
+ dwlNum*=16;//
+ dwlNum+=bCurentFigure;//
+ dwProcessed++;//
+ }
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+ if (dwProcessed)
+ {//
+ if (pdwlNum) (*pdwlNum)=dwlNum;
+ if (dwProcessed==dwStringLen)
+ {// , // .
+ dwRetErrorCode=NO_ERROR;
+ }else{// // .
+ dwRetErrorCode=ERROR_MORE_DATA;
+ }
+ }else{// // .
+ dwRetErrorCode=ERROR_INVALID_DATA;
+ }
+return(dwRetErrorCode);
+}
+
+
+
+
+__inline SSIZE_T StrHexToNum(LPCSTR lpcszString,SIZE_T dwStringLen)
+{
+ SSIZE_T lNum=0,lSingn=1;
+ BYTE bCurentFigure;
+
+
+ while(dwStringLen && ((bCurentFigure=((*lpcszString)-48))>9))
+ {
+ if (bCurentFigure=='-') lSingn=-1;
+ if (bCurentFigure=='+') lSingn=1;
+
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+ while(dwStringLen)
+ {
+ bCurentFigure=(*lpcszString);
+ if ('0'<=bCurentFigure && bCurentFigure<='9')
+ {
+ bCurentFigure-='0';
+ }else
+ if ('a'<=bCurentFigure && bCurentFigure<='f')
+ {
+ bCurentFigure-=('a'+10);
+ }else
+ if ('A'<=bCurentFigure && bCurentFigure<='F')
+ {
+ bCurentFigure-=('A'+10);
+ }else{
+ bCurentFigure=255;
+ }
+
+ if (bCurentFigure!=255)
+ {
+ lNum*=16;//
+ lNum+=bCurentFigure;//
+ }
+ lpcszString++;//
+ dwStringLen--;//
+ }
+ lNum*=lSingn;
+
+return(lNum);
+}
+
+
+__inline LONG StrHexToNum32(LPCSTR lpcszString,SIZE_T dwStringLen)
+{
+ LONG lNum=0,lSingn=1;
+ BYTE bCurentFigure;
+
+
+ while(dwStringLen && ((bCurentFigure=((*lpcszString)-48))>9))
+ {
+ if (bCurentFigure=='-') lSingn=-1;
+ if (bCurentFigure=='+') lSingn=1;
+
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+ while(dwStringLen)
+ {
+ bCurentFigure=(*lpcszString);
+ if ('0'<=bCurentFigure && bCurentFigure<='9')
+ {
+ bCurentFigure-='0';
+ }else
+ if ('a'<=bCurentFigure && bCurentFigure<='f')
+ {
+ bCurentFigure-=('a'+10);
+ }else
+ if ('A'<=bCurentFigure && bCurentFigure<='F')
+ {
+ bCurentFigure-=('A'+10);
+ }else{
+ bCurentFigure=255;
+ }
+
+ if (bCurentFigure!=255)
+ {
+ lNum*=16;//
+ lNum+=bCurentFigure;//
+ }
+ lpcszString++;//
+ dwStringLen--;//
+ }
+ lNum*=lSingn;
+
+return(lNum);
+}
+
+
+__inline LONGLONG StrHexToNum64(LPCSTR lpcszString,SIZE_T dwStringLen)
+{
+ LONGLONG llNum=0,llSingn=1;
+ BYTE bCurentFigure;
+
+
+ while(dwStringLen && ((bCurentFigure=((*lpcszString)-48))>9))
+ {
+ if (bCurentFigure=='-') llSingn=-1;
+ if (bCurentFigure=='+') llSingn=1;
+
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+ while(dwStringLen)
+ {
+ bCurentFigure=(*lpcszString);
+ if ('0'<=bCurentFigure && bCurentFigure<='9')
+ {
+ bCurentFigure-='0';
+ }else
+ if ('a'<=bCurentFigure && bCurentFigure<='f')
+ {
+ bCurentFigure-=('a'+10);
+ }else
+ if ('A'<=bCurentFigure && bCurentFigure<='F')
+ {
+ bCurentFigure-=('A'+10);
+ }else{
+ bCurentFigure=255;
+ }
+
+ if (bCurentFigure!=255)
+ {
+ llNum*=16;//
+ llNum+=bCurentFigure;//
+ }
+ lpcszString++;//
+ dwStringLen--;//
+ }
+ llNum*=llSingn;
+
+return(llNum);
+}
+
+
+
+__inline DWORD StrHexToNumEx(LPCSTR lpcszString,SIZE_T dwStringLen,SSIZE_T *plNum)
+{
+ DWORD dwRetErrorCode;
+ SIZE_T dwProcessed=0;
+ SSIZE_T lNum=0,lSingn=1;
+ BYTE bCurentFigure;
+
+
+ while(dwStringLen && ((bCurentFigure=((*lpcszString)-48))>9))
+ {
+ if (bCurentFigure=='-') lSingn=-1;
+ if (bCurentFigure=='+') lSingn=1;
+
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+ while(dwStringLen)
+ {
+ bCurentFigure=(*lpcszString);
+ if ('0'<=bCurentFigure && bCurentFigure<='9')
+ {
+ bCurentFigure-='0';
+ }else
+ if ('a'<=bCurentFigure && bCurentFigure<='f')
+ {
+ bCurentFigure-=('a'+10);
+ }else
+ if ('A'<=bCurentFigure && bCurentFigure<='F')
+ {
+ bCurentFigure-=('A'+10);
+ }else{
+ bCurentFigure=255;
+ }
+
+ if (bCurentFigure!=255)
+ {
+ lNum*=16;//
+ lNum+=bCurentFigure;//
+ dwProcessed++;//
+ }
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+ if (dwProcessed)
+ {//
+ if (plNum) (*plNum)=(lNum*lSingn);
+ if (dwProcessed==dwStringLen)
+ {// , // .
+ dwRetErrorCode=NO_ERROR;
+ }else{// // .
+ dwRetErrorCode=ERROR_MORE_DATA;
+ }
+ }else{// // .
+ dwRetErrorCode=ERROR_INVALID_DATA;
+ }
+return(dwRetErrorCode);
+}
+
+
+__inline DWORD StrHexToNumEx32(LPCSTR lpcszString,SIZE_T dwStringLen,LONG *plNum)
+{
+ DWORD dwRetErrorCode;
+ SIZE_T dwProcessed=0;
+ LONG lNum=0,lSingn=1;
+ BYTE bCurentFigure;
+
+
+ while(dwStringLen && ((bCurentFigure=((*lpcszString)-48))>9))
+ {
+ if (bCurentFigure=='-') lSingn=-1;
+ if (bCurentFigure=='+') lSingn=1;
+
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+ while(dwStringLen)
+ {
+ bCurentFigure=(*lpcszString);
+ if ('0'<=bCurentFigure && bCurentFigure<='9')
+ {
+ bCurentFigure-='0';
+ }else
+ if ('a'<=bCurentFigure && bCurentFigure<='f')
+ {
+ bCurentFigure-=('a'+10);
+ }else
+ if ('A'<=bCurentFigure && bCurentFigure<='F')
+ {
+ bCurentFigure-=('A'+10);
+ }else{
+ bCurentFigure=255;
+ }
+
+ if (bCurentFigure!=255)
+ {
+ lNum*=16;//
+ lNum+=bCurentFigure;//
+ dwProcessed++;//
+ }
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+ if (dwProcessed)
+ {//
+ if (plNum) (*plNum)=(lNum*lSingn);
+ if (dwProcessed==dwStringLen)
+ {// , // .
+ dwRetErrorCode=NO_ERROR;
+ }else{// // .
+ dwRetErrorCode=ERROR_MORE_DATA;
+ }
+ }else{// // .
+ dwRetErrorCode=ERROR_INVALID_DATA;
+ }
+return(dwRetErrorCode);
+}
+
+
+__inline DWORD StrHexToNumEx64(LPCSTR lpcszString,SIZE_T dwStringLen,LONGLONG *pllNum)
+{
+ DWORD dwRetErrorCode;
+ SIZE_T dwProcessed=0;
+ LONGLONG llNum=0,llSingn=1;
+ BYTE bCurentFigure;
+
+
+ while(dwStringLen && ((bCurentFigure=((*lpcszString)-48))>9))
+ {
+ if (bCurentFigure=='-') llSingn=-1;
+ if (bCurentFigure=='+') llSingn=1;
+
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+ while(dwStringLen)
+ {
+ bCurentFigure=(*lpcszString);
+ if ('0'<=bCurentFigure && bCurentFigure<='9')
+ {
+ bCurentFigure-='0';
+ }else
+ if ('a'<=bCurentFigure && bCurentFigure<='f')
+ {
+ bCurentFigure-=('a'+10);
+ }else
+ if ('A'<=bCurentFigure && bCurentFigure<='F')
+ {
+ bCurentFigure-=('A'+10);
+ }else{
+ bCurentFigure=255;
+ }
+
+ if (bCurentFigure!=255)
+ {
+ llNum*=16;//
+ llNum+=bCurentFigure;//
+ dwProcessed++;//
+ }
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+ if (dwProcessed)
+ {//
+ if (pllNum) (*pllNum)=(llNum*llSingn);
+ if (dwProcessed==dwStringLen)
+ {// , // .
+ dwRetErrorCode=NO_ERROR;
+ }else{// // .
+ dwRetErrorCode=ERROR_MORE_DATA;
+ }
+ }else{// // .
+ dwRetErrorCode=ERROR_INVALID_DATA;
+ }
+return(dwRetErrorCode);
+}
+
+
+
+
+#endif // !defined(AFX_STRHEXTONUM__H__INCLUDED_) \ No newline at end of file
diff --git a/protocols/MRA/Sdk/StrToNum.h b/protocols/MRA/Sdk/StrToNum.h
new file mode 100644
index 0000000000..888b940b7c
--- /dev/null
+++ b/protocols/MRA/Sdk/StrToNum.h
@@ -0,0 +1,447 @@
+/*
+ * Copyright (c) 2005 Rozhuk Ivan <rozhuk.im@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+
+
+#if !defined(AFX_STRTONUM__H__INCLUDED_)
+#define AFX_STRTONUM__H__INCLUDED_
+
+
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+
+
+
+__inline SIZE_T StrToUNum(LPCSTR lpcszString,SIZE_T dwStringLen)
+{
+ SIZE_T dwNum=0;
+ BYTE bCurentFigure;
+
+
+ while(dwStringLen)
+ {
+ if ((bCurentFigure=((*lpcszString)-48))<10)
+ {
+ dwNum*=10;//
+ dwNum+=bCurentFigure;//
+ }
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+return(dwNum);
+}
+
+
+__inline DWORD StrToUNum32(LPCSTR lpcszString,SIZE_T dwStringLen)
+{
+ DWORD dwNum=0;
+ BYTE bCurentFigure;
+
+
+ while(dwStringLen)
+ {
+ if ((bCurentFigure=((*lpcszString)-48))<10)
+ {
+ dwNum*=10;//
+ dwNum+=bCurentFigure;//
+ }
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+return(dwNum);
+}
+
+
+__inline DWORDLONG StrToUNum64(LPCSTR lpcszString,SIZE_T dwStringLen)
+{
+ DWORDLONG dwlNum=0;
+ BYTE bCurentFigure;
+
+
+ while(dwStringLen)
+ {
+ if ((bCurentFigure=((*lpcszString)-48))<10)
+ {
+ dwlNum*=10;//
+ dwlNum+=bCurentFigure;//
+ }
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+return(dwlNum);
+}
+
+
+
+
+__inline DWORD StrToUNumEx(LPCSTR lpcszString,SIZE_T dwStringLen,SIZE_T *pdwNum)
+{
+ DWORD dwRetErrorCode;
+ SIZE_T dwNum=0,dwProcessed=0;
+ BYTE bCurentFigure;
+
+
+ while(dwStringLen)
+ {
+ if ((bCurentFigure=((*lpcszString)-48))<10)
+ {
+ dwNum*=10;//
+ dwNum+=bCurentFigure;//
+ dwProcessed++;//
+ }
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+ if (dwProcessed)
+ {//
+ if (pdwNum) (*pdwNum)=dwNum;
+ if (dwProcessed==dwStringLen)
+ {// , // .
+ dwRetErrorCode=NO_ERROR;
+ }else{// // .
+ dwRetErrorCode=ERROR_MORE_DATA;
+ }
+ }else{// // .
+ dwRetErrorCode=ERROR_INVALID_DATA;
+ }
+return(dwRetErrorCode);
+}
+
+
+__inline DWORD StrToUNumEx32(LPCSTR lpcszString,SIZE_T dwStringLen,DWORD *pdwNum)
+{
+ DWORD dwRetErrorCode;
+ DWORD dwNum=0,dwProcessed=0;
+ BYTE bCurentFigure;
+
+
+ while(dwStringLen)
+ {
+ if ((bCurentFigure=((*lpcszString)-48))<10)
+ {
+ dwNum*=10;//
+ dwNum+=bCurentFigure;//
+ dwProcessed++;//
+ }
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+ if (dwProcessed)
+ {//
+ if (pdwNum) (*pdwNum)=dwNum;
+ if (dwProcessed==dwStringLen)
+ {// , // .
+ dwRetErrorCode=NO_ERROR;
+ }else{// // .
+ dwRetErrorCode=ERROR_MORE_DATA;
+ }
+ }else{// // .
+ dwRetErrorCode=ERROR_INVALID_DATA;
+ }
+return(dwRetErrorCode);
+}
+
+
+__inline DWORD StrToUNumEx64(LPCSTR lpcszString,SIZE_T dwStringLen,DWORDLONG *pdwlNum)
+{
+ DWORD dwRetErrorCode;
+ DWORDLONG dwlNum=0;
+ SIZE_T dwProcessed=0;
+ BYTE bCurentFigure;
+
+
+ while(dwStringLen)
+ {
+ if ((bCurentFigure=((*lpcszString)-48))<10)
+ {
+ dwlNum*=10;//
+ dwlNum+=bCurentFigure;//
+ dwProcessed++;//
+ }
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+ if (dwProcessed)
+ {//
+ if (pdwlNum) (*pdwlNum)=dwlNum;
+ if (dwProcessed==dwStringLen)
+ {// , // .
+ dwRetErrorCode=NO_ERROR;
+ }else{// // .
+ dwRetErrorCode=ERROR_MORE_DATA;
+ }
+ }else{// // .
+ dwRetErrorCode=ERROR_INVALID_DATA;
+ }
+return(dwRetErrorCode);
+}
+
+
+
+
+__inline SSIZE_T StrToNum(LPCSTR lpcszString,SIZE_T dwStringLen)
+{
+ SSIZE_T lNum=0,lSingn=1;
+ BYTE bCurentFigure;
+
+
+ while(dwStringLen && ((bCurentFigure=((*lpcszString)-48))>9))
+ {
+ if (bCurentFigure=='-') lSingn=-1;
+ if (bCurentFigure=='+') lSingn=1;
+
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+ while(dwStringLen)
+ {
+ if ((bCurentFigure=((*lpcszString)-48))<10)
+ {
+ lNum*=10;//
+ lNum+=bCurentFigure;//
+ }
+ lpcszString++;//
+ dwStringLen--;//
+ }
+ lNum*=lSingn;
+
+return(lNum);
+}
+
+
+__inline LONG StrToNum32(LPCSTR lpcszString,SIZE_T dwStringLen)
+{
+ LONG lNum=0,lSingn=1;
+ BYTE bCurentFigure;
+
+
+ while(dwStringLen && ((bCurentFigure=((*lpcszString)-48))>9))
+ {
+ if (bCurentFigure=='-') lSingn=-1;
+ if (bCurentFigure=='+') lSingn=1;
+
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+ while(dwStringLen)
+ {
+ if ((bCurentFigure=((*lpcszString)-48))<10)
+ {
+ lNum*=10;//
+ lNum+=bCurentFigure;//
+ }
+ lpcszString++;//
+ dwStringLen--;//
+ }
+ lNum*=lSingn;
+
+return(lNum);
+}
+
+
+__inline LONGLONG StrToNum64(LPCSTR lpcszString,SIZE_T dwStringLen)
+{
+ LONGLONG llNum=0,llSingn=1;
+ BYTE bCurentFigure;
+
+
+ while(dwStringLen && ((bCurentFigure=((*lpcszString)-48))>9))
+ {
+ if (bCurentFigure=='-') llSingn=-1;
+ if (bCurentFigure=='+') llSingn=1;
+
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+ while(dwStringLen)
+ {
+ if ((bCurentFigure=((*lpcszString)-48))<10)
+ {
+ llNum*=10;//
+ llNum+=bCurentFigure;//
+ }
+ lpcszString++;//
+ dwStringLen--;//
+ }
+ llNum*=llSingn;
+
+return(llNum);
+}
+
+
+
+__inline DWORD StrToNumEx(LPCSTR lpcszString,SIZE_T dwStringLen,SSIZE_T *plNum)
+{
+ DWORD dwRetErrorCode;
+ SIZE_T dwProcessed=0;
+ SSIZE_T lNum=0,lSingn=1;
+ BYTE bCurentFigure;
+
+
+ while(dwStringLen && ((bCurentFigure=((*lpcszString)-48))>9))
+ {
+ if (bCurentFigure=='-') lSingn=-1;
+ if (bCurentFigure=='+') lSingn=1;
+
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+ while(dwStringLen)
+ {
+ if ((bCurentFigure=((*lpcszString)-48))<10)
+ {
+ lNum*=10;//
+ lNum+=bCurentFigure;//
+ dwProcessed++;//
+ }
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+ if (dwProcessed)
+ {//
+ if (plNum) (*plNum)=(lNum*lSingn);
+ if (dwProcessed==dwStringLen)
+ {// , // .
+ dwRetErrorCode=NO_ERROR;
+ }else{// // .
+ dwRetErrorCode=ERROR_MORE_DATA;
+ }
+ }else{// // .
+ dwRetErrorCode=ERROR_INVALID_DATA;
+ }
+return(dwRetErrorCode);
+}
+
+
+__inline DWORD StrToNumEx32(LPCSTR lpcszString,SIZE_T dwStringLen,LONG *plNum)
+{
+ DWORD dwRetErrorCode;
+ SIZE_T dwProcessed=0;
+ LONG lNum=0,lSingn=1;
+ BYTE bCurentFigure;
+
+
+ while(dwStringLen && ((bCurentFigure=((*lpcszString)-48))>9))
+ {
+ if (bCurentFigure=='-') lSingn=-1;
+ if (bCurentFigure=='+') lSingn=1;
+
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+ while(dwStringLen)
+ {
+ if ((bCurentFigure=((*lpcszString)-48))<10)
+ {
+ lNum*=10;//
+ lNum+=bCurentFigure;//
+ dwProcessed++;//
+ }
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+ if (dwProcessed)
+ {//
+ if (plNum) (*plNum)=(lNum*lSingn);
+ if (dwProcessed==dwStringLen)
+ {// , // .
+ dwRetErrorCode=NO_ERROR;
+ }else{// // .
+ dwRetErrorCode=ERROR_MORE_DATA;
+ }
+ }else{// // .
+ dwRetErrorCode=ERROR_INVALID_DATA;
+ }
+return(dwRetErrorCode);
+}
+
+
+__inline DWORD StrToNumEx64(LPCSTR lpcszString,SIZE_T dwStringLen,LONGLONG *pllNum)
+{
+ DWORD dwRetErrorCode;
+ SIZE_T dwProcessed=0;
+ LONGLONG llNum=0,llSingn=1;
+ BYTE bCurentFigure;
+
+
+ while(dwStringLen && ((bCurentFigure=((*lpcszString)-48))>9))
+ {
+ if (bCurentFigure=='-') llSingn=-1;
+ if (bCurentFigure=='+') llSingn=1;
+
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+ while(dwStringLen)
+ {
+ if ((bCurentFigure=((*lpcszString)-48))<10)
+ {
+ llNum*=10;//
+ llNum+=bCurentFigure;//
+ dwProcessed++;//
+ }
+ lpcszString++;//
+ dwStringLen--;//
+ }
+
+ if (dwProcessed)
+ {//
+ if (pllNum) (*pllNum)=(llNum*llSingn);
+ if (dwProcessed==dwStringLen)
+ {// , // .
+ dwRetErrorCode=NO_ERROR;
+ }else{// // .
+ dwRetErrorCode=ERROR_MORE_DATA;
+ }
+ }else{// // .
+ dwRetErrorCode=ERROR_INVALID_DATA;
+ }
+return(dwRetErrorCode);
+}
+
+
+
+
+#endif // !defined(AFX_STRTONUM__H__INCLUDED_) \ No newline at end of file
diff --git a/protocols/MRA/Sdk/timefuncs.h b/protocols/MRA/Sdk/timefuncs.h
new file mode 100644
index 0000000000..e170b0acd2
--- /dev/null
+++ b/protocols/MRA/Sdk/timefuncs.h
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2009 Rozhuk Ivan <rozhuk.im@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+
+
+#if !defined(AFX_TIME_FUNCS__H__INCLUDED_)
+#define AFX_TIME_FUNCS__H__INCLUDED_
+
+
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include <windows.h>
+#include <time.h>
+
+
+
+#define _MAX__TIME32_T 0x7fffd27f // number of seconds from
+ // 00:00:00, 01/01/1970 UTC to
+ // 23:59:59, 01/18/2038 UTC
+
+// Number of 100 nanosecond units from 1/1/1601 to 1/1/1970
+#define EPOCH_BIAS 116444736000000000i64
+
+//nion to facilitate converting from FILETIME to unsigned __int64
+typedef union {
+ unsigned __int64 ft_scalar;
+ FILETIME ft_struct;
+ } FT;
+
+
+static inline __time32_t __cdecl _time32(__time32_t *timeptr)
+{
+ __time64_t tim;
+ FT nt_time;
+
+ GetSystemTimeAsFileTime(&(nt_time.ft_struct));
+ tim=(__time64_t)((nt_time.ft_scalar-EPOCH_BIAS)/10000000i64);
+ if (tim > (__time64_t)(_MAX__TIME32_T)) tim=(__time64_t)(-1);
+ if (timeptr) *timeptr = (__time32_t)(tim);// store time if requested
+
+return(__time32_t)(tim);
+}
+
+
+inline __time32_t MakeTime32FromLocalSystemTime(CONST PSYSTEMTIME pcstSystemTime)
+{
+ __time64_t tim=0;
+ FT nt_time;
+
+ if (SystemTimeToFileTime(pcstSystemTime,&(nt_time.ft_struct)))
+ {
+ if (LocalFileTimeToFileTime(&(nt_time.ft_struct),&(nt_time.ft_struct)))
+ {
+ tim=(__time64_t)((nt_time.ft_scalar-EPOCH_BIAS)/10000000i64);
+ if (tim > (__time64_t)(_MAX__TIME32_T)) tim=(__time64_t)(-1);
+ }
+ }
+return(__time32_t)(tim);
+}
+
+
+inline BOOL MakeLocalSystemTimeFromTime32(__time32_t tim32,PSYSTEMTIME pstSystemTime)
+{
+ BOOL bRet=FALSE;
+
+ if (pstSystemTime)
+ {
+ __time64_t tim=(__time64_t)tim32;
+ FT nt_time;
+
+ //if (tim==(__time64_t)(-1)) tim=(__time64_t)(_MAX__TIME32_T);
+ nt_time.ft_scalar=(__time64_t)((tim*10000000i64)+EPOCH_BIAS);
+ if (FileTimeToLocalFileTime(&(nt_time.ft_struct),&(nt_time.ft_struct)))
+ {
+ bRet=FileTimeToSystemTime(&(nt_time.ft_struct),pstSystemTime);
+ }
+ }
+return(bRet);
+}
+
+
+
+static inline __time32_t __cdecl _mktime32(struct tm *ptmTime)
+{
+ SYSTEMTIME stTime;
+
+ stTime.wMilliseconds=0;
+ stTime.wSecond=ptmTime->tm_sec; // seconds after the minute - [0,59]
+ stTime.wMinute=ptmTime->tm_min; // minutes after the hour - [0,59]
+ stTime.wHour=ptmTime->tm_hour; // hours since midnight - [0,23]
+ stTime.wDay=ptmTime->tm_mday; // day of the month - [1,31]
+ stTime.wMonth=(ptmTime->tm_mon+1); // months since January - [0,11]
+ stTime.wYear=(ptmTime->tm_year+1900); // years since 1900
+ stTime.wDayOfWeek=0;//ptmTime->tm_wday; // days since Sunday - [0,6]
+ //ptmTime->tm_yday; // days since January 1 - [0,365]
+ //ptmTime->tm_isdst; // daylight savings time flag
+return(MakeTime32FromLocalSystemTime(&stTime));
+}
+
+
+
+
+
+#endif // !defined(AFX_TIME_FUNCS__H__INCLUDED_)
diff --git a/protocols/MRA/Sdk/zconf.h b/protocols/MRA/Sdk/zconf.h
new file mode 100644
index 0000000000..02ce56c431
--- /dev/null
+++ b/protocols/MRA/Sdk/zconf.h
@@ -0,0 +1,428 @@
+/* zconf.h -- configuration of the zlib compression library
+ * Copyright (C) 1995-2010 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#ifndef ZCONF_H
+#define ZCONF_H
+
+/*
+ * If you *really* need a unique prefix for all types and library functions,
+ * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
+ * Even better than compiling with -DZ_PREFIX would be to use configure to set
+ * this permanently in zconf.h using "./configure --zprefix".
+ */
+#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
+
+/* all linked symbols */
+# define _dist_code z__dist_code
+# define _length_code z__length_code
+# define _tr_align z__tr_align
+# define _tr_flush_block z__tr_flush_block
+# define _tr_init z__tr_init
+# define _tr_stored_block z__tr_stored_block
+# define _tr_tally z__tr_tally
+# define adler32 z_adler32
+# define adler32_combine z_adler32_combine
+# define adler32_combine64 z_adler32_combine64
+# define compress z_compress
+# define compress2 z_compress2
+# define compressBound z_compressBound
+# define crc32 z_crc32
+# define crc32_combine z_crc32_combine
+# define crc32_combine64 z_crc32_combine64
+# define deflate z_deflate
+# define deflateBound z_deflateBound
+# define deflateCopy z_deflateCopy
+# define deflateEnd z_deflateEnd
+# define deflateInit2_ z_deflateInit2_
+# define deflateInit_ z_deflateInit_
+# define deflateParams z_deflateParams
+# define deflatePrime z_deflatePrime
+# define deflateReset z_deflateReset
+# define deflateSetDictionary z_deflateSetDictionary
+# define deflateSetHeader z_deflateSetHeader
+# define deflateTune z_deflateTune
+# define deflate_copyright z_deflate_copyright
+# define get_crc_table z_get_crc_table
+# define gz_error z_gz_error
+# define gz_intmax z_gz_intmax
+# define gz_strwinerror z_gz_strwinerror
+# define gzbuffer z_gzbuffer
+# define gzclearerr z_gzclearerr
+# define gzclose z_gzclose
+# define gzclose_r z_gzclose_r
+# define gzclose_w z_gzclose_w
+# define gzdirect z_gzdirect
+# define gzdopen z_gzdopen
+# define gzeof z_gzeof
+# define gzerror z_gzerror
+# define gzflush z_gzflush
+# define gzgetc z_gzgetc
+# define gzgets z_gzgets
+# define gzoffset z_gzoffset
+# define gzoffset64 z_gzoffset64
+# define gzopen z_gzopen
+# define gzopen64 z_gzopen64
+# define gzprintf z_gzprintf
+# define gzputc z_gzputc
+# define gzputs z_gzputs
+# define gzread z_gzread
+# define gzrewind z_gzrewind
+# define gzseek z_gzseek
+# define gzseek64 z_gzseek64
+# define gzsetparams z_gzsetparams
+# define gztell z_gztell
+# define gztell64 z_gztell64
+# define gzungetc z_gzungetc
+# define gzwrite z_gzwrite
+# define inflate z_inflate
+# define inflateBack z_inflateBack
+# define inflateBackEnd z_inflateBackEnd
+# define inflateBackInit_ z_inflateBackInit_
+# define inflateCopy z_inflateCopy
+# define inflateEnd z_inflateEnd
+# define inflateGetHeader z_inflateGetHeader
+# define inflateInit2_ z_inflateInit2_
+# define inflateInit_ z_inflateInit_
+# define inflateMark z_inflateMark
+# define inflatePrime z_inflatePrime
+# define inflateReset z_inflateReset
+# define inflateReset2 z_inflateReset2
+# define inflateSetDictionary z_inflateSetDictionary
+# define inflateSync z_inflateSync
+# define inflateSyncPoint z_inflateSyncPoint
+# define inflateUndermine z_inflateUndermine
+# define inflate_copyright z_inflate_copyright
+# define inflate_fast z_inflate_fast
+# define inflate_table z_inflate_table
+# define uncompress z_uncompress
+# define zError z_zError
+# define zcalloc z_zcalloc
+# define zcfree z_zcfree
+# define zlibCompileFlags z_zlibCompileFlags
+# define zlibVersion z_zlibVersion
+
+/* all zlib typedefs in zlib.h and zconf.h */
+# define Byte z_Byte
+# define Bytef z_Bytef
+# define alloc_func z_alloc_func
+# define charf z_charf
+# define free_func z_free_func
+# define gzFile z_gzFile
+# define gz_header z_gz_header
+# define gz_headerp z_gz_headerp
+# define in_func z_in_func
+# define intf z_intf
+# define out_func z_out_func
+# define uInt z_uInt
+# define uIntf z_uIntf
+# define uLong z_uLong
+# define uLongf z_uLongf
+# define voidp z_voidp
+# define voidpc z_voidpc
+# define voidpf z_voidpf
+
+/* all zlib structs in zlib.h and zconf.h */
+# define gz_header_s z_gz_header_s
+# define internal_state z_internal_state
+
+#endif
+
+#if defined(__MSDOS__) && !defined(MSDOS)
+# define MSDOS
+#endif
+#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
+# define OS2
+#endif
+#if defined(_WINDOWS) && !defined(WINDOWS)
+# define WINDOWS
+#endif
+#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
+# ifndef WIN32
+# define WIN32
+# endif
+#endif
+#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
+# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
+# ifndef SYS16BIT
+# define SYS16BIT
+# endif
+# endif
+#endif
+
+/*
+ * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
+ * than 64k bytes at a time (needed on systems with 16-bit int).
+ */
+#ifdef SYS16BIT
+# define MAXSEG_64K
+#endif
+#ifdef MSDOS
+# define UNALIGNED_OK
+#endif
+
+#ifdef __STDC_VERSION__
+# ifndef STDC
+# define STDC
+# endif
+# if __STDC_VERSION__ >= 199901L
+# ifndef STDC99
+# define STDC99
+# endif
+# endif
+#endif
+#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
+# define STDC
+#endif
+
+#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
+# define STDC
+#endif
+
+#ifndef STDC
+# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
+# define const /* note: need a more gentle solution here */
+# endif
+#endif
+
+/* Some Mac compilers merge all .h files incorrectly: */
+#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
+# define NO_DUMMY_DECL
+#endif
+
+/* Maximum value for memLevel in deflateInit2 */
+#ifndef MAX_MEM_LEVEL
+# ifdef MAXSEG_64K
+# define MAX_MEM_LEVEL 8
+# else
+# define MAX_MEM_LEVEL 9
+# endif
+#endif
+
+/* Maximum value for windowBits in deflateInit2 and inflateInit2.
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
+ * created by gzip. (Files created by minigzip can still be extracted by
+ * gzip.)
+ */
+#ifndef MAX_WBITS
+# define MAX_WBITS 15 /* 32K LZ77 window */
+#endif
+
+/* The memory requirements for deflate are (in bytes):
+ (1 << (windowBits+2)) + (1 << (memLevel+9))
+ that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
+ plus a few kilobytes for small objects. For example, if you want to reduce
+ the default memory requirements from 256K to 128K, compile with
+ make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
+ Of course this will generally degrade compression (there's no free lunch).
+
+ The memory requirements for inflate are (in bytes) 1 << windowBits
+ that is, 32K for windowBits=15 (default value) plus a few kilobytes
+ for small objects.
+*/
+
+ /* Type declarations */
+
+#ifndef OF /* function prototypes */
+# ifdef STDC
+# define OF(args) args
+# else
+# define OF(args) ()
+# endif
+#endif
+
+/* The following definitions for FAR are needed only for MSDOS mixed
+ * model programming (small or medium model with some far allocations).
+ * This was tested only with MSC; for other MSDOS compilers you may have
+ * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
+ * just define FAR to be empty.
+ */
+#ifdef SYS16BIT
+# if defined(M_I86SM) || defined(M_I86MM)
+ /* MSC small or medium model */
+# define SMALL_MEDIUM
+# ifdef _MSC_VER
+# define FAR _far
+# else
+# define FAR far
+# endif
+# endif
+# if (defined(__SMALL__) || defined(__MEDIUM__))
+ /* Turbo C small or medium model */
+# define SMALL_MEDIUM
+# ifdef __BORLANDC__
+# define FAR _far
+# else
+# define FAR far
+# endif
+# endif
+#endif
+
+#if defined(WINDOWS) || defined(WIN32)
+ /* If building or using zlib as a DLL, define ZLIB_DLL.
+ * This is not mandatory, but it offers a little performance increase.
+ */
+# ifdef ZLIB_DLL
+# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
+# ifdef ZLIB_INTERNAL
+# define ZEXTERN extern __declspec(dllexport)
+# else
+# define ZEXTERN extern __declspec(dllimport)
+# endif
+# endif
+# endif /* ZLIB_DLL */
+ /* If building or using zlib with the WINAPI/WINAPIV calling convention,
+ * define ZLIB_WINAPI.
+ * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
+ */
+# ifdef ZLIB_WINAPI
+# ifdef FAR
+# undef FAR
+# endif
+# include <windows.h>
+ /* No need for _export, use ZLIB.DEF instead. */
+ /* For complete Windows compatibility, use WINAPI, not __stdcall. */
+# define ZEXPORT WINAPI
+# ifdef WIN32
+# define ZEXPORTVA WINAPIV
+# else
+# define ZEXPORTVA FAR CDECL
+# endif
+# endif
+#endif
+
+#if defined (__BEOS__)
+# ifdef ZLIB_DLL
+# ifdef ZLIB_INTERNAL
+# define ZEXPORT __declspec(dllexport)
+# define ZEXPORTVA __declspec(dllexport)
+# else
+# define ZEXPORT __declspec(dllimport)
+# define ZEXPORTVA __declspec(dllimport)
+# endif
+# endif
+#endif
+
+#ifndef ZEXTERN
+# define ZEXTERN extern
+#endif
+#ifndef ZEXPORT
+# define ZEXPORT
+#endif
+#ifndef ZEXPORTVA
+# define ZEXPORTVA
+#endif
+
+#ifndef FAR
+# define FAR
+#endif
+
+#if !defined(__MACTYPES__)
+typedef unsigned char Byte; /* 8 bits */
+#endif
+typedef unsigned int uInt; /* 16 bits or more */
+typedef unsigned long uLong; /* 32 bits or more */
+
+#ifdef SMALL_MEDIUM
+ /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
+# define Bytef Byte FAR
+#else
+ typedef Byte FAR Bytef;
+#endif
+typedef char FAR charf;
+typedef int FAR intf;
+typedef uInt FAR uIntf;
+typedef uLong FAR uLongf;
+
+#ifdef STDC
+ typedef void const *voidpc;
+ typedef void FAR *voidpf;
+ typedef void *voidp;
+#else
+ typedef Byte const *voidpc;
+ typedef Byte FAR *voidpf;
+ typedef Byte *voidp;
+#endif
+
+#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
+# define Z_HAVE_UNISTD_H
+#endif
+
+#ifdef STDC
+# include <sys/types.h> /* for off_t */
+#endif
+
+/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
+ * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
+ * though the former does not conform to the LFS document), but considering
+ * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
+ * equivalently requesting no 64-bit operations
+ */
+#if -_LARGEFILE64_SOURCE - -1 == 1
+# undef _LARGEFILE64_SOURCE
+#endif
+
+#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
+# include <unistd.h> /* for SEEK_* and off_t */
+# ifdef VMS
+# include <unixio.h> /* for off_t */
+# endif
+# ifndef z_off_t
+# define z_off_t off_t
+# endif
+#endif
+
+#ifndef SEEK_SET
+# define SEEK_SET 0 /* Seek from beginning of file. */
+# define SEEK_CUR 1 /* Seek from current position. */
+# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
+#endif
+
+#ifndef z_off_t
+# define z_off_t long
+#endif
+
+#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
+# define z_off64_t off64_t
+#else
+# define z_off64_t z_off_t
+#endif
+
+#if defined(__OS400__)
+# define NO_vsnprintf
+#endif
+
+#if defined(__MVS__)
+# define NO_vsnprintf
+#endif
+
+/* MVS linker does not support external names larger than 8 bytes */
+#if defined(__MVS__)
+ #pragma map(deflateInit_,"DEIN")
+ #pragma map(deflateInit2_,"DEIN2")
+ #pragma map(deflateEnd,"DEEND")
+ #pragma map(deflateBound,"DEBND")
+ #pragma map(inflateInit_,"ININ")
+ #pragma map(inflateInit2_,"ININ2")
+ #pragma map(inflateEnd,"INEND")
+ #pragma map(inflateSync,"INSY")
+ #pragma map(inflateSetDictionary,"INSEDI")
+ #pragma map(compressBound,"CMBND")
+ #pragma map(inflate_table,"INTABL")
+ #pragma map(inflate_fast,"INFA")
+ #pragma map(inflate_copyright,"INCOPY")
+#endif
+
+#endif /* ZCONF_H */
diff --git a/protocols/MRA/Sdk/zlib.h b/protocols/MRA/Sdk/zlib.h
new file mode 100644
index 0000000000..62d0e4675b
--- /dev/null
+++ b/protocols/MRA/Sdk/zlib.h
@@ -0,0 +1,1357 @@
+/* zlib.h -- interface of the 'zlib' general purpose compression library
+ version 1.2.3, July 18th, 2005
+
+ Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly Mark Adler
+ jloup@gzip.org madler@alumni.caltech.edu
+
+
+ The data format used by the zlib library is described by RFCs (Request for
+ Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
+ (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
+*/
+
+#ifndef ZLIB_H
+#define ZLIB_H
+
+#include "zconf.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ZLIB_VERSION "1.2.3"
+#define ZLIB_VERNUM 0x1230
+
+/*
+ The 'zlib' compression library provides in-memory compression and
+ decompression functions, including integrity checks of the uncompressed
+ data. This version of the library supports only one compression method
+ (deflation) but other algorithms will be added later and will have the same
+ stream interface.
+
+ Compression can be done in a single step if the buffers are large
+ enough (for example if an input file is mmap'ed), or can be done by
+ repeated calls of the compression function. In the latter case, the
+ application must provide more input and/or consume the output
+ (providing more output space) before each call.
+
+ The compressed data format used by default by the in-memory functions is
+ the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
+ around a deflate stream, which is itself documented in RFC 1951.
+
+ The library also supports reading and writing files in gzip (.gz) format
+ with an interface similar to that of stdio using the functions that start
+ with "gz". The gzip format is different from the zlib format. gzip is a
+ gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
+
+ This library can optionally read and write gzip streams in memory as well.
+
+ The zlib format was designed to be compact and fast for use in memory
+ and on communications channels. The gzip format was designed for single-
+ file compression on file systems, has a larger header than zlib to maintain
+ directory information, and uses a different, slower check method than zlib.
+
+ The library does not install any signal handler. The decoder checks
+ the consistency of the compressed data, so the library should never
+ crash even in case of corrupted input.
+*/
+
+typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
+typedef void (*free_func) OF((voidpf opaque, voidpf address));
+
+struct internal_state;
+
+typedef struct z_stream_s {
+ Bytef *next_in; /* next input byte */
+ uInt avail_in; /* number of bytes available at next_in */
+ uLong total_in; /* total nb of input bytes read so far */
+
+ Bytef *next_out; /* next output byte should be put there */
+ uInt avail_out; /* remaining free space at next_out */
+ uLong total_out; /* total nb of bytes output so far */
+
+ char *msg; /* last error message, NULL if no error */
+ struct internal_state FAR *state; /* not visible by applications */
+
+ alloc_func zalloc; /* used to allocate the internal state */
+ free_func zfree; /* used to free the internal state */
+ voidpf opaque; /* private data object passed to zalloc and zfree */
+
+ int data_type; /* best guess about the data type: binary or text */
+ uLong adler; /* adler32 value of the uncompressed data */
+ uLong reserved; /* reserved for future use */
+} z_stream;
+
+typedef z_stream FAR *z_streamp;
+
+/*
+ gzip header information passed to and from zlib routines. See RFC 1952
+ for more details on the meanings of these fields.
+*/
+typedef struct gz_header_s {
+ int text; /* true if compressed data believed to be text */
+ uLong time; /* modification time */
+ int xflags; /* extra flags (not used when writing a gzip file) */
+ int os; /* operating system */
+ Bytef *extra; /* pointer to extra field or Z_NULL if none */
+ uInt extra_len; /* extra field length (valid if extra != Z_NULL) */
+ uInt extra_max; /* space at extra (only when reading header) */
+ Bytef *name; /* pointer to zero-terminated file name or Z_NULL */
+ uInt name_max; /* space at name (only when reading header) */
+ Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */
+ uInt comm_max; /* space at comment (only when reading header) */
+ int hcrc; /* true if there was or will be a header crc */
+ int done; /* true when done reading gzip header (not used
+ when writing a gzip file) */
+} gz_header;
+
+typedef gz_header FAR *gz_headerp;
+
+/*
+ The application must update next_in and avail_in when avail_in has
+ dropped to zero. It must update next_out and avail_out when avail_out
+ has dropped to zero. The application must initialize zalloc, zfree and
+ opaque before calling the init function. All other fields are set by the
+ compression library and must not be updated by the application.
+
+ The opaque value provided by the application will be passed as the first
+ parameter for calls of zalloc and zfree. This can be useful for custom
+ memory management. The compression library attaches no meaning to the
+ opaque value.
+
+ zalloc must return Z_NULL if there is not enough memory for the object.
+ If zlib is used in a multi-threaded application, zalloc and zfree must be
+ thread safe.
+
+ On 16-bit systems, the functions zalloc and zfree must be able to allocate
+ exactly 65536 bytes, but will not be required to allocate more than this
+ if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
+ pointers returned by zalloc for objects of exactly 65536 bytes *must*
+ have their offset normalized to zero. The default allocation function
+ provided by this library ensures this (see zutil.c). To reduce memory
+ requirements and avoid any allocation of 64K objects, at the expense of
+ compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
+
+ The fields total_in and total_out can be used for statistics or
+ progress reports. After compression, total_in holds the total size of
+ the uncompressed data and may be saved for use in the decompressor
+ (particularly if the decompressor wants to decompress everything in
+ a single step).
+*/
+
+ /* constants */
+
+#define Z_NO_FLUSH 0
+#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
+#define Z_SYNC_FLUSH 2
+#define Z_FULL_FLUSH 3
+#define Z_FINISH 4
+#define Z_BLOCK 5
+/* Allowed flush values; see deflate() and inflate() below for details */
+
+#define Z_OK 0
+#define Z_STREAM_END 1
+#define Z_NEED_DICT 2
+#define Z_ERRNO (-1)
+#define Z_STREAM_ERROR (-2)
+#define Z_DATA_ERROR (-3)
+#define Z_MEM_ERROR (-4)
+#define Z_BUF_ERROR (-5)
+#define Z_VERSION_ERROR (-6)
+/* Return codes for the compression/decompression functions. Negative
+ * values are errors, positive values are used for special but normal events.
+ */
+
+#define Z_NO_COMPRESSION 0
+#define Z_BEST_SPEED 1
+#define Z_BEST_COMPRESSION 9
+#define Z_DEFAULT_COMPRESSION (-1)
+/* compression levels */
+
+#define Z_FILTERED 1
+#define Z_HUFFMAN_ONLY 2
+#define Z_RLE 3
+#define Z_FIXED 4
+#define Z_DEFAULT_STRATEGY 0
+/* compression strategy; see deflateInit2() below for details */
+
+#define Z_BINARY 0
+#define Z_TEXT 1
+#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */
+#define Z_UNKNOWN 2
+/* Possible values of the data_type field (though see inflate()) */
+
+#define Z_DEFLATED 8
+/* The deflate compression method (the only one supported in this version) */
+
+#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
+
+#define zlib_version zlibVersion()
+/* for compatibility with versions < 1.0.2 */
+
+ /* basic functions */
+
+ZEXTERN const char * ZEXPORT zlibVersion OF((void));
+/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
+ If the first character differs, the library code actually used is
+ not compatible with the zlib.h header file used by the application.
+ This check is automatically made by deflateInit and inflateInit.
+ */
+
+/*
+ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
+
+ Initializes the internal stream state for compression. The fields
+ zalloc, zfree and opaque must be initialized before by the caller.
+ If zalloc and zfree are set to Z_NULL, deflateInit updates them to
+ use default allocation functions.
+
+ The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
+ 1 gives best speed, 9 gives best compression, 0 gives no compression at
+ all (the input data is simply copied a block at a time).
+ Z_DEFAULT_COMPRESSION requests a default compromise between speed and
+ compression (currently equivalent to level 6).
+
+ deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_STREAM_ERROR if level is not a valid compression level,
+ Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
+ with the version assumed by the caller (ZLIB_VERSION).
+ msg is set to null if there is no error message. deflateInit does not
+ perform any compression: this will be done by deflate().
+*/
+
+
+ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
+/*
+ deflate compresses as much data as possible, and stops when the input
+ buffer becomes empty or the output buffer becomes full. It may introduce some
+ output latency (reading input without producing any output) except when
+ forced to flush.
+
+ The detailed semantics are as follows. deflate performs one or both of the
+ following actions:
+
+ - Compress more input starting at next_in and update next_in and avail_in
+ accordingly. If not all input can be processed (because there is not
+ enough room in the output buffer), next_in and avail_in are updated and
+ processing will resume at this point for the next call of deflate().
+
+ - Provide more output starting at next_out and update next_out and avail_out
+ accordingly. This action is forced if the parameter flush is non zero.
+ Forcing flush frequently degrades the compression ratio, so this parameter
+ should be set only when necessary (in interactive applications).
+ Some output may be provided even if flush is not set.
+
+ Before the call of deflate(), the application should ensure that at least
+ one of the actions is possible, by providing more input and/or consuming
+ more output, and updating avail_in or avail_out accordingly; avail_out
+ should never be zero before the call. The application can consume the
+ compressed output when it wants, for example when the output buffer is full
+ (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
+ and with zero avail_out, it must be called again after making room in the
+ output buffer because there might be more output pending.
+
+ Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
+ decide how much data to accumualte before producing output, in order to
+ maximize compression.
+
+ If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
+ flushed to the output buffer and the output is aligned on a byte boundary, so
+ that the decompressor can get all input data available so far. (In particular
+ avail_in is zero after the call if enough output space has been provided
+ before the call.) Flushing may degrade compression for some compression
+ algorithms and so it should be used only when necessary.
+
+ If flush is set to Z_FULL_FLUSH, all output is flushed as with
+ Z_SYNC_FLUSH, and the compression state is reset so that decompression can
+ restart from this point if previous compressed data has been damaged or if
+ random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
+ compression.
+
+ If deflate returns with avail_out == 0, this function must be called again
+ with the same value of the flush parameter and more output space (updated
+ avail_out), until the flush is complete (deflate returns with non-zero
+ avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
+ avail_out is greater than six to avoid repeated flush markers due to
+ avail_out == 0 on return.
+
+ If the parameter flush is set to Z_FINISH, pending input is processed,
+ pending output is flushed and deflate returns with Z_STREAM_END if there
+ was enough output space; if deflate returns with Z_OK, this function must be
+ called again with Z_FINISH and more output space (updated avail_out) but no
+ more input data, until it returns with Z_STREAM_END or an error. After
+ deflate has returned Z_STREAM_END, the only possible operations on the
+ stream are deflateReset or deflateEnd.
+
+ Z_FINISH can be used immediately after deflateInit if all the compression
+ is to be done in a single step. In this case, avail_out must be at least
+ the value returned by deflateBound (see below). If deflate does not return
+ Z_STREAM_END, then it must be called again as described above.
+
+ deflate() sets strm->adler to the adler32 checksum of all input read
+ so far (that is, total_in bytes).
+
+ deflate() may update strm->data_type if it can make a good guess about
+ the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered
+ binary. This field is only for information purposes and does not affect
+ the compression algorithm in any manner.
+
+ deflate() returns Z_OK if some progress has been made (more input
+ processed or more output produced), Z_STREAM_END if all input has been
+ consumed and all output has been produced (only when flush is set to
+ Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
+ if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
+ (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not
+ fatal, and deflate() can be called again with more input and more output
+ space to continue compressing.
+*/
+
+
+ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
+/*
+ All dynamically allocated data structures for this stream are freed.
+ This function discards any unprocessed input and does not flush any
+ pending output.
+
+ deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
+ stream state was inconsistent, Z_DATA_ERROR if the stream was freed
+ prematurely (some input or output was discarded). In the error case,
+ msg may be set but then points to a static string (which must not be
+ deallocated).
+*/
+
+
+/*
+ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
+
+ Initializes the internal stream state for decompression. The fields
+ next_in, avail_in, zalloc, zfree and opaque must be initialized before by
+ the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
+ value depends on the compression method), inflateInit determines the
+ compression method from the zlib header and allocates all data structures
+ accordingly; otherwise the allocation will be deferred to the first call of
+ inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
+ use default allocation functions.
+
+ inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+ version assumed by the caller. msg is set to null if there is no error
+ message. inflateInit does not perform any decompression apart from reading
+ the zlib header if present: this will be done by inflate(). (So next_in and
+ avail_in may be modified, but next_out and avail_out are unchanged.)
+*/
+
+
+ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
+/*
+ inflate decompresses as much data as possible, and stops when the input
+ buffer becomes empty or the output buffer becomes full. It may introduce
+ some output latency (reading input without producing any output) except when
+ forced to flush.
+
+ The detailed semantics are as follows. inflate performs one or both of the
+ following actions:
+
+ - Decompress more input starting at next_in and update next_in and avail_in
+ accordingly. If not all input can be processed (because there is not
+ enough room in the output buffer), next_in is updated and processing
+ will resume at this point for the next call of inflate().
+
+ - Provide more output starting at next_out and update next_out and avail_out
+ accordingly. inflate() provides as much output as possible, until there
+ is no more input data or no more space in the output buffer (see below
+ about the flush parameter).
+
+ Before the call of inflate(), the application should ensure that at least
+ one of the actions is possible, by providing more input and/or consuming
+ more output, and updating the next_* and avail_* values accordingly.
+ The application can consume the uncompressed output when it wants, for
+ example when the output buffer is full (avail_out == 0), or after each
+ call of inflate(). If inflate returns Z_OK and with zero avail_out, it
+ must be called again after making room in the output buffer because there
+ might be more output pending.
+
+ The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH,
+ Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much
+ output as possible to the output buffer. Z_BLOCK requests that inflate() stop
+ if and when it gets to the next deflate block boundary. When decoding the
+ zlib or gzip format, this will cause inflate() to return immediately after
+ the header and before the first block. When doing a raw inflate, inflate()
+ will go ahead and process the first block, and will return when it gets to
+ the end of that block, or when it runs out of data.
+
+ The Z_BLOCK option assists in appending to or combining deflate streams.
+ Also to assist in this, on return inflate() will set strm->data_type to the
+ number of unused bits in the last byte taken from strm->next_in, plus 64
+ if inflate() is currently decoding the last block in the deflate stream,
+ plus 128 if inflate() returned immediately after decoding an end-of-block
+ code or decoding the complete header up to just before the first byte of the
+ deflate stream. The end-of-block will not be indicated until all of the
+ uncompressed data from that block has been written to strm->next_out. The
+ number of unused bits may in general be greater than seven, except when
+ bit 7 of data_type is set, in which case the number of unused bits will be
+ less than eight.
+
+ inflate() should normally be called until it returns Z_STREAM_END or an
+ error. However if all decompression is to be performed in a single step
+ (a single call of inflate), the parameter flush should be set to
+ Z_FINISH. In this case all pending input is processed and all pending
+ output is flushed; avail_out must be large enough to hold all the
+ uncompressed data. (The size of the uncompressed data may have been saved
+ by the compressor for this purpose.) The next operation on this stream must
+ be inflateEnd to deallocate the decompression state. The use of Z_FINISH
+ is never required, but can be used to inform inflate that a faster approach
+ may be used for the single inflate() call.
+
+ In this implementation, inflate() always flushes as much output as
+ possible to the output buffer, and always uses the faster approach on the
+ first call. So the only effect of the flush parameter in this implementation
+ is on the return value of inflate(), as noted below, or when it returns early
+ because Z_BLOCK is used.
+
+ If a preset dictionary is needed after this call (see inflateSetDictionary
+ below), inflate sets strm->adler to the adler32 checksum of the dictionary
+ chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
+ strm->adler to the adler32 checksum of all output produced so far (that is,
+ total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
+ below. At the end of the stream, inflate() checks that its computed adler32
+ checksum is equal to that saved by the compressor and returns Z_STREAM_END
+ only if the checksum is correct.
+
+ inflate() will decompress and check either zlib-wrapped or gzip-wrapped
+ deflate data. The header type is detected automatically. Any information
+ contained in the gzip header is not retained, so applications that need that
+ information should instead use raw inflate, see inflateInit2() below, or
+ inflateBack() and perform their own processing of the gzip header and
+ trailer.
+
+ inflate() returns Z_OK if some progress has been made (more input processed
+ or more output produced), Z_STREAM_END if the end of the compressed data has
+ been reached and all uncompressed output has been produced, Z_NEED_DICT if a
+ preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
+ corrupted (input stream not conforming to the zlib format or incorrect check
+ value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
+ if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory,
+ Z_BUF_ERROR if no progress is possible or if there was not enough room in the
+ output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
+ inflate() can be called again with more input and more output space to
+ continue decompressing. If Z_DATA_ERROR is returned, the application may then
+ call inflateSync() to look for a good compression block if a partial recovery
+ of the data is desired.
+*/
+
+
+ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
+/*
+ All dynamically allocated data structures for this stream are freed.
+ This function discards any unprocessed input and does not flush any
+ pending output.
+
+ inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
+ was inconsistent. In the error case, msg may be set but then points to a
+ static string (which must not be deallocated).
+*/
+
+ /* Advanced functions */
+
+/*
+ The following functions are needed only in some special applications.
+*/
+
+/*
+ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
+ int level,
+ int method,
+ int windowBits,
+ int memLevel,
+ int strategy));
+
+ This is another version of deflateInit with more compression options. The
+ fields next_in, zalloc, zfree and opaque must be initialized before by
+ the caller.
+
+ The method parameter is the compression method. It must be Z_DEFLATED in
+ this version of the library.
+
+ The windowBits parameter is the base two logarithm of the window size
+ (the size of the history buffer). It should be in the range 8..15 for this
+ version of the library. Larger values of this parameter result in better
+ compression at the expense of memory usage. The default value is 15 if
+ deflateInit is used instead.
+
+ windowBits can also be -8..-15 for raw deflate. In this case, -windowBits
+ determines the window size. deflate() will then generate raw deflate data
+ with no zlib header or trailer, and will not compute an adler32 check value.
+
+ windowBits can also be greater than 15 for optional gzip encoding. Add
+ 16 to windowBits to write a simple gzip header and trailer around the
+ compressed data instead of a zlib wrapper. The gzip header will have no
+ file name, no extra data, no comment, no modification time (set to zero),
+ no header crc, and the operating system will be set to 255 (unknown). If a
+ gzip stream is being written, strm->adler is a crc32 instead of an adler32.
+
+ The memLevel parameter specifies how much memory should be allocated
+ for the internal compression state. memLevel=1 uses minimum memory but
+ is slow and reduces compression ratio; memLevel=9 uses maximum memory
+ for optimal speed. The default value is 8. See zconf.h for total memory
+ usage as a function of windowBits and memLevel.
+
+ The strategy parameter is used to tune the compression algorithm. Use the
+ value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
+ filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
+ string match), or Z_RLE to limit match distances to one (run-length
+ encoding). Filtered data consists mostly of small values with a somewhat
+ random distribution. In this case, the compression algorithm is tuned to
+ compress them better. The effect of Z_FILTERED is to force more Huffman
+ coding and less string matching; it is somewhat intermediate between
+ Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as
+ Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy
+ parameter only affects the compression ratio but not the correctness of the
+ compressed output even if it is not set appropriately. Z_FIXED prevents the
+ use of dynamic Huffman codes, allowing for a simpler decoder for special
+ applications.
+
+ deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
+ method). msg is set to null if there is no error message. deflateInit2 does
+ not perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength));
+/*
+ Initializes the compression dictionary from the given byte sequence
+ without producing any compressed output. This function must be called
+ immediately after deflateInit, deflateInit2 or deflateReset, before any
+ call of deflate. The compressor and decompressor must use exactly the same
+ dictionary (see inflateSetDictionary).
+
+ The dictionary should consist of strings (byte sequences) that are likely
+ to be encountered later in the data to be compressed, with the most commonly
+ used strings preferably put towards the end of the dictionary. Using a
+ dictionary is most useful when the data to be compressed is short and can be
+ predicted with good accuracy; the data can then be compressed better than
+ with the default empty dictionary.
+
+ Depending on the size of the compression data structures selected by
+ deflateInit or deflateInit2, a part of the dictionary may in effect be
+ discarded, for example if the dictionary is larger than the window size in
+ deflate or deflate2. Thus the strings most likely to be useful should be
+ put at the end of the dictionary, not at the front. In addition, the
+ current implementation of deflate will use at most the window size minus
+ 262 bytes of the provided dictionary.
+
+ Upon return of this function, strm->adler is set to the adler32 value
+ of the dictionary; the decompressor may later use this value to determine
+ which dictionary has been used by the compressor. (The adler32 value
+ applies to the whole dictionary even if only a subset of the dictionary is
+ actually used by the compressor.) If a raw deflate was requested, then the
+ adler32 value is not computed and strm->adler is not set.
+
+ deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
+ parameter is invalid (such as NULL dictionary) or the stream state is
+ inconsistent (for example if deflate has already been called for this stream
+ or if the compression method is bsort). deflateSetDictionary does not
+ perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
+ z_streamp source));
+/*
+ Sets the destination stream as a complete copy of the source stream.
+
+ This function can be useful when several compression strategies will be
+ tried, for example when there are several ways of pre-processing the input
+ data with a filter. The streams that will be discarded should then be freed
+ by calling deflateEnd. Note that deflateCopy duplicates the internal
+ compression state which can be quite large, so this strategy is slow and
+ can consume lots of memory.
+
+ deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+ (such as zalloc being NULL). msg is left unchanged in both source and
+ destination.
+*/
+
+ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
+/*
+ This function is equivalent to deflateEnd followed by deflateInit,
+ but does not free and reallocate all the internal compression state.
+ The stream will keep the same compression level and any other attributes
+ that may have been set by deflateInit2.
+
+ deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being NULL).
+*/
+
+ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
+ int level,
+ int strategy));
+/*
+ Dynamically update the compression level and compression strategy. The
+ interpretation of level and strategy is as in deflateInit2. This can be
+ used to switch between compression and straight copy of the input data, or
+ to switch to a different kind of input data requiring a different
+ strategy. If the compression level is changed, the input available so far
+ is compressed with the old level (and may be flushed); the new level will
+ take effect only at the next call of deflate().
+
+ Before the call of deflateParams, the stream state must be set as for
+ a call of deflate(), since the currently available input may have to
+ be compressed and flushed. In particular, strm->avail_out must be non-zero.
+
+ deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
+ stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
+ if strm->avail_out was zero.
+*/
+
+ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
+ int good_length,
+ int max_lazy,
+ int nice_length,
+ int max_chain));
+/*
+ Fine tune deflate's internal compression parameters. This should only be
+ used by someone who understands the algorithm used by zlib's deflate for
+ searching for the best matching string, and even then only by the most
+ fanatic optimizer trying to squeeze out the last compressed bit for their
+ specific input data. Read the deflate.c source code for the meaning of the
+ max_lazy, good_length, nice_length, and max_chain parameters.
+
+ deflateTune() can be called after deflateInit() or deflateInit2(), and
+ returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
+ */
+
+ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
+ uLong sourceLen));
+/*
+ deflateBound() returns an upper bound on the compressed size after
+ deflation of sourceLen bytes. It must be called after deflateInit()
+ or deflateInit2(). This would be used to allocate an output buffer
+ for deflation in a single pass, and so would be called before deflate().
+*/
+
+ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
+ int bits,
+ int value));
+/*
+ deflatePrime() inserts bits in the deflate output stream. The intent
+ is that this function is used to start off the deflate output with the
+ bits leftover from a previous deflate stream when appending to it. As such,
+ this function can only be used for raw deflate, and must be used before the
+ first deflate() call after a deflateInit2() or deflateReset(). bits must be
+ less than or equal to 16, and that many of the least significant bits of
+ value will be inserted in the output.
+
+ deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
+ gz_headerp head));
+/*
+ deflateSetHeader() provides gzip header information for when a gzip
+ stream is requested by deflateInit2(). deflateSetHeader() may be called
+ after deflateInit2() or deflateReset() and before the first call of
+ deflate(). The text, time, os, extra field, name, and comment information
+ in the provided gz_header structure are written to the gzip header (xflag is
+ ignored -- the extra flags are set according to the compression level). The
+ caller must assure that, if not Z_NULL, name and comment are terminated with
+ a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
+ available there. If hcrc is true, a gzip header crc is included. Note that
+ the current versions of the command-line version of gzip (up through version
+ 1.3.x) do not support header crc's, and will report that it is a "multi-part
+ gzip file" and give up.
+
+ If deflateSetHeader is not used, the default gzip header has text false,
+ the time set to zero, and os set to 255, with no extra, name, or comment
+ fields. The gzip header is returned to the default state by deflateReset().
+
+ deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
+ int windowBits));
+
+ This is another version of inflateInit with an extra parameter. The
+ fields next_in, avail_in, zalloc, zfree and opaque must be initialized
+ before by the caller.
+
+ The windowBits parameter is the base two logarithm of the maximum window
+ size (the size of the history buffer). It should be in the range 8..15 for
+ this version of the library. The default value is 15 if inflateInit is used
+ instead. windowBits must be greater than or equal to the windowBits value
+ provided to deflateInit2() while compressing, or it must be equal to 15 if
+ deflateInit2() was not used. If a compressed stream with a larger window
+ size is given as input, inflate() will return with the error code
+ Z_DATA_ERROR instead of trying to allocate a larger window.
+
+ windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
+ determines the window size. inflate() will then process raw deflate data,
+ not looking for a zlib or gzip header, not generating a check value, and not
+ looking for any check values for comparison at the end of the stream. This
+ is for use with other formats that use the deflate compressed data format
+ such as zip. Those formats provide their own check values. If a custom
+ format is developed using the raw deflate format for compressed data, it is
+ recommended that a check value such as an adler32 or a crc32 be applied to
+ the uncompressed data as is done in the zlib, gzip, and zip formats. For
+ most applications, the zlib format should be used as is. Note that comments
+ above on the use in deflateInit2() applies to the magnitude of windowBits.
+
+ windowBits can also be greater than 15 for optional gzip decoding. Add
+ 32 to windowBits to enable zlib and gzip decoding with automatic header
+ detection, or add 16 to decode only the gzip format (the zlib format will
+ return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is
+ a crc32 instead of an adler32.
+
+ inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg
+ is set to null if there is no error message. inflateInit2 does not perform
+ any decompression apart from reading the zlib header if present: this will
+ be done by inflate(). (So next_in and avail_in may be modified, but next_out
+ and avail_out are unchanged.)
+*/
+
+ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength));
+/*
+ Initializes the decompression dictionary from the given uncompressed byte
+ sequence. This function must be called immediately after a call of inflate,
+ if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
+ can be determined from the adler32 value returned by that call of inflate.
+ The compressor and decompressor must use exactly the same dictionary (see
+ deflateSetDictionary). For raw inflate, this function can be called
+ immediately after inflateInit2() or inflateReset() and before any call of
+ inflate() to set the dictionary. The application must insure that the
+ dictionary that was used for compression is provided.
+
+ inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
+ parameter is invalid (such as NULL dictionary) or the stream state is
+ inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
+ expected one (incorrect adler32 value). inflateSetDictionary does not
+ perform any decompression: this will be done by subsequent calls of
+ inflate().
+*/
+
+ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
+/*
+ Skips invalid compressed data until a full flush point (see above the
+ description of deflate with Z_FULL_FLUSH) can be found, or until all
+ available input is skipped. No output is provided.
+
+ inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
+ if no more input was provided, Z_DATA_ERROR if no flush point has been found,
+ or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
+ case, the application may save the current current value of total_in which
+ indicates where valid compressed data was found. In the error case, the
+ application may repeatedly call inflateSync, providing more input each time,
+ until success or end of the input data.
+*/
+
+ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
+ z_streamp source));
+/*
+ Sets the destination stream as a complete copy of the source stream.
+
+ This function can be useful when randomly accessing a large stream. The
+ first pass through the stream can periodically record the inflate state,
+ allowing restarting inflate at those points when randomly accessing the
+ stream.
+
+ inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+ (such as zalloc being NULL). msg is left unchanged in both source and
+ destination.
+*/
+
+ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
+/*
+ This function is equivalent to inflateEnd followed by inflateInit,
+ but does not free and reallocate all the internal decompression state.
+ The stream will keep attributes that may have been set by inflateInit2.
+
+ inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being NULL).
+*/
+
+ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
+ int bits,
+ int value));
+/*
+ This function inserts bits in the inflate input stream. The intent is
+ that this function is used to start inflating at a bit position in the
+ middle of a byte. The provided bits will be used before any bytes are used
+ from next_in. This function should only be used with raw inflate, and
+ should be used before the first inflate() call after inflateInit2() or
+ inflateReset(). bits must be less than or equal to 16, and that many of the
+ least significant bits of value will be inserted in the input.
+
+ inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
+ gz_headerp head));
+/*
+ inflateGetHeader() requests that gzip header information be stored in the
+ provided gz_header structure. inflateGetHeader() may be called after
+ inflateInit2() or inflateReset(), and before the first call of inflate().
+ As inflate() processes the gzip stream, head->done is zero until the header
+ is completed, at which time head->done is set to one. If a zlib stream is
+ being decoded, then head->done is set to -1 to indicate that there will be
+ no gzip header information forthcoming. Note that Z_BLOCK can be used to
+ force inflate() to return immediately after header processing is complete
+ and before any actual data is decompressed.
+
+ The text, time, xflags, and os fields are filled in with the gzip header
+ contents. hcrc is set to true if there is a header CRC. (The header CRC
+ was valid if done is set to one.) If extra is not Z_NULL, then extra_max
+ contains the maximum number of bytes to write to extra. Once done is true,
+ extra_len contains the actual extra field length, and extra contains the
+ extra field, or that field truncated if extra_max is less than extra_len.
+ If name is not Z_NULL, then up to name_max characters are written there,
+ terminated with a zero unless the length is greater than name_max. If
+ comment is not Z_NULL, then up to comm_max characters are written there,
+ terminated with a zero unless the length is greater than comm_max. When
+ any of extra, name, or comment are not Z_NULL and the respective field is
+ not present in the header, then that field is set to Z_NULL to signal its
+ absence. This allows the use of deflateSetHeader() with the returned
+ structure to duplicate the header. However if those fields are set to
+ allocated memory, then the application will need to save those pointers
+ elsewhere so that they can be eventually freed.
+
+ If inflateGetHeader is not used, then the header information is simply
+ discarded. The header is always checked for validity, including the header
+ CRC if present. inflateReset() will reset the process to discard the header
+ information. The application would need to call inflateGetHeader() again to
+ retrieve the header from the next gzip stream.
+
+ inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
+ unsigned char FAR *window));
+
+ Initialize the internal stream state for decompression using inflateBack()
+ calls. The fields zalloc, zfree and opaque in strm must be initialized
+ before the call. If zalloc and zfree are Z_NULL, then the default library-
+ derived memory allocation routines are used. windowBits is the base two
+ logarithm of the window size, in the range 8..15. window is a caller
+ supplied buffer of that size. Except for special applications where it is
+ assured that deflate was used with small window sizes, windowBits must be 15
+ and a 32K byte window must be supplied to be able to decompress general
+ deflate streams.
+
+ See inflateBack() for the usage of these routines.
+
+ inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
+ the paramaters are invalid, Z_MEM_ERROR if the internal state could not
+ be allocated, or Z_VERSION_ERROR if the version of the library does not
+ match the version of the header file.
+*/
+
+typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));
+typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
+
+ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
+ in_func in, void FAR *in_desc,
+ out_func out, void FAR *out_desc));
+/*
+ inflateBack() does a raw inflate with a single call using a call-back
+ interface for input and output. This is more efficient than inflate() for
+ file i/o applications in that it avoids copying between the output and the
+ sliding window by simply making the window itself the output buffer. This
+ function trusts the application to not change the output buffer passed by
+ the output function, at least until inflateBack() returns.
+
+ inflateBackInit() must be called first to allocate the internal state
+ and to initialize the state with the user-provided window buffer.
+ inflateBack() may then be used multiple times to inflate a complete, raw
+ deflate stream with each call. inflateBackEnd() is then called to free
+ the allocated state.
+
+ A raw deflate stream is one with no zlib or gzip header or trailer.
+ This routine would normally be used in a utility that reads zip or gzip
+ files and writes out uncompressed files. The utility would decode the
+ header and process the trailer on its own, hence this routine expects
+ only the raw deflate stream to decompress. This is different from the
+ normal behavior of inflate(), which expects either a zlib or gzip header and
+ trailer around the deflate stream.
+
+ inflateBack() uses two subroutines supplied by the caller that are then
+ called by inflateBack() for input and output. inflateBack() calls those
+ routines until it reads a complete deflate stream and writes out all of the
+ uncompressed data, or until it encounters an error. The function's
+ parameters and return types are defined above in the in_func and out_func
+ typedefs. inflateBack() will call in(in_desc, &buf) which should return the
+ number of bytes of provided input, and a pointer to that input in buf. If
+ there is no input available, in() must return zero--buf is ignored in that
+ case--and inflateBack() will return a buffer error. inflateBack() will call
+ out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out()
+ should return zero on success, or non-zero on failure. If out() returns
+ non-zero, inflateBack() will return with an error. Neither in() nor out()
+ are permitted to change the contents of the window provided to
+ inflateBackInit(), which is also the buffer that out() uses to write from.
+ The length written by out() will be at most the window size. Any non-zero
+ amount of input may be provided by in().
+
+ For convenience, inflateBack() can be provided input on the first call by
+ setting strm->next_in and strm->avail_in. If that input is exhausted, then
+ in() will be called. Therefore strm->next_in must be initialized before
+ calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called
+ immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in
+ must also be initialized, and then if strm->avail_in is not zero, input will
+ initially be taken from strm->next_in[0 .. strm->avail_in - 1].
+
+ The in_desc and out_desc parameters of inflateBack() is passed as the
+ first parameter of in() and out() respectively when they are called. These
+ descriptors can be optionally used to pass any information that the caller-
+ supplied in() and out() functions need to do their job.
+
+ On return, inflateBack() will set strm->next_in and strm->avail_in to
+ pass back any unused input that was provided by the last in() call. The
+ return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
+ if in() or out() returned an error, Z_DATA_ERROR if there was a format
+ error in the deflate stream (in which case strm->msg is set to indicate the
+ nature of the error), or Z_STREAM_ERROR if the stream was not properly
+ initialized. In the case of Z_BUF_ERROR, an input or output error can be
+ distinguished using strm->next_in which will be Z_NULL only if in() returned
+ an error. If strm->next is not Z_NULL, then the Z_BUF_ERROR was due to
+ out() returning non-zero. (in() will always be called before out(), so
+ strm->next_in is assured to be defined if out() returns non-zero.) Note
+ that inflateBack() cannot return Z_OK.
+*/
+
+ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
+/*
+ All memory allocated by inflateBackInit() is freed.
+
+ inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
+ state was inconsistent.
+*/
+
+ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
+/* Return flags indicating compile-time options.
+
+ Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
+ 1.0: size of uInt
+ 3.2: size of uLong
+ 5.4: size of voidpf (pointer)
+ 7.6: size of z_off_t
+
+ Compiler, assembler, and debug options:
+ 8: DEBUG
+ 9: ASMV or ASMINF -- use ASM code
+ 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
+ 11: 0 (reserved)
+
+ One-time table building (smaller code, but not thread-safe if true):
+ 12: BUILDFIXED -- build static block decoding tables when needed
+ 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
+ 14,15: 0 (reserved)
+
+ Library content (indicates missing functionality):
+ 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
+ deflate code when not needed)
+ 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
+ and decode gzip streams (to avoid linking crc code)
+ 18-19: 0 (reserved)
+
+ Operation variations (changes in library functionality):
+ 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
+ 21: FASTEST -- deflate algorithm with only one, lowest compression level
+ 22,23: 0 (reserved)
+
+ The sprintf variant used by gzprintf (zero is best):
+ 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
+ 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
+ 26: 0 = returns value, 1 = void -- 1 means inferred string length returned
+
+ Remainder:
+ 27-31: 0 (reserved)
+ */
+
+
+ /* utility functions */
+
+/*
+ The following utility functions are implemented on top of the
+ basic stream-oriented functions. To simplify the interface, some
+ default options are assumed (compression level and memory usage,
+ standard memory allocation functions). The source code of these
+ utility functions can easily be modified if you need special options.
+*/
+
+ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen));
+/*
+ Compresses the source buffer into the destination buffer. sourceLen is
+ the byte length of the source buffer. Upon entry, destLen is the total
+ size of the destination buffer, which must be at least the value returned
+ by compressBound(sourceLen). Upon exit, destLen is the actual size of the
+ compressed buffer.
+ This function can be used to compress a whole file at once if the
+ input file is mmap'ed.
+ compress returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if there was not enough room in the output
+ buffer.
+*/
+
+ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen,
+ int level));
+/*
+ Compresses the source buffer into the destination buffer. The level
+ parameter has the same meaning as in deflateInit. sourceLen is the byte
+ length of the source buffer. Upon entry, destLen is the total size of the
+ destination buffer, which must be at least the value returned by
+ compressBound(sourceLen). Upon exit, destLen is the actual size of the
+ compressed buffer.
+
+ compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+ Z_STREAM_ERROR if the level parameter is invalid.
+*/
+
+ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
+/*
+ compressBound() returns an upper bound on the compressed size after
+ compress() or compress2() on sourceLen bytes. It would be used before
+ a compress() or compress2() call to allocate the destination buffer.
+*/
+
+ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen));
+/*
+ Decompresses the source buffer into the destination buffer. sourceLen is
+ the byte length of the source buffer. Upon entry, destLen is the total
+ size of the destination buffer, which must be large enough to hold the
+ entire uncompressed data. (The size of the uncompressed data must have
+ been saved previously by the compressor and transmitted to the decompressor
+ by some mechanism outside the scope of this compression library.)
+ Upon exit, destLen is the actual size of the compressed buffer.
+ This function can be used to decompress a whole file at once if the
+ input file is mmap'ed.
+
+ uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if there was not enough room in the output
+ buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.
+*/
+
+
+typedef voidp gzFile;
+
+ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
+/*
+ Opens a gzip (.gz) file for reading or writing. The mode parameter
+ is as in fopen ("rb" or "wb") but can also include a compression level
+ ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
+ Huffman only compression as in "wb1h", or 'R' for run-length encoding
+ as in "wb1R". (See the description of deflateInit2 for more information
+ about the strategy parameter.)
+
+ gzopen can be used to read a file which is not in gzip format; in this
+ case gzread will directly read from the file without decompression.
+
+ gzopen returns NULL if the file could not be opened or if there was
+ insufficient memory to allocate the (de)compression state; errno
+ can be checked to distinguish the two cases (if errno is zero, the
+ zlib error is Z_MEM_ERROR). */
+
+ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
+/*
+ gzdopen() associates a gzFile with the file descriptor fd. File
+ descriptors are obtained from calls like open, dup, creat, pipe or
+ fileno (in the file has been previously opened with fopen).
+ The mode parameter is as in gzopen.
+ The next call of gzclose on the returned gzFile will also close the
+ file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
+ descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
+ gzdopen returns NULL if there was insufficient memory to allocate
+ the (de)compression state.
+*/
+
+ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
+/*
+ Dynamically update the compression level or strategy. See the description
+ of deflateInit2 for the meaning of these parameters.
+ gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
+ opened for writing.
+*/
+
+ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
+/*
+ Reads the given number of uncompressed bytes from the compressed file.
+ If the input file was not in gzip format, gzread copies the given number
+ of bytes into the buffer.
+ gzread returns the number of uncompressed bytes actually read (0 for
+ end of file, -1 for error). */
+
+ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
+ voidpc buf, unsigned len));
+/*
+ Writes the given number of uncompressed bytes into the compressed file.
+ gzwrite returns the number of uncompressed bytes actually written
+ (0 in case of error).
+*/
+
+ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
+/*
+ Converts, formats, and writes the args to the compressed file under
+ control of the format string, as in fprintf. gzprintf returns the number of
+ uncompressed bytes actually written (0 in case of error). The number of
+ uncompressed bytes written is limited to 4095. The caller should assure that
+ this limit is not exceeded. If it is exceeded, then gzprintf() will return
+ return an error (0) with nothing written. In this case, there may also be a
+ buffer overflow with unpredictable consequences, which is possible only if
+ zlib was compiled with the insecure functions sprintf() or vsprintf()
+ because the secure snprintf() or vsnprintf() functions were not available.
+*/
+
+ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
+/*
+ Writes the given null-terminated string to the compressed file, excluding
+ the terminating null character.
+ gzputs returns the number of characters written, or -1 in case of error.
+*/
+
+ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
+/*
+ Reads bytes from the compressed file until len-1 characters are read, or
+ a newline character is read and transferred to buf, or an end-of-file
+ condition is encountered. The string is then terminated with a null
+ character.
+ gzgets returns buf, or Z_NULL in case of error.
+*/
+
+ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
+/*
+ Writes c, converted to an unsigned char, into the compressed file.
+ gzputc returns the value that was written, or -1 in case of error.
+*/
+
+ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
+/*
+ Reads one byte from the compressed file. gzgetc returns this byte
+ or -1 in case of end of file or error.
+*/
+
+ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
+/*
+ Push one character back onto the stream to be read again later.
+ Only one character of push-back is allowed. gzungetc() returns the
+ character pushed, or -1 on failure. gzungetc() will fail if a
+ character has been pushed but not read yet, or if c is -1. The pushed
+ character will be discarded if the stream is repositioned with gzseek()
+ or gzrewind().
+*/
+
+ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
+/*
+ Flushes all pending output into the compressed file. The parameter
+ flush is as in the deflate() function. The return value is the zlib
+ error number (see function gzerror below). gzflush returns Z_OK if
+ the flush parameter is Z_FINISH and all output could be flushed.
+ gzflush should be called only when strictly necessary because it can
+ degrade compression.
+*/
+
+ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
+ z_off_t offset, int whence));
+/*
+ Sets the starting position for the next gzread or gzwrite on the
+ given compressed file. The offset represents a number of bytes in the
+ uncompressed data stream. The whence parameter is defined as in lseek(2);
+ the value SEEK_END is not supported.
+ If the file is opened for reading, this function is emulated but can be
+ extremely slow. If the file is opened for writing, only forward seeks are
+ supported; gzseek then compresses a sequence of zeroes up to the new
+ starting position.
+
+ gzseek returns the resulting offset location as measured in bytes from
+ the beginning of the uncompressed stream, or -1 in case of error, in
+ particular if the file is opened for writing and the new starting position
+ would be before the current position.
+*/
+
+ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
+/*
+ Rewinds the given file. This function is supported only for reading.
+
+ gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
+*/
+
+ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
+/*
+ Returns the starting position for the next gzread or gzwrite on the
+ given compressed file. This position represents a number of bytes in the
+ uncompressed data stream.
+
+ gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
+*/
+
+ZEXTERN int ZEXPORT gzeof OF((gzFile file));
+/*
+ Returns 1 when EOF has previously been detected reading the given
+ input stream, otherwise zero.
+*/
+
+ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
+/*
+ Returns 1 if file is being read directly without decompression, otherwise
+ zero.
+*/
+
+ZEXTERN int ZEXPORT gzclose OF((gzFile file));
+/*
+ Flushes all pending output if necessary, closes the compressed file
+ and deallocates all the (de)compression state. The return value is the zlib
+ error number (see function gzerror below).
+*/
+
+ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
+/*
+ Returns the error message for the last error which occurred on the
+ given compressed file. errnum is set to zlib error number. If an
+ error occurred in the file system and not in the compression library,
+ errnum is set to Z_ERRNO and the application may consult errno
+ to get the exact error code.
+*/
+
+ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
+/*
+ Clears the error and end-of-file flags for file. This is analogous to the
+ clearerr() function in stdio. This is useful for continuing to read a gzip
+ file that is being written concurrently.
+*/
+
+ /* checksum functions */
+
+/*
+ These functions are not related to compression but are exported
+ anyway because they might be useful in applications using the
+ compression library.
+*/
+
+ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
+/*
+ Update a running Adler-32 checksum with the bytes buf[0..len-1] and
+ return the updated checksum. If buf is NULL, this function returns
+ the required initial value for the checksum.
+ An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
+ much faster. Usage example:
+
+ uLong adler = adler32(0L, Z_NULL, 0);
+
+ while (read_buffer(buffer, length) != EOF) {
+ adler = adler32(adler, buffer, length);
+ }
+ if (adler != original_adler) error();
+*/
+
+ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
+ z_off_t len2));
+/*
+ Combine two Adler-32 checksums into one. For two sequences of bytes, seq1
+ and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
+ each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of
+ seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.
+*/
+
+ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
+/*
+ Update a running CRC-32 with the bytes buf[0..len-1] and return the
+ updated CRC-32. If buf is NULL, this function returns the required initial
+ value for the for the crc. Pre- and post-conditioning (one's complement) is
+ performed within this function so it shouldn't be done by the application.
+ Usage example:
+
+ uLong crc = crc32(0L, Z_NULL, 0);
+
+ while (read_buffer(buffer, length) != EOF) {
+ crc = crc32(crc, buffer, length);
+ }
+ if (crc != original_crc) error();
+*/
+
+ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
+
+/*
+ Combine two CRC-32 check values into one. For two sequences of bytes,
+ seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
+ calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32
+ check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
+ len2.
+*/
+
+
+ /* various hacks, don't look :) */
+
+/* deflateInit and inflateInit are macros to allow checking the zlib version
+ * and the compiler's view of z_stream:
+ */
+ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
+ int windowBits, int memLevel,
+ int strategy, const char *version,
+ int stream_size));
+ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
+ unsigned char FAR *window,
+ const char *version,
+ int stream_size));
+#define deflateInit(strm, level) \
+ deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
+#define inflateInit(strm) \
+ inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
+#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
+ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
+ (strategy), ZLIB_VERSION, sizeof(z_stream))
+#define inflateInit2(strm, windowBits) \
+ inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
+#define inflateBackInit(strm, windowBits, window) \
+ inflateBackInit_((strm), (windowBits), (window), \
+ ZLIB_VERSION, sizeof(z_stream))
+
+
+#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
+ struct internal_state {int dummy;}; /* hack for buggy compilers */
+#endif
+
+ZEXTERN const char * ZEXPORT zError OF((int));
+ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z));
+ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ZLIB_H */
diff --git a/protocols/MRA/TODO.txt b/protocols/MRA/TODO.txt
new file mode 100644
index 0000000000..6366e73527
--- /dev/null
+++ b/protocols/MRA/TODO.txt
@@ -0,0 +1,28 @@
+!!!
+
+ feature request:
+, , . , , =)
+ , , .
+ From -.
+
+
+
+MRA_PDA_INBOX_URL
+
+
+
+
+
+ / ( )
+
+
+
+ 10 PROTOTYPE_SELFTYPING_OFF
+
+
+
+
+
+? OWNER,
+
+? , \ No newline at end of file
diff --git a/protocols/MRA/langpack_MRA_russian.txt b/protocols/MRA/langpack_MRA_russian.txt
new file mode 100644
index 0000000000..52d6fb9211
--- /dev/null
+++ b/protocols/MRA/langpack_MRA_russian.txt
@@ -0,0 +1,663 @@
+Miranda Language Pack Version 1
+Language: Russian (RU)
+Locale: 0419
+Last-Modified-Using: Miranda IM 0.8 Unicode
+Authors: Rozhuk Ivan
+Author-email: Rozhuk_I@mail.ru
+Plugins-included: mail.ru Agent
+X-Version: 1.17.0.0
+
+
+
+;
+
+[Display &Inbox]
+
+
+[Display &Inbox status]
+
+
+[Send SMS]
+ SMS
+
+[Edit &Profile]
+
+
+[My Album]
+
+
+[My Blog]
+
+
+[My Blog Status]
+
+
+[My Video]
+
+
+[My Answers]
+
+
+[My World]
+
+
+[Zhuki]
+
+
+[Chat]
+
+
+[Web search]
+
+
+[Update all users info]
+
+
+[Check updates users avatars]
+
+
+[Request authorization for all]
+
+
+
+
+;
+
+[Request authorization]
+
+
+[Grant authorization]
+
+
+[&Send postcard]
+
+
+[&View Album]
+
+
+[&Read Blog]
+
+
+[View Video]
+
+
+[Answers]
+
+
+[World]
+
+
+
+;
+
+[Mail box deleted]
+
+
+[Contact not on server]
+
+
+[Not authorized]
+
+
+[Phone/SMS only contact]
+/SMS
+
+
+
+;
+[plugin connections]
+
+
+[Avatars]
+
+
+[From: %s\r\nSubject: %s\r\n%s]
+: %s\r\n: %s\r\n%s
+
+[Unread mail is available: %lu/%lu messages]
+ : %lu/%lu
+
+[No unread mail is available\r\nTotal messages: %lu]
+ \r\n : %lu
+
+[Server error: cant get MPOP key for web authorize]
+ : MPOP
+
+[Offline message processing error, message will not deleted from server]
+ ,
+
+[Undefined message deliver error, time out]
+ ,
+
+[Please, setup e-mail in options]
+, e-mail
+
+[Please, setup password in options]
+,
+
+[Can't connect to MRIM server, error]
+ ,
+
+[NLB data corrupted]
+
+
+[Can't get data for NLB, error]
+ ,
+
+[Can't connect to NLB server, error]
+ ,
+
+[Disconnected, socket error]
+,
+
+[Disconnected, socket read error]
+,
+
+[Logon error: invalid login/password]
+ /
+
+[Another user connected with your login]
+ -
+
+[Message rejected - no such user]
+ -
+
+[Internal server error]
+
+
+[Offline messages limit exceeded]
+
+
+[Message is too large]
+
+
+[User does not accept offline messages]
+
+
+[User does not accept offline flash animation]
+
+
+[Undefined message deliver error, code: %lu]
+ , , : %lu
+
+[MRIM_CS_MESSAGE_STATUS: not found in queue]
+MRIM_CS_MESSAGE_STATUS:
+
+[Sended data is invalid]
+
+
+[User does not registred]
+
+
+[Invalid user name]
+
+
+[User allready added]
+ -
+
+[Group limit is 20]
+ (20)
+
+[MRIM_CS_*_CONTACT_ACK: not found in queue]
+MRIM_CS_*_CONTACT_ACK:
+
+[MRIM_ANKETA_INFO: not found in queue]
+MRIM_ANKETA_INFO:
+
+[MRIM_CS_SMS_ACK: not found in queue]
+MRIM_CS_SMS_ACK:
+
+[Proxy File transfer: error]
+ :
+
+[Proxy File transfer: incompatible versions]
+ :
+
+[MRIM_CS_FILE_TRANSFER_ACK: unknown error, code: %lu]
+MRIM_CS_FILE_TRANSFER_ACK: , : %lu
+
+[MRIM_CS_*_CONTACT_ACK: unknown server error, code: %lu]
+MRIM_CS_*_CONTACT_ACK: , : %lu
+
+[MRIM_CS_GAME: unknown internal game message code: %lu]
+MRIM_CS_GAME: : %lu
+
+[MRIM_CS_CONTACT_LIST2: unknown server error, code: %lu]
+MRIM_CS_CONTACT_LIST2: , : %lu
+
+[MRIM_CS_CONTACT_LIST2: bad contact list]
+MRIM_CS_CONTACT_LIST2: -
+
+[MRIM_CS_CONTACT_LIST2: internal server error]
+MRIM_CS_CONTACT_LIST2:
+
+[Mail.ru System notify]
+ Mail.ru
+
+[Avatars: can't add request to queue, error]
+: ,
+
+[Avatars: can't connect to server, error]
+: ,
+
+[Avatars: error on send HTTP request]
+: HTTP
+
+[Avatars: error on receive HTTP answer]
+: HTTP
+
+[Avatars: cant open file %S, error %lu: %s]
+: %S, %lu: %s
+
+[Avatars: error on receive file data]
+:
+
+[Avatars: cant write file data, error]
+: ,
+
+[Avatars: server return HTTP code: %lu]
+: HTTP : %lu
+
+
+[Are you sure?]
+ ?
+
+[E-mail address]
+E-mail
+
+[You cannot send when you are offline.]
+ .
+
+[Cant allocate buffer for convert to unicode.]
+
+
+[Select e-mail]
+
+
+[Your contact wakes you]
+
+
+[invisible status changed]
+
+
+[Files exchange: cant create listen soscket, will try connect to remonte host. Error]
+ : , .
+
+[MraFilesQueueConnectionReceived: connection accepted, but pExtra=NULL, this is miranda bug.]
+MraFilesQueueConnectionReceived: , pExtra=NULL, .
+
+[Receive files: error]
+ :
+
+[Receive files: error on receive file data]
+ :
+
+[Receive files: cant write file data, error]
+ : ,
+
+[Receive files: cant allocate disk space for file, size %lu bytes, error %lu: %s]
+ : , %lu , %lu: %s
+
+[Receive files: cant open file %S, error %lu: %s]
+ : %S, %lu: %s
+
+[Receive files: request for file %S not sended, error %lu: %s]
+ : %S , %lu: %s
+
+[Send files: file send request not received, error]
+ : ,
+
+[Send files: error on send file data]
+ :
+
+[Send files: cant read file data, error]
+ : ,
+
+[Send files: cant open file %S, error %lu: %s]
+ : %S, %lu: %s
+
+[Send files: requested file: %S - not found in send files list.]
+ : : %S -
+
+[Send files: bad file send request - invalid header]
+ : -
+
+[Send files: bad file send request - to small packet]
+ : -
+
+
+
+;
+
+[Leave empty if you dont want change password]
+
+
+[Create a new Mail.ru account using the Mail.ru website]
+ Mail.ru
+
+[Retrieve a lost password]
+ ?
+
+[Example: Petrov_Ivan@mail.ru]
+: Petrov_Ivan@mail.ru
+
+[Full e-mail:]
+ e-mail:
+
+
+
+;
+
+[Enable avatars support (loading)]
+ ()
+
+[Use keep-alive connections]
+ (keep-alive)
+
+[Updates check interval, min]
+ ,
+
+[Return absolute path]
+
+
+[Delete avatar file with contact]
+
+
+
+
+;
+
+[Automatic request authorization on logon]
+
+
+[Automatic add contacts to server list on logon]
+
+
+[Automatic grand authorization to users in contact list]
+
+
+[Automatic grand authorization to new users]
+
+
+[Disable spam check]
+
+
+[Hide menu items for non MRA contacts]
+ MRA
+
+[Notify about new mail if increment]
+
+
+[Notify about new mail tray icon]
+
+
+[Click to Inbox]
+
+
+[Show received Formated text (RTF receive)]
+
+
+[Send Formated text (send RTF)]
+
+
+
+;
+
+[Anti spam]
+
+
+[Enable Anti Spam]
+
+
+[Check temp contacts]
+
+
+[Delete spam bot contacts]
+
+
+[Ignory non AlphaNumeric characters]
+ /
+
+[Max. language changes in message (0 - disabled)]
+. (0 - )
+
+[Show pop up]
+
+
+[Write to system history]
+
+
+[Send spam report to server]
+
+
+[Bad words list]
+
+
+[Spam bot blocked]
+
+
+[Spam bot contact deleted]
+
+
+
+
+;
+
+[Files exchange]
+
+
+[Enable direct connections]
+
+
+[No out connection on send]
+
+
+[No out connection on receive]
+
+
+[Out connections: ignory additional ports (443, 2041)]
+ : . (443, 2041)
+
+[Hide my IP addresses]
+ IP
+
+[Add extra address]
+
+
+[Enable MRIM proxy connections]
+ MRIM
+
+[File send block size:]
+ :
+
+[512 - 65536 bytes]
+512 - 65536
+
+
+;
+
+[PopUp type]
+
+
+[Popup settings]
+
+
+[None]
+
+
+[Debug]
+
+
+[Information]
+
+
+[Question]
+
+
+[Warning]
+
+
+[Error]
+
+
+[NewMail]
+
+
+
+; X Statuses
+[Closing in]
+
+
+[Sick]
+
+
+[Home]
+
+
+[Eating]
+
+
+[Compass]
+
+
+[On WC]
+
+
+[Cooking]
+
+
+[Walking]
+
+
+[Alien]
+
+
+[Shrimp]
+
+
+[Got lost]
+
+
+[Crazy]
+
+
+[Duck]
+
+
+[Playing]
+
+
+[Smoking]
+
+
+[Office]
+
+
+[Meeting]
+
+
+[Beer]
+
+
+[Coffee]
+
+
+[Working]
+
+
+[Relaxing]
+
+
+[On the phone]
+
+
+[In institute]
+
+
+[At school]
+
+
+[Wrong number]
+
+
+[Laughing]
+
+
+[Malicious]
+
+
+[Imp]
+
+
+[Blind]
+
+
+[Disappointed]
+
+
+[Almost crying]
+
+
+[Fearful]
+
+
+[Angry]
+
+
+[Vampire]
+
+
+[Ass]
+
+
+[Love]
+
+
+[Sleeping]
+
+
+[Cool!]
+!
+
+[Peace!]
+-!
+
+[Cock a snook]
+
+
+[Get out]
+
+
+[Death]
+
+
+[Rocket]
+
+
+[Devil-fish]
+
+
+[Heavy metal]
+
+
+[Things look bad]
+
+
+[Squirrel]
+
+
+[Star]
+
+
+[Music]
+
+
+[Dating]
+
+
+
+
+
+
+
+
diff --git a/protocols/MRA/proto.h b/protocols/MRA/proto.h
new file mode 100644
index 0000000000..bd1664c4ca
--- /dev/null
+++ b/protocols/MRA/proto.h
@@ -0,0 +1,618 @@
+//***************************************************************************
+// $Id: proto.h,v 1.141 2005/10/24 15:32:33 shingrus Exp $
+//***************************************************************************
+
+#ifndef MRIM_PROTO_H
+#define MRIM_PROTO_H
+
+#include <sys/types.h>
+
+#define PROTO_VERSION_MAJOR 1
+#define PROTO_VERSION_MINOR 21
+#define PROTO_VERSION ((((u_long)(PROTO_VERSION_MAJOR))<<16)|(u_long)(PROTO_VERSION_MINOR))
+
+
+#define PROTO_MAJOR(p) (((p)&0xFFFF0000)>>16)
+#define PROTO_MINOR(p) ((p)&0x0000FFFF)
+
+
+typedef struct mrim_packet_header_t
+{
+ u_long magic; // Magic
+ u_long proto; //
+ u_long seq; // Sequence
+ u_long msg; //
+ u_long dlen; //
+ u_char reserved[24]; //
+}
+mrim_packet_header_t;
+
+#define CS_MAGIC 0xDEADBEEF // Magic ( C <-> S )
+
+
+// UNICODE = (UTF-16LE) (>=1.17)
+
+/***************************************************************************
+
+ -
+
+ ***************************************************************************/
+
+#define MRIM_CS_HELLO 0x1001 // C -> S
+// empty
+
+#define MRIM_CS_HELLO_ACK 0x1002 // S -> C
+// mrim_connection_params_t
+
+
+#define MRIM_CS_LOGIN_ACK 0x1004 // S -> C
+// empty
+
+#define MRIM_CS_LOGIN_REJ 0x1005 // S -> C
+// LPS reason ???
+
+#define MRIM_CS_PING 0x1006 // C -> S
+// empty
+
+#define MRIM_CS_MESSAGE 0x1008 // C -> S
+// UL flags
+ #define MESSAGE_FLAG_OFFLINE 0x00000001
+ #define MESSAGE_FLAG_NORECV 0x00000004
+ #define MESSAGE_FLAG_AUTHORIZE 0x00000008 // X-MRIM-Flags: 00000008
+ #define MESSAGE_FLAG_SYSTEM 0x00000040
+ #define MESSAGE_FLAG_RTF 0x00000080
+ #define MESSAGE_FLAG_CONTACT 0x00000200
+ #define MESSAGE_FLAG_NOTIFY 0x00000400
+ #define MESSAGE_FLAG_SMS 0x00000800
+ #define MESSAGE_FLAG_MULTICAST 0x00001000
+ #define MESSAGE_SMS_DELIVERY_REPORT 0x00002000
+ #define MESSAGE_FLAG_ALARM 0x00004000
+ #define MESSAGE_FLAG_FLASH 0x00008000
+ #define MESSAGE_FLAG_SPAMF_SPAM 0x00020000 // - ; ,
+ #define MESSAGE_FLAG_MULTICHAT 0x00400000 //
+ #define MULTICHAT_MESSAGE 0 // received message (s->c)
+ #define MULTICHAT_GET_MEMBERS 1 // request members list from server (c->s)
+ #define MULTICHAT_MEMBERS 2 // members list from server (s->c)
+ #define MULTICHAT_ADD_MEMBERS 3 //
+ #define MULTICHAT_ATTACHED 4 // user joined to chat (s->c)
+ #define MULTICHAT_DETACHED 5 // user leave chat (s->c)
+ #define MULTICHAT_DESTROYED 6 //
+ #define MULTICHAT_INVITE 7 //
+ #define MESSAGE_FLAG_v1p16 0x00100000 //
+ #define MESSAGE_FLAG_CP1251 0x00200000
+// LPS to e-mail ANSI
+// LPS message ANSI/UNICODE (see flags)
+// LPS rtf-formatted message (>=1.1) ???
+// LPS multichat_data (>=1.20) ???
+
+#define MAX_MULTICAST_RECIPIENTS 50
+ #define MESSAGE_USERFLAGS_MASK 0x000036A8 // Flags that user is allowed to set himself
+
+
+#define MRIM_CS_MESSAGE_ACK 0x1009 // S -> C
+// UL msg_id
+// UL flags
+// LPS from e-mail ANSI
+// LPS message UNICODE
+// LPS rtf-formatted message (>=1.1) - MESSAGE_FLAG_RTF
+// //BASE64( - MESSAGE_FLAG_AUTHORIZE
+// UL parts count = 2
+// LPS auth_sender_nick UNICODE
+// LPS auth_request_text UNICODE
+//[ LPS multichat_data ] (>= 1.20) - MESSAGE_FLAG_MULTICHAT
+// UL type
+// LPS multichat_name
+// switch(type) {
+// MULTICHAT_MESSAGE {
+// LPS sender ANSI
+// }
+// MULTICHAT_MEMBERS {
+// CLPS members
+// [ LPS owner ]
+// }
+// MULTICHAT_ADD_MEMBERS {
+// LPS sender ANSI
+// CLPS members
+// }
+// MULTICHAT_ATTACHED {
+// LPS member ANSI
+// }
+// MULTICHAT_DETACHED {
+// LPS member ANSI
+// }
+// MULTICHAT_INVITE {
+// LPS sender ANSI
+// }
+// }
+// )
+
+
+
+
+
+#define MRIM_CS_MESSAGE_RECV 0x1011 // C -> S
+// LPS from e-mail ANSI
+// UL msg_id
+
+#define MRIM_CS_MESSAGE_STATUS 0x1012 // S -> C
+// UL status
+ #define MESSAGE_DELIVERED 0x0000 // Message delivered directly to user
+ #define MESSAGE_REJECTED_NOUSER 0x8001 // Message rejected - no such user
+ #define MESSAGE_REJECTED_INTERR 0x8003 // Internal server error
+ #define MESSAGE_REJECTED_LIMIT_EXCEEDED 0x8004 // Offline messages limit exceeded
+ #define MESSAGE_REJECTED_TOO_LARGE 0x8005 // Message is too large
+ #define MESSAGE_REJECTED_DENY_OFFMSG 0x8006 // User does not accept offline messages
+ #define MESSAGE_REJECTED_DENY_OFFFLSH 0x8007 // User does not accept offline flash animation
+ //#define MESSAGE_REJECTED_DENY_OFFFLSH 0x8008 // User does not accept offline flash animation
+ //#define MESSAGE_REJECTED_DENY_OFFFLSH 0x8009 // User does not accept offline flash animation
+
+#define MRIM_CS_USER_STATUS 0x100F // S -> C
+// UL status
+ #define STATUS_OFFLINE 0x00000000
+ #define STATUS_ONLINE 0x00000001
+ #define STATUS_AWAY 0x00000002
+ #define STATUS_UNDETERMINATED 0x00000003
+ #define STATUS_USER_DEFINED 0x00000004
+ #define STATUS_FLAG_INVISIBLE 0x80000000
+// LPS spec_status_uri ANSI (>=1.14)
+ #define SPEC_STATUS_URI_MAX 256
+// LPS status_title UNICODE (>=1.14)
+ #define STATUS_TITLE_MAX 16
+// LPS status_desc UNICODE (>=1.14)
+ #define STATUS_DESC_MAX 64
+// LPS user e-mail ANSI
+// UL com_support (>=1.14)
+ #define FEATURE_FLAG_RTF_MESSAGE 0x00000001
+ #define FEATURE_FLAG_BASE_SMILES 0x00000002
+ #define FEATURE_FLAG_ADVANCED_SMILES 0x00000004
+ #define FEATURE_FLAG_CONTACTS_EXCH 0x00000008
+ #define FEATURE_FLAG_WAKEUP 0x00000010
+ #define FEATURE_FLAG_MULTS 0x00000020
+ #define FEATURE_FLAG_FILE_TRANSFER 0x00000040
+ #define FEATURE_FLAG_VOICE 0x00000080
+ #define FEATURE_FLAG_VIDEO 0x00000100
+ #define FEATURE_FLAG_GAMES 0x00000200
+ #define FEATURE_FLAG_LAST 0x00000200
+ #define FEATURE_UA_FLAG_MASK ((FEATURE_FLAG_LAST << 1) - 1)
+// LPS user_agent (>=1.14) ANSI
+ #define USER_AGENT_MAX 255
+ // Format:
+ // user_agent = param *(param )
+ // param = pname "=" pvalue
+ // pname = token
+ // pvalue = token / quoted-string
+ //
+ // Params:
+ // "client" - magent/jagent/???
+ // "name" - sys-name.
+ // "title" - display-name.
+ // "version" - product internal numeration. Examples: "1.2", "1.3 pre".
+ // "build" - product internal numeration (may be positive number or time).
+ // "protocol" - MMP protocol number by format "<major>.<minor>".
+
+
+#define MRIM_CS_LOGOUT 0x1013 // S -> C
+// UL reason
+ #define LOGOUT_NO_RELOGIN_FLAG 0x0010 // Logout due to double login
+
+#define MRIM_CS_CONNECTION_PARAMS 0x1014 // S -> C (>1.16 depricated ?)
+// mrim_connection_params_t
+
+#define MRIM_CS_USER_INFO 0x1015 // S -> C
+// (LPS key, LPS value)* X ???
+// MESSAGES.TOTAL - num UNICODE
+// MESSAGES.UNREAD - num UNICODE
+// MRIM.NICKNAME - nick UNICODE
+// client.endpoint - ip:port UNICODE
+
+
+#define MRIM_CS_ADD_CONTACT 0x1019 // C -> S
+// UL flags (group(2) or usual(0)
+ #define CONTACT_FLAG_REMOVED 0x00000001
+ #define CONTACT_FLAG_GROUP 0x00000002
+ #define CONTACT_FLAG_INVISIBLE 0x00000004
+ #define CONTACT_FLAG_VISIBLE 0x00000008
+ #define CONTACT_FLAG_IGNORE 0x00000010
+ #define CONTACT_FLAG_SHADOW 0x00000020
+ #define CONTACT_FLAG_AUTHORIZED 0x00000040 // ( >= 1.15)
+ #define CONTACT_FLAG_MULTICHAT 0x00000080 // ( >= 1.20) =128
+ #define CONTACT_FLAG_UNICODE_NAME 0x00000200 // =512
+ #define CONTACT_FLAG_PHONE 0x00100000
+
+// UL group id (unused if contact is group)
+// LPS contact e-mail ANSI
+// LPS name UNICODE
+// LPS custom phones ANSI
+// LPS BASE64(
+// UL parts count = 2
+// LPS auth_sender_nick ???
+// LPS auth_request_text ???
+// )
+// UL actions ( >= 1.15)
+// [LPS multichat_data]
+// CLPS members (>= 1.20)
+// [ LPS owner ]
+ #define ADD_CONTACT_FLAG_MYMAIL_INVITE 0x00000001
+ #define ADD_CONTACT_FLAG_MULTICHAT_ATTACHE 0x00000002
+ //used internal in win32 agent
+ #define CONTACT_AWAITING_AUTHORIZATION_USER 0x00000100
+ #define CONTACT_FLAG_TEMPORARY 0x00010000
+
+
+#define MRIM_CS_ADD_CONTACT_ACK 0x101A // S -> C
+// UL status
+ #define CONTACT_OPER_SUCCESS 0x0000
+ #define CONTACT_OPER_ERROR 0x0001
+ #define CONTACT_OPER_INTERR 0x0002
+ #define CONTACT_OPER_NO_SUCH_USER 0x0003
+ #define CONTACT_OPER_INVALID_INFO 0x0004
+ #define CONTACT_OPER_USER_EXISTS 0x0005
+ #define CONTACT_OPER_GROUP_LIMIT 0x6
+// UL contact_id or (u_long)-1 if status is not OK
+// [LPS multichat_contact (>= 1.20)]
+
+
+#define MRIM_CS_MODIFY_CONTACT 0x101B // C -> S
+// UL id
+// UL flags - same as for MRIM_CS_ADD_CONTACT
+// UL group id (unused if contact is group)
+// LPS contact e-mail ANSI
+// LPS name UNICODE
+// LPS custom phones ANSI
+
+#define MRIM_CS_MODIFY_CONTACT_ACK 0x101C // S -> C
+// UL status, same as for MRIM_CS_ADD_CONTACT_ACK
+
+#define MRIM_CS_OFFLINE_MESSAGE_ACK 0x101D // S -> C
+// UIDL
+// LPS offline message ???
+
+#define MRIM_CS_DELETE_OFFLINE_MESSAGE 0x101E // C -> S
+// UIDL
+
+
+#define MRIM_CS_AUTHORIZE 0x1020 // C -> S
+// LPS user e-mail ANSI
+
+#define MRIM_CS_AUTHORIZE_ACK 0x1021 // S -> C
+// LPS user e-mail ANSI
+
+#define MRIM_CS_CHANGE_STATUS 0x1022 // C -> S
+// UL new status
+// LPS spec_status_uri ANSI (>=1.14)
+// LPS status_title UNICODE (>=1.14)
+// LPS status_desc UNICODE (>=1.14)
+// UL com_support (>=1.14) (see MRIM_CS_USER_STATUS)
+
+
+#define MRIM_CS_GET_MPOP_SESSION 0x1024 // C -> S
+
+
+#define MRIM_CS_MPOP_SESSION 0x1025 // S -> C
+// UL status
+ #define MRIM_GET_SESSION_FAIL 0
+ #define MRIM_GET_SESSION_SUCCESS 1
+// LPS mpop session ???
+
+
+#define MRIM_CS_FILE_TRANSFER 0x1026 // C->S
+// LPS TO/FROM e-mail ANSI
+// DWORD id_request - uniq per connect
+// DWORD FILESIZE
+// LPS: // LPS Files (FileName;FileSize;FileName;FileSize;) ANSI
+ // LPS DESCRIPTION:
+ // UL ?
+ // Files (FileName;FileSize;FileName;FileSize;) UNICODE
+ // LPS Conn (IP:Port;IP:Port;) ANSI
+
+#define MRIM_CS_FILE_TRANSFER_ACK 0x1027 // S->C
+// DWORD status
+ #define FILE_TRANSFER_STATUS_OK 1
+ #define FILE_TRANSFER_STATUS_DECLINE 0
+ #define FILE_TRANSFER_STATUS_ERROR 2
+ #define FILE_TRANSFER_STATUS_INCOMPATIBLE_VERS 3
+ #define FILE_TRANSFER_MIRROR 4
+// LPS TO/FROM e-mail ANSI
+// DWORD id_request
+// LPS DESCRIPTION [Conn (IP:Port;IP:Port;) ANSI]
+
+
+
+//white pages!
+#define MRIM_CS_WP_REQUEST 0x1029 //C->S
+// DWORD field
+// LPS value ???
+#define PARAMS_NUMBER_LIMIT 50
+#define PARAM_VALUE_LENGTH_LIMIT 64
+
+//if last symbol in value eq '*' it will be replaced by LIKE '%'
+// params define
+// must be in consecutive order (0..N) to quick check in check_anketa_info_request
+ enum {
+ MRIM_CS_WP_REQUEST_PARAM_USER = 0,// ANSI
+ MRIM_CS_WP_REQUEST_PARAM_DOMAIN, // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_NICKNAME, // UNICODE
+ MRIM_CS_WP_REQUEST_PARAM_FIRSTNAME, // UNICODE
+ MRIM_CS_WP_REQUEST_PARAM_LASTNAME, // UNICODE
+ MRIM_CS_WP_REQUEST_PARAM_SEX , // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY, // not used for search
+ MRIM_CS_WP_REQUEST_PARAM_DATE1 , // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_DATE2 , // ANSI
+ //!!!!!!!!!!!!!!!!!!!online request param must be at end of request!!!!!!!!!!!!!!!
+ MRIM_CS_WP_REQUEST_PARAM_ONLINE , // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_STATUS , // we do not used it, yet
+ MRIM_CS_WP_REQUEST_PARAM_CITY_ID, // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_ZODIAC, // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_MONTH,// ANSI
+ MRIM_CS_WP_REQUEST_PARAM_BIRTHDAY_DAY, // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_COUNTRY_ID, // ANSI
+ MRIM_CS_WP_REQUEST_PARAM_MAX
+ };
+
+#define MRIM_CS_ANKETA_INFO 0x1028 //S->C
+// DWORD status
+ #define MRIM_ANKETA_INFO_STATUS_OK 1
+ #define MRIM_ANKETA_INFO_STATUS_NOUSER 0
+ #define MRIM_ANKETA_INFO_STATUS_DBERR 2
+ #define MRIM_ANKETA_INFO_STATUS_RATELIMERR 3
+// DWORD fields_num
+// DWORD max_rows
+// DWORD server_time sec since 1970 (unixtime)
+ // fields set //%fields_num == 0
+ // values set //%fields_num == 0
+// LPS value (numbers too) ???
+
+
+#define MRIM_CS_MAILBOX_STATUS 0x1033
+// DWORD new messages in mailbox
+
+
+#define MRIM_CS_GAME 0x1035
+// LPS to/from e-mail ANSI
+// DWORD session unique per game
+// DWORD msg internal game message
+ enum {
+ GAME_BASE,
+ GAME_CONNECTION_INVITE,
+ GAME_CONNECTION_ACCEPT,
+ GAME_DECLINE,
+ GAME_INC_VERSION,
+ GAME_NO_SUCH_GAME,
+ GAME_JOIN,
+ GAME_CLOSE,
+ GAME_SPEED,
+ GAME_SYNCHRONIZATION,
+ GAME_USER_NOT_FOUND,
+ GAME_ACCEPT_ACK,
+ GAME_PING,
+ GAME_RESULT,
+ GAME_MESSAGES_NUMBER
+ };
+// DWORD msg_id id for ack
+// DWORD time_send time of client
+// LPS data ???
+
+
+
+#define MRIM_CS_CONTACT_LIST2 0x1037 //S->C
+// UL status
+ #define GET_CONTACTS_OK 0x0000
+ #define GET_CONTACTS_ERROR 0x0001
+ #define GET_CONTACTS_INTERR 0x0002
+// DWORD status - if ...OK than this staff:
+// DWORD groups number
+ // mask symbols table:
+ // 's' - lps
+ // 'u' - unsigned long
+ // 'z' - zero terminated string
+ // LPS groups fields mask ANSI
+ // LPS contacts fields mask ANSI
+ // group fields
+ // contacts fields
+ // groups mask 'us' == flags, name UNICODE
+ // contact mask 'uussuussssus' flags, group id, e-mail ANSI, nick UNICODE, server flags, status, custom phone numbers ANSI, spec_status_uri ANSI, status_title UNICODE, status_desc UNICODE, com_support (future flags), user_agent (formated string) ANSI, ul blog status id, ul blog status id, ul BlogStatusTime, blog status UNICODE, blog status music UNICODE, blog status sender, ?????
+ // uussuussssusuuusssss
+ #define CONTACT_INTFLAG_NOT_AUTHORIZED 0x0001
+
+
+//old packet cs_login with cs_statistic
+#define MRIM_CS_LOGIN2 0x1038 // C -> S
+// LPS login e-mail ANSI
+// LPS password ANSI
+// DWORD status
+// LPS spec_status_uri ANSI (>=1.14)
+// LPS status_title UNICODE (>=1.14)
+// LPS status_desc UNICODE (>=1.14)
+// UL com_support (>=1.14) (see MRIM_CS_USER_STATUS)
+// LPS user_agent ANSI (>=1.14) (see MRIM_CS_USER_STATUS)
+ // + statistic packet data:
+// LPS lang (>=1.16)
+// LPS ua session (>=1.20) -
+// LPS replaced ua session (>=1.20) -
+// LPS client description ANSI
+ #define MAX_CLIENT_DESCRIPTION 256
+// unknown data
+// LPS unknown id (len=32)
+/* SetUL(&lpbDataCurrent,0);//00 00 00 00
+ SetUL(&lpbDataCurrent,0);//02 BA 0A 00
+ SetUL(&lpbDataCurrent,0);//00 00 00 03
+ SetUL(&lpbDataCurrent,0);//00 00 00 02
+
+ SetUL(&lpbDataCurrent,0);//E2 FD 1E 22
+ SetUL(&lpbDataCurrent,0);//04 00 00 00
+ SetUL(&lpbDataCurrent,0);//02 FF FF FF
+ SetUL(&lpbDataCurrent,0);//FF 05 00 00
+
+ SetUL(&lpbDataCurrent,0);//00 02 FF FF
+ SetUL(&lpbDataCurrent,0);//FF FF 06 00
+ SetUL(&lpbDataCurrent,0);//00 00 02 FF
+ SetUL(&lpbDataCurrent,0);//FF FF FF 07
+
+ SetUL(&lpbDataCurrent,0);//00 00 00 02
+ SetUL(&lpbDataCurrent,0);//FF FF FF FF
+ SetUL(&lpbDataCurrent,0);//14 00 00 00
+ SetUL(&lpbDataCurrent,0);//02 00 00 00
+
+ SetUL(&lpbDataCurrent,0);//00 16 00 00
+ SetUL(&lpbDataCurrent,0);//00 02 00 00
+ SetUL(&lpbDataCurrent,0);//00 00 17 00
+ SetUL(&lpbDataCurrent,0);//00 00 02 00
+
+ SetUL(&lpbDataCurrent,0);//00 00 00 18
+ SetUL(&lpbDataCurrent,0);//00 00 00 02
+ SetUL(&lpbDataCurrent,0);//00 00 00 00
+ SetUL(&lpbDataCurrent,0);//19 00 00 00
+
+ SetUL(&lpbDataCurrent,0);//02 00 00 00
+ SetUL(&lpbDataCurrent,0);//00 1A 00 00
+ SetUL(&lpbDataCurrent,0);//00 02 00 00
+ SetUL(&lpbDataCurrent,0);//00 00 1C 00
+
+ SetUL(&lpbDataCurrent,0);//00 00 02 00
+ SetUL(&lpbDataCurrent,0);//00 00 00 1D
+ SetUL(&lpbDataCurrent,0);//00 00 00 02
+ SetUL(&lpbDataCurrent,0);//00 00 00 00
+
+ SetUL(&lpbDataCurrent,0);//23 00 00 00
+ SetUL(&lpbDataCurrent,0);//02 01 00 00
+ SetUL(&lpbDataCurrent,0);//00 24 00 00
+ SetUL(&lpbDataCurrent,0);//00 02 01 00
+
+ SetUL(&lpbDataCurrent,0);//00 00 25 00
+ SetUL(&lpbDataCurrent,0);//00 00 02 01
+ SetUL(&lpbDataCurrent,0);//00 00 00 26
+ SetUL(&lpbDataCurrent,0);//00 00 00 02
+
+ SetUL(&lpbDataCurrent,0);//00 00 00 00
+ SetUL(&lpbDataCurrent,0);//27 00 00 00
+ SetUL(&lpbDataCurrent,0);//02 00 00 00
+ SetUL(&lpbDataCurrent,0);//00 28 00 00
+
+ SetUL(&lpbDataCurrent,0);//00 02 00 00
+ SetUL(&lpbDataCurrent,0);//00 00 29 00
+ SetUL(&lpbDataCurrent,0);//00 00 02 01
+ SetUL(&lpbDataCurrent,0);//00 00 00 2A
+
+ SetUL(&lpbDataCurrent,0);//00 00 00 02
+ SetUL(&lpbDataCurrent,0);//00 00 00 00
+ SetUL(&lpbDataCurrent,0);//2B 00 00 00
+ SetUL(&lpbDataCurrent,0);//02 00 00 00
+
+ SetUL(&lpbDataCurrent,0);//00 2C 00 00
+ SetUL(&lpbDataCurrent,0);//00 01
+
+ SetLPS(&lpbDataCurrent,"d3a4a3d0c95e5ba24f160a499ec8b4ea",32);
+*/
+
+
+#define MRIM_CS_SMS 0x1039 // C -> S
+// UL flags
+// LPS to Phone ???
+// LPS message ???
+
+#define MRIM_CS_SMS_ACK 0x1040 // S->C
+// UL status
+
+
+
+#define MRIM_CS_PROXY 0x1044
+// LPS to e-mail ANSI
+// DWORD id_request
+// DWORD data_type
+ #define MRIM_PROXY_TYPE_VOICE 1
+ #define MRIM_PROXY_TYPE_FILES 2
+ #define MRIM_PROXY_TYPE_CALLOUT 3
+// LPS user_data ???
+// LPS lps_ip_port ???
+// DWORD session_id[4]
+
+#define MRIM_CS_PROXY_ACK 0x1045
+//DWORD status
+ #define PROXY_STATUS_OK 1
+ #define PROXY_STATUS_DECLINE 0
+ #define PROXY_STATUS_ERROR 2
+ #define PROXY_STATUS_INCOMPATIBLE_VERS 3
+ #define PROXY_STATUS_NOHARDWARE 4
+ #define PROXY_STATUS_MIRROR 5
+ #define PROXY_STATUS_CLOSED 6
+// LPS to e-mail ANSI
+// DWORD id_request
+// DWORD data_type
+// LPS user_data ???
+// LPS: lps_ip_port ???
+// DWORD[4] Session_id
+
+#define MRIM_CS_PROXY_HELLO 0x1046
+// DWORD[4] Session_id
+
+#define MRIM_CS_PROXY_HELLO_ACK 0x1047
+
+
+
+#define MRIM_CS_NEW_MAIL 0x1048 // S->C
+// UL unread count
+// LPS from e-mail ANSI
+// LPS subject ???
+// UL date
+// UL uidl
+
+
+
+
+#define MRIM_CS_USER_BLOG_STATUS 0x1063
+// DWORD flags
+ #define MRIM_BLOG_STATUS_UPDATE 0x00000001
+ #define MRIM_BLOG_STATUS_MUSIC 0x00000002 // add music to status
+ #define MRIM_BLOG_STATUS_REPLY 0x00000004
+ #define MRIM_BLOG_STATUS_NOTIFY 0x00000010 // not set self status, alert only
+// LPS user
+// UINT64 id
+// DWORD time
+// LPS text (MRIM_BLOG_STATUS_MUSIC: track)
+// LPS reply_user_nick
+
+#define MRIM_CS_CHANGE_USER_BLOG_STATUS 0x1064
+// DWORD flags
+// LPS text (MRIM_BLOG_STATUS_MUSIC: track)
+ #define MICBLOG_STATUS_MAX 500
+// switch(flags) {
+// MRIM_BLOG_STATUS_REPLY:
+// UINT64 orig_id
+// }
+
+
+#define MRIM_CS_UNKNOWN 0x1073
+// DWORD ???
+// DWORD ???
+
+
+#define MRIM_CS_USER_GEO 0x1077
+// LPS user
+// LPS: // DWORD flags?
+ // LPS: "geo-point":
+ // LPS dolgota
+ // LPS shirota
+ // LPS "MAPOBJECT"
+ // LPS some data?
+ // LPS/DWORD
+ // LPS/DWORD
+ // LPS some data?
+ // LPS some data?
+
+
+#define MRIM_CS_SERVER_SETTINGS 0x1079
+
+
+
+
+
+typedef struct mrim_connection_params_t
+{
+ unsigned long ping_period;
+}
+mrim_connection_params_t;
+
+
+
+#endif // MRIM_PROTO_H
+
diff --git a/protocols/MRA/resource.h b/protocols/MRA/resource.h
new file mode 100644
index 0000000000..aa5469d599
--- /dev/null
+++ b/protocols/MRA/resource.h
@@ -0,0 +1,142 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by resource.rc
+//
+#define IDI_MRA 101
+#define IDD_OPT 102
+#define IDD_OPT_CONNECTIONS 102
+#define IDI_INBOX 103
+#define IDD_DIALOG_SELECT_EMAIL 103
+#define IDI_PROFILE 104
+#define IDI_AUTHRUGUEST 106
+#define IDI_AUTHGRANT 107
+#define IDD_MRAADVANCEDSEARCH 108
+#define IDD_OPTAVATRS 109
+#define IDD_OPT_AVATRS 109
+#define IDI_MAIL_NOTIFY 111
+#define IDI_MRA_WEB_SEARCH 112
+#define IDI_MRA_BLOGS 113
+#define IDI_MRA_POSTCARD 114
+#define IDI_MRA_ZHUKI 115
+#define IDI_MRA_PHOTO 117
+#define IDI_MRA_CHAT 120
+#define IDI_MRA_PHONE 122
+#define IDD_OPT_FILES 126
+#define IDD_OPT_ACCOUNT 127
+#define IDD_OPT_POPUPS 128
+#define IDD_MRAACCOUNT 129
+#define IDI_ICON1 130
+#define IDI_MRA_ALARM 130
+#define IDD_OPT_ANTISPAM 131
+#define IDI_MRA_VIDEO 132
+#define IDI_MRA_ANSWERS 133
+#define IDI_MRA_WORLD 134
+#define IDD_MINIBLOG 135
+#define IDI_BLOGSTATUS 137
+#define IDD_SETXSTATUS 256
+#define IDC_GROUPCONFIG 1000
+#define IDC_GROUPCONFIG2 1001
+#define IDC_GROUPMAIN 1002
+#define IDC_REGISTER 1002
+#define IDC_SLOWSEND 1003
+#define IDC_RETURN_ABC_PATH 1004
+#define IDC_FILE_SEND_HIDE_MY_ADDRESSES 1004
+#define IDC_HIDE_MENU_ITEMS_FOR_NON_MRA 1004
+#define IDC_RTF_SEND_ENABLE 1005
+#define IDC_RTF_BGCOLOUR 1006
+#define IDC_CVT_SMILES_ON_SEND_TEXT 1007
+#define IDC_CVT_SMILES_TO_TAGS 1007
+#define IDC_DELETE_AVT_ON_CONTACT_DELETE 1008
+#define IDC_FILE_SEND_ADD_EXTRA_ADDRESS 1008
+#define IDC_INCREMENTAL_NEW_MAIL_NOTIFY 1008
+#define IDC_ENABLE 1009
+#define IDC_AUTO_ADD_CONTACTS_TO_SERVER 1009
+#define IDC_FILE_SEND_NOOUTCONNECTIONONSEND 1010
+#define IDC_AUTO_AUTH_REQ_ON_LOGON 1010
+#define IDC_SHOWPOPUP 1010
+#define IDC_KEEPALIVE 1011
+#define IDC_FILE_SEND_NOOUTCONNECTIONONRECEIVE 1011
+#define IDC_LIST_EMAILS 1011
+#define IDC_TRAYICON_NEW_MAIL_NOTIFY 1011
+#define IDC_WRITETOSYSTEMHISTORY 1011
+#define IDC_FILE_SEND_IGNORYADDITIONALPORTS 1012
+#define IDC_RTF_RECEIVE_ENABLE 1012
+#define IDC_CHK_TEMP_CONTACTS 1012
+#define IDC_DELETE_SPAMBOT_CONTACT 1013
+#define IDC_RTF_SEND_SMART 1013
+#define IDC_COMBO_PHONE 1014
+#define IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX 1014
+#define IDC_FILE_SEND_ENABLE_DIRECT_CONN 1014
+#define IDC_SEND_SPAM_REPORT_TO_SERVER 1014
+#define IDC_EDIT_TEXT 1015
+#define IDC_FILE_SEND_ENABLE_MRIMPROXY_CONS 1015
+#define IDC_AUTO_AUTH_GRAND_IN_CLIST 1015
+#define IDC_CLN_NON_ALPHNUM 1015
+#define IDC_AUTO_AUTH_GRAND_NEW_USERS 1016
+#define IDC_OPTIONSTAB 1017
+#define IDC_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK 1017
+#define IDC_NEW_ACCOUNT_LINK 1018
+#define IDC_LOOKUPLINK 1019
+#define IDC_PASSWORD 1020
+#define IDC_BUTTON_DEFAULT 1020
+#define IDC_LOGIN 1022
+#define IDC_FILE_SEND_BLOCK_SIZE 1022
+#define IDC_COMBO_POPUP_TYPE 1023
+#define IDC_CHK_ENABLE 1024
+#define IDC_CHK_USE_WIN_COLORS 1025
+#define IDC_POPUP_BACKCOLOR 1026
+#define IDC_POPUP_TEXTCOLOR 1027
+#define IDC_POPUP_TIMEOUT 1028
+#define IDC_PREVIEW 1029
+#define IDC_USE_KEEPALIVE_CONN 1030
+#define IDC_BUTTON_FONT 1031
+#define IDC_BAD_WORDS_LIST 1032
+#define IDC_EDIT_BAD_WORD 1033
+#define IDC_BUTTON_ADD 1034
+#define IDC_BUTTONREMOVE 1035
+#define IDC_EMAIL_USER 1048
+#define IDC_EMAIL_DOMAIN 1049
+#define IDC_NICK 1053
+#define IDC_GENDER 1060
+#define IDC_STATE 1061
+#define IDC_ZODIAK 1062
+#define IDC_COUNTRY 1063
+#define IDC_CITY2 1064
+#define IDC_CITY 1064
+#define IDC_XTITLE 1065
+#define IDC_XMSG 1066
+#define IDC_MAX_LANG_CHANGES 1071
+#define IDC_USER_BLOG_STATUS_MSG 1072
+#define IDC_MSG_TO_SEND 1073
+#define IDC_CHK_NOTIFY 1074
+#define IDC_STATIC_WRITED_TIME 1075
+#define IDC_STATIC_CHARS_COUNTER 1076
+#define IDC_CHECK1 1077
+#define IDC_CHK_REMEMBER 1077
+#define IDC_SERVER 1171
+#define IDC_SERVERPORT 1174
+#define IDC_UPD_CHECK_INTERVAL 1175
+#define IDC_FILE_SEND_EXTRA_ADDRESS 1175
+#define IDC_FIRSTNAME 1224
+#define IDC_LASTNAME 1225
+#define IDC_AGERANGE_FROM 1410
+#define IDC_AGERANGE_TO 1411
+#define IDC_BIRTHDAY_DAY 1412
+#define IDC_BIRTHDAY_MONTH 1413
+#define IDC_BIRTHDAY_YEAR 1414
+#define IDC_ONLINEONLY 1430
+#define IDC_SUMMARYGROUP 1434
+#define IDC_LOCATIONGROUP 1436
+#define IDC_STATIC -1
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NO_MFC 1
+#define _APS_NEXT_RESOURCE_VALUE 138
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1078
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/protocols/MRA/resource.rc b/protocols/MRA/resource.rc
new file mode 100644
index 0000000000..e00f5a1b26
--- /dev/null
+++ b/protocols/MRA/resource.rc
@@ -0,0 +1,485 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#define APSTUDIO_HIDDEN_SYMBOLS
+#include "windows.h"
+#undef APSTUDIO_HIDDEN_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Neutral resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
+#ifdef _WIN32
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+#pragma code_page(1251)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_MRA ICON "Icons\\Magent.ico"
+IDI_INBOX ICON "Icons\\Mail.ico"
+IDI_PROFILE ICON "Icons\\Info.ico"
+IDI_AUTHRUGUEST ICON "Icons\\AuthReguest.ico"
+IDI_AUTHGRANT ICON "Icons\\AuthGrant.ico"
+IDI_MAIL_NOTIFY ICON "Icons\\MailNotify.ico"
+IDI_MRA_WEB_SEARCH ICON "Icons\\WebSearch.ico"
+IDI_MRA_BLOGS ICON "Icons\\Blogs.ico"
+IDI_MRA_POSTCARD ICON "Icons\\PostCards.ico"
+IDI_MRA_ZHUKI ICON "Icons\\Bagz.ico"
+IDI_MRA_PHOTO ICON "Icons\\Photo.ico"
+IDI_MRA_CHAT ICON "Icons\\Chat.ico"
+IDI_MRA_PHONE ICON "Icons\\Phone.ico"
+IDI_MRA_ALARM ICON "Icons\\Alarm.ico"
+IDI_MRA_VIDEO ICON "Icons\\video.ico"
+IDI_MRA_ANSWERS ICON "Icons\\answers.ico"
+IDI_MRA_WORLD ICON "Icons\\my world.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_MRAACCOUNT DIALOGEX 0, 0, 200, 101
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Mail.ru Account Setup"
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ EDITTEXT IDC_LOGIN,91,34,102,13,ES_AUTOHSCROLL | NOT WS_BORDER,WS_EX_STATICEDGE
+ EDITTEXT IDC_PASSWORD,91,54,102,13,ES_PASSWORD | ES_AUTOHSCROLL | NOT WS_BORDER,WS_EX_STATICEDGE
+ DEFPUSHBUTTON "OK",IDOK,87,80,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,143,80,50,14
+ CONTROL "Create new account",IDC_REGISTER,"Hyperlink",WS_TABSTOP,7,82,74,10
+ LTEXT "Please enter your Mail.ru account details to continue:",IDC_STATIC,7,9,186,20
+ LTEXT "Mail.ru e-mail:",IDC_STATIC,9,37,77,8
+ LTEXT "Password:",IDC_STATIC,9,57,77,8
+END
+
+IDD_OPT_CONNECTIONS DIALOGEX 0, 0, 295, 230
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ GROUPBOX "Configuration",IDC_GROUPCONFIG,8,7,277,208
+ RTEXT "Login Server:",IDC_STATIC,14,19,52,8
+ EDITTEXT IDC_SERVER,72,17,140,12,ES_AUTOHSCROLL
+ RTEXT "Port:",IDC_STATIC,14,34,52,8
+ EDITTEXT IDC_SERVERPORT,72,33,33,12,ES_AUTOHSCROLL | ES_NUMBER
+ LTEXT "(2042, 443, 110, 25)",IDC_STATIC,110,35,167,10
+ PUSHBUTTON "Default",IDC_BUTTON_DEFAULT,217,17,60,13
+ CONTROL "Automatic request authorization on logon",IDC_AUTO_AUTH_REQ_ON_LOGON,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,50,263,8
+ CONTROL "Automatic add contacts to server list on logon",IDC_AUTO_ADD_CONTACTS_TO_SERVER,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,61,263,8
+ CONTROL "Notify me when a message delivery has failed",IDC_SLOWSEND,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,107,263,8
+ CONTROL "Notify about new mail if increment",IDC_INCREMENTAL_NEW_MAIL_NOTIFY,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,118,263,8
+ CONTROL "Notify about new mail tray icon",IDC_TRAYICON_NEW_MAIL_NOTIFY,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,129,263,8
+ CONTROL "Hide menu items for non MRA contacts",IDC_HIDE_MENU_ITEMS_FOR_NON_MRA,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,151,263,8
+ CONTROL "Show received Formated text (RTF receive)",IDC_RTF_RECEIVE_ENABLE,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,162,263,8
+ CONTROL "Send Formated text (send RTF)",IDC_RTF_SEND_ENABLE,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,173,263,8
+ PUSHBUTTON "Font",IDC_BUTTON_FONT,23,185,42,12
+ CONTROL "",IDC_RTF_BGCOLOUR,"ColourPicker",WS_TABSTOP,70,186,38,11
+ LTEXT "Background colour",IDC_STATIC,112,188,157,8
+ CONTROL "Click to Inbox",IDC_TRAYICON_NEW_MAIL_NOTIFY_CLICK_TO_INBOX,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,140,253,8
+ CONTROL "Automatic grand authorization to users in contact list",IDC_AUTO_AUTH_GRAND_IN_CLIST,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,72,263,8
+ CONTROL "Automatic grand authorization to new users",IDC_AUTO_AUTH_GRAND_NEW_USERS,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,83,263,8
+ CONTROL "Disable spam check",IDC_AUTO_AUTH_GRAND_NEW_USERS_DISABLE_SPAM_CHECK,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,94,253,8
+END
+
+IDD_MRAADVANCEDSEARCH DIALOGEX 0, 0, 220, 235
+STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_BORDER
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ GROUPBOX "Summary",IDC_SUMMARYGROUP,8,5,205,147
+ LTEXT "Nickname:",IDC_STATIC,15,20,50,8
+ EDITTEXT IDC_NICK,65,18,139,12,ES_AUTOHSCROLL
+ LTEXT "First name:",IDC_STATIC,15,35,50,8
+ EDITTEXT IDC_FIRSTNAME,65,33,139,12,ES_AUTOHSCROLL
+ LTEXT "Last name:",IDC_STATIC,15,50,50,8
+ EDITTEXT IDC_LASTNAME,65,48,139,12,ES_AUTOHSCROLL
+ LTEXT "E-mail:",IDC_STATIC,15,65,50,8
+ EDITTEXT IDC_EMAIL_USER,65,63,69,12,ES_AUTOHSCROLL
+ CTEXT "@",IDC_STATIC,137,64,9,9
+ COMBOBOX IDC_EMAIL_DOMAIN,147,63,57,71,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Gender:",IDC_STATIC,15,87,50,8
+ COMBOBOX IDC_GENDER,65,85,139,47,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Age:",IDC_STATIC,15,102,50,8
+ RTEXT "from:",IDC_STATIC,65,102,26,9
+ COMBOBOX IDC_AGERANGE_FROM,94,100,37,90,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ RTEXT "to:",IDC_STATIC,134,102,30,9
+ COMBOBOX IDC_AGERANGE_TO,167,100,37,90,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Birthday:",IDC_STATIC,15,118,50,8
+ COMBOBOX IDC_BIRTHDAY_DAY,65,117,29,204,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_BIRTHDAY_MONTH,102,117,59,90,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_BIRTHDAY_YEAR,167,117,37,188,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Zodiak:",IDC_STATIC,15,134,50,8
+ COMBOBOX IDC_ZODIAK,65,133,139,47,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ GROUPBOX "Location",IDC_LOCATIONGROUP,7,157,207,60
+ LTEXT "Country:",IDC_STATIC,14,170,50,8
+ COMBOBOX IDC_COUNTRY,64,167,143,172,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ LTEXT "State:",IDC_STATIC,14,184,50,8
+ COMBOBOX IDC_STATE,64,183,143,172,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Search online users only",IDC_ONLINEONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,222,143,8
+ LTEXT "City:",IDC_STATIC,14,200,50,8
+ COMBOBOX IDC_CITY,64,199,143,172,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Remember",IDC_CHK_REMEMBER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,157,222,56,8
+END
+
+IDD_OPT_AVATRS DIALOGEX 0, 0, 295, 195
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ GROUPBOX "Configuration",IDC_GROUPCONFIG,8,6,277,110
+ CONTROL "Enable avatars support (loading)",IDC_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,18,259,9
+ RTEXT "Server:",IDC_STATIC,16,31,53,8
+ EDITTEXT IDC_SERVER,72,29,140,12,ES_AUTOHSCROLL
+ RTEXT "Port:",IDC_STATIC,16,46,53,8
+ EDITTEXT IDC_SERVERPORT,72,44,34,12,ES_AUTOHSCROLL | ES_NUMBER
+ LTEXT "(80, 443, 2041)",IDC_STATIC,110,46,103,10
+ PUSHBUTTON "Default",IDC_BUTTON_DEFAULT,216,29,60,13
+ EDITTEXT IDC_UPD_CHECK_INTERVAL,14,71,34,12,ES_AUTOHSCROLL | ES_NUMBER
+ LTEXT "Updates check interval, min",IDC_STATIC,51,72,222,8
+ CONTROL "Return absolute path",IDC_RETURN_ABC_PATH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,89,259,9
+ CONTROL "Delete avatar file with contact",IDC_DELETE_AVT_ON_CONTACT_DELETE,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,100,259,9
+ CONTROL "Use keep-alive connections",IDC_USE_KEEPALIVE_CONN,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,72,59,201,9
+END
+
+IDD_OPT_FILES DIALOGEX 0, 0, 295, 160
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ GROUPBOX "Files exchange",IDC_GROUPCONFIG2,8,7,277,143
+ CONTROL "No out connection on send",IDC_FILE_SEND_NOOUTCONNECTIONONSEND,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,28,244,8
+ CONTROL "No out connection on receive",IDC_FILE_SEND_NOOUTCONNECTIONONRECEIVE,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,39,244,8
+ CONTROL "Out connections: ignory additional ports (443, 2041)",IDC_FILE_SEND_IGNORYADDITIONALPORTS,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,50,244,8
+ CONTROL "Hide my IP addresses",IDC_FILE_SEND_HIDE_MY_ADDRESSES,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,61,244,8
+ CONTROL "Add extra address",IDC_FILE_SEND_ADD_EXTRA_ADDRESS,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,72,244,8
+ RTEXT "Your host (or router):",IDC_STATIC,13,84,92,8
+ EDITTEXT IDC_FILE_SEND_EXTRA_ADDRESS,108,83,170,12,ES_AUTOHSCROLL
+ LTEXT "File send block size:",IDC_STATIC,14,112,263,8
+ EDITTEXT IDC_FILE_SEND_BLOCK_SIZE,26,123,52,12,ES_AUTOHSCROLL | ES_NUMBER
+ LTEXT "512 - 65536 bytes",IDC_STATIC,82,125,97,10
+ CONTROL "Enable direct connections",IDC_FILE_SEND_ENABLE_DIRECT_CONN,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,18,263,8
+ CONTROL "Enable MRIM proxy connections",IDC_FILE_SEND_ENABLE_MRIMPROXY_CONS,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,98,263,8
+END
+
+IDD_OPT_ACCOUNT DIALOGEX 0, 0, 295, 149
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ GROUPBOX "Mail.ru Agent",IDC_GROUPMAIN,9,5,276,98,WS_GROUP
+ RTEXT "Full e-mail:",IDC_STATIC,14,22,52,8
+ EDITTEXT IDC_LOGIN,72,18,100,12,ES_AUTOHSCROLL
+ LTEXT "Example: Petrov_Ivan@mail.ru",IDC_STATIC,175,19,104,10
+ RTEXT "Password:",IDC_STATIC,14,37,52,8
+ EDITTEXT IDC_PASSWORD,72,33,100,12,ES_PASSWORD | ES_AUTOHSCROLL
+ CONTROL "Create a new Mail.ru account using the Mail.ru website",IDC_NEW_ACCOUNT_LINK,
+ "Hyperlink",WS_TABSTOP,18,72,258,9
+ CONTROL "Retrieve a lost password",IDC_LOOKUPLINK,"Hyperlink",WS_TABSTOP,18,85,258,9
+ LTEXT "Leave empty if you dont want change password",IDC_STATIC,72,48,212,8
+END
+
+IDD_OPT_POPUPS DIALOGEX 0, 0, 295, 150
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ RTEXT "PopUp type",IDC_STATIC,9,11,52,8
+ COMBOBOX IDC_COMBO_POPUP_TYPE,65,9,220,97,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ GROUPBOX "Popup settings",IDC_GROUPMAIN,9,25,276,90,WS_GROUP
+ CONTROL "Enable",IDC_CHK_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,38,260,10
+ CONTROL "&Use Windows colors",IDC_CHK_USE_WIN_COLORS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,50,246,10
+ RTEXT "Back Color",IDC_STATIC,29,65,57,8
+ CONTROL "",IDC_POPUP_BACKCOLOR,"ColourPicker",WS_TABSTOP,92,65,38,10
+ RTEXT "Text Color",IDC_STATIC,29,80,57,8
+ CONTROL "",IDC_POPUP_TEXTCOLOR,"ColourPicker",WS_TABSTOP,92,80,38,10
+ RTEXT "Timeout",IDC_STATIC,29,96,57,8
+ EDITTEXT IDC_POPUP_TIMEOUT,92,94,38,12,ES_AUTOHSCROLL | ES_NUMBER
+ PUSHBUTTON "Previe&w",IDC_PREVIEW,237,119,46,12
+END
+
+IDD_SETXSTATUS DIALOGEX 0, 0, 189, 98
+STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_CONTROLPARENT
+CAPTION "Custom Status ""%s"" Details"
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ DEFPUSHBUTTON "Closing in %d",IDOK,49,79,91,14
+ LTEXT "Title:",IDC_STATIC,5,0,179,8
+ EDITTEXT IDC_XTITLE,5,8,179,13
+ LTEXT "Message:",IDC_STATIC,5,22,179,8
+ EDITTEXT IDC_XMSG,5,31,179,43,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,20,0,1
+ PRODUCTVERSION 1,20,0,1
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "000004b0"
+ BEGIN
+ VALUE "About Miranda", "Miranda IM is a new generation IM client, extensible with numerous plugins. Get Miranda IM at http://www.miranda-im.org"
+ VALUE "Comments", "Rozhuk_I@mail.ru"
+ VALUE "FileDescription", "Miranda Mail.ru Agent protocol plugin"
+ VALUE "FileVersion", "1, 20, 0, 1"
+ VALUE "LegalCopyright", "Copyright 2005-2009 Rozhuk Ivan"
+ VALUE "OriginalFilename", "Mra.dll"
+ VALUE "ProductName", "Plugin for Miranda IM"
+ VALUE "ProductVersion", "1, 20, 0, 1"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0, 1200
+ END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO
+BEGIN
+ IDD_MRAADVANCEDSEARCH, DIALOG
+ BEGIN
+ BOTTOMMARGIN, 230
+ END
+
+ IDD_OPT_FILES, DIALOG
+ BEGIN
+ BOTTOMMARGIN, 150
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+#endif // Neutral resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Russian resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
+#ifdef _WIN32
+LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
+#pragma code_page(1251)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_BLOGSTATUS ICON "Icons\\BlogStatus.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_OPT_ANTISPAM DIALOGEX 0, 0, 295, 211
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ GROUPBOX "Configuration",IDC_GROUPCONFIG,8,6,277,197
+ CONTROL "Enable Anti Spam",IDC_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,18,259,9
+ CONTROL "Check temp contacts",IDC_CHK_TEMP_CONTACTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,29,248,9
+ CONTROL "Delete spam bot contacts",IDC_DELETE_SPAMBOT_CONTACT,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,34,40,238,9
+ EDITTEXT IDC_MAX_LANG_CHANGES,23,67,33,12,ES_AUTOHSCROLL | ES_NUMBER
+ LTEXT "Max. language changes in message (0 - disabled)",IDC_STATIC,59,69,220,11
+ CONTROL "Show pop up",IDC_SHOWPOPUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,82,248,9
+ CONTROL "Write to system history",IDC_WRITETOSYSTEMHISTORY,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,92,248,9
+ CONTROL "Send spam report to server",IDC_SEND_SPAM_REPORT_TO_SERVER,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,102,248,9
+ LTEXT "Bad words list",IDC_STATIC,25,115,96,11
+ LISTBOX IDC_BAD_WORDS_LIST,25,127,121,71,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
+ EDITTEXT IDC_EDIT_BAD_WORD,152,171,129,12,ES_AUTOHSCROLL
+ PUSHBUTTON "Add",IDC_BUTTON_ADD,152,186,42,14
+ PUSHBUTTON "Remove",IDC_BUTTONREMOVE,198,186,40,14,BS_CENTER
+ PUSHBUTTON "Default",IDC_BUTTON_DEFAULT,242,186,40,14,BS_CENTER
+ CONTROL "Ignory non AlphaNumeric characters",IDC_CLN_NON_ALPHNUM,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,56,248,9
+END
+
+IDD_MINIBLOG DIALOGEX 0, 0, 256, 134
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ DEFPUSHBUTTON "OK",IDOK,76,113,50,14,WS_DISABLED
+ PUSHBUTTON "Cancel",IDCANCEL,130,113,50,14
+ EDITTEXT IDC_USER_BLOG_STATUS_MSG,7,19,242,38,ES_MULTILINE | ES_READONLY
+ EDITTEXT IDC_MSG_TO_SEND,7,61,242,38,ES_MULTILINE
+ CONTROL "Notify",IDC_CHK_NOTIFY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,102,125,9
+ LTEXT "Writed:",IDC_STATIC_WRITED_TIME,7,7,242,11
+ LTEXT "0/500",IDC_STATIC_CHARS_COUNTER,211,103,38,11,0,WS_EX_RIGHT
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO
+BEGIN
+ IDD_MINIBLOG, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 249
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 127
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
+ "#include ""windows.h""\r\n"
+ "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+#endif // Russian resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_DIALOG_SELECT_EMAIL DIALOGEX 0, 0, 177, 169
+STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION
+CAPTION "Select e-mail"
+FONT 8, "MS Shell Dlg", 0, 0, 0x0
+BEGIN
+ LISTBOX IDC_LIST_EMAILS,7,7,163,133,LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | NOT WS_BORDER | WS_VSCROLL | WS_TABSTOP,WS_EX_STATICEDGE
+ DEFPUSHBUTTON "OK",IDOK,39,147,51,15
+ PUSHBUTTON "Cancel",IDCANCEL,93,147,51,15
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO
+BEGIN
+ IDD_DIALOG_SELECT_EMAIL, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 170
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 162
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/10.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/10.ico
new file mode 100644
index 0000000000..b13a898589
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/10.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/11.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/11.ico
new file mode 100644
index 0000000000..16d72d33c6
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/11.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/12.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/12.ico
new file mode 100644
index 0000000000..971327565c
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/12.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/13.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/13.ico
new file mode 100644
index 0000000000..0d824adc50
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/13.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/14.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/14.ico
new file mode 100644
index 0000000000..a939be5606
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/14.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/15.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/15.ico
new file mode 100644
index 0000000000..d525499cd3
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/15.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/16.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/16.ico
new file mode 100644
index 0000000000..950b03fa4b
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/16.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/17.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/17.ico
new file mode 100644
index 0000000000..9f90a34806
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/17.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/18.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/18.ico
new file mode 100644
index 0000000000..a76170ed1c
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/18.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/19.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/19.ico
new file mode 100644
index 0000000000..ae535164ae
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/19.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/20.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/20.ico
new file mode 100644
index 0000000000..ee2fe2c2a9
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/20.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/21.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/21.ico
new file mode 100644
index 0000000000..03a5d108cc
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/21.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/22.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/22.ico
new file mode 100644
index 0000000000..ba2907284a
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/22.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/23.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/23.ico
new file mode 100644
index 0000000000..a5a22372db
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/23.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/24.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/24.ico
new file mode 100644
index 0000000000..abf66b3823
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/24.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/25.txt b/protocols/MRA/xstatus_MRA/XStatus_icons/25.txt
new file mode 100644
index 0000000000..ff981d2f44
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/25.txt
@@ -0,0 +1,2 @@
+no icon
+possible chat/dnd icon here \ No newline at end of file
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/26.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/26.ico
new file mode 100644
index 0000000000..fea4f7722f
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/26.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/27.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/27.ico
new file mode 100644
index 0000000000..d5671d61c0
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/27.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/28.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/28.ico
new file mode 100644
index 0000000000..cb4fc69ce3
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/28.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/29.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/29.ico
new file mode 100644
index 0000000000..caf1684960
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/29.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/30.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/30.ico
new file mode 100644
index 0000000000..329b07ecb7
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/30.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/31.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/31.ico
new file mode 100644
index 0000000000..5cb465e1c0
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/31.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/32.txt b/protocols/MRA/xstatus_MRA/XStatus_icons/32.txt
new file mode 100644
index 0000000000..ff981d2f44
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/32.txt
@@ -0,0 +1,2 @@
+no icon
+possible chat/dnd icon here \ No newline at end of file
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/33.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/33.ico
new file mode 100644
index 0000000000..c16ab7b3ce
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/33.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/34.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/34.ico
new file mode 100644
index 0000000000..f73d8c5817
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/34.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/35.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/35.ico
new file mode 100644
index 0000000000..8594b058e2
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/35.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/36.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/36.ico
new file mode 100644
index 0000000000..51fb924ddb
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/36.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/37.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/37.ico
new file mode 100644
index 0000000000..f431151670
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/37.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/38.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/38.ico
new file mode 100644
index 0000000000..9e9b8661f3
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/38.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/39.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/39.ico
new file mode 100644
index 0000000000..83623ab3e0
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/39.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/4.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/4.ico
new file mode 100644
index 0000000000..be302007ed
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/4.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/40.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/40.ico
new file mode 100644
index 0000000000..cd47c4a72f
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/40.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/41.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/41.ico
new file mode 100644
index 0000000000..c78cfcf4d8
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/41.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/42.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/42.ico
new file mode 100644
index 0000000000..eb10108409
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/42.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/43.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/43.ico
new file mode 100644
index 0000000000..db60b063ba
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/43.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/44.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/44.ico
new file mode 100644
index 0000000000..dfcc56903c
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/44.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/45.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/45.ico
new file mode 100644
index 0000000000..72edb15716
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/45.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/46.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/46.ico
new file mode 100644
index 0000000000..4dbd7cecec
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/46.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/47.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/47.ico
new file mode 100644
index 0000000000..2468c5ef6c
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/47.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/48.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/48.ico
new file mode 100644
index 0000000000..e8f4e4de3a
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/48.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/49.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/49.ico
new file mode 100644
index 0000000000..368652a607
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/49.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/5.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/5.ico
new file mode 100644
index 0000000000..76cca4e0aa
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/5.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/50.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/50.ico
new file mode 100644
index 0000000000..ef41641d1c
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/50.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/51.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/51.ico
new file mode 100644
index 0000000000..a3ec794c39
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/51.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/52.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/52.ico
new file mode 100644
index 0000000000..08edc62dc6
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/52.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/53.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/53.ico
new file mode 100644
index 0000000000..374b72f91a
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/53.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/54.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/54.ico
new file mode 100644
index 0000000000..0223143885
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/54.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/6.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/6.ico
new file mode 100644
index 0000000000..9cfbd0544f
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/6.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/7.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/7.ico
new file mode 100644
index 0000000000..63a7b8bdfe
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/7.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/8.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/8.ico
new file mode 100644
index 0000000000..dba6ee75e4
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/8.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/9.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/9.ico
new file mode 100644
index 0000000000..598395399c
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/9.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/icon1.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/icon1.ico
new file mode 100644
index 0000000000..1fa172375c
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/icon1.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons/unknown.ico b/protocols/MRA/xstatus_MRA/XStatus_icons/unknown.ico
new file mode 100644
index 0000000000..52f5847529
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons/unknown.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/10.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/10.ico
new file mode 100644
index 0000000000..8a6082b8c4
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/10.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/11.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/11.ico
new file mode 100644
index 0000000000..45fc19ba88
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/11.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/12.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/12.ico
new file mode 100644
index 0000000000..22b5852e99
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/12.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/13.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/13.ico
new file mode 100644
index 0000000000..99f9bcbd73
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/13.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/14.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/14.ico
new file mode 100644
index 0000000000..51022c08d7
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/14.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/15.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/15.ico
new file mode 100644
index 0000000000..71479065bb
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/15.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/16.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/16.ico
new file mode 100644
index 0000000000..6d18f2342f
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/16.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/17.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/17.ico
new file mode 100644
index 0000000000..79a6ce355a
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/17.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/18.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/18.ico
new file mode 100644
index 0000000000..9bcc8cc787
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/18.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/19.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/19.ico
new file mode 100644
index 0000000000..1cd2c5ec1e
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/19.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/20.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/20.ico
new file mode 100644
index 0000000000..f315d56e3f
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/20.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/21.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/21.ico
new file mode 100644
index 0000000000..c2a63adf40
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/21.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/22.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/22.ico
new file mode 100644
index 0000000000..b8db78d98b
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/22.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/23.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/23.ico
new file mode 100644
index 0000000000..43737bcd53
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/23.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/24.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/24.ico
new file mode 100644
index 0000000000..f2d6c05e6c
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/24.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/25.txt b/protocols/MRA/xstatus_MRA/XStatus_icons_original/25.txt
new file mode 100644
index 0000000000..ff981d2f44
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/25.txt
@@ -0,0 +1,2 @@
+no icon
+possible chat/dnd icon here \ No newline at end of file
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/26.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/26.ico
new file mode 100644
index 0000000000..c225440c07
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/26.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/27.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/27.ico
new file mode 100644
index 0000000000..1ee08b64f9
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/27.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/28.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/28.ico
new file mode 100644
index 0000000000..8fb918beb2
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/28.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/29.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/29.ico
new file mode 100644
index 0000000000..caf1684960
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/29.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/30.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/30.ico
new file mode 100644
index 0000000000..329b07ecb7
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/30.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/31.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/31.ico
new file mode 100644
index 0000000000..5cb465e1c0
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/31.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/32.txt b/protocols/MRA/xstatus_MRA/XStatus_icons_original/32.txt
new file mode 100644
index 0000000000..ff981d2f44
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/32.txt
@@ -0,0 +1,2 @@
+no icon
+possible chat/dnd icon here \ No newline at end of file
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/33.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/33.ico
new file mode 100644
index 0000000000..c16ab7b3ce
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/33.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/34.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/34.ico
new file mode 100644
index 0000000000..f73d8c5817
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/34.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/35.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/35.ico
new file mode 100644
index 0000000000..8594b058e2
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/35.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/36.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/36.ico
new file mode 100644
index 0000000000..51fb924ddb
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/36.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/37.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/37.ico
new file mode 100644
index 0000000000..f431151670
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/37.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/38.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/38.ico
new file mode 100644
index 0000000000..9e9b8661f3
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/38.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/39.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/39.ico
new file mode 100644
index 0000000000..83623ab3e0
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/39.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/4.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/4.ico
new file mode 100644
index 0000000000..2c15d84e71
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/4.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/40.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/40.ico
new file mode 100644
index 0000000000..cd47c4a72f
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/40.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/41.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/41.ico
new file mode 100644
index 0000000000..c78cfcf4d8
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/41.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/42.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/42.ico
new file mode 100644
index 0000000000..eb10108409
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/42.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/43.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/43.ico
new file mode 100644
index 0000000000..db60b063ba
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/43.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/44.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/44.ico
new file mode 100644
index 0000000000..dfcc56903c
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/44.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/45.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/45.ico
new file mode 100644
index 0000000000..72edb15716
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/45.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/46.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/46.ico
new file mode 100644
index 0000000000..3be634fac4
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/46.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/47.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/47.ico
new file mode 100644
index 0000000000..0d9e7e058f
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/47.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/48.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/48.ico
new file mode 100644
index 0000000000..6905be19ab
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/48.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/49.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/49.ico
new file mode 100644
index 0000000000..368652a607
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/49.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/5.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/5.ico
new file mode 100644
index 0000000000..73995f4291
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/5.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/50.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/50.ico
new file mode 100644
index 0000000000..ef41641d1c
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/50.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/51.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/51.ico
new file mode 100644
index 0000000000..b07c24e48c
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/51.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/52.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/52.ico
new file mode 100644
index 0000000000..3e90a10d30
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/52.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/53.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/53.ico
new file mode 100644
index 0000000000..56f8edce42
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/53.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/6.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/6.ico
new file mode 100644
index 0000000000..7381d1de44
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/6.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/7.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/7.ico
new file mode 100644
index 0000000000..8ed6d251d5
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/7.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/8.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/8.ico
new file mode 100644
index 0000000000..b6adfa5f25
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/8.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/9.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/9.ico
new file mode 100644
index 0000000000..066330a625
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/9.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/XStatus_icons_original/unknown.ico b/protocols/MRA/xstatus_MRA/XStatus_icons_original/unknown.ico
new file mode 100644
index 0000000000..5d506b96f1
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/XStatus_icons_original/unknown.ico
Binary files differ
diff --git a/protocols/MRA/xstatus_MRA/resource.h b/protocols/MRA/xstatus_MRA/resource.h
new file mode 100644
index 0000000000..7a9bbeb1d8
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/resource.h
@@ -0,0 +1,67 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by xstatus_MRA.rc
+//
+#define IDS_IDENTIFY 102
+#define IDI_XSTATUS1 201
+#define IDI_XSTATUS2 202
+#define IDI_XSTATUS3 203
+#define IDI_XSTATUS4 204
+#define IDI_XSTATUS5 205
+#define IDI_XSTATUS6 206
+#define IDI_XSTATUS7 207
+#define IDI_XSTATUS8 208
+#define IDI_XSTATUS9 209
+#define IDI_XSTATUS10 210
+#define IDI_XSTATUS11 211
+#define IDI_XSTATUS12 212
+#define IDI_XSTATUS13 213
+#define IDI_XSTATUS14 214
+#define IDI_XSTATUS15 215
+#define IDI_XSTATUS16 216
+#define IDI_XSTATUS17 217
+#define IDI_XSTATUS18 218
+#define IDI_XSTATUS19 219
+#define IDI_XSTATUS20 220
+#define IDI_XSTATUS21 221
+#define IDI_XSTATUS22 222
+#define IDI_XSTATUS23 223
+#define IDI_XSTATUS24 224
+#define IDI_XSTATUS25 225
+#define IDI_XSTATUS26 226
+#define IDI_XSTATUS27 227
+#define IDI_XSTATUS28 228
+#define IDI_XSTATUS29 229
+#define IDI_XSTATUS30 230
+#define IDI_XSTATUS31 231
+#define IDI_XSTATUS32 232
+#define IDI_XSTATUS33 233
+#define IDI_XSTATUS34 234
+#define IDI_XSTATUS35 235
+#define IDI_XSTATUS36 236
+#define IDI_XSTATUS37 237
+#define IDI_XSTATUS38 238
+#define IDI_XSTATUS39 239
+#define IDI_XSTATUS40 240
+#define IDI_XSTATUS41 241
+#define IDI_XSTATUS42 242
+#define IDI_XSTATUS43 243
+#define IDI_XSTATUS44 244
+#define IDI_XSTATUS45 245
+#define IDI_XSTATUS46 246
+#define IDI_XSTATUS47 247
+#define IDI_XSTATUS48 248
+#define IDI_XSTATUS49 249
+#define IDI_XSTATUS_UNKNOWN 250
+
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 253
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1001
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/protocols/MRA/xstatus_MRA/xstatus_MRA.rc b/protocols/MRA/xstatus_MRA/xstatus_MRA.rc
new file mode 100644
index 0000000000..2d4dc48413
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/xstatus_MRA.rc
@@ -0,0 +1,144 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Neutral resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
+#ifdef _WIN32
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+#pragma code_page(1251)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_XSTATUS1 ICON "XStatus_icons\\4.ico"
+IDI_XSTATUS2 ICON "XStatus_icons\\5.ico"
+IDI_XSTATUS3 ICON "XStatus_icons\\6.ico"
+IDI_XSTATUS4 ICON "XStatus_icons\\7.ico"
+IDI_XSTATUS5 ICON "XStatus_icons\\8.ico"
+IDI_XSTATUS6 ICON "XStatus_icons\\9.ico"
+IDI_XSTATUS7 ICON "XStatus_icons\\10.ico"
+IDI_XSTATUS8 ICON "XStatus_icons\\11.ico"
+IDI_XSTATUS9 ICON "XStatus_icons\\12.ico"
+IDI_XSTATUS10 ICON "XStatus_icons\\13.ico"
+IDI_XSTATUS11 ICON "XStatus_icons\\14.ico"
+IDI_XSTATUS12 ICON "XStatus_icons\\15.ico"
+IDI_XSTATUS13 ICON "XStatus_icons\\16.ico"
+IDI_XSTATUS14 ICON "XStatus_icons\\17.ico"
+IDI_XSTATUS15 ICON "XStatus_icons\\18.ico"
+IDI_XSTATUS16 ICON "XStatus_icons\\19.ico"
+IDI_XSTATUS17 ICON "XStatus_icons\\20.ico"
+IDI_XSTATUS18 ICON "XStatus_icons\\21.ico"
+IDI_XSTATUS19 ICON "XStatus_icons\\22.ico"
+IDI_XSTATUS20 ICON "XStatus_icons\\23.ico"
+IDI_XSTATUS21 ICON "XStatus_icons\\24.ico"
+IDI_XSTATUS22 ICON "XStatus_icons\\26.ico"
+IDI_XSTATUS23 ICON "XStatus_icons\\27.ico"
+IDI_XSTATUS24 ICON "XStatus_icons\\28.ico"
+IDI_XSTATUS25 ICON "XStatus_icons\\29.ico"
+IDI_XSTATUS26 ICON "XStatus_icons\\30.ico"
+IDI_XSTATUS27 ICON "XStatus_icons\\31.ico"
+IDI_XSTATUS28 ICON "XStatus_icons\\33.ico"
+IDI_XSTATUS29 ICON "XStatus_icons\\34.ico"
+IDI_XSTATUS30 ICON "XStatus_icons\\35.ico"
+IDI_XSTATUS31 ICON "XStatus_icons\\36.ico"
+IDI_XSTATUS32 ICON "XStatus_icons\\37.ico"
+IDI_XSTATUS33 ICON "XStatus_icons\\38.ico"
+IDI_XSTATUS34 ICON "XStatus_icons\\39.ico"
+IDI_XSTATUS35 ICON "XStatus_icons\\40.ico"
+IDI_XSTATUS36 ICON "XStatus_icons\\41.ico"
+IDI_XSTATUS37 ICON "XStatus_icons\\42.ico"
+IDI_XSTATUS38 ICON "XStatus_icons\\43.ico"
+IDI_XSTATUS39 ICON "XStatus_icons\\44.ico"
+IDI_XSTATUS40 ICON "XStatus_icons\\45.ico"
+IDI_XSTATUS41 ICON "XStatus_icons\\46.ico"
+IDI_XSTATUS42 ICON "XStatus_icons\\47.ico"
+IDI_XSTATUS43 ICON "XStatus_icons\\48.ico"
+IDI_XSTATUS44 ICON "XStatus_icons\\49.ico"
+IDI_XSTATUS45 ICON "XStatus_icons\\50.ico"
+IDI_XSTATUS46 ICON "XStatus_icons\\51.ico"
+IDI_XSTATUS47 ICON "XStatus_icons\\52.ico"
+IDI_XSTATUS48 ICON "XStatus_icons\\53.ico"
+IDI_XSTATUS_UNKNOWN ICON "XStatus_icons\\unknown.ico"
+IDI_XSTATUS49 ICON "XStatus_icons\\54.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE
+BEGIN
+ IDS_IDENTIFY "# Custom Status Icons #"
+END
+
+#endif // Neutral resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/protocols/MRA/xstatus_MRA/xstatus_MRA.vcproj b/protocols/MRA/xstatus_MRA/xstatus_MRA.vcproj
new file mode 100644
index 0000000000..09e0b70f84
--- /dev/null
+++ b/protocols/MRA/xstatus_MRA/xstatus_MRA.vcproj
@@ -0,0 +1,786 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="xstatus_MRA"
+ ProjectGUID="{5B84781D-F1C3-4535-99B7-B84B6C9BCF15}"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;XSTATUS_MRA_EXPORTS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/xstatus_MRA.dll"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/xstatus_MRA.pdb"
+ SubSystem="2"
+ ResourceOnlyDLL="true"
+ SetChecksum="false"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TurnOffAssemblyGeneration="true"
+ ImportLibrary="$(OutDir)/xstatus_MRA.lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;XSTATUS_MRA_EXPORTS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/xstatus_MRA.dll"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/xstatus_MRA.pdb"
+ SubSystem="2"
+ ResourceOnlyDLL="true"
+ SetChecksum="false"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TurnOffAssemblyGeneration="true"
+ ImportLibrary="$(OutDir)/xstatus_MRA.lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="true"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;XSTATUS_MRA_EXPORTS"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/xstatus_MRA.dll"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ResourceOnlyDLL="true"
+ SetChecksum="true"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TurnOffAssemblyGeneration="true"
+ ImportLibrary="$(OutDir)/xstatus_MRA.lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="true"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;XSTATUS_MRA_EXPORTS"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/xstatus_MRA.dll"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ResourceOnlyDLL="true"
+ SetChecksum="true"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TurnOffAssemblyGeneration="true"
+ ImportLibrary="$(OutDir)/xstatus_MRA.lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release - dbg|Win32"
+ OutputDirectory="$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="true"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;XSTATUS_MRA_EXPORTS"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/xstatus_MRA.dll"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ResourceOnlyDLL="true"
+ SetChecksum="true"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TurnOffAssemblyGeneration="true"
+ ImportLibrary="$(OutDir)/xstatus_MRA.lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release - dbg|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="true"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;XSTATUS_MRA_EXPORTS"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/xstatus_MRA.dll"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ResourceOnlyDLL="true"
+ SetChecksum="true"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TurnOffAssemblyGeneration="true"
+ ImportLibrary="$(OutDir)/xstatus_MRA.lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+ >
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc"
+ >
+ <File
+ RelativePath="resource.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ <File
+ RelativePath="XStatus_icons\10.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\11.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\12.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\13.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\14.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\15.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\16.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\17.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\18.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\19.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\20.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\21.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\22.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\23.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\24.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\25.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\26.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\27.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\28.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\29.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\30.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\31.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\32.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\33.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\34.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\35.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\36.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\37.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\38.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\39.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\4.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\40.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\41.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\42.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\43.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\44.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\45.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\46.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\47.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\48.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\49.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\5.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\50.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\51.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\52.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\53.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\54.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\55.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\56.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\57.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\58.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\59.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\6.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\7.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\8.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\9.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\XStatus_icons\icon1.ico"
+ >
+ </File>
+ <File
+ RelativePath="XStatus_icons\unknown.ico"
+ >
+ </File>
+ <File
+ RelativePath="xstatus_MRA.rc"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>