gameServer/HWProtoInRoomState.hs
changeset 13709 54eb4c774ef5
parent 13708 2df519242d41
child 13710 aa1d71ca6c19
--- a/gameServer/HWProtoInRoomState.hs	Sun Aug 26 14:37:02 2018 +0200
+++ b/gameServer/HWProtoInRoomState.hs	Sun Aug 26 14:59:05 2018 +0200
@@ -433,8 +433,17 @@
 handleCmd_inRoom ["GREETING", msg] = do
     cl <- thisClient
     rm <- thisRoom
-    return [ModifyRoom (\r -> r{greeting = msg}) | isAdministrator cl || (isMaster cl && (not $ isSpecial rm))]
-
+    return $ if (not (isAdministrator cl || (isMaster cl && (not $ isSpecial rm)))) then
+                 [Warning $ loc "You're not the room master or a server admin!"]
+             else
+                 [ModifyRoom (\r -> r{greeting = msg}),
+                  AnswerClients [sendChan cl]
+                      ["CHAT", nickServer,
+                          if msg == "" then
+                              loc "Greeting message cleared."
+                          else
+                              loc "Greeting message set."
+                      ]]
 
 handleCmd_inRoom ["CALLVOTE"] = do
     cl <- thisClient