//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;
}
bool LLNotificationChannelPanel::update(const LLSD& payload, bool passed_filter)
{
	LLNotificationPtr notification = LLNotifications::instance().find(payload["id"].asUUID());
	if (notification)
	{
		LLSD row;
		row["columns"][0]["value"] = notification->getName();
		row["columns"][0]["column"] = "name";

		row["columns"][1]["value"] = notification->getMessage();
		row["columns"][1]["column"] = "content";

		row["columns"][2]["value"] = notification->getDate();
		row["columns"][2]["column"] = "date";
		row["columns"][2]["type"] = "date";

		LLScrollListItem* sli = passed_filter ? 
			getChild<LLScrollListCtrl>("notifications_list")->addElement(row) :
			getChild<LLScrollListCtrl>("notification_rejects_list")->addElement(row);
		sli->setUserdata(&(*notification));
	}

	return false;
}
示例#3
0
bool GrowlManager::filterOldNotifications(LLNotificationPtr pNotification)
{
	// *HACK: I don't see any better way to avoid getting old, persisted messages...
	return (pNotification->getDate().secondsSinceEpoch() >= LLDate::now().secondsSinceEpoch() - 10);
}