Awesome! Transactions list now even works - even with groups!
parent
0e0795b602
commit
4eac7aa05c
|
|
@ -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();
|
||||
// <FS:Ansariel> Unscrew avatar icon for transaction messages
|
||||
p.payment_message = payload["payment_message"].asString();
|
||||
p.payment_is_group = payload["payment_is_group"].asBoolean();
|
||||
// </FS:Ansariel>
|
||||
p.sender = payload["sender_name"].asString();
|
||||
p.time_stamp = notify->getDate();
|
||||
p.received_time = payload["received_time"].asDate();
|
||||
|
|
|
|||
|
|
@ -572,11 +572,18 @@ LLTransactionNotificationListItem::LLTransactionNotificationListItem(const Param
|
|||
|
||||
BOOL LLTransactionNotificationListItem::postBuild()
|
||||
{
|
||||
// <FS:Ansariel> Unscrew avatar icon for transaction messages
|
||||
mParams.title = mParams.payment_message;
|
||||
|
||||
BOOL rv = LLNotificationListItem::postBuild();
|
||||
|
||||
mAvatarIcon = getChild<LLAvatarIconCtrl>("avatar_icon");
|
||||
mAvatarIconExp = getChild<LLAvatarIconCtrl>("avatar_icon_exp");
|
||||
mAvatarIcon->setValue("System_Notification");
|
||||
mAvatarIconExp->setValue("System_Notification");
|
||||
// <FS:Ansariel> Unscrew avatar icon for transaction messages
|
||||
mGroupIcon = getChild<LLGroupIconCtrl>("group_icon");
|
||||
mGroupIconExp = getChild<LLGroupIconCtrl>("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);
|
||||
// <FS:Ansariel> 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);
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
else if (mParams.notification_name == "PaymentSent")
|
||||
{
|
||||
mAvatarIcon->setValue(mParams.paid_to_id);
|
||||
mAvatarIconExp->setValue(mParams.paid_to_id);
|
||||
// <FS:Ansariel> 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);
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
|
|
|||
|
|
@ -54,6 +54,10 @@ public:
|
|||
std::string title;
|
||||
std::string subject;
|
||||
std::string message;
|
||||
// <FS:Ansariel> Unscrew avatar icon for transaction messages
|
||||
std::string payment_message;
|
||||
bool payment_is_group;
|
||||
// </FS:Ansariel>
|
||||
std::string sender;
|
||||
S32 fee;
|
||||
LLDate time_stamp;
|
||||
|
|
@ -229,6 +233,9 @@ private:
|
|||
LLTransactionNotificationListItem & operator=(LLTransactionNotificationListItem &);
|
||||
LLAvatarIconCtrl* mAvatarIcon;
|
||||
LLAvatarIconCtrl* mAvatarIconExp;
|
||||
// <FS:Ansariel> Unscrew avatar icon for transaction messages
|
||||
LLGroupIconCtrl* mGroupIcon;
|
||||
LLGroupIconCtrl* mGroupIconExp;
|
||||
};
|
||||
|
||||
class LLSystemNotificationListItem : public LLNotificationListItem
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
// <FS:AO> 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";
|
||||
|
||||
// <FS:AO> 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);
|
||||
}
|
||||
// </FS:AO>
|
||||
}
|
||||
|
||||
payload["payment_is_group"] = is_name_group;
|
||||
payload["payment_message"] = message_notification_well;
|
||||
|
||||
// <FS:Ansariel> TipTracker Support
|
||||
FSMoneyTracker* tipTracker = LLFloaterReg::getTypedInstance<FSMoneyTracker>("money_tracker");
|
||||
if ((tipTracker->isShown() || tipTracker->isMinimized()) || gSavedSettings.getBOOL("FSAlwaysTrackPayments"))
|
||||
|
|
|
|||
Loading…
Reference in New Issue