当前位置: 首页>>代码示例>>C++>>正文


C++ LLNotificationPtr::getPayload方法代码示例

本文整理汇总了C++中LLNotificationPtr::getPayload方法的典型用法代码示例。如果您正苦于以下问题:C++ LLNotificationPtr::getPayload方法的具体用法?C++ LLNotificationPtr::getPayload怎么用?C++ LLNotificationPtr::getPayload使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LLNotificationPtr的用法示例。


在下文中一共展示了LLNotificationPtr::getPayload方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: name

// static
void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_file_only)
{
	const std::string name = LLHandlerUtil::getSubstitutionName(notification);

	const std::string& session_name = notification->getPayload().has(
			"SESSION_NAME") ? notification->getPayload()["SESSION_NAME"].asString() : name;

	// don't create IM p2p session with objects, it's necessary condition to log
	if (notification->getName() != OBJECT_GIVE_ITEM)
	{
		LLUUID from_id = notification->getPayload()["from_id"];

		//there still appears a log history file with weird name " .txt"
		if (" " == session_name || "{waiting}" == session_name || "{nobody}" == session_name)
		{
			llwarning("Weird session name (" + session_name + ") for notification " + notification->getName(), 666)
		}

		if(to_file_only)
		{
			logToIM(IM_NOTHING_SPECIAL, session_name, "", notification->getMessage(),
					LLUUID(), LLUUID());
		}
		else
		{
			logToIM(IM_NOTHING_SPECIAL, session_name, INTERACTIVE_SYSTEM_FROM, notification->getMessage(),
					from_id, LLUUID());
		}
	}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:30,代码来源:llnotificationhandlerutil.cpp

示例2: isEquivalentTo

bool LLNotification::isEquivalentTo(LLNotificationPtr that) const
{
	if (this->mTemplatep->mName != that->mTemplatep->mName) 
	{
		return false; // must have the same template name or forget it
	}
	if (this->mTemplatep->mUnique)
	{
		const LLSD& these_substitutions = this->getSubstitutions();
		const LLSD& those_substitutions = that->getSubstitutions();
		const LLSD& this_payload = this->getPayload();
		const LLSD& that_payload = that->getPayload();

		// highlander bit sez there can only be one of these
		for (std::vector<std::string>::const_iterator it = mTemplatep->mUniqueContext.begin(), end_it = mTemplatep->mUniqueContext.end();
			it != end_it;
			++it)
		{
			// if templates differ in either substitution strings or payload with the given field name
			// then they are considered inequivalent
			// use of get() avoids converting the LLSD value to a map as the [] operator would
			if (these_substitutions.get(*it).asString() != those_substitutions.get(*it).asString()
				|| this_payload.get(*it).asString() != that_payload.get(*it).asString())
			{
				return false;
			}
		}
		return true;
	}

	return false; 
}
开发者ID:OS-Development,项目名称:VW.Singularity,代码行数:32,代码来源:llnotifications.cpp

示例3: onNewNotification

//static 
bool LLGroupNotifyBox::onNewNotification(const LLSD& notify)
{
	LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());

	if (notification)
	{
		const LLSD& payload = notification->getPayload();
		// Get the group data
		LLGroupData group_data;
		if (!gAgent.getGroupData(payload["group_id"].asUUID(),group_data))
		{
			llwarns << "Group notice for unkown group: " << payload["group_id"].asUUID() << llendl;
			return false;
		}

		LLGroupNotifyBox* self;
		self = new LLGroupNotifyBox(payload["subject"].asString(),
									payload["message"].asString(),
									payload["sender_name"].asString(), 
									payload["group_id"].asUUID(), 
									group_data.mInsigniaID, 
									group_data.mName,
									notification->getDate(),
									payload["inventory_offer"].isDefined(),
									payload["inventory_name"].asString(),
									payload["inventory_offer"]);
		gNotifyBoxView->addChild(self);
	}
	return false;
}
开发者ID:ArxNet,项目名称:SingularityViewer,代码行数:31,代码来源:llgroupnotify.cpp

示例4: addNotifPanelToIM

// static
void LLHandlerUtil::addNotifPanelToIM(const LLNotificationPtr& notification)
{
	const std::string name = LLHandlerUtil::getSubstitutionName(notification);
	LLUUID from_id = notification->getPayload()["from_id"];

	LLUUID session_id = spawnIMSession(name, from_id);
	// add offer to session
	LLIMModel::LLIMSession * session = LLIMModel::getInstance()->findIMSession(
			session_id);
	llassert_always(session != NULL);

	LLSD offer;
	offer["notification_id"] = notification->getID();
	offer["from"] = SYSTEM_FROM;
	offer["time"] = LLLogChat::timestamp(false);
	offer["index"] = (LLSD::Integer)session->mMsgs.size();
	session->mMsgs.push_front(offer);


	// update IM floater and counters
	LLSD arg;
	arg["session_id"] = session_id;
	arg["num_unread"] = ++(session->mNumUnread);
	arg["participant_unread"] = ++(session->mParticipantUnreadMessageCount);
	LLIMModel::getInstance()->mNewMsgSignal(arg);
}
开发者ID:OS-Development,项目名称:VW.Dolphin_v3,代码行数:27,代码来源:llnotificationhandlerutil.cpp

示例5: updateVisibleIMFLoaterMesages

// static
void LLHandlerUtil::updateVisibleIMFLoaterMesages(const LLNotificationPtr& notification)
{
	const std::string name = LLHandlerUtil::getSubstitutionName(notification);
	LLUUID from_id = notification->getPayload()["from_id"];
	LLUUID session_id = spawnIMSession(name, from_id);

	updateIMFLoaterMesages(session_id);
}
开发者ID:OS-Development,项目名称:VW.Dolphin_v3,代码行数:9,代码来源:llnotificationhandlerutil.cpp

示例6: 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;
}
开发者ID:CaseyraeStarfinder,项目名称:Firestorm-Viewer,代码行数:59,代码来源:llnotificationalerthandler.cpp

示例7: notification_id_to_object_id

LLUUID notification_id_to_object_id(const LLUUID& notification_id)
{
	LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id);
	if(notification)
	{
		return notification->getPayload()["object_id"].asUUID();
	}
	return LLUUID::null;
}
开发者ID:JohnMcCaffery,项目名称:Armadillo-Phoenix,代码行数:9,代码来源:llscriptfloater.cpp

示例8: getSubstitutionName

// static
std::string LLHandlerUtil::getSubstitutionName(const LLNotificationPtr& notification)
{
	std::string res = notification->getSubstitutions().has("NAME")
		? notification->getSubstitutions()["NAME"]
		: notification->getSubstitutions()["[NAME]"];
	if (res.empty())
	{
		LLUUID from_id = notification->getPayload()["FROM_ID"];

		//*TODO all keys everywhere should be made of the same case, there is a mix of keys in lower and upper cases
		if (from_id.isNull()) 
		{
			from_id = notification->getPayload()["from_id"];
		}
		if(!gCacheName->getFullName(from_id, res))
		{
			res = "";
		}
	}
	return res;
}
开发者ID:OS-Development,项目名称:VW.Dolphin_v3,代码行数:22,代码来源:llnotificationhandlerutil.cpp

示例9: processNotification

//static 
bool LLFirstUse::processNotification(const LLSD& notify)
{
	if (notify["sigtype"].asString() == "delete")
	{
		LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
		if (notification)
		{
			// disable any future notifications
			gWarningSettings.setBOOL(notification->getPayload()["control_var"], FALSE);
		}
	}
	return false;
}
开发者ID:gurucoyote,项目名称:viewer-development,代码行数:14,代码来源:llfirstuse.cpp

示例10:

LLPanelOnlineStatus::LLPanelOnlineStatus(
		const LLNotificationPtr& notification) :
	LLPanelTipToast(notification)
{

	buildFromFile(
			"panel_online_status_toast.xml");


	getChild<LLUICtrl>("avatar_icon")->setValue(notification->getPayload()["FROM_ID"]);
	getChild<LLUICtrl>("message")->setValue(notification->getMessage());

	if (notification->getPayload().has("respond_on_mousedown")
			&& notification->getPayload()["respond_on_mousedown"])
	{
		setMouseDownCallback(boost::bind(&LLNotification::respond,
				notification, notification->getResponseTemplate()));
	}

	S32 max_line_count =  gSavedSettings.getS32("TipToastMessageLineCount");
	snapToMessageHeight(getChild<LLTextBox> ("message"), max_line_count);

}
开发者ID:OS-Development,项目名称:VW.Kirsten,代码行数:23,代码来源:llpanelonlinestatus.cpp

示例11: isIMFloaterOpened

// static
bool LLHandlerUtil::isIMFloaterOpened(const LLNotificationPtr& notification)
{
	bool res = false;

	LLUUID from_id = notification->getPayload()["from_id"];
	LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL,
			from_id);

	LLIMFloater* im_floater = LLFloaterReg::findTypedInstance<LLIMFloater>(
					"impanel", session_id);
	if (im_floater != NULL)
	{
		res = im_floater->getVisible() == TRUE;
	}

	return res;
}
开发者ID:Xara,项目名称:Opensource-V2-SL-Viewer,代码行数:18,代码来源:llnotificationhandlerutil.cpp

示例12: processNotification

bool LLBrowserNotification::processNotification(const LLNotificationPtr& notification)
{
	LLUUID media_id = notification->getPayload()["media_id"].asUUID();
	LLMediaCtrl* media_instance = LLMediaCtrl::getInstance(media_id);
	if (media_instance)
	{
		media_instance->showNotification(notification);
	}
	else if (LLViewerMediaFocus::instance().getControlsMediaID() == media_id)
	{
		LLViewerMediaImpl* impl = LLViewerMedia::getMediaImplFromTextureID(media_id);
		if (impl)
		{
			impl->showNotification(notification);
		}
	}
	return false;
}
开发者ID:Belxjander,项目名称:Kirito,代码行数:18,代码来源:llbrowsernotification.cpp

示例13: canSpawnIMSession

// static
bool LLHandlerUtil::canSpawnIMSession(const LLNotificationPtr& notification)
{
//	return OFFER_FRIENDSHIP == notification->getName()
//			|| USER_GIVE_ITEM == notification->getName()
//			|| TELEPORT_OFFERED == notification->getName();
// [SL:KB] - Patch: UI-Notifications | Checked: 2011-04-11 (Catznip-2.5.0a) | Added: Catznip-2.5.0a
//	return 
//		(canEmbedNotificationInIM(notification)) && 
//		( (OFFER_FRIENDSHIP == notification->getName()) || (USER_GIVE_ITEM == notification->getName()) || 
//		  (TELEPORT_OFFERED == notification->getName()) );
// [/SL:KB]
// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0h) | Added: RLVa-1.3.0h
	return 
		(canEmbedNotificationInIM(notification)) && 
		( (!rlv_handler_t::isEnabled()) || (gRlvHandler.canStartIM(notification->getPayload()["from_id"].asUUID())) ) &&
		( (OFFER_FRIENDSHIP == notification->getName()) || (USER_GIVE_ITEM == notification->getName()) || 
		  (TELEPORT_OFFERED == notification->getName()) );
// [/RLVa:KB]
}
开发者ID:DarkSpyro003,项目名称:DarkSpyros_Viewer,代码行数:20,代码来源:llnotificationhandlerutil.cpp

示例14: decIMMesageCounter

// static
void LLHandlerUtil::decIMMesageCounter(const LLNotificationPtr& notification)
{
	const std::string name = LLHandlerUtil::getSubstitutionName(notification);
	LLUUID from_id = notification->getPayload()["from_id"];
	LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, from_id);

	LLIMModel::LLIMSession * session = LLIMModel::getInstance()->findIMSession(
			session_id);

	if (session == NULL)
	{
		return;
	}

	LLSD arg;
	arg["session_id"] = session_id;
	session->mNumUnread--;
	arg["num_unread"] = session->mNumUnread;
	session->mParticipantUnreadMessageCount--;
	arg["participant_unread"] = session->mParticipantUnreadMessageCount;
	LLIMModel::getInstance()->mNewMsgSignal(arg);
}
开发者ID:OS-Development,项目名称:VW.Dolphin_v3,代码行数:23,代码来源:llnotificationhandlerutil.cpp

示例15: LLUUID

// static
void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_file_only)
{
	// don't create IM p2p session with objects, it's necessary condition to log
	if (notification->getName() != OBJECT_GIVE_ITEM)
	{
		LLUUID from_id = notification->getPayload()["from_id"];

		if (from_id.isNull())
		{
			llwarns << " from_id for notification " << notification->getName() << " is null " << llendl;
			return;
		}

		if(to_file_only)
		{
			gCacheName->get(from_id, false, boost::bind(&log_name_callback, _2, "", notification->getMessage(), LLUUID()));
		}
		else
		{
			gCacheName->get(from_id, false, boost::bind(&log_name_callback, _2, INTERACTIVE_SYSTEM_FROM, notification->getMessage(), from_id));
		}
	}
}
开发者ID:OS-Development,项目名称:VW.Dolphin_v3,代码行数:24,代码来源:llnotificationhandlerutil.cpp


注:本文中的LLNotificationPtr::getPayload方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。