1
0
mirror of https://github.com/anope/anope.git synced 2026-06-26 21:36:38 +02:00

m_chanstats: do not count negative words if you have more smileys in a line than words

This commit is contained in:
DukePyrolator
2014-01-17 06:49:49 +01:00
parent d27594f8a6
commit 4b192addd2
+6 -1
View File
@@ -589,7 +589,12 @@ class MChanstats : public Module
size_t smileys_other = CountSmileys(msg, SmileysOther);
// do not count smileys as words
words = words - smileys_happy - smileys_sad - smileys_other;
size_t smileys = smileys_happy + smileys_sad + smileys_other;
if (smileys > words)
words = 0;
else
words = words - smileys;
query = "CALL " + prefix + "chanstats_proc_update(@channel@, @nick@, 1, @letters@, @words@, @action@, "
"@smileys_happy@, @smileys_sad@, @smileys_other@, '0', '0', '0', '0');";
query.SetValue("channel", c->name);