summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2013-01-03 14:19:04 -0800
committerGilbert Gonzales <gilbert@lindenlab.com>2013-01-03 14:19:04 -0800
commitaa6fee292d1721eac6f0f1f270844e01e06979d4 (patch)
tree08394bf123757afbbbd3aaf3488e9215868f8d90 /indra
parent034143225ba60e8bb1163501e2f57c2be932578b (diff)
CHUI-499: Fixed a serialization problem where the a notification's objectInfo was not being serialized/deserialized.
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/llnotifications.cpp5
-rw-r--r--indra/llui/llnotifications.h4
-rw-r--r--indra/newview/lldonotdisturbnotificationstorage.cpp2
-rw-r--r--indra/newview/llnotificationstorage.cpp7
-rwxr-xr-xindra/newview/llviewermessage.cpp3
-rw-r--r--indra/newview/llviewermessage.h1
6 files changed, 14 insertions, 8 deletions
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index c9b4399bef..8aa0b6f110 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -517,6 +517,11 @@ LLSD LLNotification::asLLSD()
p.expiry = mExpiresAt;
p.priority = mPriority;
+ if(mResponder)
+ {
+ p.functor.responder_sd = mResponder->asLLSD();
+ }
+
if(!mResponseFunctorName.empty())
{
p.functor.name = mResponseFunctorName;
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index 42dee4c3e9..2a6391f49e 100644
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -322,11 +322,13 @@ public:
Alternative<std::string> name;
Alternative<LLNotificationFunctorRegistry::ResponseFunctor> function;
Alternative<LLNotificationResponderPtr> responder;
+ Alternative<LLSD> responder_sd;
Functor()
: name("responseFunctor"),
function("functor"),
- responder("responder")
+ responder("responder"),
+ responder_sd("responder_sd")
{}
};
Optional<Functor> functor;
diff --git a/indra/newview/lldonotdisturbnotificationstorage.cpp b/indra/newview/lldonotdisturbnotificationstorage.cpp
index f4560d5668..6407a3fa0c 100644
--- a/indra/newview/lldonotdisturbnotificationstorage.cpp
+++ b/indra/newview/lldonotdisturbnotificationstorage.cpp
@@ -118,7 +118,7 @@ void LLDoNotDisturbNotificationStorage::loadNotifications()
}
else
{
- LLNotificationResponderInterface* responder = createResponder(notification_params["name"], notification_params["responder"]);
+ LLNotificationResponderInterface* responder = createResponder(notification_params["responder_sd"]["responder_type"], notification_params["responder_sd"]);
if (responder == NULL)
{
LL_WARNS("LLDoNotDisturbNotificationStorage") << "cannot create responder for notification of type '"
diff --git a/indra/newview/llnotificationstorage.cpp b/indra/newview/llnotificationstorage.cpp
index b797775369..4c5b7cc198 100644
--- a/indra/newview/llnotificationstorage.cpp
+++ b/indra/newview/llnotificationstorage.cpp
@@ -126,13 +126,8 @@ LLResponderRegistry::LLResponderRegistry()
, mBuildMap()
{
add("ObjectGiveItem", &create<LLOfferInfo>);
- add("OwnObjectGiveItem", &create<LLOfferInfo>);
add("UserGiveItem", &create<LLOfferInfo>);
-
- add("TeleportOffered", &create<LLOfferInfo>);
- add("TeleportOffered_MaturityExceeded", &create<LLOfferInfo>);
-
- add("OfferFriendship", &create<LLOfferInfo>);
+ add("offer_info", &create<LLOfferInfo>);
}
LLResponderRegistry::~LLResponderRegistry()
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 04dd7c911b..d264a18597 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -1361,6 +1361,8 @@ void inventory_offer_mute_callback(const LLUUID& blocked_id,
gSavedSettings.getString("NotificationChannelUUID")), OfferMatcher(blocked_id));
}
+std::string LLOfferInfo::mResponderType = "offer_info";
+
LLOfferInfo::LLOfferInfo()
: LLNotificationResponderInterface()
, mFromGroup(FALSE)
@@ -1406,6 +1408,7 @@ LLOfferInfo::LLOfferInfo(const LLOfferInfo& info)
LLSD LLOfferInfo::asLLSD()
{
LLSD sd;
+ sd["responder_type"] = mResponderType;
sd["im_type"] = mIM;
sd["from_id"] = mFromID;
sd["from_group"] = mFromGroup;
diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h
index 447fdeb9c7..3237f3fbdd 100644
--- a/indra/newview/llviewermessage.h
+++ b/indra/newview/llviewermessage.h
@@ -229,6 +229,7 @@ public:
void forceResponse(InventoryOfferResponse response);
+ static std::string mResponderType;
EInstantMessage mIM;
LLUUID mFromID;
BOOL mFromGroup;