diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 33dd0656ed..4982c48141 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -24130,6 +24130,17 @@ Change of this parameter will affect the layout of buttons in notification toast
Value
1
+ FSMaxPendingIMMessages
+
diff --git a/indra/newview/fsfloaterim.cpp b/indra/newview/fsfloaterim.cpp
index 7e78c1dea4..1fefb9e259 100644
--- a/indra/newview/fsfloaterim.cpp
+++ b/indra/newview/fsfloaterim.cpp
@@ -87,6 +87,7 @@ FSFloaterIM::FSFloaterIM(const LLUUID& session_id)
mControlPanel(NULL),
mSessionID(session_id),
mLastMessageIndex(-1),
+ mPendingMessages(0),
mDialog(IM_NOTHING_SPECIAL),
mChatHistory(NULL),
mInputEditor(NULL),
@@ -301,8 +302,10 @@ void FSFloaterIM::newIMCallback(const LLSD& data){
FSFloaterIM* floater = LLFloaterReg::findTypedInstance("fs_impanel", session_id);
if (floater == NULL) return;
- // update if visible, otherwise will be updated when opened
- if (floater->getVisible())
+ // update if visible or max pending messages exceeded, otherwise will be updated when opened
+ static LLCachedControl fsMaxPendingIMMessages(gSavedSettings, "FSMaxPendingIMMessages");
+ floater->mPendingMessages++;
+ if (floater->getVisible() || floater->mPendingMessages > fsMaxPendingIMMessages)
{
floater->updateMessages();
}
@@ -1355,7 +1358,7 @@ void FSFloaterIM::updateMessages()
std::list messages;
// we shouldn't reset unread message counters if IM floater doesn't have focus
- LLIMModel::instance().getMessages(mSessionID, messages, mLastMessageIndex + 1, hasFocus());
+ LLIMModel::instance().getMessages(mSessionID, messages, mLastMessageIndex + 1, hasFocus());
if (messages.size())
{
@@ -1447,6 +1450,8 @@ void FSFloaterIM::updateMessages()
}
}
}
+
+ mPendingMessages = 0;
}
void FSFloaterIM::reloadMessages(bool clean_messages/* = false*/)
diff --git a/indra/newview/fsfloaterim.h b/indra/newview/fsfloaterim.h
index 31e228235a..7d4ed99b64 100644
--- a/indra/newview/fsfloaterim.h
+++ b/indra/newview/fsfloaterim.h
@@ -239,6 +239,7 @@ private:
FSPanelChatControlPanel* mControlPanel;
LLUUID mSessionID;
S32 mLastMessageIndex;
+ S32 mPendingMessages;
EInstantMessage mDialog;
LLUUID mOtherParticipantUUID;