From b5652e60108af925e919e08453d9e4b302cc5257 Mon Sep 17 00:00:00 2001 From: Chris Miles Date: Wed, 19 Jul 2023 23:57:04 -0500 Subject: [PATCH] [Saylink] Fix cases where saylinks were not being cached (#3508) * [Saylink] Fix cases where saylinks were not being cached * Update say_link.cpp --- common/say_link.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/say_link.cpp b/common/say_link.cpp index 5ac7b7c94..db39c6381 100644 --- a/common/say_link.cpp +++ b/common/say_link.cpp @@ -376,7 +376,7 @@ std::string EQ::SayLinkEngine::InjectSaylinksIfNotExist(const char *message) void EQ::SayLinkEngine::LoadCachedSaylinks() { - auto saylinks = SaylinkRepository::GetWhere(database, "phrase not like '%#%'"); + auto saylinks = SaylinkRepository::GetWhere(database, "phrase not REGEXP BINARY '[A-Z]' and phrase not REGEXP '[0-9]'"); LogSaylink("Loaded [{}] saylinks into cache", saylinks.size()); g_cached_saylinks = saylinks; } @@ -399,6 +399,7 @@ SaylinkRepository::Saylink EQ::SayLinkEngine::GetOrSaveSaylink(std::string sayli // return if found from the database if (!saylinks.empty()) { + g_cached_saylinks.emplace_back(saylinks[0]); return saylinks[0]; }