summaryrefslogtreecommitdiff
path: root/indra/newview/llnotificationstorage.cpp
diff options
context:
space:
mode:
authorMonty Brandenberg <monty@lindenlab.com>2014-09-22 18:51:19 -0400
committerMonty Brandenberg <monty@lindenlab.com>2014-09-22 18:51:19 -0400
commit620817c1c3368d73f1b47b1593a0bcbcf567e297 (patch)
treee37b76dc8d154ab661ab23e6be2b6b098f97e4b2 /indra/newview/llnotificationstorage.cpp
parent329608d24668b044e16b54ff7a7d0ac592b2b88d (diff)
parent8897e7ca24533e0093825346391f5fa9a37f2427 (diff)
Merge. Refresh from viewer-drano-http-4 after release of 3.7.16.
Diffstat (limited to 'indra/newview/llnotificationstorage.cpp')
-rwxr-xr-xindra/newview/llnotificationstorage.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/indra/newview/llnotificationstorage.cpp b/indra/newview/llnotificationstorage.cpp
index 2923221c90..e9970de58c 100755
--- a/indra/newview/llnotificationstorage.cpp
+++ b/indra/newview/llnotificationstorage.cpp
@@ -103,19 +103,21 @@ bool LLNotificationStorage::writeNotifications(const LLSD& pNotificationData) co
return didFileOpen;
}
-bool LLNotificationStorage::readNotifications(LLSD& pNotificationData) const
+bool LLNotificationStorage::readNotifications(LLSD& pNotificationData, bool is_new_filename) const
{
- LL_INFOS("LLNotificationStorage") << "starting read '" << mFileName << "'" << LL_ENDL;
+ std::string filename = is_new_filename? mFileName : mOldFileName;
+
+ LL_INFOS("LLNotificationStorage") << "starting read '" << filename << "'" << LL_ENDL;
bool didFileRead;
pNotificationData.clear();
- llifstream notifyFile(mFileName.c_str());
+ llifstream notifyFile(filename.c_str());
didFileRead = notifyFile.is_open();
if (!didFileRead)
{
- LL_WARNS("LLNotificationStorage") << "Failed to open file '" << mFileName << "'" << LL_ENDL;
+ LL_WARNS("LLNotificationStorage") << "Failed to open file '" << filename << "'" << LL_ENDL;
}
else
{
@@ -128,7 +130,19 @@ bool LLNotificationStorage::readNotifications(LLSD& pNotificationData) const
}
}
- LL_INFOS("LLNotificationStorage") << "ending read '" << mFileName << "'" << LL_ENDL;
+ LL_INFOS("LLNotificationStorage") << "ending read '" << filename << "'" << LL_ENDL;
+ if (!didFileRead)
+ {
+ if(is_new_filename)
+ {
+ didFileRead = readNotifications(pNotificationData, false);
+ if(didFileRead)
+ {
+ writeNotifications(pNotificationData);
+ LLFile::remove(mOldFileName);
+ }
+ }
+ }
return didFileRead;
}