для подключения к icq.jimm.online добавил параметр JIMM=1 (включает канал 1 и отключает антиспам)

This commit is contained in:
Dmitriy Dus 2026-11-19 16:24:14 +02:00
parent 799868a096
commit 3233776efc
2 changed files with 30 additions and 2 deletions

View file

@ -4697,6 +4697,11 @@ int ICQKid2::pollIncomingEvents(int tmout)
setNetworkTimeout(tmp_tm);
if (net_ret!=1) return net_ret;
if (getenv("ICQ_DEBUG") && snd.service_id!=0x0013 && !(snd.service_id==0x0003 && snd.subtype_id==0x000b)) {
printf("SNAC in %04x,%04x len %u:", snd.service_id, snd.subtype_id, (unsigned)snd.data.size());
for (size_t k=0; k<snd.data.size() && k<24; k++) printf(" %02x", snd.data[k]);
printf("\n"); fflush(stdout);
}
if (snd.service_id==0x0015 && snd.subtype_id==0x0003)
{

View file

@ -562,7 +562,7 @@ void MyIcqInterface::onIncomingMsg(ICQKid2Message msg){
pkt.len=utf8_2_win1251(pkt.data,msg.text.c_str(),16383);
break;
}
if (findCLUIN(msg.uin)<0){
if (!getenv("JIMM") && findCLUIN(msg.uin)<0){
if (pkt.data[0]=='4'){
ICQKidFullUserInfo info;
if (getFullUserInfo(msg.uin,info,true)){
@ -1059,7 +1059,7 @@ void *ServerThread(void *tParam)
printf("ICQ UIN is %u\n", param->uin);
if (!miif.doConnect()){
printf("Connect failed at %d%% for %u\n",miif.connect_phase_percentage,param->uin);
printf("Connect failed at %d%% for %u, icq error %d %s\n",miif.connect_phase_percentage,param->uin,miif.connect_error_code,miif.connect_error_url.c_str());
sprintf(rpkt.data,"Connect failed at %d%%",miif.connect_phase_percentage);
L_ERRTX:
rpkt.len=strlen(rpkt.data);
@ -1146,7 +1146,30 @@ void *ServerThread(void *tParam)
sprintf(s,"%u",rpkt.uin);
int uen_ind=miif.findCLUIN(s);
rpkt.data[rpkt.len]=0;
if (getenv("ICQ_DEBUG")) { if (uen_ind>=0) printf("T_SENDMSG to %s len %d: in CL, relay %d unicode %d status %d\n", s, rpkt.len, miif.ContactListUins[uen_ind].srv_relay_cap, miif.ContactListUins[uen_ind].unicode_cap, miif.ContactListUins[uen_ind].online_status);
else printf("T_SENDMSG to %s len %d: NOT in CL\n", s, rpkt.len); }
fflush(stdout);
miif.total_msg=(miif.total_msg+1)&0x7FFF;
if (getenv("JIMM"))
{
/* channel 1, UCS-2BE: every client shows it (channel 2 = old ICQ rendezvous only) */
string utf, ucs;
win1251_2_utf8(utf, (unsigned char*)rpkt.data);
for (size_t k=0; k<utf.size();)
{
unsigned c=(unsigned char)utf[k];
unsigned u;
if (c<0x80) { u=c; k++; }
else if ((c&0xE0)==0xC0 && k+1<utf.size()) { u=((c&0x1F)<<6)|(utf[k+1]&0x3F); k+=2; }
else if (k+2<utf.size()) { u=((c&0x0F)<<12)|((utf[k+1]&0x3F)<<6)|(utf[k+2]&0x3F); k+=3; }
else { u='?'; k++; }
ucs+=(char)(u>>8); ucs+=(char)(u&0xFF);
}
bool ok=miif.sendMessage(MyIcqInterface::ICQKid2Message(s,ucs,MyIcqInterface::ICQKid2Message::UCS2BE),miif.total_msg);
if (getenv("ICQ_DEBUG")) printf(" sent ch1 ucs2 %s\n", ok?"ok":"refused -> local8bit"); fflush(stdout);
if (!ok) miif.sendMessage(MyIcqInterface::ICQKid2Message(s,rpkt.data,MyIcqInterface::ICQKid2Message::LOCAL8BIT),miif.total_msg);
}
else
if ( (uen_ind>=0) &&
(miif.ContactListUins[uen_ind].srv_relay_cap) &&
(miif.ContactListUins[uen_ind].online_status!=STATUS_OFFLINE)