Automated merge with https://hg.aws.productengine.com/secondlife/viewer-2-0/
--HG-- branch : product-enginemeow-7.2.2
commit
63096e40de
|
|
@ -265,6 +265,11 @@ public:
|
|||
*/
|
||||
static bool canLogToIM(const LLNotificationPtr& notification);
|
||||
|
||||
/**
|
||||
* Checks sufficient conditions to spawn IM session.
|
||||
*/
|
||||
static bool canSpawnIMSession(const LLNotificationPtr& notification);
|
||||
|
||||
/**
|
||||
* Writes notification message to IM session.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -43,7 +43,10 @@ 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");
|
||||
|
||||
// static
|
||||
bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification)
|
||||
|
|
@ -53,6 +56,14 @@ bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification)
|
|||
|| PAYMENT_RECIVED == 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
|
||||
void LLHandlerUtil::logToIM(const EInstantMessage& session_type,
|
||||
const std::string& session_name, const std::string& from_name,
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
#include "llnotificationmanager.h"
|
||||
#include "llnotifications.h"
|
||||
#include "llscriptfloater.h"
|
||||
#include "llimview.h"
|
||||
|
||||
using namespace LLNotificationsUI;
|
||||
|
||||
|
|
@ -101,6 +102,26 @@ bool LLOfferHandler::processNotification(const LLSD& notify)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (LLHandlerUtil::canSpawnIMSession(notification))
|
||||
{
|
||||
const std::string name = notification->getSubstitutions().has(
|
||||
"NAME") ? notification->getSubstitutions()["NAME"]
|
||||
: notification->getSubstitutions()["[NAME]"];
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
LLToastNotifyPanel* notify_box = new LLToastNotifyPanel(notification);
|
||||
|
||||
LLToast::Params p;
|
||||
|
|
|
|||
|
|
@ -2010,13 +2010,17 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
|
|||
case IM_INVENTORY_ACCEPTED:
|
||||
{
|
||||
args["NAME"] = name;
|
||||
LLNotificationsUtil::add("InventoryAccepted", args);
|
||||
LLSD payload;
|
||||
payload["from_id"] = from_id;
|
||||
LLNotificationsUtil::add("InventoryAccepted", args, payload);
|
||||
break;
|
||||
}
|
||||
case IM_INVENTORY_DECLINED:
|
||||
{
|
||||
args["NAME"] = name;
|
||||
LLNotificationsUtil::add("InventoryDeclined", args);
|
||||
LLSD payload;
|
||||
payload["from_id"] = from_id;
|
||||
LLNotificationsUtil::add("InventoryDeclined", args, payload);
|
||||
break;
|
||||
}
|
||||
// TODO: _DEPRECATED suffix as part of vote removal - DEV-24856
|
||||
|
|
|
|||
|
|
@ -4499,14 +4499,14 @@ You don't have permission to copy this.
|
|||
<notification
|
||||
icon="notifytip.tga"
|
||||
name="InventoryAccepted"
|
||||
type="notifytip">
|
||||
type="offer">
|
||||
[NAME] received your inventory offer.
|
||||
</notification>
|
||||
|
||||
<notification
|
||||
icon="notifytip.tga"
|
||||
name="InventoryDeclined"
|
||||
type="notifytip">
|
||||
type="offer">
|
||||
[NAME] declined your inventory offer.
|
||||
</notification>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue