diff --git a/modules/simple_away.cpp b/modules/simple_away.cpp index 48362512..fc62d361 100644 --- a/modules/simple_away.cpp +++ b/modules/simple_away.cpp @@ -47,6 +47,12 @@ public: m_iAwayWait = SIMPLE_AWAY_DEFAULT_TIME; m_bClientSetAway = false; m_bWeSetAway = false; + + AddHelpCommand(); + AddCommand("Reason", static_cast(&CSimpleAway::OnReasonCommand), "[]", "Prints or sets the away reason (%s is replaced with the time you were set away)"); + AddCommand("Timer", static_cast(&CSimpleAway::OnTimerCommand), "", "Prints the current time to wait before setting you away"); + AddCommand("SetTimer", static_cast(&CSimpleAway::OnSetTimerCommand), "", "Sets the time to wait before setting you away"); + AddCommand("DisableTimer", static_cast(&CSimpleAway::OnDisableTimerCommand), "", "Disables the wait time before setting you away"); } virtual ~CSimpleAway() {} @@ -102,62 +108,38 @@ public: SetAway(); } - virtual void OnModCommand(const CString& sLine) { - CString sCommand = sLine.Token(0); - - if (sCommand.Equals("help")) { - CTable Table; - Table.AddColumn("Command"); - Table.AddColumn("Description"); - Table.AddRow(); - Table.SetCell("Command", "Reason []"); - Table.SetCell("Description", "Prints and optionally sets the away reason."); - Table.AddRow(); - Table.SetCell("Command", "Timer"); - Table.SetCell("Description", "Prints the current time to wait before setting you away."); - Table.AddRow(); - Table.SetCell("Command", "SetTimer