summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAlexei Arabadji <aarabadji@productengine.com>2009-12-25 16:41:06 +0200
committerAlexei Arabadji <aarabadji@productengine.com>2009-12-25 16:41:06 +0200
commit40d89ae418be2c43903955f1ee4dfbf05e38576c (patch)
treea3f0c95567b4a633d1ff2411c1d035d46bdb59cd /indra
parent5d5d9ee7fa6a5bbe0b4573088c9e79e33e299999 (diff)
fixed EXT-700 “"Offer" notifications should be accessible via chiclet”
made inventory and teleport offers spawn chiclet; made 'inventory accepted' toast as notytip; --HG-- branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llnotificationhandler.h5
-rw-r--r--indra/newview/llnotificationhandlerutil.cpp30
-rw-r--r--indra/newview/llnotificationofferhandler.cpp11
-rw-r--r--indra/newview/llnotificationtiphandler.cpp13
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml2
5 files changed, 45 insertions, 16 deletions
diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h
index 515c86bae8..33ef4c81cd 100644
--- a/indra/newview/llnotificationhandler.h
+++ b/indra/newview/llnotificationhandler.h
@@ -298,6 +298,11 @@ public:
* Writes notification message to nearby chat.
*/
static void logToNearbyChat(const LLNotificationPtr& notification, EChatSourceType type);
+
+ /**
+ * Spawns IM session.
+ */
+ static void spawnIMSession(const std::string& name, const LLUUID& from_id);
};
}
diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp
index 5b54092c5c..174efd24a6 100644
--- a/indra/newview/llnotificationhandlerutil.cpp
+++ b/indra/newview/llnotificationhandlerutil.cpp
@@ -47,11 +47,13 @@ const static std::string GRANTED_MODIFY_RIGHTS("GrantedModifyRights"),
"ObjectGiveItem"), OBJECT_GIVE_ITEM_UNKNOWN_USER(
"ObjectGiveItemUnknownUser"), PAYMENT_RECIVED("PaymentRecived"),
ADD_FRIEND_WITH_MESSAGE("AddFriendWithMessage"),
- USER_GIVE_ITEM("UserGiveItem"), OFFER_FRIENDSHIP("OfferFriendship"),
+ USER_GIVE_ITEM("UserGiveItem"), INVENTORY_ACCEPTED("InventoryAccepted"),
+ OFFER_FRIENDSHIP("OfferFriendship"),
FRIENDSHIP_ACCEPTED("FriendshipAccepted"),
FRIENDSHIP_OFFERED("FriendshipOffered"),
FRIEND_ONLINE("FriendOnline"), FRIEND_OFFLINE("FriendOffline"),
- SERVER_OBJECT_MESSAGE("ServerObjectMessage");
+ SERVER_OBJECT_MESSAGE("ServerObjectMessage"),
+ TELEPORT_OFFERED("TeleportOffered");
// static
bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification)
@@ -60,7 +62,8 @@ bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification)
|| REVOKED_MODIFY_RIGHTS == notification->getName()
|| PAYMENT_RECIVED == notification->getName()
|| FRIENDSHIP_OFFERED == notification->getName()
- || SERVER_OBJECT_MESSAGE == notification->getName();
+ || SERVER_OBJECT_MESSAGE == notification->getName()
+ || INVENTORY_ACCEPTED == notification->getName();
}
// static
@@ -68,7 +71,8 @@ bool LLHandlerUtil::canLogToNearbyChat(const LLNotificationPtr& notification)
{
return notification->getType() == "notifytip"
&& FRIEND_ONLINE != notification->getName()
- && FRIEND_OFFLINE != notification->getName();
+ && FRIEND_OFFLINE != notification->getName()
+ && INVENTORY_ACCEPTED != notification->getName();
}
// static
@@ -76,7 +80,10 @@ bool LLHandlerUtil::canSpawnIMSession(const LLNotificationPtr& notification)
{
return ADD_FRIEND_WITH_MESSAGE == notification->getName()
|| OFFER_FRIENDSHIP == notification->getName()
- || FRIENDSHIP_ACCEPTED == notification->getName();
+ || FRIENDSHIP_ACCEPTED == notification->getName()
+ || USER_GIVE_ITEM == notification->getName()
+ || INVENTORY_ACCEPTED == notification->getName()
+ || TELEPORT_OFFERED == notification->getName();
}
// static
@@ -169,3 +176,16 @@ void LLHandlerUtil::logToNearbyChat(const LLNotificationPtr& notification, EChat
}
}
+// static
+void LLHandlerUtil::spawnIMSession(const std::string& name, const LLUUID& from_id)
+{
+ LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, from_id);
+
+ LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(
+ session_id);
+ if (session == NULL)
+ {
+ LLIMMgr::instance().addSession(name, IM_NOTHING_SPECIAL, from_id);
+ }
+}
+
diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp
index 4d64c5c0e4..5861a802e9 100644
--- a/indra/newview/llnotificationofferhandler.cpp
+++ b/indra/newview/llnotificationofferhandler.cpp
@@ -111,16 +111,7 @@ bool LLOfferHandler::processNotification(const LLSD& notify)
LLUUID from_id = notification->getPayload()["from_id"];
- LLUUID session_id = LLIMMgr::computeSessionID(
- IM_NOTHING_SPECIAL, from_id);
-
- LLIMModel::LLIMSession* session =
- LLIMModel::instance().findIMSession(session_id);
- if (session == NULL)
- {
- LLIMMgr::instance().addSession(name, IM_NOTHING_SPECIAL,
- from_id);
- }
+ LLHandlerUtil::spawnIMSession(name, from_id);
}
if (notification->getPayload().has("SUPPRES_TOST")
diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp
index 9afaddae82..83a2215ac6 100644
--- a/indra/newview/llnotificationtiphandler.cpp
+++ b/indra/newview/llnotificationtiphandler.cpp
@@ -101,6 +101,19 @@ bool LLTipHandler::processNotification(const LLSD& notify)
}
}
+ const std::string name = notification->getSubstitutions()["NAME"];
+ LLUUID from_id = notification->getPayload()["from_id"];
+ if (LLHandlerUtil::canLogToIM(notification))
+ {
+ LLHandlerUtil::logToIM(IM_NOTHING_SPECIAL, name, name,
+ notification->getMessage(), from_id, from_id);
+ }
+
+ if (LLHandlerUtil::canSpawnIMSession(notification))
+ {
+ LLHandlerUtil::spawnIMSession(name, from_id);
+ }
+
LLToastNotifyPanel* notify_box = new LLToastNotifyPanel(notification);
LLToast::Params p;
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index d4b712e048..ee8b7a5132 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -4498,7 +4498,7 @@ You don&apos;t have permission to copy this.
<notification
icon="notifytip.tga"
name="InventoryAccepted"
- type="offer">
+ type="notifytip">
[NAME] received your inventory offer.
</notification>