From 70a82ac3df37bd868bf86ba0bdf4af1941706fad Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 28 Sep 2016 12:35:34 +0300 Subject: MAINT-6773 Add payment message --- doc/contributions.txt | 1 + indra/newview/llfloaterpay.cpp | 5 ++--- indra/newview/llviewermessage.cpp | 18 ++++++++++------ indra/newview/skins/default/xui/en/floater_pay.xml | 24 ++++++++++++++++++++-- indra/newview/skins/default/xui/en/strings.xml | 3 +++ 5 files changed, 40 insertions(+), 11 deletions(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index 9f6b701000..6515394a00 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -202,6 +202,7 @@ Ansariel Hiller MAINT-6637 MAINT-6636 MAINT-6752 + MAINT-6773 Aralara Rajal Arare Chantilly CHUIBUG-191 diff --git a/indra/newview/llfloaterpay.cpp b/indra/newview/llfloaterpay.cpp index dfe462c8d1..87973c2286 100644 --- a/indra/newview/llfloaterpay.cpp +++ b/indra/newview/llfloaterpay.cpp @@ -284,7 +284,6 @@ void LLFloaterPay::processPayPriceReply(LLMessageSystem* msg, void **userdata) self->mQuickPayButton[i]->setLabelUnselected(button_str); self->mQuickPayButton[i]->setVisible(TRUE); self->mQuickPayInfo[i]->mAmount = pay_button; - self->getChildView("fastpay text")->setVisible(TRUE); if ( pay_button > max_pay_amount ) { @@ -412,7 +411,6 @@ void LLFloaterPay::payDirectly(money_callback callback, floater->getChildView("pay btn")->setVisible(TRUE); floater->getChildView("amount text")->setVisible(TRUE); - floater->getChildView("fastpay text")->setVisible(TRUE); for(S32 i=0;imQuickPayButton[i]->setVisible(TRUE); @@ -594,7 +592,8 @@ void LLFloaterPay::give(S32 amount) else { // just transfer the L$ - mCallback(mTargetUUID, gAgent.getRegion(), amount, mTargetIsGroup, TRANS_GIFT, LLStringUtil::null); + std::string paymentMessage(getChild("payment_message")->getValue().asString()); + mCallback(mTargetUUID, gAgent.getRegion(), amount, mTargetIsGroup, TRANS_GIFT, (paymentMessage.empty() ? LLStringUtil::null : paymentMessage)); // check if the payee needs to be unmuted LLMuteList::getInstance()->autoRemove(mTargetUUID, LLMuteList::AR_MONEY); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 3925154c0f..1a220a07b9 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5467,9 +5467,12 @@ static std::string reason_from_transaction_type(S32 transaction_type, case TRANS_CLASSIFIED_CHARGE: return LLTrans::getString("to publish a classified ad"); + case TRANS_GIFT: + // Simulator returns "Payment" if no custom description has been entered + return (item_desc == "Payment" ? std::string() : item_desc); + // These have no reason to display, but are expected and should not // generate warnings - case TRANS_GIFT: case TRANS_PAY_OBJECT: case TRANS_OBJECT_PAYS: return std::string(); @@ -5579,6 +5582,7 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg) LLSD payload; bool you_paid_someone = (source_id == gAgentID); + std::string gift_suffix = (transaction_type == TRANS_GIFT ? "_gift" : ""); if (you_paid_someone) { if(!gSavedSettings.getBOOL("NotifyMoneySpend")) @@ -5592,8 +5596,8 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg) { if (dest_id.notNull()) { - message = success ? LLTrans::getString("you_paid_ldollars", args) : - LLTrans::getString("you_paid_failure_ldollars", args); + message = success ? LLTrans::getString("you_paid_ldollars" + gift_suffix, args) : + LLTrans::getString("you_paid_failure_ldollars" + gift_suffix, args); } else { @@ -5620,7 +5624,8 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg) payload["dest_id"] = dest_id; notification = success ? "PaymentSent" : "PaymentFailure"; } - else { + else + { // ...someone paid you if(!gSavedSettings.getBOOL("NotifyMoneyReceived")) { @@ -5631,9 +5636,10 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg) name_id = source_id; if (!reason.empty()) { - message = LLTrans::getString("paid_you_ldollars", args); + message = LLTrans::getString("paid_you_ldollars" + gift_suffix, args); } - else { + else + { message = LLTrans::getString("paid_you_ldollars_no_reason", args); } final_args["MESSAGE"] = message; diff --git a/indra/newview/skins/default/xui/en/floater_pay.xml b/indra/newview/skins/default/xui/en/floater_pay.xml index 9d91f801a6..3e3f8b49ce 100644 --- a/indra/newview/skins/default/xui/en/floater_pay.xml +++ b/indra/newview/skins/default/xui/en/floater_pay.xml @@ -2,7 +2,7 @@ Test Name That Is Extremely Long To Check Clipping + + Description (optional): + + + right="-1" />