diff options
author | Dmitry Zaporozhan <dzaporozhan@productengine.com> | 2010-02-16 11:54:46 +0200 |
---|---|---|
committer | Dmitry Zaporozhan <dzaporozhan@productengine.com> | 2010-02-16 11:54:46 +0200 |
commit | a24eb0a4496471b59ae70074e8d44b078eacb347 (patch) | |
tree | f109f238dfccecbc27cc9886f3e5913f73c4cb61 /indra | |
parent | 09ffc1e0311bc143601b50cff6f65fe914e855bd (diff) |
Fixed low bug EXT-5124 - Display buddy icons on online/offline alerts
--HG--
branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llcallingcard.cpp | 15 | ||||
-rw-r--r-- | indra/newview/llnotificationtiphandler.cpp | 45 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_online_status.xml | 35 |
4 files changed, 92 insertions, 7 deletions
diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index c3bda26aac..79a2631c31 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -682,17 +682,24 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) } BOOL notify = FALSE; LLSD args; + LLSD payload; for(S32 i = 0; i < count; ++i) { msg->getUUIDFast(_PREHASH_AgentBlock, _PREHASH_AgentID, agent_id, i); + payload["FROM_ID"] = agent_id; info = getBuddyInfo(agent_id); if(info) { setBuddyOnline(agent_id,online); if(chat_notify) { - notify = TRUE; - args["NAME_SLURL"] = LLSLURL::buildCommand("agent", agent_id, "about"); + std::string first, last; + if(gCacheName->getName(agent_id, first, last)) + { + notify = TRUE; + args["FIRST"] = first; + args["LAST"] = last; + } } } else @@ -719,13 +726,13 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) notification = LLNotificationsUtil::add("FriendOnline", args, - LLSD().with("respond_on_mousedown", TRUE), + payload.with("respond_on_mousedown", TRUE), boost::bind(&LLAvatarActions::startIM, agent_id)); } else { notification = - LLNotificationsUtil::add("FriendOffline", args); + LLNotificationsUtil::add("FriendOffline", args, payload); } // If there's an open IM session with this agent, send a notification there too. diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp index 83a2215ac6..c55c8d6221 100644 --- a/indra/newview/llnotificationtiphandler.cpp +++ b/indra/newview/llnotificationtiphandler.cpp @@ -43,6 +43,37 @@ using namespace LLNotificationsUI; +class LLOnalineStatusToast : public LLToastPanel +{ +public: + + struct Params + { + LLNotificationPtr notification; + LLUUID avatar_id; + std::string message; + + Params() {} + }; + + LLOnalineStatusToast(Params& p) : LLToastPanel(p.notification) + { + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_online_status.xml"); + + childSetValue("avatar_icon", p.avatar_id); + childSetValue("message", p.message); + + if (p.notification->getPayload().has("respond_on_mousedown") + && p.notification->getPayload()["respond_on_mousedown"] ) + { + setMouseDownCallback(boost::bind(&LLNotification::respond, p.notification, + p.notification->getResponseTemplate())); + } + + // set line max count to 2 in case of a very long name + snapToMessageHeight(getChild<LLTextBox>("message"), 2); + } +}; //-------------------------------------------------------------------------- LLTipHandler::LLTipHandler(e_notification_type type, const LLSD& id) @@ -114,7 +145,19 @@ bool LLTipHandler::processNotification(const LLSD& notify) LLHandlerUtil::spawnIMSession(name, from_id); } - LLToastNotifyPanel* notify_box = new LLToastNotifyPanel(notification); + LLToastPanel* notify_box = NULL; + if("FriendOffline" == notification->getName() || "FriendOnline" == notification->getName()) + { + LLOnalineStatusToast::Params p; + p.notification = notification; + p.message = notification->getMessage(); + p.avatar_id = notification->getPayload()["FROM_ID"]; + notify_box = new LLOnalineStatusToast(p); + } + else + { + notify_box = new LLToastNotifyPanel(notification); + } LLToast::Params p; p.notif_id = notification->getID(); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 9c6b18ef27..ef983dacfe 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4310,14 +4310,14 @@ Topic: [SUBJECT], Message: [MESSAGE] icon="notifytip.tga" name="FriendOnline" type="notifytip"> -[NAME_SLURL] is Online +[FIRST] [LAST] is Online </notification> <notification icon="notifytip.tga" name="FriendOffline" type="notifytip"> -[NAME_SLURL] is Offline +[FIRST] [LAST] is Offline </notification> <notification diff --git a/indra/newview/skins/default/xui/en/panel_online_status.xml b/indra/newview/skins/default/xui/en/panel_online_status.xml new file mode 100644 index 0000000000..babe459231 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_online_status.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + background_visible="true" + height="152" + label="friend_online_status" + layout="topleft" + left="0" + name="friend_online_status" + top="0" + width="305"> + <avatar_icon + follows="top|left" + height="18" + image_name="Generic_Person" + layout="topleft" + left="3" + mouse_opaque="false" + name="avatar_icon" + top="10" + width="18" /> + <text + font="SansSerifSmall" + follows="all" + height="137" + layout="topleft" + left_pad="5" + name="message" + text_color="white" + top="15" + use_ellipses="true" + value="" + width="285" + word_wrap="true" + max_length="350" /> +</panel>
\ No newline at end of file |