From 7166d483d7bba1deb9dbf9d1b5c9bcbe10728a95 Mon Sep 17 00:00:00 2001 From: imaginos Date: Fri, 1 Apr 2005 08:49:46 +0000 Subject: [PATCH] woops actually delete the message git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@58 726aef4b-f618-498e-8847-2d620e286838 --- modules/away.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/away.cpp b/modules/away.cpp index 56c3d436..c7083a78 100644 --- a/modules/away.cpp +++ b/modules/away.cpp @@ -20,6 +20,9 @@ * * * $Log$ + * Revision 1.2 2005/04/01 08:49:46 imaginos + * woops actually delete the message + * * Revision 1.1 2005/04/01 08:30:47 imaginos * simple away script * @@ -58,7 +61,7 @@ public: { if ( m_sPassword.empty() ) { - char *pTmp = getpass( "Enter Encryption Key for savebuff.so: " ); + char *pTmp = getpass( "Enter Encryption Key for away.so: " ); if ( pTmp ) m_sPassword = CBlowfish::MD5( pTmp ); @@ -158,6 +161,9 @@ public: if ( sWhich == "all" ) { PutModNotice( "Deleted " + CUtils::ToString( m_vMessages.size() ) + " Messages.", "away" ); + for( u_int a = 0; a < m_vMessages.size(); a++ ) + m_vMessages.erase( m_vMessages.begin() + a-- ); + } else if ( sWhich.empty() ) { @@ -247,7 +253,11 @@ public: { if ( ( !m_bIsAway ) || ( bForce ) ) { - m_sReason = sReason; + if ( !bForce ) + m_sReason = sReason; + else if ( !sReason.empty() ) + m_sReason = sReason; + time_t iTime = time( NULL ); char *pTime = ctime( &iTime ); string sTime;