cups-filters/0001-Use-description-location-from-server-if-available-ot.patch

30 lines
1.3 KiB
Diff

diff --git a/utils/cups-browsed.c b/utils/cups-browsed.c
index d4396d7..6dba2ed 100644
--- a/utils/cups-browsed.c
+++ b/utils/cups-browsed.c
@@ -8793,6 +8793,10 @@ gboolean update_cups_queues(gpointer unused) {
IPP_PRINTER_IDLE);
/* ... and accepting jobs */
ippAddBoolean(request, IPP_TAG_PRINTER, "printer-is-accepting-jobs", 1);
+ // Location (only if the remote server actually provides a location string)
+ if (p->location && p->location[0])
+ ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_TEXT,
+ "printer-location", NULL, p->location);
num_options = 0;
options = NULL;
/* Device URI: ipp(s)://<remote host>:631/printers/<remote queue>
@@ -8808,6 +8812,13 @@ gboolean update_cups_queues(gpointer unused) {
num_options = cupsAddOption(p->options[i].name,
p->options[i].value,
num_options, &options);
+
+ // Description (only if the remote server actually provides a description
+ // string)
+ if (p->info && p->info[0])
+ num_options = cupsAddOption("printer-info", p->info,
+ num_options, &options);
+
/* Encode option list into IPP attributes */
cupsEncodeOptions2(request, num_options, options, IPP_TAG_OPERATION);
cupsEncodeOptions2(request, num_options, options, IPP_TAG_PRINTER);