本文整理汇总了C++中Protocol::chatService方法的典型用法代码示例。如果您正苦于以下问题:C++ Protocol::chatService方法的具体用法?C++ Protocol::chatService怎么用?C++ Protocol::chatService使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Protocol
的用法示例。
在下文中一共展示了Protocol::chatService方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: maxMessageSize
int OtrMessageService::maxMessageSize(const Account &account) const
{
Protocol *protocolHandler = account.protocolHandler();
if (!protocolHandler)
return 0;
ChatService *chatService = protocolHandler->chatService();
if (!chatService)
return 0;
return chatService->maxMessageLength();
}
示例2: accountUnregistered
void Firewall::accountUnregistered(Account account)
{
Protocol *protocol = account.protocolHandler();
if (!protocol)
return;
ChatService *chatService = protocol->chatService();
if (!chatService)
return;
disconnect(chatService, SIGNAL(filterIncomingMessage(Chat, Contact, QString &, time_t, bool &)),
this, SLOT(filterIncomingMessage(Chat, Contact, QString &, time_t, bool &)));
disconnect(chatService, SIGNAL(filterOutgoingMessage(Chat, QString &, bool &)),
this, SLOT(filterOutgoingMessage(Chat, QString &, bool &)));
disconnect(account, SIGNAL(connected()), this, SLOT(accountConnected()));
}
示例3: checkChat
bool Firewall::checkChat(const Chat &chat, const Contact &sender, const QString &message, bool &ignore)
{
kdebugf();
if (!CheckChats)
return false;
// konferencja
if (chat.contacts().count() > 1)
{
kdebugf2();
return false;
}
if (!sender.ownerBuddy().isAnonymous() || Passed.contains(sender))
{
kdebugf2();
return false;
}
if (chat.chatAccount().statusContainer()->status().type() == "Invisible" && DropAnonymousWhenInvisible)
{
writeLog(sender, tr("Chat with anonim silently dropped.\n") + "----------------------------------------------------\n");
kdebugf2();
return true;
}
if (IgnoreInvisible)
{
if (sender.currentStatus().isDisconnected())
{
QDateTime *dateTime = chat.chatAccount().data()->moduleData<QDateTime>("firewall-account-connected");
if (dateTime && (*dateTime < QDateTime::currentDateTime()))
{
Protocol *protocol = chat.chatAccount().protocolHandler();
if (!protocol)
{
kdebugf2();
return false;
}
ChatService *chatService = protocol->chatService();
if (!chatService)
{
kdebugf2();
return false;
}
chatService->sendMessage(chat, tr("This message has been generated AUTOMATICALLY!\n\nI'm a busy person and I don't have time for stupid chats with the persons hiding itself. If you want to talk with me change the status to Online or Busy first."), true);
}
writeLog(sender, tr("Chat with invisible anonim ignored.\n") + "----------------------------------------------------\n");
kdebugf2();
return true;
}
}
if (pattern.exactMatch(message.simplified()))
{
Passed.insert(sender);
if (Confirmation)
{
Protocol *protocol = chat.chatAccount().protocolHandler();
if (!protocol)
{
kdebugf2();
return false;
}
ChatService *chatService = protocol->chatService();
if (!chatService)
{
kdebugf2();
return false;
}
chatService->sendMessage(chat, ConfirmationText, true);
}
writeLog(sender, tr("User wrote right answer!\n") + "----------------------------------------------------\n");
ignore = true;
kdebugf2();
return false;
}
else
{
if (LastContact != sender && Search)
{
SearchWindow *sd = new SearchWindow(Core::instance()->kaduWindow(), sender.ownerBuddy());
sd->show();
sd->firstSearch();
LastContact = sender;
}
//.........这里部分代码省略.........