Send ticket change notifications even if status doesn't change
[bpt/portal.git] / request.sml
index 8e3dbc5..e3a6dec 100644 (file)
@@ -147,12 +147,17 @@ val statusToString =
      | REJECTED => "Rejected"
 
 fun notifyMod (oldStatus, newStatus, changer, req) =
-    notify (fn (_, mail) =>
-              (Mail.mwrite (mail, changer);
-               Mail.mwrite (mail, " has changed the status of this request from ");
-               Mail.mwrite (mail, statusToString oldStatus);
-               Mail.mwrite (mail, " to ");
-               Mail.mwrite (mail, statusToString newStatus);
-               Mail.mwrite (mail, ".\n\n"))) req
+    if oldStatus = newStatus then
+       notify (fn (_, mail) =>
+                  (Mail.mwrite (mail, changer);
+                   Mail.mwrite (mail, " has added a comment to this request.\n\n"))) req
+    else
+       notify (fn (_, mail) =>
+                  (Mail.mwrite (mail, changer);
+                   Mail.mwrite (mail, " has changed the status of this request from ");
+                   Mail.mwrite (mail, statusToString oldStatus);
+                   Mail.mwrite (mail, " to ");
+                   Mail.mwrite (mail, statusToString newStatus);
+                   Mail.mwrite (mail, ".\n\n"))) req
                
 end