summaryrefslogtreecommitdiff
path: root/indra/newview/llcommunicationchannel.cpp
diff options
context:
space:
mode:
authorCho <cho@lindenlab.com>2013-01-17 01:58:40 +0000
committerCho <cho@lindenlab.com>2013-01-17 01:58:40 +0000
commit1a3de3b1fc79f7a237922fc813d97d3ba8deb4f3 (patch)
treee00623423296f76a6429791ec6c86f958d08c3a6 /indra/newview/llcommunicationchannel.cpp
parent5083517c7cd6b91b8920ab0f698600abed955280 (diff)
parent2f551019921ca12f9dd94f474a4d684e04d73dd7 (diff)
merging latest changes
Diffstat (limited to 'indra/newview/llcommunicationchannel.cpp')
-rw-r--r--indra/newview/llcommunicationchannel.cpp36
1 files changed, 35 insertions, 1 deletions
diff --git a/indra/newview/llcommunicationchannel.cpp b/indra/newview/llcommunicationchannel.cpp
index 4b0a70ffd8..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,17 +67,46 @@ 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::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)
+{
+ removeItemFromHistory(p);
+}
+
void LLCommunicationChannel::onFilterFail(LLNotificationPtr pNotificationPtr)
{
std::string notificationType = pNotificationPtr->getType();
if ((notificationType == "groupnotify")
|| (notificationType == "offer")
- || (notificationType == "notifytoast"))
+ || (notificationType == "notifytoast")
+ && !pNotificationPtr->isCancelled())
{
mHistory.insert(std::make_pair<LLDate, LLNotificationPtr>(pNotificationPtr->getDate(), pNotificationPtr));
}