mirror of
https://github.com/meshtastic/firmware.git
synced 2025-07-30 02:15:41 +00:00
Fix for reply function to remember last messaged
This commit is contained in:
parent
5f583fed0a
commit
37bc831849
@ -66,16 +66,18 @@ CannedMessageModule::CannedMessageModule()
|
|||||||
|
|
||||||
void CannedMessageModule::LaunchWithDestination(NodeNum newDest, uint8_t newChannel)
|
void CannedMessageModule::LaunchWithDestination(NodeNum newDest, uint8_t newChannel)
|
||||||
{
|
{
|
||||||
if (!lastDestSet) {
|
// Use the requested destination, unless it's "broadcast" and we have a previous node/channel
|
||||||
dest = NODENUM_BROADCAST;
|
if (newDest == NODENUM_BROADCAST && lastDestSet) {
|
||||||
channel = 0;
|
newDest = lastDest;
|
||||||
lastDest = dest;
|
newChannel = lastChannel;
|
||||||
lastChannel = channel;
|
|
||||||
lastDestSet = true;
|
|
||||||
} else {
|
|
||||||
dest = lastDest;
|
|
||||||
channel = lastChannel;
|
|
||||||
}
|
}
|
||||||
|
dest = newDest;
|
||||||
|
channel = newChannel;
|
||||||
|
lastDest = dest;
|
||||||
|
lastChannel = channel;
|
||||||
|
lastDestSet = true;
|
||||||
|
|
||||||
|
// Rest of function unchanged...
|
||||||
// Always select the first real canned message on activation
|
// Always select the first real canned message on activation
|
||||||
int firstRealMsgIdx = 0;
|
int firstRealMsgIdx = 0;
|
||||||
for (int i = 0; i < messagesCount; ++i) {
|
for (int i = 0; i < messagesCount; ++i) {
|
||||||
@ -95,10 +97,28 @@ void CannedMessageModule::LaunchWithDestination(NodeNum newDest, uint8_t newChan
|
|||||||
notifyObservers(&e);
|
notifyObservers(&e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CannedMessageModule::LaunchRepeatDestination()
|
||||||
|
{
|
||||||
|
if (!lastDestSet) {
|
||||||
|
LaunchWithDestination(NODENUM_BROADCAST, 0);
|
||||||
|
} else {
|
||||||
|
LaunchWithDestination(lastDest, lastChannel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CannedMessageModule::LaunchFreetextWithDestination(NodeNum newDest, uint8_t newChannel)
|
void CannedMessageModule::LaunchFreetextWithDestination(NodeNum newDest, uint8_t newChannel)
|
||||||
{
|
{
|
||||||
|
// Use the requested destination, unless it's "broadcast" and we have a previous node/channel
|
||||||
|
if (newDest == NODENUM_BROADCAST && lastDestSet) {
|
||||||
|
newDest = lastDest;
|
||||||
|
newChannel = lastChannel;
|
||||||
|
}
|
||||||
dest = newDest;
|
dest = newDest;
|
||||||
channel = newChannel;
|
channel = newChannel;
|
||||||
|
lastDest = dest;
|
||||||
|
lastChannel = channel;
|
||||||
|
lastDestSet = true;
|
||||||
|
|
||||||
runState = CANNED_MESSAGE_RUN_STATE_FREETEXT;
|
runState = CANNED_MESSAGE_RUN_STATE_FREETEXT;
|
||||||
requestFocus();
|
requestFocus();
|
||||||
UIFrameEvent e;
|
UIFrameEvent e;
|
||||||
|
@ -59,6 +59,7 @@ class CannedMessageModule : public SinglePortModule, public Observable<const UIF
|
|||||||
CannedMessageModule();
|
CannedMessageModule();
|
||||||
|
|
||||||
void LaunchWithDestination(NodeNum, uint8_t newChannel = 0);
|
void LaunchWithDestination(NodeNum, uint8_t newChannel = 0);
|
||||||
|
void LaunchRepeatDestination();
|
||||||
void LaunchFreetextWithDestination(NodeNum, uint8_t newChannel = 0);
|
void LaunchFreetextWithDestination(NodeNum, uint8_t newChannel = 0);
|
||||||
|
|
||||||
// === Emote Picker navigation ===
|
// === Emote Picker navigation ===
|
||||||
|
Loading…
Reference in New Issue
Block a user