From 5b24f18c37182b18ba012aa6b79264b76ebd08fb Mon Sep 17 00:00:00 2001 From: John Reese Date: Wed, 26 Jan 2011 21:09:34 -0500 Subject: [PATCH] Fix bug in replied condition For any channel/PM where the user hasn't yet sent a message, the replied condition would always return false due to failing a `0 < 0` expression. The fix special-cases last_notification_time values of 0 to always return true. --- notifo.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/notifo.cpp b/notifo.cpp index 74ae46a..4a2500f 100644 --- a/notifo.cpp +++ b/notifo.cpp @@ -332,7 +332,9 @@ class CNotifoMod : public CModule bool replied(const CString& context) { CString value = options["replied"].AsLower(); - return value != "yes" || last_notification_time[context] < last_reply_time[context]; + return value != "yes" + || last_notification_time[context] == 0 + || last_notification_time[context] < last_reply_time[context]; } /**