s3: Lift the server_messaging_context from pjob_store_notify
authorVolker Lendecke <vl@samba.org>
Sun, 8 Aug 2010 14:50:17 +0000 (16:50 +0200)
committerVolker Lendecke <vl@samba.org>
Sun, 8 Aug 2010 16:09:36 +0000 (18:09 +0200)
source3/printing/printing.c

index 22330256a16c92ea0c620a4a950de01abea20212..f314c3342d1a3a516733d4da7c436add68900a90 100644 (file)
@@ -557,7 +557,10 @@ static uint32 map_to_spoolss_status(uint32 lpq_status)
        return 0;
 }
 
-static void pjob_store_notify(const char* sharename, uint32 jobid, struct printjob *old_data,
+static void pjob_store_notify(struct tevent_context *ev,
+                             struct messaging_context *msg_ctx,
+                             const char* sharename, uint32 jobid,
+                             struct printjob *old_data,
                              struct printjob *new_data)
 {
        bool new_job = False;
@@ -576,41 +579,34 @@ static void pjob_store_notify(const char* sharename, uint32 jobid, struct printj
           --jerry (i'll feel dirty for this) */
 
        if (new_job) {
-               notify_job_submitted(server_event_context(),
-                                    server_messaging_context(),
+               notify_job_submitted(ev, msg_ctx,
                                     sharename, jobid, new_data->starttime);
-               notify_job_username(server_event_context(),
-                                   server_messaging_context(),
+               notify_job_username(ev, msg_ctx,
                                    sharename, jobid, new_data->user);
        }
 
        if (new_job || !strequal(old_data->jobname, new_data->jobname))
-               notify_job_name(server_event_context(),
-                               server_messaging_context(),
+               notify_job_name(ev, msg_ctx,
                                sharename, jobid, new_data->jobname);
 
        /* Job attributes of a new job or attributes that can be
           modified. */
 
        if (new_job || !strequal(old_data->jobname, new_data->jobname))
-               notify_job_name(server_event_context(),
-                               server_messaging_context(),
+               notify_job_name(ev, msg_ctx,
                                sharename, jobid, new_data->jobname);
 
        if (new_job || old_data->status != new_data->status)
-               notify_job_status(server_event_context(),
-                                 server_messaging_context(),
+               notify_job_status(ev, msg_ctx,
                                  sharename, jobid,
                                  map_to_spoolss_status(new_data->status));
 
        if (new_job || old_data->size != new_data->size)
-               notify_job_total_bytes(server_event_context(),
-                                      server_messaging_context(),
+               notify_job_total_bytes(ev, msg_ctx,
                                       sharename, jobid, new_data->size);
 
        if (new_job || old_data->page_count != new_data->page_count)
-               notify_job_total_pages(server_event_context(),
-                                      server_messaging_context(),
+               notify_job_total_pages(ev, msg_ctx,
                                       sharename, jobid, new_data->page_count);
 }
 
@@ -688,13 +684,18 @@ static bool pjob_store(const char* sharename, uint32 jobid, struct printjob *pjo
                {
                        if ( unpack_pjob( old_data.dptr, old_data.dsize, &old_pjob ) != -1 )
                        {
-                               pjob_store_notify( sharename, jobid, &old_pjob , pjob );
+                               pjob_store_notify(server_event_context(),
+                                                 server_messaging_context(),
+                                                 sharename, jobid, &old_pjob,
+                                                 pjob);
                                talloc_free(old_pjob.devmode);
                        }
                }
                else {
                        /* new job */
-                       pjob_store_notify( sharename, jobid, NULL, pjob );
+                       pjob_store_notify(server_event_context(),
+                                         server_messaging_context(),
+                                         sharename, jobid, NULL, pjob);
                }
        }