diff options
author | DukePyrolator <DukePyrolator@anope.org> | 2014-01-17 06:49:49 +0100 |
---|---|---|
committer | DukePyrolator <DukePyrolator@anope.org> | 2014-01-17 06:49:49 +0100 |
commit | 4b192addd2fbd20c2dd98530cd57580fa41bd30e (patch) | |
tree | 75dc5f524a7b4304078670369e1ee6c41d98365f /modules | |
parent | d27594f8a61a7a3eae74a56983b2957233a0b64d (diff) |
m_chanstats: do not count negative words if you have more smileys in a line than words
Diffstat (limited to 'modules')
-rw-r--r-- | modules/extra/stats/m_chanstats.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/extra/stats/m_chanstats.cpp b/modules/extra/stats/m_chanstats.cpp index 13958dcc3..c3be9d640 100644 --- a/modules/extra/stats/m_chanstats.cpp +++ b/modules/extra/stats/m_chanstats.cpp @@ -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); |