Skip to content

Commit 5071c1e

Browse files
committed
Merge remote-tracking branch 'github-liru/master' into NixTesting
2 parents ecd52a9 + 5d44552 commit 5071c1e

32 files changed

Lines changed: 1438 additions & 1239 deletions

indra/llmath/lloctree.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ class LLOctreeNode : public LLTreeNode<T>
537537
OctreeStats::getInstance()->realloc(old_cap,mData.capacity());
538538
#endif
539539

540-
this->notifyAddition(data);
540+
LLOctreeNode<T>::notifyAddition(data);
541541
return true;
542542
}
543543
else
@@ -593,7 +593,7 @@ class LLOctreeNode : public LLTreeNode<T>
593593
OctreeStats::getInstance()->realloc(old_cap,mData.capacity());
594594
#endif
595595

596-
this->notifyAddition(data);
596+
LLOctreeNode<T>::notifyAddition(data);
597597
return true;
598598
}
599599

indra/newview/jcfloaterareasearch.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ void JCFloaterAreaSearch::processObjectPropertiesFamily(LLMessageSystem* msg, vo
299299
// We cache unknown objects (to avoid having to request them later)
300300
// and requested objects.
301301
msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_OwnerID, data->owner_id);
302+
if (auto obj = gObjectList.findObject(object_id)) obj->mOwnerID = data->owner_id; // Singu Note: Try to get Owner whenever possible
302303
msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_GroupID, data->group_id);
303304
msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Name, data->name);
304305
msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Description, data->desc);

indra/newview/lldrawable.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,6 +1149,7 @@ LLSpatialPartition* LLDrawable::getSpatialPartition()
11491149
//must be an active volume
11501150
if (!mSpatialBridge)
11511151
{
1152+
// Spatial bridge ctors self-register...
11521153
if (mVObjp->isHUDAttachment())
11531154
{
11541155
setSpatialBridge(new LLHUDBridge(this, getRegion()));
@@ -1615,9 +1616,9 @@ void LLSpatialBridge::cleanupReferences()
16151616
}
16161617
}*/
16171618

1618-
LLDrawable* drawablep = mDrawable;
1619-
mDrawable = NULL;
1620-
drawablep->setSpatialBridge(NULL);
1619+
LLPointer<LLDrawable> drawablep = mDrawable;
1620+
mDrawable = nullptr;
1621+
drawablep->setSpatialBridge(nullptr);
16211622
}
16221623
}
16231624

indra/newview/llfloateravatarlist.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -363,45 +363,45 @@ static void cmd_teleport(const LLAvatarListEntry* entry);
363363
namespace
364364
{
365365
typedef LLMemberListener<LLView> view_listener_t;
366-
class RadarTrack : public view_listener_t
366+
class RadarTrack final : public view_listener_t
367367
{
368-
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
368+
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) override
369369
{
370370
LLFloaterAvatarList::instance().onClickTrack();
371371
return true;
372372
}
373373
};
374374

375-
class RadarFocus : public view_listener_t
375+
class RadarFocus final : public view_listener_t
376376
{
377-
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
377+
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) override
378378
{
379379
LLFloaterAvatarList::setFocusAvatar(LFIDBearer::getActiveSelectedID());
380380
return true;
381381
}
382382
};
383383

384-
class RadarFocusPrev : public view_listener_t
384+
class RadarFocusPrev final : public view_listener_t
385385
{
386-
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
386+
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) override
387387
{
388388
LLFloaterAvatarList::instance().focusOnPrev(userdata.asInteger());
389389
return true;
390390
}
391391
};
392392

393-
class RadarFocusNext : public view_listener_t
393+
class RadarFocusNext final : public view_listener_t
394394
{
395-
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
395+
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) override
396396
{
397397
LLFloaterAvatarList::instance().focusOnNext(userdata.asInteger());
398398
return true;
399399
}
400400
};
401401

402-
class RadarAnnounceKeys : public view_listener_t
402+
class RadarAnnounceKeys final : public view_listener_t
403403
{
404-
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
404+
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) override
405405
{
406406
LLFloaterAvatarList::instance().sendKeys();
407407
return true;

indra/newview/llimprocessing.cpp

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -514,22 +514,22 @@ bool group_vote_callback(const LLSD& notification, const LLSD& response)
514514
}
515515
static LLNotificationFunctorRegistration group_vote_callback_reg("GroupVote", group_vote_callback);
516516

517-
void LLIMProcessing::processNewMessage(LLUUID from_id,
517+
void LLIMProcessing::processNewMessage(const LLUUID& from_id,
518518
BOOL from_group,
519-
LLUUID to_id,
519+
const LLUUID& to_id,
520520
U8 offline,
521521
EInstantMessage dialog, // U8
522-
LLUUID session_id,
522+
const LLUUID& session_id,
523523
U32 timestamp,
524-
std::string name,
525-
std::string message,
524+
std::string& name,
525+
std::string& message,
526526
U32 parent_estate_id,
527-
LLUUID region_id,
527+
const LLUUID& region_id,
528528
LLVector3 position,
529529
U8 *binary_bucket,
530530
S32 binary_bucket_size,
531531
LLHost &sender,
532-
LLUUID aux_id)
532+
const LLUUID& aux_id)
533533
{
534534
LLChat chat;
535535
std::string buffer;
@@ -566,6 +566,10 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
566566
// object IMs contain sender object id in session_id (STORM-1209)
567567
|| (chat.mSourceType == CHAT_SOURCE_OBJECT && LLMuteList::getInstance()->isMuted(session_id));
568568

569+
// Singu Note: Try to get Owner whenever possible, here owner is the from id
570+
if (chat.mSourceType == CHAT_SOURCE_OBJECT && session_id.notNull())
571+
if (auto obj = gObjectList.findObject(session_id)) obj->mOwnerID = from_id;
572+
569573
bool is_linden = chat.mSourceType != CHAT_SOURCE_OBJECT &&
570574
LLMuteList::getInstance()->isLinden(name);
571575
chat.mMuted = is_muted && !is_linden;
@@ -1967,15 +1971,17 @@ void LLIMProcessing::requestOfflineMessagesCoro(const LLCoroResponder& responder
19671971
from_group = message_data["from_group"].asString() == "Y";
19681972
}
19691973

1974+
auto agentName = message_data["from_agent_name"].asString();
1975+
auto message = message_data["message"].asString();
19701976
LLIMProcessing::processNewMessage(message_data["from_agent_id"].asUUID(),
19711977
from_group,
19721978
message_data["to_agent_id"].asUUID(),
19731979
IM_OFFLINE,
19741980
(EInstantMessage)message_data["dialog"].asInteger(),
19751981
LLUUID::null, // session id, since there is none we can only use frienship/group invite caps
19761982
message_data["timestamp"].asInteger(),
1977-
message_data["from_agent_name"].asString(),
1978-
message_data["message"].asString(),
1983+
agentName,
1984+
message,
19791985
parent_estate_id,
19801986
message_data["region_id"].asUUID(),
19811987
position,

indra/newview/llimprocessing.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,22 @@ class LLIMProcessing
3838
{
3939
public:
4040
// Pre-process message for IM manager
41-
static void processNewMessage(LLUUID from_id,
41+
static void processNewMessage(const LLUUID& from_id,
4242
BOOL from_group,
43-
LLUUID to_id,
43+
const LLUUID& to_id,
4444
U8 offline,
4545
EInstantMessage dialog, // U8
46-
LLUUID session_id,
46+
const LLUUID& session_id,
4747
U32 timestamp,
48-
std::string agentName,
49-
std::string message,
48+
std::string& agentName,
49+
std::string& message,
5050
U32 parent_estate_id,
51-
LLUUID region_id,
51+
const LLUUID& region_id,
5252
LLVector3 position,
5353
U8 *binary_bucket,
5454
S32 binary_bucket_size,
5555
LLHost &sender,
56-
LLUUID aux_id = LLUUID::null);
56+
const LLUUID& aux_id = LLUUID::null);
5757

5858
// Either receives list of offline messages from 'ReadOfflineMsgs' capability
5959
// or uses legacy method

indra/newview/llpanelprofile.cpp

Lines changed: 46 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@
4141
#include "lltabcontainer.h"
4242
#include "llviewercontrol.h"
4343
#include "llviewernetwork.h"
44+
#include "llmutelist.h"
45+
#endif
46+
#include "llfloatermute.h"
4447

48+
#ifdef AI_UNUSED
4549
static const std::string PANEL_PICKS = "panel_picks";
4650
#endif // AI_UNUSED
4751

@@ -55,19 +59,19 @@ std::string getProfileURL(const std::string& agent_name)
5559
llassert(!url.empty());
5660
LLSD subs;
5761
subs["AGENT_NAME"] = agent_name;
58-
url = LLWeb::expandURLSubstitutions(url,subs);
62+
url = LLWeb::expandURLSubstitutions(url, subs);
5963
LLStringUtil::toLower(url);
6064
return url;
6165
}
6266

63-
class LLProfileHandler : public LLCommandHandler
67+
class LLProfileHandler final : public LLCommandHandler
6468
{
6569
public:
6670
// requires trusted browser to trigger
6771
LLProfileHandler() : LLCommandHandler("profile", UNTRUSTED_THROTTLE) { }
6872

6973
bool handle(const LLSD& params, const LLSD& query_map,
70-
LLMediaCtrl* web)
74+
LLMediaCtrl* web) override
7175
{
7276
if (params.size() < 1) return false;
7377
std::string agent_name = params[0];
@@ -80,14 +84,14 @@ class LLProfileHandler : public LLCommandHandler
8084
};
8185
LLProfileHandler gProfileHandler;
8286

83-
class LLAgentHandler : public LLCommandHandler
87+
class LLAgentHandler final : public LLCommandHandler
8488
{
8589
public:
8690
// requires trusted browser to trigger
8791
LLAgentHandler() : LLCommandHandler("agent", UNTRUSTED_THROTTLE) { }
8892

8993
bool handle(const LLSD& params, const LLSD& query_map,
90-
LLMediaCtrl* web)
94+
LLMediaCtrl* web) override
9195
{
9296
if (params.size() < 2) return false;
9397
LLUUID avatar_id;
@@ -144,6 +148,12 @@ class LLAgentHandler : public LLCommandHandler
144148
return true;
145149
}
146150

151+
if (verb == "removefriend")
152+
{
153+
LLAvatarActions::removeFriendDialog(avatar_id);
154+
return true;
155+
}
156+
147157
if (verb == "mute")
148158
{
149159
if (! LLAvatarActions::isBlocked(avatar_id))
@@ -162,6 +172,28 @@ class LLAgentHandler : public LLCommandHandler
162172
return true;
163173
}
164174

175+
if (verb == "block")
176+
{
177+
if (params.size() > 2)
178+
{
179+
const std::string object_name = LLURI::unescape(params[2].asString());
180+
LLMute mute(avatar_id, object_name, LLMute::OBJECT);
181+
LLMuteList::getInstance()->add(mute);
182+
LLFloaterMute::showInstance()->selectMute(mute.mID);
183+
}
184+
return true;
185+
}
186+
187+
if (verb == "unblock")
188+
{
189+
if (params.size() > 2)
190+
{
191+
const std::string object_name = params[2].asString();
192+
LLMute mute(avatar_id, object_name, LLMute::OBJECT);
193+
LLMuteList::getInstance()->remove(mute);
194+
}
195+
return true;
196+
}
165197
return false;
166198
}
167199
};
@@ -171,13 +203,13 @@ LLAgentHandler gAgentHandler;
171203
#ifdef AI_UNUSED
172204
//-- LLPanelProfile::ChildStack begins ----------------------------------------
173205
LLPanelProfile::ChildStack::ChildStack()
174-
: mParent(NULL)
206+
: mParent(nullptr)
175207
{
176208
}
177209

178210
LLPanelProfile::ChildStack::~ChildStack()
179211
{
180-
while (mStack.size() != 0)
212+
while (!mStack.empty())
181213
{
182214
view_list_t& top = mStack.back();
183215
for (view_list_t::const_iterator it = top.begin(); it != top.end(); ++it)
@@ -217,7 +249,7 @@ bool LLPanelProfile::ChildStack::push()
217249
/// Restore saved children (adding them back to the child list).
218250
bool LLPanelProfile::ChildStack::pop()
219251
{
220-
if (mStack.size() == 0)
252+
if (mStack.empty())
221253
{
222254
LL_WARNS() << "Empty stack" << LL_ENDL;
223255
llassert(mStack.size() == 0);
@@ -240,7 +272,7 @@ bool LLPanelProfile::ChildStack::pop()
240272
void LLPanelProfile::ChildStack::preParentReshape()
241273
{
242274
mSavedStack = mStack;
243-
while(mStack.size() > 0)
275+
while(!mStack.empty())
244276
{
245277
pop();
246278
}
@@ -255,9 +287,8 @@ void LLPanelProfile::ChildStack::postParentReshape()
255287
for (stack_t::const_iterator stack_it = mStack.begin(); stack_it != mStack.end(); ++stack_it)
256288
{
257289
const view_list_t& vlist = (*stack_it);
258-
for (view_list_t::const_iterator list_it = vlist.begin(); list_it != vlist.end(); ++list_it)
290+
for (auto viewp : vlist)
259291
{
260-
LLView* viewp = *list_it;
261292
LL_DEBUGS() << "removing " << viewp->getName() << LL_ENDL;
262293
mParent->removeChild(viewp);
263294
}
@@ -273,9 +304,9 @@ void LLPanelProfile::ChildStack::dump()
273304
std::ostringstream dbg_line;
274305
dbg_line << "lvl #" << lvl << ":";
275306
const view_list_t& vlist = (*stack_it);
276-
for (view_list_t::const_iterator list_it = vlist.begin(); list_it != vlist.end(); ++list_it)
307+
for (auto list_it : vlist)
277308
{
278-
dbg_line << " " << (*list_it)->getName();
309+
dbg_line << " " << list_it->getName();
279310
}
280311
LL_DEBUGS() << dbg_line.str() << LL_ENDL;
281312
}
@@ -372,7 +403,7 @@ void LLPanelProfile::onOpen()
372403
void LLPanelProfile::onTabSelected(const LLSD& param)
373404
{
374405
std::string tab_name = param.asString();
375-
if (NULL != getTabContainer()[tab_name])
406+
if (nullptr != getTabContainer()[tab_name])
376407
{
377408
getTabContainer()[tab_name]->onOpen(getAvatarId());
378409
}
@@ -416,7 +447,7 @@ void LLPanelProfile::closePanel(LLPanel* panel)
416447

417448
// Prevent losing focus by the floater
418449
const child_list_t* child_list = getChildList();
419-
if (child_list->size() > 0)
450+
if (!child_list->empty())
420451
{
421452
child_list->front()->setFocus(TRUE);
422453
}

indra/newview/llselectmgr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5446,6 +5446,7 @@ void LLSelectMgr::processObjectProperties(LLMessageSystem* msg, void** user_data
54465446
node->mInventorySerial = inv_serial;
54475447
node->mSitName.assign(sit_name);
54485448
node->mTouchName.assign(touch_name);
5449+
if (auto obj = node->getObject()) obj->mOwnerID = owner_id; // Singu Note: Try to get Owner whenever possible
54495450
}
54505451
}
54515452

0 commit comments

Comments
 (0)