| 286 | | gUserManager.SetUserInGroup(dropId.toLatin1(), dropPpid, GROUPS_USER, gid, true); |
| | 286 | { |
| | 287 | bool moveUser = Config::ContactList::instance()->dragMovesUser(); |
| | 288 | gUserManager.SetUserInGroup(dropId.toLatin1(), dropPpid, GROUPS_USER, gid, true, moveUser); |
| | 289 | |
| | 290 | // If we are moving user we now need to remove it from the old group. |
| | 291 | // However, since the drop event doesn't contain the originating |
| | 292 | // group, we don't know which group that is so we'll just have to |
| | 293 | // remove the user from all other groups. |
| | 294 | if (moveUser) |
| | 295 | { |
| | 296 | const ICQUser* u = gUserManager.FetchUser(dropId.toLatin1(), dropPpid, LOCK_R); |
| | 297 | if (u != NULL) |
| | 298 | { |
| | 299 | UserGroupList userGroups = u->GetGroups(); |
| | 300 | gUserManager.DropUser(u); |
| | 301 | |
| | 302 | UserGroupList::const_iterator i; |
| | 303 | for (i = userGroups.begin(); i != userGroups.end(); ++i) |
| | 304 | if (*i != gid) |
| | 305 | gUserManager.SetUserInGroup(dropId.toLatin1(), dropPpid, GROUPS_USER, *i, false, false); |
| | 306 | } |
| | 307 | } |
| | 308 | } |