Show
Ignore:
Timestamp:
07/03/08 22:13:49 (5 months ago)
Author:
flynd
Message:

More UIN removed.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/licq/src/icqd-chat.cpp

    r6402 r6405  
    124124{ 
    125125  m_nVersion = u->Version(); 
    126   m_nUin = u->Uin(); 
    127126  m_szId = strdup(u->IdString()); 
     127  m_nUin = strtoul(m_szId, NULL, 10); 
    128128  m_nPPID = u->PPID(); 
    129129  m_nIp = u->Ip(); 
     
    793793  bool bTryDirect = true; 
    794794  bool bResult = false; 
    795   ICQUser *temp_user = gUserManager.FetchUser(u->uin, LOCK_R); 
     795  ICQUser* temp_user = gUserManager.FetchUser(u->szId, u->nPPID, LOCK_R); 
    796796  if (temp_user != NULL) 
    797797  { 
     
    883883  u->m_pClient = new CChatClient(); 
    884884  u->m_pClient->m_nVersion = s->Version(); 
    885   u->m_pClient->m_nUin = s->Owner(); 
    886885  u->m_pClient->m_szId = strdup(s->OwnerId()); 
     886  u->m_pClient->m_nUin = strtoul(u->m_pClient->m_szId, NULL, 10); 
    887887  u->m_pClient->m_nPPID = s->OwnerPPID(); 
    888888  u->m_pClient->m_nIp = s->RemoteIp(); 
     
    10901090 
    10911091      CPChat_ColorFont pin(u->sock.RecvBuffer()); 
    1092       u->uin = pin.Uin(); 
    10931092      u->szId = strdup(pin.Id()); 
     1093      u->uin = strtoul(u->szId, NULL, 10); 
    10941094      u->nPPID = pin.PPID(); 
    10951095//      m_nSession = pin.Session(); 
     
    14621462        unsigned long nUin = u->chatQueue[0] | (u->chatQueue[1] << 8) | 
    14631463          (u->chatQueue[2] << 16) | (u->chatQueue[3] << 24); 
     1464        char id[16]; 
     1465        snprintf(id, 16, "%lu", nUin); 
    14641466 
    14651467        // Deque all the characters 
     
    14711473        for (iter = chatUsers.begin(); iter != chatUsers.end(); ++iter) 
    14721474        { 
    1473           if((*iter)->Uin() == nUin) 
     1475          if (strcmp((*iter)->Id(), id) == 0) 
    14741476            break; 
    14751477        } 
     
    14781480 
    14791481        CBuffer bye(4); 
    1480         SendBuffer(&bye, CHAT_DISCONNECTIONxKICKED, nUin, true); 
     1482        SendBuffer(&bye, CHAT_DISCONNECTIONxKICKED, id, true); 
    14811483 
    14821484        CloseClient(*iter); 
     
    17491751          unsigned long nUin = u->chatQueue[0] | (u->chatQueue[1] << 8) | 
    17501752            (u->chatQueue[2] << 16) | (u->chatQueue[3] << 24); 
     1753          char id[16]; 
     1754          snprintf(id, 16, "%lu", nUin); 
    17511755 
    17521756          // Find the user and say bye-bye to him 
     
    17541758          for (iter = chatUsers.begin(); iter != chatUsers.end(); ++iter) 
    17551759          { 
    1756             if((*iter)->Uin() == nUin) 
     1760            if (strcmp((*iter)->Id(), id) == 0) 
    17571761             break; 
    17581762          } 
     
    17611765 
    17621766          CBuffer bye(4); 
    1763           SendBuffer(&bye, CHAT_DISCONNECTIONxKICKED, nUin, true); 
     1767          SendBuffer(&bye, CHAT_DISCONNECTIONxKICKED, id, true); 
    17641768 
    17651769          CloseClient(*iter); 
     
    18641868//-----CChatManager::SendBuffer---------------------------------------------- 
    18651869void CChatManager::SendBuffer(CBuffer *b, unsigned char cmd, 
    1866                               unsigned long _nUin, 
    1867                               bool bNotIter) 
     1870    const char* id, bool bNotIter) 
    18681871{ 
    18691872  ChatUserList::iterator iter; 
     
    18711874  bool ok = false; 
    18721875 
    1873   if (_nUin != 0) 
     1876  if (id != NULL) 
    18741877  { 
    18751878    for (u_iter = chatUsers.begin(); u_iter != chatUsers.end(); ++u_iter) 
    18761879    { 
    1877       if ((*u_iter)->Uin() == _nUin) 
     1880      if (strcmp((*u_iter)->Id(), id) == 0) 
    18781881        break; 
    18791882    } 
     
    18881891 
    18891892    // Send it to every user 
    1890     if (_nUin == 0) 
     1893    if (id == NULL) 
    18911894    { 
    18921895      for (iter = chatUsers.begin(); iter != chatUsers.end(); ++iter) 
     
    20222025 
    20232026 
    2024 void CChatManager::SendKick(unsigned long _nUin) 
    2025 { 
     2027void CChatManager::SendKick(const char* id) 
     2028{ 
     2029  unsigned long _nUin = strtoul(id, NULL, 10); 
     2030 
    20262031  // Take care of the vote stuff now 
    20272032  // The user we are kicking automatically is a no vote 
     
    20382043  CBuffer buf(4); 
    20392044  buf.PackUnsignedLong(_nUin); 
    2040   SendBuffer(&buf, CHAT_KICK, _nUin, true); 
    2041 } 
    2042  
    2043  
    2044 void CChatManager::SendKickNoVote(unsigned long _nUin) 
    2045 { 
     2045  SendBuffer(&buf, CHAT_KICK, id, true); 
     2046} 
     2047 
     2048 
     2049void CChatManager::SendKickNoVote(const char *id) 
     2050{ 
     2051  unsigned long _nUin = strtoul(id, NULL, 10); 
     2052 
    20462053  // Tell everyone that this user has been kicked 
    20472054  CBuffer buf_TellAll(6); 
     
    20492056  buf_TellAll.PackChar(0x02); 
    20502057  buf_TellAll.PackChar(0x01); 
    2051   SendBuffer(&buf_TellAll, CHAT_KICKxPASS, _nUin, true); 
     2058  SendBuffer(&buf_TellAll, CHAT_KICKxPASS, id, true); 
    20522059 
    20532060  // They don't know if there was a vote or not, they just see they've been kicked 
     
    20552062  buf.PackChar(0x02); 
    20562063  buf.PackChar(0x01); 
    2057   SendBuffer(&buf, CHAT_KICKxYOU, _nUin, false); 
     2064  SendBuffer(&buf, CHAT_KICKxYOU, id, false); 
    20582065 
    20592066  // And close the connection to the kicked user 
     
    20612068  for (iter = chatUsers.begin(); iter != chatUsers.end(); ++iter) 
    20622069  { 
    2063     if((*iter)->Uin() == _nUin) 
     2070    if(strcmp((*iter)->Id(), id) == 0) 
    20642071      break; 
    20652072  } 
     
    20682075 
    20692076  CBuffer bye(4); 
    2070   SendBuffer(&bye, CHAT_DISCONNECTIONxKICKED, _nUin, false); 
     2077  SendBuffer(&bye, CHAT_DISCONNECTIONxKICKED, id, false); 
    20712078 
    20722079  CloseClient(*iter); 
     
    22472254void CChatManager::FinishKickVote(VoteInfoList::iterator iter, bool bPassed) 
    22482255{ 
     2256  char voteId[16]; 
     2257  snprintf(voteId, 16, "%lu", (*iter)->nUin); 
     2258 
    22492259  // Find the person we are kicking in the ChatUserList 
    22502260  ChatUserList::iterator userIter; 
    22512261  for (userIter = chatUsers.begin(); userIter != chatUsers.end(); ++userIter) 
    22522262  { 
    2253     if ((*userIter)->Uin() == (*iter)->nUin) 
     2263    if (strcmp((*userIter)->Id(), voteId) == 0) 
    22542264      break; 
    22552265  } 
     
    22712281 
    22722282  if (bPassed) 
    2273     SendBuffer(&buf, CHAT_KICKxPASS, (*iter)->nUin, true); 
     2283    SendBuffer(&buf, CHAT_KICKxPASS, voteId, true); 
    22742284  else 
    2275     SendBuffer(&buf, CHAT_KICKxFAIL, (*iter)->nUin, true); 
     2285    SendBuffer(&buf, CHAT_KICKxFAIL, voteId, true); 
    22762286 
    22772287  // Send the person a notice if they were kicked 
    22782288  if (bPassed) 
    22792289  { 
    2280     SendBuffer(&buf, CHAT_KICKxYOU, (*iter)->nUin, false); 
     2290    SendBuffer(&buf, CHAT_KICKxYOU, voteId, false); 
    22812291    CloseClient(*userIter); 
    22822292  } 
     
    23212331    if (sz[0] != '\0') nPos += sprintf(&sz[nPos], ", "); 
    23222332    if ((*iter)->Name()[0] == '\0') 
    2323       nPos += sprintf(&sz[nPos], "%lu", (*iter)->Uin()); 
     2333      nPos += sprintf(&sz[nPos], "%s", (*iter)->Id()); 
    23242334    else 
    23252335      nPos += sprintf(&sz[nPos], "%s", (*iter)->Name()); 
     
    25012511 
    25022512  bool bSendIntIp = false; 
    2503   ICQUser *temp_user = gUserManager.FetchUser(rc->u->Uin(), LOCK_R); 
     2513  ICQUser* temp_user = gUserManager.FetchUser(rc->u->Id(), rc->u->PPID(), LOCK_R); 
    25042514  if (temp_user != NULL) 
    25052515  {