本文整理汇总了C++中LLNotificationPtr::getMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ LLNotificationPtr::getMessage方法的具体用法?C++ LLNotificationPtr::getMessage怎么用?C++ LLNotificationPtr::getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLNotificationPtr
的用法示例。
在下文中一共展示了LLNotificationPtr::getMessage方法的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());
}
}
示例2: onLLNotification
//static
bool KVGrowlManager::onLLNotification(const LLSD& notice)
{
if(notice["sigtype"].asString() != "add")
return false;
if(!shouldNotify())
return false;
LLNotificationPtr notification = LLNotifications::instance().find(notice["id"].asUUID());
std::string name = notification->getName();
LLSD substitutions = notification->getSubstitutions();
if(LLStartUp::getStartupState() < STATE_STARTED)
{
LL_WARNS("GrowlLLNotification") << "GrowlManager discarded a notification (" << name << ") - too early." << LL_ENDL;
return false;
}
if(gGrowlManager->mNotifications.find(name) != gGrowlManager->mNotifications.end())
{
KVGrowlNotification* growl_notification = &gGrowlManager->mNotifications[name];
std::string body = "";
std::string title = "";
if(growl_notification->useDefaultTextForTitle)
title = notification->getMessage();
else if(growl_notification->growlTitle != "")
title = growl_notification->growlTitle;
LLStringUtil::format(title, substitutions);
if(growl_notification->useDefaultTextForBody)
body = notification->getMessage();
else if(growl_notification->growlBody != "")
body = growl_notification->growlBody;
LLStringUtil::format(body, substitutions);
gGrowlManager->notify(title, body, growl_notification->growlName);
}
return false;
}
示例3: onLLNotification
bool GrowlManager::onLLNotification(const LLSD& notice)
{
if(notice["sigtype"].asString() != "add")
return false;
static BOOL* enabled = rebind_llcontrol<BOOL>("PhoenixEnableGrowl", &gSavedSettings, true);
if(!*enabled)
return false;
if(!shouldNotify())
return false;
LLNotificationPtr notification = LLNotifications::instance().find(notice["id"].asUUID());
std::string name = notification->getName();
LLSD substitutions = notification->getSubstitutions();
if(LLStartUp::getStartupState() < STATE_STARTED)
{
LL_WARNS("GrowlLLNotification") << "GrowlManager discarded a notification (" << name << ") - too early." << LL_ENDL;
return false;
}
if(gGrowlManager->mNotifications.find(name) != gGrowlManager->mNotifications.end())
{
GrowlNotification* growl_notification = &gGrowlManager->mNotifications[name];
std::string body = "";
std::string title = "";
if(growl_notification->useDefaultTextForTitle)
title = notification->getMessage();
else if(growl_notification->growlTitle != "")
title = LLNotification::format(growl_notification->growlTitle, substitutions);
if(growl_notification->useDefaultTextForBody)
body = notification->getMessage();
else if(growl_notification->growlBody != "")
body = LLNotification::format(growl_notification->growlBody, substitutions);
LL_INFOS("GrowlLLNotification") << "Notice: " << title << ": " << body << LL_ENDL;
gGrowlManager->notify(title, body, growl_notification->growlName);
}
return false;
}
示例4: onLLNotification
bool GrowlManager::onLLNotification(const LLSD& notice)
{
if (notice["sigtype"].asString() != "add")
{
return false;
}
LLNotificationPtr notification = LLNotifications::instance().find(notice["id"].asUUID());
std::string name = notification->getName();
LLSD substitutions = notification->getSubstitutions();
if (gGrowlManager->mNotifications.find(name) != gGrowlManager->mNotifications.end())
{
GrowlNotification* growl_notification = &gGrowlManager->mNotifications[name];
std::string body = "";
std::string title = "";
if (growl_notification->useDefaultTextForTitle)
{
title = notification->getMessage();
}
else if (!growl_notification->growlTitle.empty())
{
title = growl_notification->growlTitle;
LLStringUtil::format(title, substitutions);
}
if (growl_notification->useDefaultTextForBody)
{
body = notification->getMessage();
}
else if (!growl_notification->growlBody.empty())
{
body = growl_notification->growlBody;
LLStringUtil::format(body, substitutions);
}
//TM:FS no need to log whats sent to growl
//LL_INFOS("GrowlLLNotification") << "Notice: " << title << ": " << body << LL_ENDL;
if (name == "ObjectGiveItem" || name == "OwnObjectGiveItem" || name == "ObjectGiveItemUnknownUser" || name == "UserGiveItem" || name == "SystemMessageTip")
{
LLUrlMatch urlMatch;
LLWString newLine = utf8str_to_wstring(body);
LLWString workLine = utf8str_to_wstring(body);
while (LLUrlRegistry::instance().findUrl(workLine, urlMatch) && !urlMatch.getUrl().empty())
{
LLWStringUtil::replaceString(newLine, utf8str_to_wstring(urlMatch.getUrl()), utf8str_to_wstring(urlMatch.getLabel()));
// Remove the URL from the work line so we don't end in a loop in case of regular URLs!
// findUrl will always return the very first URL in a string
workLine = workLine.erase(0, urlMatch.getEnd() + 1);
}
body = wstring_to_utf8str(newLine);
}
gGrowlManager->notify(title, body, growl_notification->growlName);
}
return false;
}
示例5: on_avatar_name_cache_notify
static void on_avatar_name_cache_notify(const LLUUID& agent_id,
const LLAvatarName& av_name,
bool online,
LLSD payload)
{
// Popup a notify box with online status of this agent
// Use display name only because this user is your friend
std::string name;
LLAvatarNameCache::getPNSName(av_name, name);
LLSD args;
args["NAME"] = name;
// Popup a notify box with online status of this agent
LLNotificationPtr notification = LLNotificationsUtil::add(online ? "FriendOnline" : "FriendOffline", args, payload);
// If there's an open IM session with this agent, send a notification there too.
LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, agent_id);
LLFloaterIMPanel *floater = gIMMgr->findFloaterBySession(session_id);
if (floater)
{
std::string notifyMsg = notification->getMessage();
if (!notifyMsg.empty())
floater->addHistoryLine(notifyMsg,gSavedSettings.getColor4("SystemChatColor"));
}
}
示例6: on_avatar_name_cache_notify
static void on_avatar_name_cache_notify(const LLUUID& agent_id,
const LLAvatarName& av_name,
bool online,
LLSD payload)
{
// Popup a notify box with online status of this agent
// Use display name only because this user is your friend
LLSD args;
switch (gSavedSettings.getS32("PhoenixNameSystem"))
{
case 0 : args["NAME"] = av_name.getLegacyName(); break;
case 1 : args["NAME"] = (av_name.mIsDisplayNameDefault ? av_name.mDisplayName : av_name.getCompleteName()); break;
case 2 : args["NAME"] = av_name.mDisplayName; break;
default : args["NAME"] = av_name.getCompleteName(); break;
}
// Popup a notify box with online status of this agent
LLNotificationPtr notification = LLNotificationsUtil::add(online ? "FriendOnline" : "FriendOffline", args, payload);
// If there's an open IM session with this agent, send a notification there too.
LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, agent_id);
LLFloaterIMPanel *floater = gIMMgr->findFloaterBySession(session_id);
if (floater)
{
std::string notifyMsg = notification->getMessage();
if (!notifyMsg.empty())
floater->addHistoryLine(notifyMsg,gSavedSettings.getColor4("SystemChatColor"));
}
}
示例7: asLLSD
LLSD LLNotificationsListener::asLLSD(LLNotificationPtr note)
{
LLSD notificationInfo(note->asLLSD());
// For some reason the following aren't included in LLNotification::asLLSD().
notificationInfo["summary"] = note->summarize();
notificationInfo["id"] = note->id();
notificationInfo["type"] = note->getType();
notificationInfo["message"] = note->getMessage();
notificationInfo["label"] = note->getLabel();
return notificationInfo;
}
示例8: logToNearbyChat
// static
void LLHandlerUtil::logToNearbyChat(const LLNotificationPtr& notification, EChatSourceType type)
{
LLNearbyChat* nearby_chat = LLNearbyChat::getInstance();
if(nearby_chat)
{
LLChat chat_msg(notification->getMessage());
chat_msg.mSourceType = type;
chat_msg.mFromName = SYSTEM_FROM;
chat_msg.mFromID = LLUUID::null;
nearby_chat->addMessage(chat_msg);
}
}
示例9: chat_notification
void chat_notification(const LLNotificationPtr notification)
{
// TODO: Make a separate archive for these.
if (gSavedSettings.getBOOL("HideNotificationsInChat")) return;
LLChat chat(notification->getMessage());
chat.mSourceType = CHAT_SOURCE_SYSTEM;
// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0e) | Added: RLVa-0.2.0b
// Notices should already have their contents filtered where necessary
if (rlv_handler_t::isEnabled())
chat.mRlvLocFiltered = chat.mRlvNamesFiltered = true;
// [/RLVa:KB]
LLFloaterChat::getInstance()->addChatHistory(chat);
}
示例10: onScriptDialog
//static
void GrowlManager::onScriptDialog(const LLSD& data)
{
LLNotificationPtr notification = LLNotifications::instance().find(data["notification_id"].asUUID());
std::string name = notification->getName();
LLSD payload = notification->getPayload();
LLSD substitutions = notification->getSubstitutions();
//LL_INFOS("GrowlLLNotification") << "Script dialog: name=" << name << " - payload=" << payload << " subs=" << substitutions << LL_ENDL;
if (gGrowlManager->mNotifications.find(name) != gGrowlManager->mNotifications.end())
{
GrowlNotification* growl_notification = &gGrowlManager->mNotifications[name];
std::string body = "";
std::string title = "";
if (growl_notification->useDefaultTextForTitle)
{
title = notification->getMessage();
}
else if (!growl_notification->growlTitle.empty())
{
title = growl_notification->growlTitle;
LLStringUtil::format(title, substitutions);
}
if (growl_notification->useDefaultTextForBody)
{
body = notification->getMessage();
}
else if (!growl_notification->growlBody.empty())
{
body = growl_notification->growlBody;
LLStringUtil::format(body, substitutions);
}
gGrowlManager->notify(title, body, growl_notification->growlName);
}
}
示例11: on_avatar_name_cache_notify
static void on_avatar_name_cache_notify(const LLUUID& agent_id,
const LLAvatarName& av_name,
bool online,
LLSD payload)
{
// Popup a notify box with online status of this agent
// Use display name only because this user is your friend
LLSD args;
args["NAME"] = av_name.getNSName(friend_name_system());
args["STATUS"] = online ? LLTrans::getString("OnlineStatus") : LLTrans::getString("OfflineStatus");
std::string name = args["NAME"];
boost::algorithm::trim(name);
xantispam_check(agent_id.asString(), (online ? "&-ExecFriendIsOnline!" : "&-ExecFriendIsOffline!"), (online ? name + " is online" : name + " is offline"));
// do not pop up a notification when disabled for this agent
if(!xantispam_check(agent_id.asString(), (online ? "!StatusFriendIsOnline" : "!StatusFriendIsOffline"), name))
{
return;
}
// / xantispam
// Popup a notify box with online status of this agent
LLNotificationPtr notification;
if (online)
{
notification =
LLNotifications::instance().add("FriendOnlineOffline",
args,
payload,
boost::bind(&LLAvatarActions::startIM, agent_id));
}
else
{
notification =
LLNotifications::instance().add("FriendOnlineOffline", args, payload);
}
// If there's an open IM session with this agent, send a notification there too.
LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, agent_id);
if (LLFloaterIMPanel* floater = gIMMgr->findFloaterBySession(session_id))
{
std::string notify_msg = notification->getMessage();
if (!notify_msg.empty())
floater->addHistoryLine(notify_msg, gSavedSettings.getColor4("SystemChatColor"));
}
}
示例12: on_avatar_name_cache_notify
static void on_avatar_name_cache_notify(const LLUUID& agent_id,
const LLAvatarName& av_name,
bool online,
LLSD payload)
{
// Popup a notify box with online status of this agent
// Use display name only because this user is your friend
LLSD args;
args["NAME"] = av_name.mDisplayName;
LLNotificationPtr notification;
if (online)
{
notification =
LLNotificationsUtil::add("FriendOnline",
args,
payload.with("respond_on_mousedown", TRUE),
boost::bind(&LLAvatarActions::startIM, agent_id));
}
else
{
notification =
LLNotificationsUtil::add("FriendOffline", args, payload);
}
// If there's an open IM session with this agent, send a notification there too.
LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, agent_id);
std::string notify_msg = notification->getMessage();
LLIMModel::instance().proccessOnlineOfflineNotification(session_id, notify_msg);
// If desired, also send it to nearby chat, this allows friends'
// online/offline times to be referenced in chat & logged.
if (gSavedSettings.getBOOL("OnlineOfflinetoNearbyChat")) {
LLChat chat;
chat.mText = notify_msg;
chat.mSourceType = CHAT_SOURCE_SYSTEM;
args["type"] = LLNotificationsUI::NT_NEARBYCHAT;
LLNotificationsUI::LLNotificationManager::instance().onChat(chat, args);
}
}
示例13:
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);
}
示例14: 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));
}
}
}
示例15: on_avatar_name_cache_notify
static void on_avatar_name_cache_notify(const LLUUID& agent_id,
const LLAvatarName& av_name,
bool online,
LLSD payload)
{
// Popup a notify box with online status of this agent
// Use display name only because this user is your friend
LLSD args;
args["NAME"] = av_name.getNSName(friend_name_system());
args["STATUS"] = online ? LLTrans::getString("OnlineStatus") : LLTrans::getString("OfflineStatus");
// Popup a notify box with online status of this agent
LLNotificationPtr notification;
static const LLCachedControl<S32> behavior(gSavedSettings, "LiruOnlineNotificationBehavior", 1);
if (online && behavior)
{
notification =
LLNotifications::instance().add("FriendOnlineOffline",
args,
payload,
behavior == 1 ? boost::bind(&LLAvatarActions::startIM, agent_id) : (LLNotificationResponder)boost::bind(LLAvatarActions::showProfile, agent_id, false));
}
else
{
notification =
LLNotifications::instance().add("FriendOnlineOffline", args, payload);
}
// If there's an open IM session with this agent, send a notification there too.
LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, agent_id);
if (LLFloaterIMPanel* floater = gIMMgr->findFloaterBySession(session_id))
{
std::string notify_msg = notification->getMessage();
if (!notify_msg.empty())
floater->addHistoryLine(notify_msg, gSavedSettings.getColor4("SystemChatColor"));
}
}