Remove legacy version handling

This commit is contained in:
John Reese 2012-07-24 09:23:11 -07:00
parent 6c413a91e6
commit 894448ca6f
1 changed files with 0 additions and 17 deletions

View File

@ -18,15 +18,6 @@
#include <znc/FileUtils.h> #include <znc/FileUtils.h>
#include "time.h" #include "time.h"
#if (!defined(VERSION_MAJOR) || !defined(VERSION_MINOR) || (VERSION_MAJOR == 0 && VERSION_MINOR < 72))
#error This module needs ZNC 0.072 or newer.
#endif
// Handle versions of ZNC older than 0.090 by disabling the away_only condition
#if VERSION_MAJOR == 0 && VERSION_MINOR >= 90
#define PUSH_AWAY
#endif
// Forward declaration // Forward declaration
class CPushMod; class CPushMod;
@ -121,9 +112,7 @@ class CPushMod : public CModule
defaults["query_conditions"] = "all"; defaults["query_conditions"] = "all";
// Notification conditions // Notification conditions
#ifdef PUSH_AWAY
defaults["away_only"] = "no"; defaults["away_only"] = "no";
#endif
defaults["client_count_less_than"] = "0"; defaults["client_count_less_than"] = "0";
defaults["highlight"] = ""; defaults["highlight"] = "";
defaults["idle"] = "0"; defaults["idle"] = "0";
@ -444,12 +433,8 @@ class CPushMod : public CModule
*/ */
bool away_only() bool away_only()
{ {
#ifdef PUSH_AWAY
CString value = options["away_only"].AsLower(); CString value = options["away_only"].AsLower();
return value != "yes" || GetNetwork()->IsIRCAway(); return value != "yes" || GetNetwork()->IsIRCAway();
#else
return true;
#endif
} }
/** /**
@ -1122,11 +1107,9 @@ class CPushMod : public CModule
table.AddColumn("Condition"); table.AddColumn("Condition");
table.AddColumn("Status"); table.AddColumn("Status");
#ifdef PUSH_AWAY
table.AddRow(); table.AddRow();
table.SetCell("Condition", "away"); table.SetCell("Condition", "away");
table.SetCell("Status", GetNetwork()->IsIRCAway() ? "yes" : "no"); table.SetCell("Status", GetNetwork()->IsIRCAway() ? "yes" : "no");
#endif
table.AddRow(); table.AddRow();
table.SetCell("Condition", "client_count"); table.SetCell("Condition", "client_count");