mirror of
https://github.com/osmarks/ngircd.git
synced 2025-01-15 18:15:40 +00:00
- IRC-Befehl "AWAY" implementert.
This commit is contained in:
parent
83177581e4
commit
949977e878
@ -9,11 +9,14 @@
|
|||||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||||
*
|
*
|
||||||
* $Id: irc.c,v 1.77 2002/02/27 17:05:41 alex Exp $
|
* $Id: irc.c,v 1.78 2002/02/27 18:23:45 alex Exp $
|
||||||
*
|
*
|
||||||
* irc.c: IRC-Befehle
|
* irc.c: IRC-Befehle
|
||||||
*
|
*
|
||||||
* $Log: irc.c,v $
|
* $Log: irc.c,v $
|
||||||
|
* Revision 1.78 2002/02/27 18:23:45 alex
|
||||||
|
* - IRC-Befehl "AWAY" implementert.
|
||||||
|
*
|
||||||
* Revision 1.77 2002/02/27 17:05:41 alex
|
* Revision 1.77 2002/02/27 17:05:41 alex
|
||||||
* - PRIVMSG beachtet nun die Channel-Modes "n" und "m".
|
* - PRIVMSG beachtet nun die Channel-Modes "n" und "m".
|
||||||
*
|
*
|
||||||
@ -1382,6 +1385,14 @@ GLOBAL BOOLEAN IRC_MODE( CLIENT *Client, REQUEST *Req )
|
|||||||
/* Befehl kommt von einem Server, daher
|
/* Befehl kommt von einem Server, daher
|
||||||
* trauen wir ihm "unbesehen" ... */
|
* trauen wir ihm "unbesehen" ... */
|
||||||
x[0] = *mode_ptr;
|
x[0] = *mode_ptr;
|
||||||
|
|
||||||
|
if(( cl ) && ( x[0] == 'a' ))
|
||||||
|
{
|
||||||
|
/* away */
|
||||||
|
if( set ) Client_SetAway( cl, "Away" );
|
||||||
|
else Client_SetAway( cl, NULL );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1467,7 +1478,7 @@ GLOBAL BOOLEAN IRC_MODE( CLIENT *Client, REQUEST *Req )
|
|||||||
x[0] = 'p';
|
x[0] = 'p';
|
||||||
break;
|
break;
|
||||||
case 'q':
|
case 'q':
|
||||||
/* Quite */
|
/* Quiet */
|
||||||
x[0] = 'q';
|
x[0] = 'q';
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
@ -1605,6 +1616,33 @@ GLOBAL BOOLEAN IRC_MODE( CLIENT *Client, REQUEST *Req )
|
|||||||
} /* IRC_MODE */
|
} /* IRC_MODE */
|
||||||
|
|
||||||
|
|
||||||
|
GLOBAL BOOLEAN IRC_AWAY( CLIENT *Client, REQUEST *Req )
|
||||||
|
{
|
||||||
|
assert( Client != NULL );
|
||||||
|
assert( Req != NULL );
|
||||||
|
|
||||||
|
if( Client_Type( Client ) != CLIENT_USER ) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client ));
|
||||||
|
|
||||||
|
/* Falsche Anzahl Parameter? */
|
||||||
|
if( Req->argc > 1 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
|
||||||
|
|
||||||
|
if(( Req->argc == 1 ) && (Req->argv[0][0] ))
|
||||||
|
{
|
||||||
|
/* AWAY setzen */
|
||||||
|
Client_SetAway( Client, Req->argv[0] );
|
||||||
|
IRC_WriteStrServersPrefix( Client, Client, "MODE %s :+a", Client_ID( Client ));
|
||||||
|
return IRC_WriteStrClient( Client, RPL_NOWAWAY_MSG, Client_ID( Client ));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* AWAY loeschen */
|
||||||
|
Client_SetAway( Client, NULL );
|
||||||
|
IRC_WriteStrServersPrefix( Client, Client, "MODE %s :-a", Client_ID( Client ));
|
||||||
|
return IRC_WriteStrClient( Client, RPL_UNAWAY_MSG, Client_ID( Client ));
|
||||||
|
}
|
||||||
|
} /* IRC_AWAY */
|
||||||
|
|
||||||
|
|
||||||
GLOBAL BOOLEAN IRC_OPER( CLIENT *Client, REQUEST *Req )
|
GLOBAL BOOLEAN IRC_OPER( CLIENT *Client, REQUEST *Req )
|
||||||
{
|
{
|
||||||
INT i;
|
INT i;
|
||||||
@ -1905,6 +1943,12 @@ GLOBAL BOOLEAN IRC_WHOIS( CLIENT *Client, REQUEST *Req )
|
|||||||
if( ! IRC_WriteStrClient( from, RPL_WHOISIDLE_MSG, Client_ID( from ), Client_ID( c ), Conn_GetIdle( Client_Conn ( c )))) return DISCONNECTED;
|
if( ! IRC_WriteStrClient( from, RPL_WHOISIDLE_MSG, Client_ID( from ), Client_ID( c ), Conn_GetIdle( Client_Conn ( c )))) return DISCONNECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Away? */
|
||||||
|
if( Client_HasMode( c, 'a' ))
|
||||||
|
{
|
||||||
|
if( ! IRC_WriteStrClient( from, RPL_AWAY_MSG, Client_ID( from ), Client_ID( c ), Client_Away( c ))) return DISCONNECTED;
|
||||||
|
}
|
||||||
|
|
||||||
/* End of Whois */
|
/* End of Whois */
|
||||||
return IRC_WriteStrClient( from, RPL_ENDOFWHOIS_MSG, Client_ID( from ), Client_ID( c ));
|
return IRC_WriteStrClient( from, RPL_ENDOFWHOIS_MSG, Client_ID( from ), Client_ID( c ));
|
||||||
} /* IRC_WHOIS */
|
} /* IRC_WHOIS */
|
||||||
|
@ -9,11 +9,14 @@
|
|||||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||||
*
|
*
|
||||||
* $Id: irc.h,v 1.24 2002/02/23 21:39:48 alex Exp $
|
* $Id: irc.h,v 1.25 2002/02/27 18:23:46 alex Exp $
|
||||||
*
|
*
|
||||||
* irc.h: IRC-Befehle (Header)
|
* irc.h: IRC-Befehle (Header)
|
||||||
*
|
*
|
||||||
* $Log: irc.h,v $
|
* $Log: irc.h,v $
|
||||||
|
* Revision 1.25 2002/02/27 18:23:46 alex
|
||||||
|
* - IRC-Befehl "AWAY" implementert.
|
||||||
|
*
|
||||||
* Revision 1.24 2002/02/23 21:39:48 alex
|
* Revision 1.24 2002/02/23 21:39:48 alex
|
||||||
* - IRC-Befehl KILL sowie Kills bei Nick Collsisions implementiert.
|
* - IRC-Befehl KILL sowie Kills bei Nick Collsisions implementiert.
|
||||||
*
|
*
|
||||||
@ -134,6 +137,7 @@ GLOBAL BOOLEAN IRC_PRIVMSG( CLIENT *Client, REQUEST *Req );
|
|||||||
GLOBAL BOOLEAN IRC_NOTICE( CLIENT *Client, REQUEST *Req );
|
GLOBAL BOOLEAN IRC_NOTICE( CLIENT *Client, REQUEST *Req );
|
||||||
|
|
||||||
GLOBAL BOOLEAN IRC_MODE( CLIENT *Client, REQUEST *Req );
|
GLOBAL BOOLEAN IRC_MODE( CLIENT *Client, REQUEST *Req );
|
||||||
|
GLOBAL BOOLEAN IRC_AWAY( CLIENT *Client, REQUEST *Req );
|
||||||
|
|
||||||
GLOBAL BOOLEAN IRC_NAMES( CLIENT *Client, REQUEST *Req );
|
GLOBAL BOOLEAN IRC_NAMES( CLIENT *Client, REQUEST *Req );
|
||||||
GLOBAL BOOLEAN IRC_ISON( CLIENT *Client, REQUEST *Req );
|
GLOBAL BOOLEAN IRC_ISON( CLIENT *Client, REQUEST *Req );
|
||||||
|
@ -9,11 +9,14 @@
|
|||||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||||
*
|
*
|
||||||
* $Id: parse.c,v 1.25 2002/02/26 20:52:15 alex Exp $
|
* $Id: parse.c,v 1.26 2002/02/27 18:23:46 alex Exp $
|
||||||
*
|
*
|
||||||
* parse.c: Parsen der Client-Anfragen
|
* parse.c: Parsen der Client-Anfragen
|
||||||
*
|
*
|
||||||
* $Log: parse.c,v $
|
* $Log: parse.c,v $
|
||||||
|
* Revision 1.26 2002/02/27 18:23:46 alex
|
||||||
|
* - IRC-Befehl "AWAY" implementert.
|
||||||
|
*
|
||||||
* Revision 1.25 2002/02/26 20:52:15 alex
|
* Revision 1.25 2002/02/26 20:52:15 alex
|
||||||
* - Fehler bei Fehlermeldung wg. unbekanntem Prefix behoben.
|
* - Fehler bei Fehlermeldung wg. unbekanntem Prefix behoben.
|
||||||
*
|
*
|
||||||
@ -378,6 +381,7 @@ LOCAL BOOLEAN Handle_Request( CONN_ID Idx, REQUEST *Req )
|
|||||||
else if( strcasecmp( Req->command, "PART" ) == 0 ) return IRC_PART( client, Req );
|
else if( strcasecmp( Req->command, "PART" ) == 0 ) return IRC_PART( client, Req );
|
||||||
else if( strcasecmp( Req->command, "VERSION" ) == 0 ) return IRC_VERSION( client, Req );
|
else if( strcasecmp( Req->command, "VERSION" ) == 0 ) return IRC_VERSION( client, Req );
|
||||||
else if( strcasecmp( Req->command, "KILL" ) == 0 ) return IRC_KILL( client, Req );
|
else if( strcasecmp( Req->command, "KILL" ) == 0 ) return IRC_KILL( client, Req );
|
||||||
|
else if( strcasecmp( Req->command, "AWAY" ) == 0 ) return IRC_AWAY( client, Req );
|
||||||
|
|
||||||
/* Unbekannter Befehl */
|
/* Unbekannter Befehl */
|
||||||
if( Client_Type( client ) != CLIENT_SERVER ) IRC_WriteStrClient( client, ERR_UNKNOWNCOMMAND_MSG, Client_ID( client ), Req->command );
|
if( Client_Type( client ) != CLIENT_SERVER ) IRC_WriteStrClient( client, ERR_UNKNOWNCOMMAND_MSG, Client_ID( client ), Req->command );
|
||||||
|
Loading…
Reference in New Issue
Block a user