summaryrefslogtreecommitdiff
path: root/indra/newview/llcommunicationchannel.cpp
diff options
context:
space:
mode:
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));
}