]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Add document-format-preferred and include image/urf in the TXT record.
authorMichael R Sweet <msweet@msweet.org>
Mon, 8 Mar 2021 00:46:26 +0000 (19:46 -0500)
committerMichael R Sweet <msweet@msweet.org>
Mon, 8 Mar 2021 00:46:26 +0000 (19:46 -0500)
scheduler/printers.c

index 306ebfb363cc56bde5c640be324fb1e1e751234f..4f5b60e2999af76025612ba98f77c55e339ec0c3 100644 (file)
@@ -3610,6 +3610,8 @@ add_printer_formats(cupsd_printer_t *p)   /* I - Printer */
   ipp_attribute_t *attr;               /* document-format-supported attribute */
   char         mimetype[MIME_MAX_SUPER + MIME_MAX_TYPE + 2];
                                        /* MIME type name */
+  const char   *preferred = "image/urf";
+                                       /* document-format-preferred value */
 
 
  /*
@@ -3655,6 +3657,9 @@ add_printer_formats(cupsd_printer_t *p)   /* I - Printer */
 
       cupsArrayDelete(filters);
       cupsArrayAdd(p->filetypes, type);
+
+      if (!strcasecmp(mimetype, "application/pdf"))
+        preferred = "application/pdf";
     }
     else
       cupsdLogMessage(CUPSD_LOG_DEBUG2,
@@ -3692,6 +3697,8 @@ add_printer_formats(cupsd_printer_t *p)   /* I - Printer */
     attr->values[i].string.text = _cupsStrAlloc(mimetype);
   }
 
+  ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_MIMETYPE), "document-format-preferred", NULL, preferred);
+
 #ifdef HAVE_DNSSD
   {
     char               pdl[1024];      /* Buffer to build pdl list */
@@ -3739,6 +3746,8 @@ add_printer_formats(cupsd_printer_t *p)   /* I - Printer */
          strlcat(pdl, "image/png,", sizeof(pdl));
        else if (!_cups_strcasecmp(type->type, "pwg-raster"))
          strlcat(pdl, "image/pwg-raster,", sizeof(pdl));
+       else if (!_cups_strcasecmp(type->type, "urf"))
+         strlcat(pdl, "image/urf,", sizeof(pdl));
       }
     }