diff options
| author | Crystalwarrior <varsash@gmail.com> | 2021-03-22 03:38:51 +0300 |
|---|---|---|
| committer | Crystalwarrior <varsash@gmail.com> | 2021-03-22 03:38:51 +0300 |
| commit | ba36356a8869c1d22802dc0e8c4706dc2ba0f54e (patch) | |
| tree | 5ff42b3e279ba8e0db99104a636aaf55cc6ddaec | |
| parent | 702b2758985d77750e905c7eadc88f6511ac58dd (diff) | |
Fix log_chatmessage being called for the same message like 24 or more times causing insane spam
Reduce needless copy-pasting for shit that doesn't even need to be there
I actually made this fix but I stashed the older version when splitting the branches so you got the bugged verison instead.
| -rw-r--r-- | src/courtroom.cpp | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp index c656930d..307499f4 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -2019,22 +2019,7 @@ void Courtroom::skip_chatmessage_queue() while (!chatmessage_queue.isEmpty()) { QStringList p_contents = chatmessage_queue.dequeue(); - for (int n_string = 0; n_string < MS_MAXIMUM; ++n_string) { - // Note that we have added stuff that vanilla clients and servers simply - // won't send. So now, we have to check if the thing we want even exists - // amongst the packet's content. We also have to check if the server even - // supports CCCC's IC features, or if it's just japing us. Also, don't - // forget! A size 15 message will have indices from 0 to 14. - if (n_string < p_contents.size() && - (n_string < MS_MINIMUM || ao_app->cccc_ic_support_enabled)) { - m_chatmessage[n_string] = p_contents.at(n_string); - } - else { - m_chatmessage[n_string] = ""; - } - // We have logs displaying as soon as we reach the message in our queue, which is a less confusing but also less accurate experience for the user. - log_chatmessage(m_chatmessage[MESSAGE], m_chatmessage[CHAR_ID].toInt(), m_chatmessage[SHOWNAME], m_chatmessage[TEXT_COLOR].toInt(), DISPLAY_ONLY); - } + log_chatmessage(p_contents[MESSAGE], p_contents[CHAR_ID].toInt(), p_contents[SHOWNAME], p_contents[TEXT_COLOR].toInt(), DISPLAY_ONLY); } } |
