本文整理汇总了C++中LLNotificationPtr::canLogToIM方法的典型用法代码示例。如果您正苦于以下问题:C++ LLNotificationPtr::canLogToIM方法的具体用法?C++ LLNotificationPtr::canLogToIM怎么用?C++ LLNotificationPtr::canLogToIM使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLNotificationPtr
的用法示例。
在下文中一共展示了LLNotificationPtr::canLogToIM方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processNotification
//--------------------------------------------------------------------------
bool LLAlertHandler::processNotification(const LLNotificationPtr& notification)
{
if(mChannel.isDead())
{
return false;
}
// arrange a channel on a screen
if(!mChannel.get()->getVisible())
{
initChannel();
}
if (notification->canLogToIM() && notification->hasFormElements())
{
const std::string name = LLHandlerUtil::getSubstitutionName(notification);
LLUUID from_id = notification->getPayload()["from_id"];
// [RLVa:KB] - Checked: 2013-05-09 (RLVa-1.4.9)
// Don't spawn an IM session for non-chat related events:
// - LLHandlerUtil::logToIMP2P() below will still be called with to_file_only == false
// - LLHandlerUtil::logToIM() will eventually be called as a result and without an open IM session it will log the
// same message as it would for an open session whereas to_file_only == true would take a different code path
if ( (RlvActions::hasOpenP2PSession(from_id)) || (RlvActions::canStartIM(from_id)) )
{
// [/RLVa:KB]
// firstly create session...
LLHandlerUtil::spawnIMSession(name, from_id);
// [RLVa:KB] - Checked: 2013-05-09 (RLVa-1.4.9)
}
// [/RLVa:KB]
// ...then log message to have IM Well notified about new message
LLHandlerUtil::logToIMP2P(notification);
}
LLToastAlertPanel* alert_dialog = new LLToastAlertPanel(notification, mIsModal);
LLToast::Params p;
p.notif_id = notification->getID();
p.notification = notification;
p.panel = dynamic_cast<LLToastPanel*>(alert_dialog);
p.enable_hide_btn = false;
p.can_fade = false;
p.is_modal = mIsModal;
p.on_delete_toast = boost::bind(&LLAlertHandler::onDeleteToast, this, _1);
// Show alert in middle of progress view (during teleport) (EXT-1093)
LLProgressView* progress = gViewerWindow->getProgressView();
LLRect rc = progress && progress->getVisible() ? progress->getRect() : gViewerWindow->getWorldViewRectScaled();
mChannel.get()->updatePositionAndSize(rc);
LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
if(channel)
channel->addToast(p);
return false;
}