本文整理汇总了C++中chatmessage::Ptr::getContent方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::getContent方法的具体用法?C++ Ptr::getContent怎么用?C++ Ptr::getContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chatmessage::Ptr
的用法示例。
在下文中一共展示了Ptr::getContent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onFileRecvRequest
void ChatForm::onFileRecvRequest(ToxFile file)
{
if (file.friendId != f->getFriendID())
return;
Widget::getInstance()->newFriendMessageAlert(file.friendId);
QString name;
ToxId friendId = f->getToxId();
if (friendId != previousId)
{
name = f->getDisplayedName();
previousId = friendId;
}
ChatMessage::Ptr msg = ChatMessage::createFileTransferMessage(name, file, false, QDateTime::currentDateTime());
insertChatMessage(msg);
ChatLineContentProxy* proxy = static_cast<ChatLineContentProxy*>(msg->getContent(1));
assert(proxy->getWidgetType() == ChatLineContentProxy::FileTransferWidgetType);
FileTransferWidget* tfWidget = static_cast<FileTransferWidget*>(proxy->getWidget());
// there is auto-accept for that conact
if (!Settings::getInstance().getAutoAcceptDir(f->getToxId()).isEmpty())
{
tfWidget->autoAcceptTransfer(Settings::getInstance().getAutoAcceptDir(f->getToxId()));
}
else if (Settings::getInstance().getAutoSaveEnabled())
{ //global autosave to global directory
tfWidget->autoAcceptTransfer(Settings::getInstance().getGlobalAutoAcceptDir());
}
Widget::getInstance()->updateFriendActivity(f);
}
示例2: onFileRecvRequest
void ChatForm::onFileRecvRequest(ToxFile file)
{
if (file.friendId != f->getFriendID())
return;
Widget* w = Widget::getInstance();
if (!w->isFriendWidgetCurActiveWidget(f)|| w->isMinimized() || !w->isActiveWindow())
{
w->newMessageAlert(f->getFriendWidget());
f->setEventFlag(true);
f->getFriendWidget()->updateStatusLight();
}
QString name;
ToxId friendId = f->getToxId();
if (friendId != previousId)
{
name = f->getDisplayedName();
previousId = friendId;
}
ChatMessage::Ptr msg = ChatMessage::createFileTransferMessage(name, file, false, QDateTime::currentDateTime());
insertChatMessage(msg);
if (!Settings::getInstance().getAutoAcceptDir(f->getToxId()).isEmpty()
|| Settings::getInstance().getAutoSaveEnabled())
{
ChatLineContentProxy* proxy = static_cast<ChatLineContentProxy*>(msg->getContent(1));
assert(proxy->getWidgetType() == ChatLineContentProxy::FileTransferWidgetType);
FileTransferWidget* tfWidget = static_cast<FileTransferWidget*>(proxy->getWidget());
tfWidget->autoAcceptTransfer(Settings::getInstance().getAutoAcceptDir(f->getToxId()));
}
}