summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llimfloater.cpp23
-rw-r--r--indra/newview/llnotificationhandlerutil.cpp13
-rw-r--r--indra/newview/llnotificationofferhandler.cpp9
3 files changed, 28 insertions, 17 deletions
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index 5f56690d2e..9b5c69d33d 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -648,14 +648,23 @@ void LLIMFloater::updateMessages()
if (msg.has("notification_id"))
{
chat.mNotifId = msg["notification_id"].asUUID();
- // remove embedded notification from channel
- LLNotificationsUI::LLScreenChannel* channel = dynamic_cast<LLNotificationsUI::LLScreenChannel*>
- (LLNotificationsUI::LLChannelManager::getInstance()->
- findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID"))));
- if (getVisible())
+ // if notification exists - embed it
+ if (LLNotificationsUtil::find(chat.mNotifId) != NULL)
{
- // toast will be automatically closed since it is not storable toast
- channel->hideToast(chat.mNotifId);
+ // remove embedded notification from channel
+ LLNotificationsUI::LLScreenChannel* channel = dynamic_cast<LLNotificationsUI::LLScreenChannel*>
+ (LLNotificationsUI::LLChannelManager::getInstance()->
+ findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID"))));
+ if (getVisible())
+ {
+ // toast will be automatically closed since it is not storable toast
+ channel->hideToast(chat.mNotifId);
+ }
+ }
+ // if notification doesn't exist - try to use next message which should be log entry
+ else
+ {
+ continue;
}
}
//process text message
diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp
index 741d08af1e..a37e796a6d 100644
--- a/indra/newview/llnotificationhandlerutil.cpp
+++ b/indra/newview/llnotificationhandlerutil.cpp
@@ -294,7 +294,7 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_fi
if(to_file_only)
{
logToIM(IM_NOTHING_SPECIAL, session_name, "", notification->getMessage(),
- from_id, LLUUID());
+ LLUUID(), LLUUID());
}
else
{
@@ -389,11 +389,18 @@ void LLHandlerUtil::addNotifPanelToIM(const LLNotificationPtr& notification)
LLSD offer;
offer["notification_id"] = notification->getID();
- offer["from_id"] = notification->getPayload()["from_id"];
- offer["from"] = name;
+ offer["from"] = SYSTEM_FROM;
offer["time"] = LLLogChat::timestamp(false);
offer["index"] = (LLSD::Integer)session->mMsgs.size();
session->mMsgs.push_front(offer);
+
+
+ // update IM floater and counters
+ LLSD arg;
+ arg["session_id"] = session_id;
+ arg["num_unread"] = ++(session->mNumUnread);
+ arg["participant_unread"] = ++(session->mParticipantUnreadMessageCount);
+ LLIMModel::getInstance()->mNewMsgSignal(arg);
}
// static
diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp
index 97a1df66df..0a42d8adbe 100644
--- a/indra/newview/llnotificationofferhandler.cpp
+++ b/indra/newview/llnotificationofferhandler.cpp
@@ -156,7 +156,8 @@ bool LLOfferHandler::processNotification(const LLSD& notify)
if (LLHandlerUtil::canLogToIM(notification))
{
- if (LLHandlerUtil::isIMFloaterOpened(notification))
+ // log only to file if notif panel can be embedded to IM and IM is opened
+ if (add_notid_to_im && LLHandlerUtil::isIMFloaterOpened(notification))
{
LLHandlerUtil::logToIMP2P(notification, true);
}
@@ -165,12 +166,6 @@ bool LLOfferHandler::processNotification(const LLSD& notify)
LLHandlerUtil::logToIMP2P(notification);
}
}
-
- // update IM floater messages if need
- if (add_notid_to_im)
- {
- LLHandlerUtil::updateVisibleIMFLoaterMesages(notification);
- }
}
}
else if (notify["sigtype"].asString() == "delete")