diff options
author | Yuri Chebotarev <ychebotarev@productengine.com> | 2009-12-09 19:14:20 +0200 |
---|---|---|
committer | Yuri Chebotarev <ychebotarev@productengine.com> | 2009-12-09 19:14:20 +0200 |
commit | b9d0bc8c8e356e65a1dccf9727c1463ec797f2f4 (patch) | |
tree | a8409a477d697652aecaf487f3cc0c8d6c5483b1 /indra/newview/llnotificationhandlerutil.cpp | |
parent | bf4cbc517ce14bcceb0ee890c541a8973fee62a9 (diff) | |
parent | b24cbb3633594ed7a7ebde1701175cbe33608dea (diff) |
merge
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llnotificationhandlerutil.cpp')
-rw-r--r-- | indra/newview/llnotificationhandlerutil.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 6748bd7982..749786a829 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,8 @@ 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"); // static bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification) @@ -59,6 +62,14 @@ bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification) } // static +bool LLHandlerUtil::canLogToNearbyChat(const LLNotificationPtr& notification) +{ + return notification->getType() == "notifytip" + && FRIEND_ONLINE != notification->getName() + && FRIEND_OFFLINE != notification->getName(); +} + +// static bool LLHandlerUtil::canSpawnIMSession(const LLNotificationPtr& notification) { return ADD_FRIEND_WITH_MESSAGE == notification->getName() @@ -144,3 +155,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); + } +} + |