Skip to content

Commit 99e6b75

Browse files
authored
Merge pull request #493 from liamcottle/fix/cli-messages
Don't show CLI replies on display
2 parents 5489042 + 0914056 commit 99e6b75

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

examples/companion_radio/MyMesh.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,13 +319,17 @@ void MyMesh::queueMessage(const ContactInfo &from, uint8_t txt_type, mesh::Packe
319319
uint8_t frame[1];
320320
frame[0] = PUSH_CODE_MSG_WAITING; // send push 'tickle'
321321
_serial->writeFrame(frame, 1);
322-
} else {
323-
#ifdef DISPLAY_CLASS
324-
ui_task.soundBuzzer(UIEventType::contactMessage);
325-
#endif
326322
}
323+
327324
#ifdef DISPLAY_CLASS
328-
ui_task.newMsg(path_len, from.name, text, offline_queue_len);
325+
// we only want to show text messages on display, not cli data
326+
bool should_display = txt_type == TXT_TYPE_PLAIN || txt_type == TXT_TYPE_SIGNED_PLAIN;
327+
if (should_display) {
328+
ui_task.newMsg(path_len, from.name, text, offline_queue_len);
329+
if (!_serial->isConnected()) {
330+
ui_task.soundBuzzer(UIEventType::contactMessage);
331+
}
332+
}
329333
#endif
330334
}
331335

0 commit comments

Comments
 (0)