diff --git a/indra/newview/llfloaternotificationstabbed.cpp b/indra/newview/llfloaternotificationstabbed.cpp index 4b5fe4989a..d48e35b0ef 100644 --- a/indra/newview/llfloaternotificationstabbed.cpp +++ b/indra/newview/llfloaternotificationstabbed.cpp @@ -390,6 +390,10 @@ void LLFloaterNotificationsTabbed::onStoreToast(LLPanel* info_panel, LLUUID id) p.fee = payload["fee"]; p.subject = payload["subject"].asString(); p.message = payload["message"].asString(); + // Unscrew avatar icon for transaction messages + p.payment_message = payload["payment_message"].asString(); + p.payment_is_group = payload["payment_is_group"].asBoolean(); + // p.sender = payload["sender_name"].asString(); p.time_stamp = notify->getDate(); p.received_time = payload["received_time"].asDate(); diff --git a/indra/newview/llnotificationlistitem.cpp b/indra/newview/llnotificationlistitem.cpp index 8005fa6239..58dc0d5aa2 100644 --- a/indra/newview/llnotificationlistitem.cpp +++ b/indra/newview/llnotificationlistitem.cpp @@ -572,11 +572,18 @@ LLTransactionNotificationListItem::LLTransactionNotificationListItem(const Param BOOL LLTransactionNotificationListItem::postBuild() { + // Unscrew avatar icon for transaction messages + mParams.title = mParams.payment_message; + BOOL rv = LLNotificationListItem::postBuild(); + mAvatarIcon = getChild("avatar_icon"); mAvatarIconExp = getChild("avatar_icon_exp"); mAvatarIcon->setValue("System_Notification"); mAvatarIconExp->setValue("System_Notification"); + // Unscrew avatar icon for transaction messages + mGroupIcon = getChild("group_icon"); + mGroupIconExp = getChild("group_icon_exp"); mAvatarIcon->setVisible(TRUE); mAvatarIconExp->setVisible(TRUE); @@ -588,13 +595,45 @@ BOOL LLTransactionNotificationListItem::postBuild() if (mParams.notification_name == "PaymentReceived") { - mAvatarIcon->setValue(mParams.paid_from_id); - mAvatarIconExp->setValue(mParams.paid_from_id); + // Unscrew avatar icon for transaction messages + //mAvatarIcon->setValue(mParams.paid_from_id); + //mAvatarIconExp->setValue(mParams.paid_from_id); + if (!mParams.payment_is_group) + { + mAvatarIcon->setValue(mParams.paid_from_id); + mAvatarIconExp->setValue(mParams.paid_from_id); + } + else + { + mGroupIcon->setValue(mParams.paid_from_id); + mGroupIconExp->setValue(mParams.paid_from_id); + mGroupIcon->setVisible(TRUE); + mGroupIconExp->setVisible(TRUE); + mAvatarIcon->setVisible(FALSE); + mAvatarIconExp->setVisible(FALSE); + } + // } else if (mParams.notification_name == "PaymentSent") { - mAvatarIcon->setValue(mParams.paid_to_id); - mAvatarIconExp->setValue(mParams.paid_to_id); + // Unscrew avatar icon for transaction messages + //mAvatarIcon->setValue(mParams.paid_to_id); + //mAvatarIconExp->setValue(mParams.paid_to_id); + if (!mParams.payment_is_group) + { + mAvatarIcon->setValue(mParams.paid_to_id); + mAvatarIconExp->setValue(mParams.paid_to_id); + } + else + { + mGroupIcon->setValue(mParams.paid_to_id); + mGroupIconExp->setValue(mParams.paid_to_id); + mGroupIcon->setVisible(TRUE); + mGroupIconExp->setVisible(TRUE); + mAvatarIcon->setVisible(FALSE); + mAvatarIconExp->setVisible(FALSE); + } + // } return rv; diff --git a/indra/newview/llnotificationlistitem.h b/indra/newview/llnotificationlistitem.h index 9a4ce2be4b..fb0ca29ca3 100644 --- a/indra/newview/llnotificationlistitem.h +++ b/indra/newview/llnotificationlistitem.h @@ -54,6 +54,10 @@ public: std::string title; std::string subject; std::string message; + // Unscrew avatar icon for transaction messages + std::string payment_message; + bool payment_is_group; + // std::string sender; S32 fee; LLDate time_stamp; @@ -229,6 +233,9 @@ private: LLTransactionNotificationListItem & operator=(LLTransactionNotificationListItem &); LLAvatarIconCtrl* mAvatarIcon; LLAvatarIconCtrl* mAvatarIconExp; + // Unscrew avatar icon for transaction messages + LLGroupIconCtrl* mGroupIcon; + LLGroupIconCtrl* mGroupIconExp; }; class LLSystemNotificationListItem : public LLNotificationListItem diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 9600b2d732..fe47e605ae 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -6958,26 +6958,30 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg) } std::string source_slurl; + std::string source_slurl_name; if (is_source_group) { source_slurl = LLSLURL( "group", source_id, "inspect").getSLURLString(); + source_slurl_name = source_slurl; } else { - //source_slurl =LLSLURL( "agent", source_id, "completename").getSLURLString(); + source_slurl_name =LLSLURL( "agent", source_id, "completename").getSLURLString(); source_slurl =LLSLURL( "agent", source_id, "inspect").getSLURLString(); } std::string dest_slurl; + std::string dest_slurl_name; if (is_dest_group) { dest_slurl = LLSLURL( "group", dest_id, "inspect").getSLURLString(); + dest_slurl_name = dest_slurl; } else { - //dest_slurl = LLSLURL( "agent", dest_id, "completename").getSLURLString(); + dest_slurl_name = LLSLURL( "agent", dest_id, "completename").getSLURLString(); dest_slurl = LLSLURL( "agent", dest_id, "inspect").getSLURLString(); } @@ -6993,6 +6997,7 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg) bool is_name_group = false; LLUUID name_id; std::string message; + std::string message_notification_well; std::string notification; LLSD final_args; LLSD payload; @@ -7046,12 +7051,13 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg) final_args["MESSAGE"] = message; payload["dest_id"] = dest_id; - notification = "PaymentSent"; + notification = success ? "PaymentSent" : "PaymentFailure"; // Additionally, always add a SLURL-enabled form. - args["NAME"] = dest_slurl; is_name_group = is_dest_group; name_id = dest_id; + + args["NAME"] = dest_slurl; if (!reason.empty()) { if (dest_id.notNull()) @@ -7081,7 +7087,36 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg) } } final_args["SLURLMESSAGE"] = message; - notification = success ? "PaymentSent" : "PaymentFailure"; + + args["NAME"] = dest_slurl_name; + if (!reason.empty()) + { + if (dest_id.notNull()) + { + message_notification_well = success ? LLTrans::getString("you_paid_ldollars", args) : + LLTrans::getString("you_paid_failure_ldollars", args); + } + else + { + // transaction fee to the system, eg, to create a group + message_notification_well = success ? LLTrans::getString("you_paid_ldollars_no_name", args) : + LLTrans::getString("you_paid_failure_ldollars_no_name", args); + } + } + else + { + if (dest_id.notNull()) + { + message_notification_well = success ? LLTrans::getString("you_paid_ldollars_no_reason", args) : + LLTrans::getString("you_paid_failure_ldollars_no_reason", args); + } + else + { + // no target, no reason, you just paid money + message_notification_well = success ? LLTrans::getString("you_paid_ldollars_no_info", args) : + LLTrans::getString("you_paid_failure_ldollars_no_info", args); + } + } } else { @@ -7104,9 +7139,10 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg) notification = "PaymentReceived"; // Additionally, always add a SLURL-enabled form. - args["NAME"] = source_slurl; is_name_group = is_source_group; name_id = source_id; + + args["NAME"] = source_slurl; if (!reason.empty()) { message = LLTrans::getString("paid_you_ldollars", args); @@ -7116,9 +7152,22 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg) message = LLTrans::getString("paid_you_ldollars_no_reason", args); } final_args["SLURLMESSAGE"] = message; + + args["NAME"] = source_slurl_name; + if (!reason.empty()) + { + message_notification_well = LLTrans::getString("paid_you_ldollars", args); + } + else + { + message_notification_well = LLTrans::getString("paid_you_ldollars_no_reason", args); + } // } + payload["payment_is_group"] = is_name_group; + payload["payment_message"] = message_notification_well; + // TipTracker Support FSMoneyTracker* tipTracker = LLFloaterReg::getTypedInstance("money_tracker"); if ((tipTracker->isShown() || tipTracker->isMinimized()) || gSavedSettings.getBOOL("FSAlwaysTrackPayments"))