From 5e9e63c45e37917ffb0acd83832d0d8f99d01883 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 28 Nov 2012 17:38:49 +0000 Subject: new macroses for MS_PROTO_CHAINRECV: ProtoChainRecv, ProtoChainRecvMsg & ProtoChainRecvFile git-svn-id: http://svn.miranda-ng.org/main/trunk@2540 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/AimOscar/src/server.cpp | 336 ++++++++++++++++---------------------- 1 file changed, 138 insertions(+), 198 deletions(-) (limited to 'protocols/AimOscar/src/server.cpp') diff --git a/protocols/AimOscar/src/server.cpp b/protocols/AimOscar/src/server.cpp index a968c20bd5..9df0f81c7f 100644 --- a/protocols/AimOscar/src/server.cpp +++ b/protocols/AimOscar/src/server.cpp @@ -268,19 +268,19 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003 else deleteSetting(hContact, "Transport" ); - if(admin_aol) + if (admin_aol) { setByte(hContact, AIM_KEY_AC, ACCOUNT_TYPE_ADMIN); } - else if(aol) + else if (aol) { setByte(hContact, AIM_KEY_AC, ACCOUNT_TYPE_AOL); } - else if(icq) + else if (icq) { setByte(hContact, AIM_KEY_AC, ACCOUNT_TYPE_ICQ); } - else if(unconfirmed) + else if (unconfirmed) { setByte(hContact, AIM_KEY_AC, ACCOUNT_TYPE_UNCONFIRMED); } @@ -289,17 +289,17 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003 setByte(hContact, AIM_KEY_AC, ACCOUNT_TYPE_CONFIRMED); } - if(bot) + if (bot) { strcpy(client,CLIENT_BOT); bot_user=1; } - if(wireless) + if (wireless) { strcpy(client,CLIENT_SMS); wireless_user=1; } - else if(away) + else if (away) { away_user=1; } @@ -407,93 +407,93 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003 for(int i=0;i=snac.len()) break; } - while (offset")) - { + if (strstr(msg_buf, "")) { char* beg = strstr(msg_buf, ""); char* end = strstr(msg_buf, ""); - if (beg && end && beg < end) - { + if (beg && end && beg < end) { beg += 6; end[0] = 0; memmove(msg_buf, beg, end - beg + 1); } - else - descr_included = false; + else descr_included = false; } } - else if(tlv.cmp(0x000d)) - { + else if (tlv.cmp(0x000d)) { char* enc = tlv.dup(); unicode_descr = strcmp(enc, "unicode-2-0") == 0; mir_free(enc); @@ -1291,47 +1261,29 @@ void CAimProto::snac_received_message(SNAC &snac,HANDLE hServerConn,unsigned sho i += TLV_HEADER_SIZE + tlv.len(); } } - else if (cap_cmp(snac.val(offset+10), AIM_CAP_RTCAUDIO) == 0 || - cap_cmp(snac.val(offset+10), AIM_CAP_RTCVIDEO) == 0) - { - for (int i = 26; i < tlv.len(); ) - { + else if (cap_cmp(snac.val(offset+10), AIM_CAP_RTCAUDIO) == 0 || cap_cmp(snac.val(offset+10), AIM_CAP_RTCVIDEO) == 0) { + for (int i = 26; i < tlv.len(); ) { TLV tlv(snac.val(offset+i)); if (tlv.cmp(0x000A)) - { request_num=tlv.ushort();//for file transfer - } - else if(tlv.cmp(0x0002))//proxy ip - { + else if (tlv.cmp(0x0002))//proxy ip proxy_ip = tlv.ulong(); - } - else if(tlv.cmp(0x0003))//client ip - { + else if (tlv.cmp(0x0003))//client ip local_ip = tlv.ulong(); - } - else if(tlv.cmp(0x0004))//verified ip - { + else if (tlv.cmp(0x0004))//verified ip verified_ip = tlv.ulong(); - } - else if(tlv.cmp(0x0005)) - { + else if (tlv.cmp(0x0005)) port=tlv.ushort(); - } } channel = 0; break; } - else if (cap_cmp(snac.val(offset+10), AIM_CAP_CHAT) == 0)//it's a chat invite request - { - for(int i=26;i