diff options
author | Mike Antipov <mantipov@productengine.com> | 2009-12-26 13:25:22 +0200 |
---|---|---|
committer | Mike Antipov <mantipov@productengine.com> | 2009-12-26 13:25:22 +0200 |
commit | 4c4c78872898bc7a8fdbc5f403b667a0c7896719 (patch) | |
tree | fd85b0a36829153e62d7f9c463fe47145b48746b /indra/newview/llnotificationhandlerutil.cpp | |
parent | 18e3fd3e0a765309039571d9dc12a68590cfbf75 (diff) |
Fixed normal bug EXT-3643 (Make Friend Offer dialog a modal alert)
-- made dialog a modal alert
-- logging to IM is left as it was
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llnotificationhandlerutil.cpp')
-rw-r--r-- | indra/newview/llnotificationhandlerutil.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 34807485a6..fba5773602 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -63,6 +63,7 @@ bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification) return GRANTED_MODIFY_RIGHTS == notification->getName() || REVOKED_MODIFY_RIGHTS == notification->getName() || PAYMENT_RECIVED == notification->getName() + || OFFER_FRIENDSHIP == notification->getName() || FRIENDSHIP_OFFERED == notification->getName() || SERVER_OBJECT_MESSAGE == notification->getName() || INVENTORY_ACCEPTED == notification->getName() @@ -82,8 +83,7 @@ bool LLHandlerUtil::canLogToNearbyChat(const LLNotificationPtr& notification) // static bool LLHandlerUtil::canSpawnIMSession(const LLNotificationPtr& notification) { - return ADD_FRIEND_WITH_MESSAGE == notification->getName() - || OFFER_FRIENDSHIP == notification->getName() + return OFFER_FRIENDSHIP == notification->getName() || FRIENDSHIP_ACCEPTED == notification->getName() || USER_GIVE_ITEM == notification->getName() || INVENTORY_ACCEPTED == notification->getName() @@ -91,6 +91,12 @@ bool LLHandlerUtil::canSpawnIMSession(const LLNotificationPtr& notification) } // static +bool LLHandlerUtil::canSpawnSessionAndLogToIM(const LLNotificationPtr& notification) +{ + return canLogToIM(notification) && canSpawnIMSession(notification); +} + +// static void LLHandlerUtil::logToIM(const EInstantMessage& session_type, const std::string& session_name, const std::string& from_name, const std::string& message, const LLUUID& session_owner_id, @@ -124,10 +130,7 @@ void LLHandlerUtil::logToIM(const EInstantMessage& session_type, // static void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification) { - const std::string - name = - notification->getSubstitutions().has("NAME") ? notification->getSubstitutions()["NAME"] - : notification->getSubstitutions()["[NAME]"]; + const std::string name = LLHandlerUtil::getSubstitutionName(notification); const std::string session_name = notification->getPayload().has( "SESSION_NAME") ? notification->getPayload()["SESSION_NAME"].asString() : name; @@ -193,3 +196,10 @@ void LLHandlerUtil::spawnIMSession(const std::string& name, const LLUUID& from_i } } +// static +std::string LLHandlerUtil::getSubstitutionName(const LLNotificationPtr& notification) +{ + return notification->getSubstitutions().has("NAME") + ? notification->getSubstitutions()["NAME"] + : notification->getSubstitutions()["[NAME]"]; +} |