Skip to content

Commit

Permalink
Remove clientside doublepost checking
Browse files Browse the repository at this point in the history
  • Loading branch information
scatterflower committed Aug 16, 2020
1 parent 11250e1 commit 079ce93
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/courtroom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1792,9 +1792,11 @@ void Courtroom::handle_chatmessage(QStringList *p_contents)

QString f_displayname;
if (!is_spectator && (m_chatmessage[SHOWNAME].isEmpty() || !ui_showname_enable->isChecked())) {
// If the users is not a spectator and showname is disabled, use the character's name
f_displayname = ao_app->get_showname(char_list.at(f_char_id).name);
}
else {
// Otherwise, use the showname
f_displayname = m_chatmessage[SHOWNAME];
}

Expand All @@ -1803,20 +1805,7 @@ void Courtroom::handle_chatmessage(QStringList *p_contents)
f_displayname = ao_app->get_showname(char_list.at(f_char_id).name);

QString f_message = f_displayname + ": " + m_chatmessage[MESSAGE] + '\n';
// Remove undesired newline chars
m_chatmessage[MESSAGE].remove("\n");
chatmessage_is_empty =
m_chatmessage[MESSAGE] == " " || m_chatmessage[MESSAGE] == "";

if (f_char_id >= 0 && !chatmessage_is_empty &&
f_message == previous_ic_message) // Not a system message
return;

if (f_char_id <= -1)
previous_ic_message =
""; // System messages don't care about repeating themselves
else
previous_ic_message = f_message;
bool ok;
int objection_mod = m_chatmessage[OBJECTION_MOD].toInt(
&ok, 10); // checks if its a custom obj.
Expand Down

0 comments on commit 079ce93

Please sign in to comment.