CHUI-689: When DND mode is enabled, making a direct delivery purchase results in an IM message from '(Nobody)'. Solution: Fixed a problem in process_improved_im that would falsy use system messages while in DND mode as an IM from a user. Also made it so that while in DND mode, SystemMessages and message with a high or greater priority are shown to the user as toasts (before a notification chiclet would just appear without the toast).

master
Gilbert Gonzales 2013-02-01 11:18:23 -08:00
parent 2ec0d24e4a
commit dde030e6cd
2 changed files with 6 additions and 1 deletions

View File

@ -27,6 +27,7 @@
#include "llviewerprecompiledheaders.h" // must be first include
#include "llagent.h"
#include "llnotificationhandler.h"
#include "lltoastnotifypanel.h"
#include "llviewercontrol.h"
@ -95,6 +96,10 @@ bool LLScriptHandler::processNotification(const LLNotificationPtr& notification)
p.notification = notification;
p.panel = notify_box;
p.on_delete_toast = boost::bind(&LLScriptHandler::onDeleteToast, this, _1);
if(gAgent.isDoNotDisturb())
{
p.force_show = notification->getName() == "SystemMessage" || notification->getPriority() >= NOTIFICATION_PRIORITY_HIGH;
}
LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
if(channel)

View File

@ -2391,7 +2391,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
// do nothing -- don't distract newbies in
// Prelude with global IMs
}
else if (offline == IM_ONLINE && is_do_not_disturb && name != SYSTEM_FROM)
else if (offline == IM_ONLINE && is_do_not_disturb && from_id.notNull())
{
// return a standard "do not disturb" message, but only do it to online IM
// (i.e. not other auto responses and not store-and-forward IM)