]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
faxq: suppress blocked notifies if the job is already blocked
authorAidan Van Dyk <aidan@ifax.com>
Mon, 17 Sep 2007 19:34:41 +0000 (19:34 +0000)
committerAidan Van Dyk <aidan@ifax.com>
Mon, 17 Sep 2007 19:34:41 +0000 (19:34 +0000)
If a job is already blocked, the blocked notify has already happened, and
there is no need to re-run it.

faxd/faxQueueApp.c++

index 94b11be7f5e477c618d7c3f4b71405b1095b8ffb..5828f75c163f9b9aef13897ef8b7b6b84481755f 100644 (file)
@@ -2236,11 +2236,12 @@ faxQueueApp::rejectJob(Job& job, FaxRequest& req, const Status& r)
 void
 faxQueueApp::blockJob(Job& job, FaxRequest& req, const Status& r)
 {
+    int old_state = job.state;
     job.state = FaxRequest::state_blocked;
     req.result = r;
     updateRequest(req, job);
     traceQueue(job, "%s", r.string());
-    if (req.isNotify(FaxRequest::when_requeued))
+    if (req.isNotify(FaxRequest::when_requeued) && old_state != FaxRequest::state_blocked)
        notifySender(job, Job::blocked); 
     Trigger::post(Trigger::JOB_BLOCKED, job);
 }