+
+GLOBAL void
+Client_SetUser( CLIENT *Client, const char *User, bool Idented )
+{
+ /* set clients username */
+
+ assert( Client != NULL );
+ assert( User != NULL );
+
+ if (Idented) {
+ strlcpy(Client->user, User, sizeof(Client->user));
+ } else {
+ Client->user[0] = '~';
+ strlcpy(Client->user + 1, User, sizeof(Client->user) - 1);
+ }
+} /* Client_SetUser */
+
+
+GLOBAL void
+Client_SetInfo( CLIENT *Client, const char *Info )
+{
+ /* set client hostname */
+
+ assert( Client != NULL );
+ assert( Info != NULL );
+
+ strlcpy(Client->info, Info, sizeof(Client->info));
+} /* Client_SetInfo */
+
+
+GLOBAL void
+Client_SetModes( CLIENT *Client, const char *Modes )
+{
+ assert( Client != NULL );
+ assert( Modes != NULL );
+
+ strlcpy(Client->modes, Modes, sizeof( Client->modes ));
+} /* Client_SetModes */
+
+
+GLOBAL void
+Client_SetFlags( CLIENT *Client, const char *Flags )
+{
+ assert( Client != NULL );
+ assert( Flags != NULL );
+
+ strlcpy(Client->flags, Flags, sizeof(Client->flags));
+} /* Client_SetFlags */
+
+
+GLOBAL void
+Client_SetPassword( CLIENT *Client, const char *Pwd )
+{
+ /* set password sent by client */
+
+ assert( Client != NULL );
+ assert( Pwd != NULL );
+
+ strlcpy(Client->pwd, Pwd, sizeof(Client->pwd));
+} /* Client_SetPassword */
+
+
+GLOBAL void
+Client_SetAway( CLIENT *Client, const char *Txt )
+{
+ /* Set AWAY reason of client */
+
+ assert( Client != NULL );
+ assert( Txt != NULL );
+
+ strlcpy( Client->away, Txt, sizeof( Client->away ));
+ LogDebug("%s \"%s\" is away: %s", Client_TypeText(Client),
+ Client_Mask(Client), Txt);
+} /* Client_SetAway */
+
+
+GLOBAL void
+Client_SetType( CLIENT *Client, int Type )
+{
+ assert( Client != NULL );
+ Client->type = Type;
+ if( Type == CLIENT_SERVER ) Generate_MyToken( Client );
+ Adjust_Counters( Client );
+} /* Client_SetType */
+
+
+GLOBAL void
+Client_SetHops( CLIENT *Client, int Hops )
+{
+ assert( Client != NULL );
+ Client->hops = Hops;
+} /* Client_SetHops */
+
+
+GLOBAL void
+Client_SetToken( CLIENT *Client, int Token )
+{
+ assert( Client != NULL );
+ Client->token = Token;
+} /* Client_SetToken */
+
+
+GLOBAL void
+Client_SetIntroducer( CLIENT *Client, CLIENT *Introducer )
+{
+ assert( Client != NULL );
+ assert( Introducer != NULL );
+ Client->introducer = Introducer;
+} /* Client_SetIntroducer */
+
+
+GLOBAL void
+Client_SetOperByMe( CLIENT *Client, bool OperByMe )
+{
+ assert( Client != NULL );
+ Client->oper_by_me = OperByMe;
+} /* Client_SetOperByMe */
+
+
+GLOBAL bool
+Client_ModeAdd( CLIENT *Client, char Mode )
+{
+ /* Set Mode.
+ * If Client already alread had Mode, return false.
+ * If the Mode was newly set, return true.
+ */
+
+ char x[2];
+
+ assert( Client != NULL );
+
+ x[0] = Mode; x[1] = '\0';
+ if (!strchr( Client->modes, x[0])) {
+ strlcat( Client->modes, x, sizeof( Client->modes ));
+ return true;
+ }
+ else return false;
+} /* Client_ModeAdd */
+
+
+GLOBAL bool
+Client_ModeDel( CLIENT *Client, char Mode )
+{
+ /* Delete Mode.
+ * If Mode was removed, return true.
+ * If Client did not have Mode, return false.
+ */
+
+ char x[2], *p;
+
+ assert( Client != NULL );
+
+ x[0] = Mode; x[1] = '\0';
+
+ p = strchr( Client->modes, x[0] );
+ if( ! p ) return false;
+
+ /* Client has Mode -> delete */
+ while( *p )