mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-26 22:16:22 +00:00
Use helper function to clean incoming messages
We might want to use utf8proc or something to normalize utf8 strings later?
This commit is contained in:
@@ -1427,19 +1427,19 @@ sv_ev_bookmark_autojoin(Bookmark *bookmark)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_clean_incoming_message(ProfMessage *message)
|
_cut(ProfMessage *message, const char *cut)
|
||||||
{
|
{
|
||||||
if (strstr(message->plain, "\u200E")) {
|
if (strstr(message->plain, cut)) {
|
||||||
char **split = g_strsplit(message->plain, "\u200E", -1);
|
char **split = g_strsplit(message->plain, cut, -1);
|
||||||
free(message->plain);
|
|
||||||
message->plain = g_strjoinv("", split);
|
|
||||||
g_strfreev(split);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strstr(message->plain, "\u200F")) {
|
|
||||||
char **split = g_strsplit(message->plain, "\u200F", -1);
|
|
||||||
free(message->plain);
|
free(message->plain);
|
||||||
message->plain = g_strjoinv("", split);
|
message->plain = g_strjoinv("", split);
|
||||||
g_strfreev(split);
|
g_strfreev(split);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_clean_incoming_message(ProfMessage *message)
|
||||||
|
{
|
||||||
|
_cut(message, "\u200E");
|
||||||
|
_cut(message, "\u200F");
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user