diff options
author | Alexei Arabadji <aarabadji@productengine.com> | 2009-12-07 15:15:41 +0200 |
---|---|---|
committer | Alexei Arabadji <aarabadji@productengine.com> | 2009-12-07 15:15:41 +0200 |
commit | 0a617f15a83262ab472ca88f146c57bb0f6a6a73 (patch) | |
tree | 849d190131693d9ea976c0ce25501801d03ce5cb /indra/newview/llnotificationhandlerutil.cpp | |
parent | 67ff38b51b59766ff7bc0af1e541b54ac067ea70 (diff) |
implemented EXT-2797 “Making friendship offer should be recorded into IM history”
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llnotificationhandlerutil.cpp')
-rw-r--r-- | indra/newview/llnotificationhandlerutil.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 0fbc6575e8..6748bd7982 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -46,14 +46,16 @@ const static std::string GRANTED_MODIFY_RIGHTS("GrantedModifyRights"), "ObjectGiveItemUnknownUser"), PAYMENT_RECIVED("PaymentRecived"), ADD_FRIEND_WITH_MESSAGE("AddFriendWithMessage"), USER_GIVE_ITEM("UserGiveItem"), OFFER_FRIENDSHIP("OfferFriendship"), - FRIENDSHIP_ACCEPTED("FriendshipAccepted"); + 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 @@ -103,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); } } |