+ // first part the user from all chans theyre on, so things dont get messy
+ for (unsigned int i = 0; i < user->chans.size(); i++)
+ {
+ if (user->chans[i].channel != NULL)
+ {
+ if (user->chans[i].channel->name)
+ {
+ Srv->PartUserFromChannel(user,user->chans[i].channel->name,"Unparking");
+ }
+ }
+ }
+ // remove all their old modes
+ WriteServ(user->fd,"MODE %s -%s",user->nick,user->modes);
+ // now, map them to the parked user, while nobody can see :p
+ Srv->PseudoToUser(user,unpark,"Unparked to "+std::string(parameters[0]));
+ // set all their new modes
+ WriteServ(unpark->fd,"MODE %s +%s",unpark->nick,unpark->modes);
+ // spool their away log to them
+ WriteServ(unpark->fd,"NOTICE %s :*** You are now unparked. You have successfully taken back the nickname and privilages of %s.",unpark->nick,unpark->nick);
+ for (awaylog::iterator i = awy->begin(); i != awy->end(); i++)
+ {
+ char timebuf[MAXBUF];
+ tm *timeinfo = localtime(&i->tm);
+ strlcpy(timebuf,asctime(timeinfo),MAXBUF);
+ timebuf[strlen(timebuf)-1] = '\0';
+ WriteServ(unpark->fd,"NOTICE %s :From %s at %s: \2%s\2",unpark->nick,i->from.c_str(),timebuf,i->text.c_str());
+ }
+ delete awy;
+ unpark->Shrink("park_awaylog");
+ unpark->Shrink("park_key");
+ for (parkinfo::iterator j = pinfo.begin(); j != pinfo.end(); j++)