summaryrefslogtreecommitdiff
path: root/protocols/Omegle/src/chat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Omegle/src/chat.cpp')
-rw-r--r--protocols/Omegle/src/chat.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/protocols/Omegle/src/chat.cpp b/protocols/Omegle/src/chat.cpp
index 007a8cbd38..cf98c66a32 100644
--- a/protocols/Omegle/src/chat.cpp
+++ b/protocols/Omegle/src/chat.cpp
@@ -23,10 +23,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
void OmegleProto::UpdateChat(const TCHAR *name, const TCHAR *message, bool addtolog)
{
+ // replace % to %% to not interfere with chat color codes
+ std::tstring smessage = message;
+ utils::text::treplace_all(&smessage, _T("%"), _T("%%"));
+
GCDEST gcd = { m_szModuleName, m_tszUserName, GC_EVENT_MESSAGE };
GCEVENT gce = { sizeof(gce), &gcd };
gce.time = ::time(NULL);
- gce.ptszText = message;
+ gce.ptszText = smessage.c_str();
if (name == NULL) {
gcd.iType = GC_EVENT_INFORMATION;
@@ -56,6 +60,9 @@ int OmegleProto::OnChatEvent(WPARAM wParam,LPARAM lParam)
{
std::string text = mir_t2a_cp(hook->ptszText,CP_UTF8);
+ // replace %% back to %, because chat automatically does this to sent messages
+ utils::text::replace_all(&text, "%%", "%");
+
if (text.empty())
break;