Changeset 6389 for trunk/rms

Show
Ignore:
Timestamp:
07/02/08 06:04:48 (5 months ago)
Author:
flynd
Message:

Some more uin function calls changed and added a missing free().

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/rms/src/rms.cpp

    r6379 r6389  
    794794  //XXX Handle the case when we have the owner 
    795795  if (szId == 0) 
    796     m_nUin = gUserManager.OwnerUin(); 
     796    m_nUin = strtoul(gUserManager.OwnerId(LICQ_PPID).c_str(), (char**)NULL, 10); 
    797797 
    798798  // Print the user info 
     
    14851485    fprintf(fs, "%d User not added\n", CODE_ADDUSERxERROR); 
    14861486  } 
    1487    
     1487 
     1488  free(szId); 
    14881489  return fflush(fs); 
    14891490} 
     
    15041505  if (nUin >= 10000) 
    15051506  { 
    1506     licqDaemon->RemoveUserFromList(nUin); 
     1507    licqDaemon->RemoveUserFromList(data_arg, LICQ_PPID); 
    15071508    fprintf(fs, "%d User removed\n", CODE_REMUSERxDONE); 
    15081509  } 
     
    15331534    return fflush(fs); 
    15341535  } 
    1535    
    1536  
    1537   if (isdigit(*data_arg)) 
    1538   { 
    1539     nUin = strtoul(data_arg, (char**)NULL, 10); 
    1540     while (*data_arg != '\0' && *data_arg != ' ') data_arg++; 
    1541     NEXT_WORD(data_arg); 
    1542   } 
    1543    else 
     1536 
     1537  if (!isdigit(*data_arg)) 
    15441538  { 
    15451539    fprintf(fs, "%d Invalid UIN.\n", CODE_INVALIDxUSER); 
    15461540    return fflush(fs); 
    15471541  } 
     1542  char* id = strdup(data_arg); 
     1543  nUin = strtoul(data_arg, (char**)NULL, 10); 
     1544  while (*data_arg != '\0' && *data_arg != ' ') data_arg++; 
     1545  NEXT_WORD(data_arg); 
    15481546 
    15491547  if (nUin < 10000) 
     
    15561554  { 
    15571555    fprintf(fs, "%d Opening secure connection.\n", CODE_SECURExOPEN); 
    1558     licqDaemon->icqOpenSecureChannel(nUin); 
     1556    licqDaemon->icqOpenSecureChannel(id); 
    15591557  } 
    15601558  else 
     
    15621560  { 
    15631561    fprintf(fs, "%d Closing secure connection.\n", CODE_SECURExCLOSE); 
    1564     licqDaemon->icqCloseSecureChannel(nUin); 
     1562    licqDaemon->icqCloseSecureChannel(id); 
    15651563  } 
    15661564  else 
    15671565  { 
    1568    ICQUser *u = gUserManager.FetchUser(nUin,LOCK_R); 
     1566    ICQUser* u = gUserManager.FetchUser(id, LICQ_PPID, LOCK_R); 
    15691567   if (u->Secure() == 0) 
    15701568   { 
     
    15771575   gUserManager.DropUser(u); 
    15781576  } 
    1579    
    1580   return fflush(fs); 
    1581 } 
     1577 
     1578  free(id); 
     1579  return fflush(fs); 
     1580}