diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index b874402d0b..d490ad418f 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -138,13 +138,13 @@
RadarAlertChannel
RadarLegacyChannelAlertRefreshUUID
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 8cf4e688a2..2f23d769fb 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1145,8 +1145,7 @@ void LLPanelPeople::updateNearbyList()
if (mRadarEnterAlerts.size() > 0)
{
mRadarFrameCount++;
- S32 chan = (S32)gSavedSettings.getU32("RadarAlertChannel");
- if (chan < 0) { chan = chan * -1; } // make sure chan is always positive
+ S32 chan = gSavedSettings.getS32("RadarAlertChannel");
std::string msg = llformat("/%d %d,%d",chan,mRadarFrameCount,(int)mRadarEnterAlerts.size());
while(mRadarEnterAlerts.size() > 0)
{
@@ -1156,7 +1155,17 @@ void LLPanelPeople::updateNearbyList()
msg = llformat("%s,%s",msg.c_str(),mRadarEnterAlerts.back().asString().c_str());
mRadarEnterAlerts.pop_back();
}
- LLNearbyChatBar::sendChatFromViewer(msg,CHAT_TYPE_WHISPER,FALSE);
+ LLMessageSystem* msgs = gMessageSystem;
+ msgs->newMessage("ScriptDialogReply");
+ msgs->nextBlock("AgentData");
+ msgs->addUUID("AgentID", gAgent.getID());
+ msgs->addUUID("SessionID", gAgent.getSessionID());
+ msgs->nextBlock("Data");
+ msgs->addUUID("ObjectID", gAgent.getID());
+ msgs->addS32("ChatChannel", chan);
+ msgs->addS32("ButtonIndex", 1);
+ msgs->addString("ButtonLabel", msg.c_str());
+ gAgent.sendReliableMessage();
}
}
if (mRadarLeaveAlerts.size() > 0)
@@ -1697,6 +1706,15 @@ void LLPanelPeople::onChatButtonClicked()
if (group_id.notNull())
LLGroupActions::startIM(group_id);
}
+void LLPanelPeople::requestRadarChannelAlertSync()
+{
+ F32 timeNow = gFrameTimeSeconds;
+ if( (timeNow - RADAR_CHAT_MIN_SPACING)>mRadarLastRequestTime)
+ {
+ mRadarLastRequestTime=timeNow;
+ mRadarAlertRequest = true;
+ }
+}
void LLPanelPeople::teleportToAvatar(LLUUID targetAv)
// Teleports user to last scanned location of nearby avatar
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index b9d775f8e9..cce839ad20 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -45,9 +45,11 @@ class LLTabContainer;
class LLMenuButton;
class LLMenuGL;
-const U32 MAX_AVATARS_PER_ALERT = 27; // maximum number of UUIDs we can cram into a single channel radar alert message
+const U32 MAX_AVATARS_PER_ALERT = 7; // maximum number of UUIDs we can cram into a single channel radar alert message
const U32 COARSE_OFFSET_INTERVAL = 31; // seconds after which we query the bridge for a coarse location adjustment
const U32 NAMEFORMAT_DISPLAYNAME = 0;
+const U32 RADAR_CHAT_MIN_SPACING = 6; //minimum delay between radar chat messages
+
const U32 NAMEFORMAT_USERNAME = 1;
const U32 NAMEFORMAT_DISPLAYNAME_USERNAME = 2;
const U32 NAMEFORMAT_USERNAME_DISPLAYNAME = 3;
@@ -65,7 +67,7 @@ public:
/*virtual*/ void onOpen(const LLSD& key);
/*virtual*/ bool notifyChildren(const LLSD& info);
void teleportToAvatar(LLUUID targetAv);
- void requestRadarChannelAlertSync() {mRadarAlertRequest = true;}
+ void requestRadarChannelAlertSync();
// Implements LLVoiceClientStatusObserver::onChange() to enable call buttons
// when voice is available
/*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal);
@@ -218,6 +220,7 @@ private:
S32 mRadarFrameCount;
bool mRadarAlertRequest;
+ F32 mRadarLastRequestTime;
};
#endif //LL_LLPANELPEOPLE_H