diff options
author | Palmer <palmer@lindenlab.com> | 2009-12-08 10:00:32 -0800 |
---|---|---|
committer | Palmer <palmer@lindenlab.com> | 2009-12-08 10:00:32 -0800 |
commit | 74f2cb2a70ddad7fe8819fd6855831e0615dc8d5 (patch) | |
tree | 61f2ce7a6cfb5963b7517a582164047a6833757b /indra/newview/llnotificationhandlerutil.cpp | |
parent | cd138869d5bfcf40d3d13d7b887e36263e2919d9 (diff) | |
parent | e07ef0d0e0e8cbd58afd4c6ee970634bd2f783e7 (diff) |
Grabbed more viewer 2 changes that should fix parabuild problem
Diffstat (limited to 'indra/newview/llnotificationhandlerutil.cpp')
-rw-r--r-- | indra/newview/llnotificationhandlerutil.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 857b7e9796..6748bd7982 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -43,14 +43,27 @@ using namespace LLNotificationsUI; const static std::string GRANTED_MODIFY_RIGHTS("GrantedModifyRights"), REVOKED_MODIFY_RIGHTS("RevokedModifyRights"), OBJECT_GIVE_ITEM( "ObjectGiveItem"), OBJECT_GIVE_ITEM_UNKNOWN_USER( - "ObjectGiveItemUnknownUser"), PAYMENT_RECIVED("PaymentRecived"); + "ObjectGiveItemUnknownUser"), PAYMENT_RECIVED("PaymentRecived"), + ADD_FRIEND_WITH_MESSAGE("AddFriendWithMessage"), + USER_GIVE_ITEM("UserGiveItem"), OFFER_FRIENDSHIP("OfferFriendship"), + FRIENDSHIP_ACCEPTED("FriendshipAccepted"), + FRIENDSHIP_OFFERED("FriendshipOffered"); // static bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification) { return GRANTED_MODIFY_RIGHTS == notification->getName() || REVOKED_MODIFY_RIGHTS == notification->getName() - || PAYMENT_RECIVED == notification->getName(); + || PAYMENT_RECIVED == notification->getName() + || FRIENDSHIP_OFFERED == notification->getName(); +} + +// static +bool LLHandlerUtil::canSpawnIMSession(const LLNotificationPtr& notification) +{ + return ADD_FRIEND_WITH_MESSAGE == notification->getName() + || OFFER_FRIENDSHIP == notification->getName() + || FRIENDSHIP_ACCEPTED == notification->getName(); } // static @@ -92,13 +105,16 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification) notification->getSubstitutions().has("NAME") ? notification->getSubstitutions()["NAME"] : notification->getSubstitutions()["[NAME]"]; + 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 && notification->getName() != OBJECT_GIVE_ITEM_UNKNOWN_USER) { LLUUID from_id = notification->getPayload()["from_id"]; - logToIM(IM_NOTHING_SPECIAL, name, name, notification->getMessage(), + logToIM(IM_NOTHING_SPECIAL, session_name, name, notification->getMessage(), from_id, from_id); } } |