]> arthur.barton.de Git - ngircd.git/commitdiff
- Changed semantics of Client_SetAway() [from HEAD].
authorAlexander Barton <alex@barton.de>
Wed, 8 Jan 2003 23:09:04 +0000 (23:09 +0000)
committerAlexander Barton <alex@barton.de>
Wed, 8 Jan 2003 23:09:04 +0000 (23:09 +0000)
src/ngircd/client.c

index 3b265fd8b7fe1ab27fbb5c7c9b9240f6f9acb9c7..2a4bf3f3222191ae21fd3256a4b03516be6c7e1f 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: client.c,v 1.65.2.1 2002/12/22 23:42:28 alex Exp $";
+static char UNUSED id[] = "$Id: client.c,v 1.65.2.2 2003/01/08 23:09:04 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -394,24 +394,13 @@ Client_SetPassword( CLIENT *Client, CHAR *Pwd )
 GLOBAL VOID
 Client_SetAway( CLIENT *Client, CHAR *Txt )
 {
-       /* Von einem Client gelieferte AWAY-Nachricht */
-
+       /* Set AWAY reason of client */
+       
        assert( Client != NULL );
+       assert( Txt != NULL );
 
-       if( Txt )
-       {
-               /* Client AWAY setzen */
-               strncpy( Client->away, Txt, CLIENT_AWAY_LEN - 1 );
-               Client->away[CLIENT_AWAY_LEN - 1] = '\0';
-               Client_ModeAdd( Client, 'a' );
-               Log( LOG_DEBUG, "User \"%s\" is away: %s", Client_Mask( Client ), Txt );
-       }
-       else
-       {
-               /* AWAY loeschen */
-               Client_ModeDel( Client, 'a' );
-               Log( LOG_DEBUG, "User \"%s\" is no longer away.", Client_Mask( Client ));
-       }
+       strlcpy( Client->away, Txt, sizeof( Client->away ));
+       Log( LOG_DEBUG, "User \"%s\" is away: %s", Client_Mask( Client ), Txt );
 } /* Client_SetAway */