Changeset 6315

Show
Ignore:
Timestamp:
06/16/08 09:26:35 (4 months ago)
Author:
eugene
Message:

Fixed user addition algorithm.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/qt4-gui/src/dialogs/adduserdlg.cpp

    r6313 r6315  
    9999  if (!id.isEmpty()) 
    100100  { 
    101     ICQUser* u = gUserManager.FetchUser(id, ppid, LOCK_W); 
     101    ICQUser* u = gUserManager.FetchUser(id, ppid, LOCK_R); 
    102102 
    103103    if (u == NULL) 
    104       added = gLicqDaemon->AddUserToList(id, ppid); 
     104      added = gLicqDaemon->AddUserToList(id, ppid, true, false, group); 
    105105    else 
    106106    { 
    107107      if (u->NotInList()) 
    108108      { 
     109        u->Unlock(); 
     110        gUserManager.SetUserInGroup(id, ppid, GROUPS_USER, group, true, true); 
     111        u->Lock(LOCK_W); 
    109112        u->SetPermanent(); 
    110113        added = true; 
     
    114117  } 
    115118 
    116   if (added) 
    117   { 
    118     gUserManager.SetUserInGroup(id, ppid, GROUPS_USER, group, true, true); 
    119     if (notify && ppid == LICQ_PPID) 
    120       gLicqDaemon->icqAlertUser(id, ppid); 
    121   } 
     119  if (added && notify) 
     120    gLicqDaemon->icqAlertUser(id, ppid); 
    122121 
    123122  close();