Show
Ignore:
Timestamp:
05/02/03 09:17:08 (6 years ago)
Author:
emostar
Message:

Support adding AIM contacts on the server to the local list

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/protocol_plugin_1_3_0/licq/src/icqd-srv.cpp

    r3473 r3478  
    28202820      nPacketCount = packet.UnpackUnsignedShortBE(); 
    28212821      nCount += nPacketCount; 
    2822        
     2822 
    28232823      for (unsigned short i = 0; i < nPacketCount; i++) 
    28242824      { 
    2825         char *szName; 
     2825        char *szId; 
    28262826        unsigned short nTag, nID, nType, nByteLen; 
    28272827 
    2828         // Can't use UnpackUinString because this may be a group name 
    2829         szName = packet.UnpackStringBE(); 
     2828        // Can't use UnpackUserString because this may be a group name 
     2829        szId = packet.UnpackStringBE(); 
    28302830        nTag = packet.UnpackUnsignedShortBE(); 
    28312831        nID = packet.UnpackUnsignedShortBE(); 
     
    28332833        nByteLen = packet.UnpackUnsignedShortBE(); 
    28342834 
    2835         char *szUnicodeName = gTranslator.FromUnicode(szName); 
     2835        char *szUnicodeName = gTranslator.FromUnicode(szId); 
    28362836 
    28372837        if (nByteLen) 
     
    28412841            gLog.Error("%sUnable to parse contact list TLV, aborting!\n", 
    28422842                                             L_ERRORxSTR); 
    2843             delete[] szName; 
     2843            delete[] szId; 
    28442844            return; 
    28452845          } 
     
    28572857            bool bAwaitingAuth = packet.hasTLV(0x0066); 
    28582858 
    2859             unsigned long nUin = atoi(szName); 
     2859            //unsigned long nUin = atoi(szName); 
    28602860            unsigned short nInGroup = gUserManager.GetGroupFromID(nTag); 
    28612861            bool isOnList = true; 
    2862             if (nUin && !gUserManager.IsOnList(nUin)) 
     2862            if (szId && !gUserManager.IsOnList(szId, LICQ_PPID)) 
    28632863            { 
    28642864              isOnList = false; 
    2865               AddUserToList(nUin, false); // Don't notify server 
     2865              AddUserToList(szId, LICQ_PPID, false); // Don't notify server 
    28662866            } 
    28672867 
    28682868            char *szUnicodeAlias = gTranslator.FromUnicode(szNewName); 
    28692869 
    2870             ICQUser *u = gUserManager.FetchUser(nUin, LOCK_W); 
     2870            ICQUser *u = gUserManager.FetchUser(szId, LICQ_PPID, LOCK_W); 
    28712871            if (u) 
    28722872            { 
     
    29232923            } 
    29242924 
    2925             gLog.Info("%sAdded %s (%ld) to list from server.\n", L_SRVxSTR, 
    2926               (szUnicodeAlias ? szUnicodeAlias : ""), nUin); 
     2925            gLog.Info("%sAdded %s (%s) to list from server.\n", L_SRVxSTR, 
     2926              (szUnicodeAlias ? szUnicodeAlias : ""), szId); 
    29272927            if (szUnicodeAlias) 
    29282928              delete [] szUnicodeAlias; 
     
    29372937          case ICQ_ROSTxGROUP: 
    29382938          { 
    2939             if (szName[0] != '\0') 
     2939            if (szId[0] != '\0') 
    29402940            { 
    29412941              // Rename the group if we have it already or else add it 
     
    29592959 
    29602960        packet.cleanupTLV(); 
    2961         delete[] szName; 
     2961        delete[] szId; 
    29622962      } // for count 
    29632963