summaryrefslogtreecommitdiff
path: root/0001-Use-description-location-from-server-if-available-ot.patch
blob: 8cdf96ab1e8acfbb09f3270b6424d417816b3b32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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);