Changeset 4902

Show
Ignore:
Timestamp:
05/04/07 09:52:47 (19 months ago)
Author:
emostar
Message:

Fix updating our security settings (Require Auth, Show Web Presence).
I'm pretty sure Hide IP is not supported on the protocol anymore.. need to investigate whether to keep it or not.
We get some more packets that are marked as unknown, but for now it is ok to ignore these.

Also, if you look at the code, the META_... commands seem to have been changed. Maybe we need to fix more of them... Will check into that.

Fixes #1473 and #404

Location:
trunk/licq
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/licq/include/licq_icq.h

    r4786 r4902  
    220220const unsigned short ICQ_CMDxMETA_ORGBACKxINFOxRSP = 0x0096; // 150 
    221221const unsigned short ICQ_CMDxMETA_SENDxSMSxRSP     = 0x0096; // 150 
    222 const unsigned short ICQ_CMDxMETA_SECURITYxRSP     = 0x00A0; // 160 
     222// Deprecated? const unsigned short ICQ_CMDxMETA_SECURITYxRSP     = 0x00A0; // 160 
     223const unsigned short ICQ_CMDxMETA_SECURITYxRSP     = 0x0C3F; 
    223224const unsigned short ICQ_CMDxMETA_PASSWORDxRSP     = 0x00AA; // 170 
    224225const unsigned short ICQ_CMDxMETA_RANDOMxUSERxRSP  = 0x0366; // 870 
     
    242243const unsigned short ICQ_CMDxMETA_INTERESTSxINFOxSET = 0x0410; // 1040 
    243244const unsigned short ICQ_CMDxMETA_ORGBACKxINFOxSET = 0x041A; // 1050 
    244 const unsigned short ICQ_CMDxMETA_SECURITYxSET     = 0x0424; // 1060 
     245// Deprecated? const unsigned short ICQ_CMDxMETA_SECURITYxSET     = 0x0424; // 1060 
     246const unsigned short ICQ_CMDxMETA_SECURITYxSET     = 0x0C3A; 
    245247const unsigned short ICQ_CMDxMETA_PASSWORDxSET     = 0x042E; // 1070 
    246248const unsigned short ICQ_CMDxMETA_REQUESTxALLxINFO = 0x04B2; // 1202 
  • trunk/licq/src/icqd-srv.cpp

    r4799 r4902  
    10881088unsigned long CICQDaemon::icqSetSecurityInfo(bool bAuthorize, bool bHideIp, bool bWebAware) 
    10891089{ 
     1090  // Since ICQ5.1, the status change packet is sent first, which means it is 
     1091  // assumed that the set security info packet works. 
     1092  ICQOwner *o = gUserManager.FetchOwner(LOCK_W); 
     1093  o->SetEnableSave(false); 
     1094  o->SetAuthorization(bAuthorize); 
     1095  o->SetWebAware(bWebAware); 
     1096  o->SetHideIp(bHideIp); 
     1097  o->SetEnableSave(true); 
     1098  o->SaveLicqInfo(); 
     1099  unsigned short s = o->StatusFull(); 
     1100  gUserManager.DropOwner(); 
     1101  // Set status to ensure the status flags are set 
     1102  icqSetStatus(s); 
     1103 
     1104  // Now send the set security info packet 
    10901105    CPU_Meta_SetSecurityInfo *p = new CPU_Meta_SetSecurityInfo(bAuthorize, bHideIp, bWebAware); 
    10911106    gLog.Info(tr("%sUpdating security info (#%hu/#%d)...\n"), L_SRVxSTR, p->Sequence(), p->SubSequence()); 
     
    49875002    } 
    49885003    case 0x07DA: 
     5004    case 0x07D0: // XXX Now I see this one, huh? 
    49895005    { 
    49905006      unsigned short nSubtype; 
     
    50155031        pEvent = DoneServerEvent(nSubSequence, 
    50165032          nResult == META_SUCCESS ? EVENT_SUCCESS : EVENT_FAILED); 
    5017  
    5018         if (pEvent != NULL && nResult == META_SUCCESS) 
    5019         { 
    5020           CPU_Meta_SetSecurityInfo *p = (CPU_Meta_SetSecurityInfo *)pEvent->m_pPacket; 
    5021           ICQOwner *o = gUserManager.FetchOwner(LOCK_W); 
    5022           o->SetEnableSave(false); 
    5023           o->SetAuthorization(p->Authorization()); 
    5024           o->SetWebAware(p->WebAware()); 
    5025           o->SetHideIp(p->HideIp()); 
    5026           o->SetEnableSave(true); 
    5027           o->SaveLicqInfo(); 
    5028           unsigned short s = o->StatusFull(); 
    5029           gUserManager.DropOwner(); 
    5030  
    5031           // Set status to ensure the status flags are set 
    5032           icqSetStatus(s); 
    5033         } 
    50345033      } 
    50355034      else if (nSubtype == ICQ_CMDxMETA_GENERALxINFOxRSP) 
  • trunk/licq/src/icqpacket.cpp

    r4785 r4902  
    40194019 
    40204020 
    4021   int packetSize = 2+2+2+4+2+2+2+4; 
     4021  int packetSize = 2+2+2+4+2+2+2+4+6; 
    40224022  m_nSize += packetSize; 
    40234023  InitBuffer(); 
     
    40314031  buffer->PackUnsignedShortBE(m_nSubSequence); 
    40324032  buffer->PackUnsignedShort(m_nMetaCommand); // subtype 
    4033   buffer->PackChar(m_nAuthorization); 
     4033  buffer->PackUnsignedShortBE(0x0C03); 
     4034  buffer->PackUnsignedShortBE(0x0100); 
    40344035  buffer->PackChar(m_nWebAware); 
     4036  buffer->PackChar(0xF8); 
     4037  buffer->PackChar(2); 
    40354038  buffer->PackChar(1); 
    40364039  buffer->PackChar(0); 
     4040  buffer->PackChar(m_nAuthorization); 
    40374041} 
    40384042