本文整理汇总了C++中IrcMessage::SetDateTime方法的典型用法代码示例。如果您正苦于以下问题:C++ IrcMessage::SetDateTime方法的具体用法?C++ IrcMessage::SetDateTime怎么用?C++ IrcMessage::SetDateTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IrcMessage
的用法示例。
在下文中一共展示了IrcMessage::SetDateTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateMessage
QObject* ServerParticipantEntry::CreateMessage (IMessage::MessageType,
const QString&, const QString& body)
{
IrcMessage *message = new IrcMessage (IMessage::MTChatMessage,
IMessage::DOut,
ISH_->GetServerID (),
Nick_,
Account_->GetClientConnection ().get ());
message->SetBody (body);
message->SetDateTime (QDateTime::currentDateTime ());
return message;
}
示例2: IncomingMessage
void IrcServerHandler::IncomingMessage (const QString& nick,
const QString& target, const QString& msg, IMessage::Type type)
{
if (ChannelsManager_->IsChannelExists (target))
ChannelsManager_->ReceivePublicMessage (target, nick, msg);
else
{
//TODO Work only for exists entries
IrcMessage *message = new IrcMessage (type,
IMessage::Direction::In,
ServerID_,
nick,
Account_->GetClientConnection ().get ());
message->SetBody (msg);
message->SetDateTime (QDateTime::currentDateTime ());
bool found = false;
for (const auto entryObj : ChannelsManager_->GetParticipantsByNick (nick))
{
const auto entry = qobject_cast<EntryBase*> (entryObj);
if (!entry)
continue;
found = true;
entry->HandleMessage (message);
}
if (!found)
{
if (Nick2Entry_.contains (nick))
Nick2Entry_ [nick]->HandleMessage (message);
else
GetParticipantEntry (nick)->HandleMessage (message);
}
}
}