本文整理汇总了C++中CNick::SetIdleSince方法的典型用法代码示例。如果您正苦于以下问题:C++ CNick::SetIdleSince方法的具体用法?C++ CNick::SetIdleSince怎么用?C++ CNick::SetIdleSince使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CNick
的用法示例。
在下文中一共展示了CNick::SetIdleSince方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseLineArgV
/**
* ParseLineArgV
*
* Parses and processes a line which was sent by the server.
*
* @param argc number of tokens
* @param argv the tokens
*/
bool CIRCConnection::ParseLineArgV(int argc, const char **argv) {
CChannel *Channel;
CClientConnection *Client;
m_LastResponse = g_CurrentTime;
if (argc < 2) {
return true;
}
const char *Reply = argv[0];
const char *Raw = argv[1];
char *Nick = ::NickFromHostmask(Reply);
int iRaw = atoi(Raw);
bool b_Me = false;
if (m_CurrentNick != NULL && Nick != NULL && strcasecmp(Nick, m_CurrentNick) == 0) {
b_Me = true;
}
free(Nick);
Client = GetOwner()->GetClientConnectionMultiplexer();
// HASH values
CHashCompare hashRaw(argv[1]);
static CHashCompare hashPrivmsg("PRIVMSG");
static CHashCompare hashNotice("NOTICE");
static CHashCompare hashJoin("JOIN");
static CHashCompare hashPart("PART");
static CHashCompare hashKick("KICK");
static CHashCompare hashNick("NICK");
static CHashCompare hashQuit("QUIT");
static CHashCompare hashMode("MODE");
static CHashCompare hashTopic("TOPIC");
static CHashCompare hashPong("PONG");
// END of HASH values
if (argc > 3 && iRaw == 433) {
bool ReturnValue = ModuleEvent(argc, argv);
if (ReturnValue) {
if (GetCurrentNick() == NULL) {
WriteLine("NICK :%s_", argv[3]);
}
if (m_NickCatchTimer == NULL) {
m_NickCatchTimer = new CTimer(30, false, NickCatchTimer, this);
}
}
return ReturnValue;
} else if (argc > 3 && hashRaw == hashPrivmsg && Client == NULL) {
const char *Host;
const char *Dest = argv[2];
char *Nick = ::NickFromHostmask(Reply);
Channel = GetChannel(Dest);
if (Channel != NULL) {
CNick *User = Channel->GetNames()->Get(Nick);
if (User != NULL) {
User->SetIdleSince(g_CurrentTime);
}
Channel->AddBacklogLine(argv[0], argv[3]);
}
if (!ModuleEvent(argc, argv)) {
free(Nick);
return false;
}
/* don't log ctcp requests */
if (argv[3][0] != '\1' && argv[3][strlen(argv[3]) - 1] != '\1' && Dest != NULL &&
Nick != NULL && m_CurrentNick != NULL && strcasecmp(Dest, m_CurrentNick) == 0 &&
strcasecmp(Nick, m_CurrentNick) != 0) {
char *Dup;
char *Delim;
Dup = strdup(Reply);
if (AllocFailed(Dup)) {
free(Nick);
return true;
}
Delim = strchr(Dup, '!');
if (Delim != NULL) {
//.........这里部分代码省略.........