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.cpp91
1 files changed, 63 insertions, 28 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index a05bd30600..f8b6e0f687 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -94,8 +94,9 @@
#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"
@@ -143,6 +144,9 @@
#include "llwindebug.h" // For the invalid message handler
#endif
+//#include "llnearbychathistory.h"
+#include "llnotificationmanager.h"
+
//
// Constants
//
@@ -206,6 +210,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:
@@ -912,17 +920,17 @@ void open_offer(const std::vector<LLUUID>& items, const std::string& from_name)
//highlight item, if it's not in the trash or lost+found
// Don't auto-open the inventory floater
- LLInventoryView* view = NULL;
+ LLFloaterInventory* view = NULL;
if(gSavedSettings.getBOOL("ShowInInventory") &&
asset_type != LLAssetType::AT_CALLINGCARD &&
item->getInventoryType() != LLInventoryType::IT_ATTACHMENT &&
!from_name.empty())
{
- view = LLInventoryView::showAgentInventory();
+ view = LLFloaterInventory::showAgentInventory();
}
else
{
- view = LLInventoryView::getActiveInventory();
+ view = LLFloaterInventory::getActiveInventory();
}
if(!view)
{
@@ -986,7 +994,8 @@ void inventory_offer_mute_callback(const LLUUID& blocked_id,
if (LLMuteList::getInstance()->add(mute))
{
LLFloaterReg::showInstance("mute");
- LLFloaterReg::getTypedInstance<LLFloaterMute>("mute")->selectMute(blocked_id);
+ 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.
@@ -1248,6 +1257,12 @@ 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);
@@ -1454,6 +1469,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;
@@ -1527,7 +1544,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;
@@ -1577,11 +1594,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,
@@ -1715,7 +1737,7 @@ 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.
@@ -1772,7 +1794,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
@@ -1789,6 +1811,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
{
@@ -1819,7 +1846,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);
@@ -1876,7 +1903,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)
{
@@ -2369,15 +2396,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:
@@ -2385,12 +2412,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;
}
@@ -2418,11 +2445,18 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
&& (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
LLFloaterChat::addChat(chat, FALSE, FALSE);
}
else
{
- // just add to chat history
+ LLNotificationsUI::LLNotificationManager::instance().onChat(
+ chat, LLNotificationsUI::NT_NEARBYCHAT);
+ // adding temporarily
LLFloaterChat::addChatHistory(chat);
}
}
@@ -3837,7 +3871,7 @@ void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data)
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
}
@@ -4509,9 +4543,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));
@@ -4793,13 +4824,13 @@ 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,
LLTrans::getString("AcquiredItems"));
@@ -5494,10 +5525,14 @@ void process_script_teleport_request(LLMessageSystem* msg, void**)
msg->getVector3("Data", "SimPosition", pos);
msg->getVector3("Data", "LookAt", look_at);
- LLFloaterWorldMap::getInstance()->trackURL(
- sim_name, (S32)pos.mV[VX], (S32)pos.mV[VY], (S32)pos.mV[VZ]);
- LLFloaterReg::showInstance("world_map", "center");
-
+ 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(LLSLURL::buildSLURL(sim_name, (S32)pos.mV[VX], (S32)pos.mV[VY], (S32)pos.mV[VZ]), FALSE);