From 07d3cc5d153d4a07419b8ab3404ccd3cc35d2ab1 Mon Sep 17 00:00:00 2001 From: fufesou Date: Wed, 12 Mar 2025 23:32:26 +0800 Subject: [PATCH] Feat. Remote printer. Signed-off-by: fufesou --- protos/message.proto | 40 ++++++++++++++++++++++++++++++++++++++++ src/config.rs | 4 ++++ 2 files changed, 44 insertions(+) diff --git a/protos/message.proto b/protos/message.proto index 741d24d..b35b783 100644 --- a/protos/message.proto +++ b/protos/message.proto @@ -69,6 +69,10 @@ message OSLogin { string password = 2; } +message ClientFeature { + bool printer = 1; +} + message LoginRequest { string username = 1; bytes password = 2; @@ -86,6 +90,7 @@ message LoginRequest { OSLogin os_login = 12; string my_platform = 13; bytes hwid = 14; + string platform_additions = 16; } message Auth2FA { @@ -843,6 +848,40 @@ message VoiceCallResponse { int64 ack_timestamp = 3; } +message PrinterRequest { + int32 id = 1; +} + +message PrinterResponse { + int32 id = 1; + bool accepted = 2; +} + +message PrinterBlock { + int32 id = 1; + bytes data = 2; + bool compressed = 3; +} + +message PrinterDone { + int32 id = 1; +} + +message PrinterError { + int32 id = 1; + string error = 2; +} + +message Printer { + oneof union { + PrinterRequest printer_request = 1; + PrinterResponse printer_response = 2; + PrinterBlock printer_block = 3; + PrinterDone printer_done = 4; + PrinterError printer_error = 5; + } +} + message Message { oneof union { SignedId signed_id = 3; @@ -871,5 +910,6 @@ message Message { PointerDeviceEvent pointer_device_event = 26; Auth2FA auth_2fa = 27; MultiClipboards multi_clipboards = 28; + Printer printer = 29; } } diff --git a/src/config.rs b/src/config.rs index ce2c75e..a2cc179 100644 --- a/src/config.rs +++ b/src/config.rs @@ -2378,6 +2378,10 @@ pub mod keys { pub const OPTION_FLUTTER_CURRENT_AB_NAME: &str = "current-ab-name"; pub const OPTION_ALLOW_REMOTE_CM_MODIFICATION: &str = "allow-remote-cm-modification"; + pub const OPTION_PRINTER_INCOMING_JOB_ACTION: &str = "printer-incomming-job-action"; + pub const OPTION_PRINTER_ALLOW_AUTO_PRINT: &str = "allow-printer-auto-print"; + pub const OPTION_PRINTER_SELECTED_NAME: &str = "printer-selected-name"; + // android floating window options pub const OPTION_DISABLE_FLOATING_WINDOW: &str = "disable-floating-window"; pub const OPTION_FLOATING_WINDOW_SIZE: &str = "floating-window-size";