summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rw-r--r--indra/newview/llviewermessage.cpp381
1 files changed, 251 insertions, 130 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 7664d7ee07..28e20d92d0 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -37,7 +37,7 @@
#include <deque>
-#include "audioengine.h"
+#include "llaudioengine.h"
#include "indra_constants.h"
#include "lscript_byteformat.h"
#include "mean_collision_data.h"
@@ -48,6 +48,7 @@
#include "lldbstrings.h"
#include "lleconomy.h"
#include "llfilepicker.h"
+#include "llfloaterreg.h"
#include "llfocusmgr.h"
#include "llfollowcamparams.h"
#include "llinstantmessage.h"
@@ -77,7 +78,6 @@
#include "llfloaterbuycurrency.h"
#include "llfloaterbuyland.h"
#include "llfloaterchat.h"
-#include "llfloatergroupinfo.h"
#include "llfloaterimagepreview.h"
#include "llfloaterland.h"
#include "llfloaterregioninfo.h"
@@ -93,13 +93,15 @@
#include "llhudmanager.h"
#include "llimpanel.h"
#include "llinventorymodel.h"
-#include "llinventoryview.h"
+#include "llfloaterinventory.h"
#include "llmenugl.h"
+#include "llmoveview.h"
#include "llmutelist.h"
#include "llnotifications.h"
#include "llnotify.h"
#include "llpanelgrouplandmoney.h"
#include "llselectmgr.h"
+#include "llsidetray.h"
#include "llstartup.h"
#include "llsky.h"
#include "llstatenums.h"
@@ -125,7 +127,7 @@
#include "llviewerthrottle.h"
#include "llviewerwindow.h"
#include "llvlmanager.h"
-#include "llvoavatar.h"
+#include "llvoavatarself.h"
#include "llvotextbubble.h"
#include "llweb.h"
#include "llworld.h"
@@ -134,13 +136,19 @@
#include "llfloaterworldmap.h"
#include "llviewerdisplay.h"
#include "llkeythrottle.h"
+#include "llgroupactions.h"
+#include "llagentui.h"
#include <boost/tokenizer.hpp>
+#include <boost/algorithm/string/split.hpp>
#if LL_WINDOWS // For Windows specific error handler
#include "llwindebug.h" // For the invalid message handler
#endif
+//#include "llnearbychathistory.h"
+#include "llnotificationmanager.h"
+
//
// Constants
//
@@ -160,7 +168,7 @@ void open_offer(const std::vector<LLUUID>& items, const std::string& from_name);
bool check_offer_throttle(const std::string& from_name, bool check_only);
void callbackCacheEstateOwnerName(const LLUUID& id,
const std::string& first, const std::string& last,
- BOOL is_group, void*);
+ BOOL is_group);
//inventory offer throttle globals
LLFrameTimer gThrottleTimer;
@@ -204,6 +212,10 @@ bool friendship_offer_callback(const LLSD& notification, const LLSD& response)
LLUUID fid;
LLMessageSystem* msg = gMessageSystem;
const LLSD& payload = notification["payload"];
+
+ // add friend to recent people list
+ LLRecentPeople::instance().add(payload["from_id"]);
+
switch(option)
{
case 0:
@@ -630,7 +642,7 @@ bool join_group_response(const LLSD& notification, const LLSD& response)
if (option == 2 && !group_id.isNull())
{
- LLFloaterGroupInfo::showFromUUID(group_id);
+ LLGroupActions::show(group_id);
LLSD args;
args["MESSAGE"] = message;
LLNotifications::instance().add("JoinGroup", args, notification["payload"]);
@@ -867,13 +879,14 @@ void open_offer(const std::vector<LLUUID>& items, const std::string& from_name)
LLInventoryItem* item;
for(; it != end; ++it)
{
- item = gInventory.getItem(*it);
+ const LLUUID& id = *it;
+ item = gInventory.getItem(id);
if(!item)
{
- LL_WARNS("Messaging") << "Unable to show inventory item: " << *it << LL_ENDL;
+ LL_WARNS("Messaging") << "Unable to show inventory item: " << id << LL_ENDL;
continue;
}
- if(gInventory.isObjectDescendentOf(*it, trash_id))
+ if(gInventory.isObjectDescendentOf(id, trash_id))
{
continue;
}
@@ -882,40 +895,55 @@ void open_offer(const std::vector<LLUUID>& items, const std::string& from_name)
//if we are throttled, don't display them
if (check_offer_throttle(from_name, false))
{
- // I'm not sure this is a good idea.
- bool show_keep_discard = item->getPermissions().getCreator() != gAgent.getID();
- //bool show_keep_discard = true;
+ // If we opened this ourselves, focus it
+ BOOL take_focus = from_name.empty() ? TAKE_FOCUS_YES : TAKE_FOCUS_NO;
switch(asset_type)
{
- case LLAssetType::AT_NOTECARD:
- open_notecard((LLViewerInventoryItem*)item, std::string("Note: ") + item->getName(), LLUUID::null, show_keep_discard, LLUUID::null, FALSE);
+ case LLAssetType::AT_NOTECARD:
+ LLFloaterReg::showInstance("preview_notecard", LLSD(id), take_focus);
break;
- case LLAssetType::AT_LANDMARK:
- open_landmark((LLViewerInventoryItem*)item, std::string("Landmark: ") + item->getName(), show_keep_discard, LLUUID::null, FALSE);
+ case LLAssetType::AT_LANDMARK:
+ {
+ LLInventoryCategory* parent_folder = gInventory.getCategory(item->getParentUUID());
+ LLSD args;
+ args["LANDMARK_NAME"] = item->getName();
+ args["FOLDER_NAME"] = std::string(parent_folder ? parent_folder->getName() : "unnkown");
+ LLNotifications::instance().add("LandmarkCreated", args);
+
+ // Open new landmark for editing in Places panel.
+ LLSD key;
+ key["type"] = "landmark";
+ key["id"] = item->getUUID();
+ LLSideTray::getInstance()->showPanel("panel_places", key);
+ }
break;
- case LLAssetType::AT_TEXTURE:
- open_texture(*it, std::string("Texture: ") + item->getName(), show_keep_discard, LLUUID::null, FALSE);
+ case LLAssetType::AT_TEXTURE:
+ LLFloaterReg::showInstance("preview_texture", LLSD(id), take_focus);
break;
- default:
+ default:
break;
}
}
//highlight item, if it's not in the trash or lost+found
// Don't auto-open the inventory floater
- LLInventoryView* view = LLInventoryView::getActiveInventory();
- if(!view)
- {
- return;
- }
-
+ LLFloaterInventory* view = NULL;
if(gSavedSettings.getBOOL("ShowInInventory") &&
asset_type != LLAssetType::AT_CALLINGCARD &&
item->getInventoryType() != LLInventoryType::IT_ATTACHMENT &&
!from_name.empty())
{
- LLInventoryView::showAgentInventory(TRUE);
+ view = LLFloaterInventory::showAgentInventory();
+ }
+ else
+ {
+ view = LLFloaterInventory::getActiveInventory();
+ }
+ if(!view)
+ {
+ return;
}
+
//Trash Check
LLUUID trash_id;
trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH);
@@ -941,17 +969,19 @@ void open_offer(const std::vector<LLUUID>& items, const std::string& from_name)
LL_DEBUGS("Messaging") << "Highlighting" << item->getUUID() << LL_ENDL;
//highlight item
- LLUICtrl* focus_ctrl = gFocusMgr.getKeyboardFocus();
- view->getPanel()->setSelection(item->getUUID(), TAKE_FOCUS_NO);
- gFocusMgr.setKeyboardFocus(focus_ctrl);
+ if (view->getPanel())
+ {
+ LLFocusableElement* focus_ctrl = gFocusMgr.getKeyboardFocus();
+ view->getPanel()->setSelection(item->getUUID(), TAKE_FOCUS_NO);
+ gFocusMgr.setKeyboardFocus(focus_ctrl);
+ }
}
}
void inventory_offer_mute_callback(const LLUUID& blocked_id,
const std::string& first_name,
const std::string& last_name,
- BOOL is_group,
- void* user_data)
+ BOOL is_group)
{
std::string from_name;
LLMute::EType type;
@@ -970,8 +1000,9 @@ void inventory_offer_mute_callback(const LLUUID& blocked_id,
LLMute mute(blocked_id, from_name, type);
if (LLMuteList::getInstance()->add(mute))
{
- LLFloaterMute::showInstance();
- LLFloaterMute::getInstance()->selectMute(blocked_id);
+ LLFloaterReg::showInstance("mute");
+ LLFloaterMute* mute_instance = LLFloaterReg::getTypedInstance<LLFloaterMute>("mute");
+ if(mute_instance) mute_instance->selectMute(blocked_id);
}
// purge the message queue of any previously queued inventory offers from the same source.
@@ -1040,7 +1071,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
// * we can't build two messages at once.
if (2 == button)
{
- gCacheName->getNameFromUUID(mFromID, mFromGroup, inventory_offer_mute_callback, this);
+ gCacheName->get(mFromID, mFromGroup, &inventory_offer_mute_callback);
}
LLMessageSystem* msg = gMessageSystem;
@@ -1055,7 +1086,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
msg->addUUIDFast(_PREHASH_ID, mTransactionID);
msg->addU32Fast(_PREHASH_Timestamp, NO_TIMESTAMP); // no timestamp necessary
std::string name;
- gAgent.buildFullname(name);
+ LLAgentUI::buildFullname(name);
msg->addStringFast(_PREHASH_FromAgentName, name);
msg->addStringFast(_PREHASH_Message, "");
msg->addU32Fast(_PREHASH_ParentEstateID, 0);
@@ -1070,7 +1101,6 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
itemp = (LLViewerInventoryItem*)gInventory.getItem(mObjectID);
}
- // *TODO:translate
std::string from_string; // Used in the pop-up.
std::string chatHistory_string; // Used in chat history.
if (mFromObject == TRUE)
@@ -1080,13 +1110,18 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
std::string group_name;
if (gCacheName->getGroupName(mFromID, group_name))
{
- from_string = std::string("An object named '") + mFromName + "' owned by the group '" + group_name + "'";
- chatHistory_string = mFromName + " owned by the group '" + group_name + "'";
+ from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+"'"
+ + mFromName + LLTrans::getString("'") +" " + LLTrans::getString("InvOfferOwnedByGroup")
+ + " "+ "'" + group_name + "'";
+
+ chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedByGroup")
+ + " " + group_name + "'";
}
else
{
- from_string = std::string("An object named '") + mFromName + "' owned by an unknown group";
- chatHistory_string = mFromName + " owned by an unknown group";
+ from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+"'"
+ + mFromName +"'"+ " " + LLTrans::getString("InvOfferOwnedByUnknownGroup");
+ chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedByUnknownGroup");
}
}
else
@@ -1094,13 +1129,15 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
std::string first_name, last_name;
if (gCacheName->getName(mFromID, first_name, last_name))
{
- from_string = std::string("An object named '") + mFromName + "' owned by " + first_name + " " + last_name;
- chatHistory_string = mFromName + " owned by " + first_name + " " + last_name;
+ from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+ LLTrans::getString("'") + mFromName
+ + LLTrans::getString("'")+" " + LLTrans::getString("InvOfferOwnedBy") + first_name + " " + last_name;
+ chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedBy") + " " + first_name + " " + last_name;
}
else
{
- from_string = std::string("An object named '") + mFromName + "' owned by an unknown user";
- chatHistory_string = mFromName + " owned by an unknown user";
+ from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+LLTrans::getString("'")
+ + mFromName + LLTrans::getString("'")+" " + LLTrans::getString("InvOfferOwnedByUnknownUser");
+ chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedByUnknownUser");
}
}
}
@@ -1128,7 +1165,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
//don't spam them if they are getting flooded
if (check_offer_throttle(mFromName, true))
{
- log_message = chatHistory_string + " gave you " + mDesc + ".";
+ log_message = chatHistory_string + " " + LLTrans::getString("InvOfferGaveYou") + " " + mDesc + LLTrans::getString(".");
chat.mText = log_message;
LLFloaterChat::addChatHistory(chat);
}
@@ -1191,7 +1228,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
// send the message
msg->sendReliable(mHost);
- log_message = "You decline " + mDesc + " from " + mFromName + ".";
+ log_message = LLTrans::getString("InvOfferYouDecline") + " " + mDesc + " " + LLTrans::getString("InvOfferFrom") + " " + mFromName +".";
chat.mText = log_message;
if( LLMuteList::getInstance()->isMuted(mFromID ) && ! LLMuteList::getInstance()->isLinden(mFromName) ) // muting for SL-42269
{
@@ -1227,15 +1264,17 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
break;
}
+ if(IM_INVENTORY_OFFERED == mIM)
+ {
+ // add buddy to recent people list
+ LLRecentPeople::instance().add(mFromID);
+ }
+
if(opener)
{
gInventory.addObserver(opener);
}
- // Allow these to stack up, but once you deal with one, reset the
- // position.
- gFloaterView->resetStartingFloaterPosition();
-
delete this;
return false;
}
@@ -1329,7 +1368,7 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task)
args["NAME"] = info->mFromName;
LLNotification::Params p("ObjectGiveItem");
- p.substitutions(args).payload(payload).functor(boost::bind(&LLOfferInfo::inventory_offer_callback, info, _1, _2));
+ p.substitutions(args).payload(payload).functor.function(boost::bind(&LLOfferInfo::inventory_offer_callback, info, _1, _2));
if (from_task)
{
@@ -1415,7 +1454,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
LLChat chat;
std::string buffer;
- // *TODO:translate - need to fix the full name to first/last (maybe)
+ // *TODO: Translate - need to fix the full name to first/last (maybe)
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, from_id);
msg->getBOOLFast(_PREHASH_MessageBlock, _PREHASH_FromGroup, from_group);
msg->getUUIDFast(_PREHASH_MessageBlock, _PREHASH_ToAgentID, to_id);
@@ -1437,6 +1476,8 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
BOOL is_muted = LLMuteList::getInstance()->isMuted(from_id, name, LLMute::flagTextChat);
BOOL is_linden = LLMuteList::getInstance()->isLinden(name);
BOOL is_owned_by_me = FALSE;
+ BOOL is_friend = (LLAvatarTracker::instance().getBuddyInfo(from_id) == NULL) ? false : true;
+ BOOL accept_im_from_only_friend = gSavedSettings.getBOOL("VoiceCallsFriendsOnly");
chat.mMuted = is_muted && !is_linden;
chat.mFromID = from_id;
@@ -1466,7 +1507,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
case IM_CONSOLE_AND_CHAT_HISTORY:
// These are used for system messages, hence don't need the name,
// as it is always "Second Life".
- // *TODO:translate
+ // *TODO: Translate
args["MESSAGE"] = message;
// Note: don't put the message in the IM history, even though was sent
@@ -1492,7 +1533,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
// if there is not a panel for this conversation (i.e. it is a new IM conversation
// initiated by the other party) then...
std::string my_name;
- gAgent.buildFullname(my_name);
+ LLAgentUI::buildFullname(my_name);
std::string response = gSavedPerAccountSettings.getString("BusyModeResponse2");
pack_instant_message(
gMessageSystem,
@@ -1510,7 +1551,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
// now store incoming IM in chat history
- buffer = separator_string + message.substr(message_offset);
+ buffer = message.substr(message_offset);
LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL;
@@ -1560,11 +1601,16 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
{
saved = llformat("(Saved %s) ", formatted_time(timestamp).c_str());
}
- buffer = separator_string + saved + message.substr(message_offset);
+ buffer = saved + message.substr(message_offset);
LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL;
- if (!is_muted || is_linden)
+ bool mute_im = is_muted;
+ if(accept_im_from_only_friend&&!is_friend)
+ {
+ mute_im = true;
+ }
+ if (!mute_im || is_linden)
{
gIMMgr->addMessage(
session_id,
@@ -1611,7 +1657,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
case IM_MESSAGEBOX:
{
// This is a block, modeless dialog.
- //*TODO:translate
+ //*TODO: Translate
args["MESSAGE"] = message;
LLNotifications::instance().add("SystemMessage", args);
}
@@ -1698,13 +1744,14 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
LLSD args;
args["SUBJECT"] = subj;
args["MESSAGE"] = mes;
- LLNotifications::instance().add(LLNotification::Params("GroupNotice").substitutions(args).payload(payload).timestamp(timestamp));
+ LLNotifications::instance().add(LLNotification::Params("GroupNotice").substitutions(args).payload(payload).time_stamp(timestamp));
}
// Also send down the old path for now.
if (IM_GROUP_NOTICE_REQUESTED == dialog)
{
- LLFloaterGroupInfo::showNotice(subj,mes,group_id,has_inventory,item_name,info);
+
+ LLPanelGroup::showNotice(subj,mes,group_id,has_inventory,item_name,info);
}
}
break;
@@ -1755,7 +1802,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
// Someone has offered us some inventory.
{
LLOfferInfo* info = new LLOfferInfo;
-
+ bool mute_im = false;
if (IM_INVENTORY_OFFERED == dialog)
{
struct offer_agent_bucket_t
@@ -1772,6 +1819,11 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
bucketp = (struct offer_agent_bucket_t*) &binary_bucket[0];
info->mType = (LLAssetType::EType) bucketp->asset_type;
info->mObjectID = bucketp->object_id;
+
+ if(accept_im_from_only_friend&&!is_friend)
+ {
+ mute_im = true;
+ }
}
else
{
@@ -1802,7 +1854,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
info->mDesc = message;
info->mHost = msg->getSender();
//if (((is_busy && !is_owned_by_me) || is_muted))
- if ( is_muted )
+ if ( is_muted || mute_im)
{
// Same as closing window
info->forceResponse(IOR_DECLINE);
@@ -1859,7 +1911,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
{
saved = llformat("(Saved %s) ", formatted_time(timestamp).c_str());
}
- buffer = separator_string + saved + message.substr(message_offset);
+ buffer = saved + message.substr(message_offset);
BOOL is_this_agent = FALSE;
if(from_id == gAgentID)
{
@@ -1969,7 +2021,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
else
{
LLSD args;
- // *TODO:translate -> [FIRST] [LAST] (maybe)
+ // *TODO: Translate -> [FIRST] [LAST] (maybe)
args["NAME"] = name;
args["MESSAGE"] = message;
LLSD payload;
@@ -2086,7 +2138,7 @@ void busy_message (LLMessageSystem* msg, LLUUID from_id)
if (gAgent.getBusy())
{
std::string my_name;
- gAgent.buildFullname(my_name);
+ LLAgentUI::buildFullname(my_name);
std::string response = gSavedPerAccountSettings.getString("BusyModeResponse2");
pack_instant_message(
gMessageSystem,
@@ -2352,15 +2404,15 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
switch(chat.mChatType)
{
case CHAT_TYPE_WHISPER:
- verb = " " + LLTrans::getString("whisper") + " ";
+ verb = "(" + LLTrans::getString("whisper") + ")";
break;
case CHAT_TYPE_DEBUG_MSG:
case CHAT_TYPE_OWNER:
case CHAT_TYPE_NORMAL:
- verb = ": ";
+ verb = "";
break;
case CHAT_TYPE_SHOUT:
- verb = " " + LLTrans::getString("shout") + " ";
+ verb = "(" + LLTrans::getString("shout") + ")";
break;
case CHAT_TYPE_START:
case CHAT_TYPE_STOP:
@@ -2368,12 +2420,12 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
break;
default:
LL_WARNS("Messaging") << "Unknown type " << chat.mChatType << " in chat!" << LL_ENDL;
- verb = " say, ";
+ verb = "";
break;
}
- chat.mText = from_name;
+ chat.mText = "";
chat.mText += verb;
chat.mText += mesg;
}
@@ -2396,17 +2448,24 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
// T * * * F Yes Yes
chat.mMuted = is_muted && !is_linden;
-
-
+
if (!visible_in_chat_bubble
&& (is_linden || !is_busy || is_owned_by_me))
{
// show on screen and add to history
+ LLNotificationsUI::LLNotificationManager::instance().onChat(
+ chat, LLNotificationsUI::NT_NEARBYCHAT);
+
+ // adding temporarily so that communications window chat bar
+ // works until the new chat window is ready
+ chat.mText = from_name + ": " + chat.mText;
LLFloaterChat::addChat(chat, FALSE, FALSE);
}
else
{
- // just add to chat history
+ LLNotificationsUI::LLNotificationManager::instance().onChat(
+ chat, LLNotificationsUI::NT_NEARBYCHAT);
+ // adding temporarily
LLFloaterChat::addChatHistory(chat);
}
}
@@ -2430,7 +2489,7 @@ void process_teleport_start(LLMessageSystem *msg, void**)
}
else
{
- gViewerWindow->setProgressCancelButtonVisible(TRUE, std::string("Cancel")); // *TODO: Translate
+ gViewerWindow->setProgressCancelButtonVisible(TRUE, LLTrans::getString("Cancel"));
}
// Freeze the UI and show progress bar
@@ -2465,7 +2524,7 @@ void process_teleport_progress(LLMessageSystem* msg, void**)
}
else
{
- gViewerWindow->setProgressCancelButtonVisible(TRUE, std::string("Cancel")); //TODO: Translate
+ gViewerWindow->setProgressCancelButtonVisible(TRUE, LLTrans::getString("Cancel"));
}
std::string buffer;
msg->getString("Info", "Message", buffer);
@@ -2880,12 +2939,45 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
{
LLSD payload;
payload["message"] = version_channel;
- LLNotifications::instance().add("ServerVersionChanged", LLSD(), payload);
+ LLNotifications::instance().add("ServerVersionChanged", LLSD(), payload, server_version_changed_callback);
}
gLastVersionChannel = version_channel;
}
+bool server_version_changed_callback(const LLSD& notification, const LLSD& response)
+{
+ if(notification["payload"]["message"].asString() =="")
+ return false;
+ std::string url ="http://wiki.secondlife.com/wiki/Release_Notes/";
+ //parse the msg string
+ std::string server_version = notification["payload"]["message"].asString();
+ std::vector<std::string> s_vect;
+ boost::algorithm::split(s_vect, server_version, isspace);
+ for(U32 i = 0; i < s_vect.size(); i++)
+ {
+ if (i != (s_vect.size() - 1))
+ {
+ if(i != (s_vect.size() - 2))
+ {
+ url += s_vect[i] + "_";
+ }
+ else
+ {
+ url += s_vect[i] + "/";
+ }
+ }
+ else
+ {
+ url += s_vect[i].substr(0,4);
+ }
+ }
+
+ LLWeb::loadURL(url);
+ return false;
+}
+
+
void process_crossed_region(LLMessageSystem* msg, void**)
{
LLUUID agent_id;
@@ -3217,11 +3309,12 @@ void process_terse_object_update_improved(LLMessageSystem *mesgsys, void **user_
gObjectList.processCompressedObjectUpdate(mesgsys, user_data, OUT_TERSE_IMPROVED);
}
+static LLFastTimer::DeclareTimer FTM_PROCESS_OBJECTS("Process Objects");
void process_kill_object(LLMessageSystem *mesgsys, void **user_data)
{
- LLFastTimer t(LLFastTimer::FTM_PROCESS_OBJECTS);
+ LLFastTimer t(FTM_PROCESS_OBJECTS);
LLUUID id;
U32 local_id;
@@ -3782,13 +3875,13 @@ void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data)
gAgent.setSitCamera(sitObjectID, camera_eye, camera_at);
}
- gAgent.mForceMouselook = force_mouselook;
+ gAgent.setForceMouselook(force_mouselook);
LLViewerObject* object = gObjectList.findObject(sitObjectID);
if (object)
{
LLVector3 sit_spot = object->getPositionAgent() + (sitPosition * object->getRotation());
- if (!use_autopilot || (avatar && avatar->mIsSitting && avatar->getRoot() == object->getRoot()))
+ if (!use_autopilot || (avatar && avatar->isSitting() && avatar->getRoot() == object->getRoot()))
{
//we're already sitting on this object, so don't autopilot
}
@@ -4094,7 +4187,7 @@ void process_money_balance_reply( LLMessageSystem* msg, void** )
{
// Make the user confirm the transaction, since they might
// have missed something during an event.
- // *TODO:translate
+ // *TODO: Translate
LLSD args;
args["MESSAGE"] = desc;
LLNotifications::instance().add("SystemMessage", args);
@@ -4170,7 +4263,7 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock)
bool attempt_standard_notification(LLMessageSystem* msgsystem)
{
// if we have additional alert data
- if (msgsystem->getNumberOfBlocksFast(_PREHASH_AlertInfo) > 0)
+ if (msgsystem->has(_PREHASH_AlertInfo) && msgsystem->getNumberOfBlocksFast(_PREHASH_AlertInfo) > 0)
{
// notification was specified using the new mechanism, so we can just handle it here
std::string notificationID;
@@ -4316,23 +4409,23 @@ void process_alert_core(const std::string& message, BOOL modal)
}
else
{
- // *TODO:translate
- args["MESSAGE"] = text;
+ std::string new_msg =LLNotifications::instance().getGlobalString(text);
+ args["MESSAGE"] = new_msg;
LLNotifications::instance().add("SystemMessage", args);
}
}
else if (modal)
{
- // *TODO:translate
LLSD args;
- args["ERROR_MESSAGE"] = message;
+ std::string new_msg =LLNotifications::instance().getGlobalString(message);
+ args["ERROR_MESSAGE"] = new_msg;
LLNotifications::instance().add("ErrorMessage", args);
}
else
{
- // *TODO:translate
LLSD args;
- args["MESSAGE"] = message;
+ std::string new_msg =LLNotifications::instance().getGlobalString(message);
+ args["MESSAGE"] = new_msg;
LLNotifications::instance().add("SystemMessageTip", args);
}
}
@@ -4346,11 +4439,11 @@ void handle_show_mean_events(void *)
{
return;
}
-
- LLFloaterBump::show(NULL);
+ LLFloaterReg::showInstance("bumps");
+ //LLFloaterBump::showInstance();
}
-void mean_name_callback(const LLUUID &id, const std::string& first, const std::string& last, BOOL always_false, void* data)
+void mean_name_callback(const LLUUID &id, const std::string& first, const std::string& last, BOOL always_false)
{
if (gNoRender)
{
@@ -4428,7 +4521,7 @@ void process_mean_collision_alert_message(LLMessageSystem *msgsystem, void **use
LLMeanCollisionData *mcd = new LLMeanCollisionData(gAgentID, perp, time, type, mag);
gMeanCollisionList.push_front(mcd);
const BOOL is_group = FALSE;
- gCacheName->getNameFromUUID(perp, is_group, mean_name_callback);
+ gCacheName->get(perp, is_group, &mean_name_callback);
}
}
}
@@ -4460,9 +4553,6 @@ void process_economy_data(LLMessageSystem *msg, void** /*user_data*/)
LL_INFOS_ONCE("Messaging") << "EconomyData message arrived; upload cost is L$" << upload_cost << LL_ENDL;
- LLFloaterImagePreview::setUploadAmount(upload_cost);
- LLFloaterAnimPreview::setUploadAmount(upload_cost);
-
gMenuHolder->childSetLabelArg("Upload Image", "[COST]", llformat("%d", upload_cost));
gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", llformat("%d", upload_cost));
gMenuHolder->childSetLabelArg("Upload Animation", "[COST]", llformat("%d", upload_cost));
@@ -4480,7 +4570,7 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp
// located in [REGIONNAME] at [REGIONPOS],
// has been <granted|denied> permission to: [PERMISSIONS]."
- LLUIString notice(LLFloaterChat::getInstance()->getString(granted ? "ScriptQuestionCautionChatGranted" : "ScriptQuestionCautionChatDenied"));
+ LLUIString notice(LLTrans::getString(granted ? "ScriptQuestionCautionChatGranted" : "ScriptQuestionCautionChatDenied"));
// always include the object name and owner name
notice.setArg("[OBJECTNAME]", notification["payload"]["object_name"].asString());
@@ -4534,7 +4624,7 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp
perms.append(", ");
}
- perms.append(LLFloaterChat::getInstance()->getString(SCRIPT_QUESTIONS[i]));
+ perms.append(LLTrans::getString(SCRIPT_QUESTIONS[i]));
}
}
@@ -4628,7 +4718,7 @@ static LLNotificationFunctorRegistration script_question_cb_reg_2("ScriptQuestio
void process_script_question(LLMessageSystem *msg, void **user_data)
{
- // *TODO:translate owner name -> [FIRST] [LAST]
+ // *TODO: Translate owner name -> [FIRST] [LAST]
LLHost sender = msg->getSender();
@@ -4652,7 +4742,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data)
// so we'll reuse the same namespace for both throttle types.
std::string throttle_name = owner_name;
std::string self_name;
- gAgent.getName( self_name );
+ LLAgentUI::buildName( self_name );
if( owner_name == self_name )
{
throttle_name = taskid.getString();
@@ -4696,7 +4786,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data)
if (questions & LSCRIPTRunTimePermissionBits[i])
{
count++;
- script_question += " " + LLFloaterChat::getInstance()->getString(SCRIPT_QUESTIONS[i]) + "\n";
+ script_question += " " + LLTrans::getString(SCRIPT_QUESTIONS[i]) + "\n";
// check whether permission question should cause special caution dialog
caution |= (SCRIPT_QUESTION_IS_CAUTION[i]);
@@ -4744,15 +4834,15 @@ void container_inventory_arrived(LLViewerObject* object,
gAgent.changeCameraToDefault();
}
- LLInventoryView* view = LLInventoryView::getActiveInventory();
+ LLFloaterInventory* view = LLFloaterInventory::getActiveInventory();
if (inventory->size() > 2)
{
// create a new inventory category to put this in
LLUUID cat_id;
- cat_id = gInventory.createNewCategory(gAgent.getInventoryRootID(),
+ cat_id = gInventory.createNewCategory(gInventory.getRootFolderID(),
LLAssetType::AT_NONE,
- std::string("Acquired Items")); //TODO: Translate
+ LLTrans::getString("AcquiredItems"));
InventoryObjectList::const_iterator it = inventory->begin();
InventoryObjectList::const_iterator end = inventory->end();
@@ -4846,10 +4936,18 @@ void container_inventory_arrived(LLViewerObject* object,
// method to format the time.
std::string formatted_time(const time_t& the_time)
{
- char buffer[30]; /* Flawfinder: ignore */
- LLStringUtil::copy(buffer, ctime(&the_time), 30);
- buffer[24] = '\0';
- return std::string(buffer);
+ std::string dateStr = "["+LLTrans::getString("LTimeWeek")+"] ["
+ +LLTrans::getString("LTimeMonth")+"] ["
+ +LLTrans::getString("LTimeDay")+"] ["
+ +LLTrans::getString("LTimeHour")+"]:["
+ +LLTrans::getString("LTimeMin")+"]:["
+ +LLTrans::getString("LTimeSec")+"] ["
+ +LLTrans::getString("LTimeYear")+"]";
+
+ LLSD substitution;
+ substitution["datetime"] = (S32) the_time;
+ LLStringUtil::format (dateStr, substitution);
+ return dateStr;
}
@@ -4860,7 +4958,7 @@ void process_teleport_failed(LLMessageSystem *msg, void**)
LLSD args;
// if we have additional alert data
- if (msg->getNumberOfBlocksFast(_PREHASH_AlertInfo) > 0)
+ if (msg->has(_PREHASH_AlertInfo) && msg->getSizeFast(_PREHASH_AlertInfo, _PREHASH_Message) > 0)
{
// Get the message ID
msg->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, reason);
@@ -4917,6 +5015,9 @@ void process_teleport_failed(LLMessageSystem *msg, void**)
LLNotifications::instance().add("CouldNotTeleportReason", args);
+ // Let the interested parties know that teleport failed.
+ LLViewerParcelMgr::getInstance()->onTeleportFailed();
+
if( gAgent.getTeleportState() != LLAgent::TELEPORT_NONE )
{
gAgent.setTeleportState( LLAgent::TELEPORT_NONE );
@@ -4966,6 +5067,11 @@ void process_teleport_local(LLMessageSystem *msg,void**)
gAgent.updateCamera();
send_agent_update(TRUE, TRUE);
+
+ // Let the interested parties know we've teleported.
+ // Vadim *HACK: Agent position seems to get reset (to render position?)
+ // on each frame, so we have to pass the new position manually.
+ LLViewerParcelMgr::getInstance()->onTeleportFinished(true, gAgent.getPosGlobalFromAgent(pos));
}
void send_simple_im(const LLUUID& to_id,
@@ -4974,7 +5080,7 @@ void send_simple_im(const LLUUID& to_id,
const LLUUID& id)
{
std::string my_name;
- gAgent.buildFullname(my_name);
+ LLAgentUI::buildFullname(my_name);
send_improved_im(to_id,
my_name,
message,
@@ -4995,7 +5101,7 @@ void send_group_notice(const LLUUID& group_id,
// This will mean converting the item to a binary bucket,
// and the subject/message into a single field.
std::string my_name;
- gAgent.buildFullname(my_name);
+ LLAgentUI::buildFullname(my_name);
// Combine subject + message into a single string.
std::ostringstream subject_and_message;
@@ -5073,13 +5179,13 @@ void handle_lure(const LLUUID& invitee)
}
// Prompt for a message to the invited user.
-void handle_lure(LLDynamicArray<LLUUID>& ids)
+void handle_lure(const std::vector<LLUUID>& ids)
{
LLSD edit_args;
edit_args["REGION"] = gAgent.getRegion()->getName();
LLSD payload;
- for (LLDynamicArray<LLUUID>::iterator it = ids.begin();
+ for (LLDynamicArray<LLUUID>::const_iterator it = ids.begin();
it != ids.end();
++it)
{
@@ -5298,7 +5404,7 @@ static LLNotificationFunctorRegistration callback_load_url_reg("LoadWebPage", ca
// We've got the name of the person who owns the object hurling the url.
// Display confirmation dialog.
-void callback_load_url_name(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data)
+void callback_load_url_name(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group)
{
std::vector<LLSD>::iterator it;
for (it = gLoadUrlList.begin(); it != gLoadUrlList.end(); )
@@ -5311,7 +5417,7 @@ void callback_load_url_name(const LLUUID& id, const std::string& first, const st
std::string owner_name;
if (is_group)
{
- owner_name = first + " (group)";
+ owner_name = first + LLTrans::getString("Group");
}
else
{
@@ -5375,7 +5481,7 @@ void process_load_url(LLMessageSystem* msg, void**)
// Add to list of pending name lookups
gLoadUrlList.push_back(payload);
- gCacheName->getNameFromUUID(owner_id, owner_is_group, callback_load_url_name);
+ gCacheName->get(owner_id, owner_is_group, &callback_load_url_name);
}
@@ -5431,12 +5537,17 @@ void process_script_teleport_request(LLMessageSystem* msg, void**)
msg->getVector3("Data", "SimPosition", pos);
msg->getVector3("Data", "LookAt", look_at);
- gFloaterWorldMap->trackURL(sim_name, (S32)pos.mV[VX], (S32)pos.mV[VY], (S32)pos.mV[VZ]);
- LLFloaterWorldMap::show(NULL, TRUE);
-
+ LLFloaterWorldMap* instance = LLFloaterWorldMap::getInstance();
+ if(instance)
+ {
+ instance->trackURL(
+ sim_name, (S32)pos.mV[VX], (S32)pos.mV[VY], (S32)pos.mV[VZ]);
+ LLFloaterReg::showInstance("world_map", "center");
+ }
+
// remove above two lines and replace with below line
// to re-enable parcel browser for llMapDestination()
- // LLURLDispatcher::dispatch(LLURLDispatcher::buildSLURL(sim_name, (S32)pos.mV[VX], (S32)pos.mV[VY], (S32)pos.mV[VZ]), FALSE);
+ // LLURLDispatcher::dispatch(LLSLURL::buildSLURL(sim_name, (S32)pos.mV[VX], (S32)pos.mV[VY], (S32)pos.mV[VZ]), FALSE);
}
@@ -5458,18 +5569,28 @@ void process_covenant_reply(LLMessageSystem* msg, void**)
std::string last_modified;
if (covenant_timestamp == 0)
{
- last_modified = LLTrans::getString("covenant_never_modified");
+ last_modified = LLTrans::getString("covenant_last_modified")+LLTrans::getString("never_text");
}
else
{
- last_modified = LLTrans::getString("covenant_modified") + " " + formatted_time((time_t)covenant_timestamp);
+ last_modified = LLTrans::getString("covenant_last_modified")+"["
+ +LLTrans::getString("LTimeWeek")+"] ["
+ +LLTrans::getString("LTimeMonth")+"] ["
+ +LLTrans::getString("LTimeDay")+"] ["
+ +LLTrans::getString("LTimeHour")+"]:["
+ +LLTrans::getString("LTimeMin")+"]:["
+ +LLTrans::getString("LTimeSec")+"] ["
+ +LLTrans::getString("LTimeYear")+"]";
+ LLSD substitution;
+ substitution["datetime"] = (S32) covenant_timestamp;
+ LLStringUtil::format (last_modified, substitution);
}
LLPanelEstateCovenant::updateLastModified(last_modified);
LLPanelLandCovenant::updateLastModified(last_modified);
LLFloaterBuyLand::updateLastModified(last_modified);
- // Estates can't be owned by groups
+ gCacheName->get(estate_owner_id, false, &callbackCacheEstateOwnerName);
BOOL is_group = FALSE;
gCacheName->getNameFromUUID(estate_owner_id, is_group, callbackCacheEstateOwnerName);
@@ -5493,11 +5614,11 @@ void process_covenant_reply(LLMessageSystem* msg, void**)
if (estate_owner_id.isNull())
{
// mainland
- covenant_text = "There is no Covenant provided for this Estate.";
+ covenant_text = LLTrans::getString("RegionNoCovenant");
}
else
{
- covenant_text = "There is no Covenant provided for this Estate. The land on this estate is being sold by the Estate owner, not Linden Lab. Please contact the Estate Owner for sales details.";
+ covenant_text = LLTrans::getString("RegionNoCovenantOtherOwner");
}
LLPanelEstateCovenant::updateCovenantText(covenant_text, covenant_id);
LLPanelLandCovenant::updateCovenantText(covenant_text);
@@ -5507,13 +5628,13 @@ void process_covenant_reply(LLMessageSystem* msg, void**)
void callbackCacheEstateOwnerName(const LLUUID& id,
const std::string& first, const std::string& last,
- BOOL is_group, void*)
+ BOOL is_group)
{
std::string name;
if (id.isNull())
{
- name = "(none)";
+ name = LLTrans::getString("none_text");
}
else
{
@@ -5544,10 +5665,10 @@ void onCovenantLoadComplete(LLVFS *vfs,
if( (file_length > 19) && !strncmp( &buffer[0], "Linden text version", 19 ) )
{
- LLViewerTextEditor* editor =
- new LLViewerTextEditor(std::string("temp"),
- LLRect(0,0,0,0),
- file_length+1);
+ LLViewerTextEditor::Params params;
+ params.name("temp");
+ params.max_text_length(file_length+1);
+ LLViewerTextEditor * editor = LLUICtrlFactory::create<LLViewerTextEditor> (params);
if( !editor->importBuffer( &buffer[0], file_length+1 ) )
{
LL_WARNS("Messaging") << "Problem importing estate covenant." << LL_ENDL;
@@ -5622,6 +5743,6 @@ void invalid_message_callback(LLMessageSystem* msg,
void LLOfferInfo::forceResponse(InventoryOfferResponse response)
{
LLNotification::Params params("UserGiveItem");
- params.functor(boost::bind(&LLOfferInfo::inventory_offer_callback, this, _1, _2));
+ params.functor.function(boost::bind(&LLOfferInfo::inventory_offer_callback, this, _1, _2));
LLNotifications::instance().forceResponse(params, response);
}