HEADER v3, primary аккаунты и подтверждения

This commit is contained in:
AidarKC
2026-11-27 12:29:24 +03:00
parent f9e7c4ef94
commit ae430e84c7
89 changed files with 1201 additions and 1596 deletions
@@ -54,7 +54,7 @@ inline bool buildPair(uint16_t type,uint16_t subtype,uint16_t version,const Byte
constexpr uint32_t MAX_NUMBER=2147482623,PROFILE=2147483645,CONNECTION=2147483646,TECH=2147483647;
const bool header=type==0&&subtype==0,tech=type==0&&subtype==1,fixed=type==3||type==4;
const bool channel=type==1&&(subtype==10||subtype==11||subtype==50||subtype==90||subtype==92||subtype==100||subtype==110||subtype==120||subtype==130);
if(version!=1||number>MAX_NUMBER||header!=(number==0)||(type==0&&!header&&!tech)||body.size()>8*1024*1024-124)return false;
if((version!=1&&!(header&&(version==2||version==3)))||number>MAX_NUMBER||header!=(number==0)||(type==0&&!header&&!tech)||body.size()>8*1024*1024-124)return false;
if(header&&std::any_of(prev,prev+32,[](uint8_t b){return b!=0;}))return false;
const size_t prefix=fixed?40:(tech||channel?44:0),offset=fixed?0:4;
if(body.size()<prefix)return false;