X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fm_away.c;h=ef440c19ab37a54009864dd76bdbbcf0cc5c897c;hb=refs%2Fheads%2Fupstream;hp=b926a6aa0c2b3b97d2e5d08bccb2be7a5a2d663a;hpb=42b168dd34dc62baa5821e2386fa0293366f3e6c;p=ircu2.10.12-pk.git diff --git a/ircd/m_away.c b/ircd/m_away.c index b926a6a..ef440c1 100644 --- a/ircd/m_away.c +++ b/ircd/m_away.c @@ -84,6 +84,7 @@ #include "client.h" #include "ircd.h" #include "ircd_alloc.h" +#include "ircd_log.h" #include "ircd_reply.h" #include "ircd_string.h" #include "msg.h" @@ -92,7 +93,7 @@ #include "s_user.h" #include "send.h" -#include +/* #include -- Now using assert in ircd_log.h */ #include /* @@ -141,7 +142,7 @@ static int user_set_away(struct User* user, char* message) /* - * m_away - generic message handler template + * m_away - generic message handler * - Added 14 Dec 1988 by jto. * * parv[0] = sender prefix @@ -153,12 +154,15 @@ static int user_set_away(struct User* user, char* message) int m_away(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { char* away_message = parv[1]; + int was_away = cli_user(sptr)->away != 0; assert(0 != cptr); assert(cptr == sptr); - if (user_set_away(cli_user(sptr), away_message)) { - sendcmdto_serv_butone(sptr, CMD_AWAY, cptr, ":%s", away_message); + if (user_set_away(cli_user(sptr), away_message)) + { + if (!was_away) + sendcmdto_serv_butone(sptr, CMD_AWAY, cptr, ":%s", away_message); send_reply(sptr, RPL_NOWAWAY); } else { @@ -169,7 +173,7 @@ int m_away(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) } /* - * ms_away - server message handler template + * ms_away - server message handler * - Added 14 Dec 1988 by jto. * * parv[0] = sender prefix