summaryrefslogtreecommitdiff
path: root/indra/newview/llcommunicationchannel.cpp
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2013-01-15 20:36:48 -0800
committerGilbert Gonzales <gilbert@lindenlab.com>2013-01-15 20:36:48 -0800
commitde9e2c38126682e5c6215151e3389380a93b8bc0 (patch)
treeb5247933dbe5cd0366c6e9811ee7fd8e9d39a4fb /indra/newview/llcommunicationchannel.cpp
parent028ceaef1441cbd2d87b294c6cfe7193a6b8bbd7 (diff)
CHUI-668: Code review changes
Diffstat (limited to 'indra/newview/llcommunicationchannel.cpp')
-rw-r--r--indra/newview/llcommunicationchannel.cpp32
1 files changed, 30 insertions, 2 deletions
diff --git a/indra/newview/llcommunicationchannel.cpp b/indra/newview/llcommunicationchannel.cpp
index a99047c163..0821510645 100644
--- a/indra/newview/llcommunicationchannel.cpp
+++ b/indra/newview/llcommunicationchannel.cpp
@@ -52,6 +52,11 @@ bool LLCommunicationChannel::filterByDoNotDisturbStatus(LLNotificationPtr)
return !gAgent.isDoNotDisturb();
}
+S32 LLCommunicationChannel::getHistorySize() const
+{
+ return mHistory.size();
+}
+
LLCommunicationChannel::history_list_t::const_iterator LLCommunicationChannel::beginHistory() const
{
return mHistory.begin();
@@ -62,14 +67,37 @@ LLCommunicationChannel::history_list_t::const_iterator LLCommunicationChannel::e
return mHistory.end();
}
+LLCommunicationChannel::history_list_t::iterator LLCommunicationChannel::beginHistory()
+{
+ return mHistory.begin();
+}
+
+LLCommunicationChannel::history_list_t::iterator LLCommunicationChannel::endHistory()
+{
+ return mHistory.end();
+}
+
void LLCommunicationChannel::clearHistory()
{
mHistory.clear();
}
-void LLCommunicationChannel::removeItem(history_list_t::const_iterator itemToRemove)
+void LLCommunicationChannel::removeItemFromHistory(LLNotificationPtr p)
+{
+ //Find the notification and removes it from mHistory
+ for(history_list_t::iterator it = beginHistory(); it != endHistory(); ++it)
+ {
+ if(it->second == p)
+ {
+ mHistory.erase(it);
+ break;
+ }
+ }
+}
+
+void LLCommunicationChannel::onDelete(LLNotificationPtr p)
{
- mHistory.erase(itemToRemove);
+ removeItemFromHistory(p);
}
void LLCommunicationChannel::onFilterFail(LLNotificationPtr pNotificationPtr)