Skip to content

Commit f503fea

Browse files
author
realtag
committed
Restrict repeater replies to !ping/!status
1 parent b7b9360 commit f503fea

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

examples/simple_repeater/MyMesh.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ void MyMesh::pumpDiscordWebhook() {
927927

928928
bool MyMesh::isPingChannel(const mesh::GroupChannel& channel) const {
929929
if (_prefs.ping_public_enabled && public_channel_ready && memcmp(channel.hash, public_channel.hash, PATH_HASH_SIZE) == 0) return true;
930-
if (test_channel_ready && memcmp(channel.hash, test_channel.hash, PATH_HASH_SIZE) == 0) return true;
930+
if (_prefs.ping_test_enabled && test_channel_ready && memcmp(channel.hash, test_channel.hash, PATH_HASH_SIZE) == 0) return true;
931931
return false;
932932
}
933933

@@ -1216,8 +1216,7 @@ void MyMesh::onGroupDataRecv(mesh::Packet* packet, uint8_t type, const mesh::Gro
12161216
if (!isPingChannel(channel)) return;
12171217
bool is_ping = containsSubstringCaseInsensitive(body, "!ping");
12181218
bool is_status = containsSubstringCaseInsensitive(body, "!status");
1219-
bool is_test = _prefs.ping_test_enabled && containsSubstringCaseInsensitive(body, "test");
1220-
if (!is_ping && !is_status && !is_test) return;
1219+
if (!is_ping && !is_status) return;
12211220

12221221
bool is_public_channel = public_channel_ready && memcmp(channel.hash, public_channel.hash, PATH_HASH_SIZE) == 0;
12231222
bool is_test_channel = test_channel_ready && memcmp(channel.hash, test_channel.hash, PATH_HASH_SIZE) == 0;

0 commit comments

Comments
 (0)