FIX: record mqtt if connected with tunnel

Change-Id: I521b16d66e1a38e72b26c8528d17e6384c3a4555
This commit is contained in:
chunmao.guo 2023-05-31 19:50:49 +08:00 committed by Lane.Wei
parent 8a7d3f36a8
commit c5805588ac
2 changed files with 4 additions and 1 deletions

View file

@ -500,6 +500,7 @@ public:
int m_active_state = 0; // 0 - not active, 1 - active but print_sequence_id not valid, 1 - active but no update-to-date state, 2 - update-to-date int m_active_state = 0; // 0 - not active, 1 - active but print_sequence_id not valid, 1 - active but no update-to-date state, 2 - update-to-date
bool is_support_tunnel_mqtt = false; bool is_support_tunnel_mqtt = false;
int print_sequence_id = 0; int print_sequence_id = 0;
bool is_tunnel_mqtt = false;
/* ams properties */ /* ams properties */
std::map<std::string, Ams*> amsList; // key: ams[id], start with 0 std::map<std::string, Ams*> amsList; // key: ams[id], start with 0

View file

@ -1868,9 +1868,11 @@ void GUI_App::init_networking_callbacks()
GUI::wxGetApp().CallAfter([this, dev_id] { GUI::wxGetApp().CallAfter([this, dev_id] {
if (m_is_closing) if (m_is_closing)
return; return;
bool tunnel = boost::algorithm::starts_with(dev_id, "tunnel/");
/* request_pushing */ /* request_pushing */
MachineObject* obj = m_device_manager->get_my_machine(dev_id); MachineObject* obj = m_device_manager->get_my_machine(tunnel ? dev_id.substr(7) : dev_id);
if (obj) { if (obj) {
obj->is_tunnel_mqtt = tunnel;
obj->command_request_push_all(); obj->command_request_push_all();
obj->command_get_version(); obj->command_get_version();
} }