diff options
author | James Cook <james@lindenlab.com> | 2009-12-11 10:22:50 -0800 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2009-12-11 10:22:50 -0800 |
commit | a87b99cd950de20dc55e1ae6ce7186863a554326 (patch) | |
tree | 43d1385397cbefac07934588824a3d0716fc6365 /indra/newview/llnotificationhandlerutil.cpp | |
parent | b26694f2ab4d88fb8a0e4b1f0e8733f111af4522 (diff) | |
parent | c74d5c483cbd75c5e2a0b17c8980755a9932c53a (diff) |
Merge, fixed conflict in panel_preferences_sound.xml
Diffstat (limited to 'indra/newview/llnotificationhandlerutil.cpp')
-rw-r--r-- | indra/newview/llnotificationhandlerutil.cpp | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 6748bd7982..5b54092c5c 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -37,6 +37,8 @@ #include "llnotifications.h" #include "llimview.h" #include "llagent.h" +#include "llfloaterreg.h" +#include "llnearbychat.h" using namespace LLNotificationsUI; @@ -47,7 +49,9 @@ const static std::string GRANTED_MODIFY_RIGHTS("GrantedModifyRights"), ADD_FRIEND_WITH_MESSAGE("AddFriendWithMessage"), USER_GIVE_ITEM("UserGiveItem"), OFFER_FRIENDSHIP("OfferFriendship"), FRIENDSHIP_ACCEPTED("FriendshipAccepted"), - FRIENDSHIP_OFFERED("FriendshipOffered"); + FRIENDSHIP_OFFERED("FriendshipOffered"), + FRIEND_ONLINE("FriendOnline"), FRIEND_OFFLINE("FriendOffline"), + SERVER_OBJECT_MESSAGE("ServerObjectMessage"); // static bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification) @@ -55,7 +59,16 @@ bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification) return GRANTED_MODIFY_RIGHTS == notification->getName() || REVOKED_MODIFY_RIGHTS == notification->getName() || PAYMENT_RECIVED == notification->getName() - || FRIENDSHIP_OFFERED == notification->getName(); + || FRIENDSHIP_OFFERED == notification->getName() + || SERVER_OBJECT_MESSAGE == notification->getName(); +} + +// static +bool LLHandlerUtil::canLogToNearbyChat(const LLNotificationPtr& notification) +{ + return notification->getType() == "notifytip" + && FRIEND_ONLINE != notification->getName() + && FRIEND_OFFLINE != notification->getName(); } // static @@ -144,3 +157,15 @@ void LLHandlerUtil::logGroupNoticeToIMGroup( payload["group_id"], sender_id); } +// static +void LLHandlerUtil::logToNearbyChat(const LLNotificationPtr& notification, EChatSourceType type) +{ + LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD()); + if(nearby_chat) + { + LLChat chat_msg(notification->getMessage()); + chat_msg.mSourceType = type; + nearby_chat->addMessage(chat_msg); + } +} + |