KVIrc  4.9.2
DeveloperAPIs
Macros | Functions
KviIrcServerParser_numericHandlers.cpp File Reference
#include "KviIrcServerParser.h"
#include "KviWindow.h"
#include "KviQueryWindow.h"
#include "kvi_out.h"
#include "KviLocale.h"
#include "KviIrcSocket.h"
#include "KviOptions.h"
#include "KviChannelWindow.h"
#include "KviTopicWidget.h"
#include "KviIrcUserDataBase.h"
#include "kvi_defaults.h"
#include "KviControlCodes.h"
#include "KviMainWindow.h"
#include "KviParameterList.h"
#include "KviApplication.h"
#include "KviNotifyList.h"
#include "KviIrcNumericCodes.h"
#include "KviIrcConnection.h"
#include "KviIrcConnectionStateData.h"
#include "KviIrcConnectionUserInfo.h"
#include "KviIrcConnectionServerInfo.h"
#include "KviIrcConnectionAsyncWhoisData.h"
#include "KviIrcConnectionTarget.h"
#include "KviTimeUtils.h"
#include "KviLagMeter.h"
#include "KviKvsEventTriggers.h"
#include "KviKvsScript.h"
#include "KviKvsVariantList.h"
#include "KviIdentityProfileSet.h"
#include <QPixmap>
#include <QDateTime>
#include <QTextCodec>
#include <QRegExp>
#include <QByteArray>
#include <QLocale>

Macros

#define DECRYPT_IF_NEEDED(_target, _txt, _type, _type2, _buffer, _retptr, _retmsgtype)
 
#define IS_CHANNEL_TYPE_FLAG(_qchar)   (msg->connection()->serverInfo()->supportedChannelTypes().indexOf(_qchar) != -1)
 
#define IS_USER_MODE_PREFIX(_qchar)   (msg->connection()->serverInfo()->supportedModePrefixes().indexOf(_qchar) != -1)
 
#define PARSE_NUMERIC_ENDOFLIST(__funcname, __modechar, __daicon, __szWhatQString)
 
#define PARSE_NUMERIC_LIST(__funcname, __modechar, __ico, __szWhatQString)
 

Functions

void getDateTimeStringFromCharTimeT (QString &szBuffer, const char *time_t_string)
 
 PARSE_NUMERIC_LIST (parseNumericExceptList, 'e', KVI_OUT_BANEXCEPT, __tr2qs("Ban exception listing"))
 
 PARSE_NUMERIC_LIST (parseNumericQList, 'q', KVI_OUT_BAN, __tr2qs("Owner listing"))
 
 PARSE_NUMERIC_LIST (parseNumericAList, 'a', KVI_OUT_BAN, __tr2qs("Admin/protected nicks listing"))
 
 PARSE_NUMERIC_LIST (parseNumericReopList, 'R', KVI_OUT_BAN, __tr2qs("Reop masks listing"))
 
 PARSE_NUMERIC_LIST (parseNumericSpamFilterList, 'g', KVI_OUT_BAN, __tr2qs("Spam filter listing"))
 
 PARSE_NUMERIC_LIST (parseNumericChanAccessList, 'w', KVI_OUT_INVITEEXCEPT, __tr2qs("Channel access listing"))
 
 PARSE_NUMERIC_LIST (parseNumericExemptChanOpList, 'X', KVI_OUT_INVITEEXCEPT, __tr2qs("Channel exemptions listing"))
 

Macro Definition Documentation

#define DECRYPT_IF_NEEDED (   _target,
  _txt,
  _type,
  _type2,
  _buffer,
  _retptr,
  _retmsgtype 
)
Value:
_retptr = _txt; \
_retmsgtype = _type;

Referenced by KviIrcServerParser::parseNumericTopic().

#define IS_CHANNEL_TYPE_FLAG (   _qchar)    (msg->connection()->serverInfo()->supportedChannelTypes().indexOf(_qchar) != -1)
#define IS_USER_MODE_PREFIX (   _qchar)    (msg->connection()->serverInfo()->supportedModePrefixes().indexOf(_qchar) != -1)
#define PARSE_NUMERIC_ENDOFLIST (   __funcname,
  __modechar,
  __daicon,
  __szWhatQString 
)
Value:
void KviIrcServerParser::__funcname(KviIrcMessage * msg) \
{ \
QString szChan = msg->connection()->decodeText(msg->safeParam(1)); \
KviChannelWindow * chan = msg->connection()->findChannel(szChan); \
if(chan) \
{ \
if(chan->sentListRequest(__modechar)) \
{ \
chan->setListRequestDone(__modechar); \
return; \
} \
} \
if(!msg->haltOutput()) \
{ \
KviWindow * pOut = chan ? chan : KVI_OPTION_BOOL(KviOption_boolServerRepliesToActiveWindow) ? msg->console()->activeWindow() : static_cast<KviWindow *>(msg->console()); \
pOut->output(__daicon, __tr2qs("End of channel %Q for \r!c\r%Q\r"), &(__szWhatQString), &szChan); \
} \
}
#define __tr2qs(__text__)
Definition: KviLocale.h:224
Definition: KviIrcMessage.h:50
#define KVI_OPTION_BOOL(_idx)
Definition: KviOptions.h:653
if(m_pFile) delete m_pFile
#define KviOption_boolServerRepliesToActiveWindow
Definition: KviOptions.h:249
Base class for all windows in KVIrc.
Definition: KviWindow.h:74
virtual void output(int iMsgType, const char *pcFormat,...)
Definition: KviWindow.cpp:1205
#define PARSE_NUMERIC_LIST (   __funcname,
  __modechar,
  __ico,
  __szWhatQString 
)
Value:
void KviIrcServerParser::__funcname(KviIrcMessage * msg) \
{ \
QString szChan = msg->connection()->decodeText(msg->safeParam(1)); \
QString banmask = msg->connection()->decodeText(msg->safeParam(2)); \
QString bansetby = msg->connection()->decodeText(msg->safeParam(3)); \
QString bansetat; \
getDateTimeStringFromCharTimeT(bansetat, msg->safeParam(4)); \
if(bansetby.isEmpty()) \
bansetby = __tr2qs("(Unknown)"); \
KviChannelWindow * chan = msg->connection()->findChannel(szChan); \
if(chan) \
{ \
chan->setModeInList(__modechar, banmask, true, bansetby, QString(msg->safeParam(4)).toUInt()); \
if(chan->sentListRequest(__modechar)) \
return; \
} \
if(!msg->haltOutput()) \
{ \
KviWindow * pOut = chan ? chan : KVI_OPTION_BOOL(KviOption_boolServerRepliesToActiveWindow) ? msg->console()->activeWindow() : static_cast<KviWindow *>(msg->console()); \
pOut->output(__ico, __tr2qs("%Q for \r!c\r%Q\r: \r!m-%c\r%Q\r (set by %Q on %Q)"), \
&(__szWhatQString), &szChan, __modechar, &banmask, &bansetby, &bansetat); \
} \
}
#define __tr2qs(__text__)
Definition: KviLocale.h:224
Definition: KviIrcMessage.h:50
#define KVI_OPTION_BOOL(_idx)
Definition: KviOptions.h:653
void getDateTimeStringFromCharTimeT(QString &szBuffer, const char *time_t_string)
Definition: KviIrcServerParser_numericHandlers.cpp:771
if(m_pFile) delete m_pFile
#define KviOption_boolServerRepliesToActiveWindow
Definition: KviOptions.h:249
Base class for all windows in KVIrc.
Definition: KviWindow.h:74
virtual void output(int iMsgType, const char *pcFormat,...)
Definition: KviWindow.cpp:1205

Function Documentation

void getDateTimeStringFromCharTimeT ( QString &  szBuffer,
const char *  time_t_string 
)
PARSE_NUMERIC_LIST ( parseNumericExceptList  ,
'e ,
KVI_OUT_BANEXCEPT  ,
__tr2qs("Ban exception listing")   
)
PARSE_NUMERIC_LIST ( parseNumericQList  ,
'q ,
KVI_OUT_BAN  ,
__tr2qs("Owner listing")   
)
PARSE_NUMERIC_LIST ( parseNumericAList  ,
'a ,
KVI_OUT_BAN  ,
__tr2qs("Admin/protected nicks listing")   
)
PARSE_NUMERIC_LIST ( parseNumericReopList  ,
'R'  ,
KVI_OUT_BAN  ,
__tr2qs("Reop masks listing")   
)
PARSE_NUMERIC_LIST ( parseNumericSpamFilterList  ,
'g ,
KVI_OUT_BAN  ,
__tr2qs("Spam filter listing")   
)
PARSE_NUMERIC_LIST ( parseNumericChanAccessList  ,
'w ,
KVI_OUT_INVITEEXCEPT  ,
__tr2qs("Channel access listing")   
)
PARSE_NUMERIC_LIST ( parseNumericExemptChanOpList  ,
'X ,
KVI_OUT_INVITEEXCEPT  ,
__tr2qs("Channel exemptions listing")   
)