- The big forward port. I probably broke lots of stuff, so please look over any
[ircu2.10.12-pk.git] / ircd / m_away.c
index b926a6aa0c2b3b97d2e5d08bccb2be7a5a2d663a..8718f0718231ad1efbe35b8d0d5a64197305c542 100644 (file)
@@ -153,12 +153,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 {