Show L$ transactions in nearby chat. Fixes FIRE-1470

master
Ansariel 2011-07-11 15:55:35 +02:00
parent 4999de1dc0
commit 436f2beafd
3 changed files with 67 additions and 10 deletions

View File

@ -2,6 +2,17 @@
<llsd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="llsd.xsd">
<map>
<key>FSPaymentInfoInChat</key>
<map>
<key>Comment</key>
<string>If true, L$ balance changes will be shown in nearby chat instead of toasts.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>FSScriptDialogNoTransparency</key>
<map>
<key>Comment</key>

View File

@ -5632,10 +5632,24 @@ static void money_balance_group_notify(const LLUUID& group_id,
LLSD args,
LLSD payload)
{
// Message uses name SLURLs, don't actually have to substitute in
// the name. We're just making sure it's available.
// Notification is either PaymentReceived or PaymentSent
LLNotificationsUtil::add(notification, args, payload);
static LLCachedControl<bool> balance_change_in_chat(gSavedSettings, "FSPaymentInfoInChat");
if (balance_change_in_chat)
{
LLChat chat;
chat.mText = llformat(args["MESSAGE"].asString().c_str(), name.c_str());
chat.mSourceType = CHAT_SOURCE_SYSTEM;
LLSD chat_args;
chat_args["type"] = LLNotificationsUI::NT_NEARBYCHAT;
LLNotificationsUI::LLNotificationManager::instance().onChat(chat, chat_args);
}
else
{
// Message uses name SLURLs, don't actually have to substitute in
// the name. We're just making sure it's available.
// Notification is either PaymentReceived or PaymentSent
LLNotificationsUtil::add(notification, args, payload);
}
}
static void money_balance_avatar_notify(const LLUUID& agent_id,
@ -5644,10 +5658,24 @@ static void money_balance_avatar_notify(const LLUUID& agent_id,
LLSD args,
LLSD payload)
{
// Message uses name SLURLs, don't actually have to substitute in
// the name. We're just making sure it's available.
// Notification is either PaymentReceived or PaymentSent
LLNotificationsUtil::add(notification, args, payload);
static LLCachedControl<bool> balance_change_in_chat(gSavedSettings, "FSPaymentInfoInChat");
if (balance_change_in_chat)
{
LLChat chat;
chat.mText = llformat(args["MESSAGE"].asString().c_str(), av_name.getCompleteName().c_str());
chat.mSourceType = CHAT_SOURCE_SYSTEM;
LLSD chat_args;
chat_args["type"] = LLNotificationsUI::NT_NEARBYCHAT;
LLNotificationsUI::LLNotificationManager::instance().onChat(chat, chat_args);
}
else
{
// Message uses name SLURLs, don't actually have to substitute in
// the name. We're just making sure it's available.
// Notification is either PaymentReceived or PaymentSent
LLNotificationsUtil::add(notification, args, payload);
}
}
static void process_money_balance_reply_extended(LLMessageSystem* msg)
@ -5662,6 +5690,11 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg)
S32 amount = 0;
std::string item_description;
// Ansariel: If we output to chat history and probably console,
// don't create an SLURL for the name or we will end
// up with a SLURL in the console
static LLCachedControl<bool> balance_change_in_chat(gSavedSettings, "FSPaymentInfoInChat");
msg->getS32("TransactionInfo", "TransactionType", transaction_type);
msg->getUUID("TransactionInfo", "SourceID", source_id);
msg->getBOOL("TransactionInfo", "IsSourceGroup", is_source_group);
@ -5723,7 +5756,7 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg)
bool you_paid_someone = (source_id == gAgentID);
if (you_paid_someone)
{
args["NAME"] = dest_slurl;
args["NAME"] = balance_change_in_chat ? "%s" : dest_slurl;
is_name_group = is_dest_group;
name_id = dest_id;
if (!reason.empty())
@ -5755,7 +5788,7 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg)
}
else {
// ...someone paid you
args["NAME"] = source_slurl;
args["NAME"] = balance_change_in_chat ? "%s" : source_slurl;
is_name_group = is_source_group;
name_id = source_id;
if (!reason.empty())

View File

@ -902,7 +902,18 @@
width="50"
height="20"
control_name="PhoenixBoldGroupMods"
name="PhoenixBoldGroupMods"
label="Show group moderator messages in bold"/>
<check_box
layout="topleft"
follows="left|top"
top_pad="0"
left="20"
width="50"
height="20"
control_name="FSPaymentInfoInChat"
name="FSPaymentInfoInChat"
label="Show L$ transactions in local chat instead of toasts"/>
<check_box
layout="topleft"
follows="left|top"
@ -910,6 +921,7 @@
width="50"
height="20"
control_name="PhoenixMuteAllGroups"
name="PhoenixMuteAllGroups"
label="Disable ALL group chats"/>
<check_box
layout="topleft"
@ -918,6 +930,7 @@
width="50"
height="20"
control_name="PhoenixMuteGroupWhenNoticesDisabled"
name="PhoenixMuteGroupWhenNoticesDisabled"
label="When 'Receive group notices' is disabled, disable group chat as well"/>
<button
layout="topleft"