diff options
-rw-r--r-- | indra/newview/llcallfloater.cpp | 56 | ||||
-rw-r--r-- | indra/newview/llcallfloater.h | 10 | ||||
-rw-r--r-- | indra/newview/llimfloater.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llimview.cpp | 30 | ||||
-rw-r--r-- | indra/newview/llimview.h | 10 | ||||
-rw-r--r-- | indra/newview/llnotificationgrouphandler.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llnotificationhandler.h | 15 | ||||
-rw-r--r-- | indra/newview/llnotificationhandlerutil.cpp | 90 | ||||
-rw-r--r-- | indra/newview/llnotificationofferhandler.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llnotificationscripthandler.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llpanelavatar.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llviewermessage.cpp | 23 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_voice_controls.xml | 31 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 27 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_im_control_panel.xml | 1 |
15 files changed, 253 insertions, 59 deletions
diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 46432a4953..1b929eca0e 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -35,6 +35,7 @@ #include "llcallfloater.h" +#include "llagentdata.h" // for gAgentID #include "llavatarlist.h" #include "llbottomtray.h" #include "llparticipantlist.h" @@ -46,6 +47,7 @@ LLCallFloater::LLCallFloater(const LLSD& key) , mSpeakerManager(NULL) , mPaticipants(NULL) , mAvatarList(NULL) +, mVoiceType(VC_LOCAL_CHAT) { } @@ -69,6 +71,8 @@ BOOL LLCallFloater::postBuild() anchor_panel, this, getDockTongue(), LLDockControl::TOP)); + initAgentData(); + // update list for current session updateSession(); @@ -110,6 +114,19 @@ void LLCallFloater::updateSession() if (im_session) { mSpeakerManager = LLIMModel::getInstance()->getSpeakerManager(session_id); + switch (im_session->mType) + { + case IM_NOTHING_SPECIAL: + case IM_SESSION_P2P_INVITE: + mVoiceType = VC_PEER_TO_PEER; + break; + case IM_SESSION_CONFERENCE_START: + mVoiceType = VC_AD_HOC_CHAT; + break; + default: + mVoiceType = VC_GROUP_CHAT; + break; + } } if (NULL == mSpeakerManager) @@ -117,6 +134,7 @@ void LLCallFloater::updateSession() // by default let show nearby chat participants mSpeakerManager = LLLocalSpeakerMgr::getInstance(); lldebugs << "Set DEFAULT speaker manager" << llendl; + mVoiceType = VC_LOCAL_CHAT; } updateTitle(); @@ -130,6 +148,11 @@ void LLCallFloater::refreshPartisipantList() bool do_not_use_context_menu_in_local_chat = LLLocalSpeakerMgr::getInstance() != mSpeakerManager; mPaticipants = new LLParticipantList(mSpeakerManager, mAvatarList, do_not_use_context_menu_in_local_chat); + + if (!do_not_use_context_menu_in_local_chat) + { + mAvatarList->setNoItemsCommentText(getString("no_one_near")); + } } void LLCallFloater::onCurrentChannelChanged(const LLUUID& /*session_id*/) @@ -140,16 +163,37 @@ void LLCallFloater::onCurrentChannelChanged(const LLUUID& /*session_id*/) void LLCallFloater::updateTitle() { LLVoiceChannel* voice_channel = LLVoiceChannel::getCurrentVoiceChannel(); - if (NULL == voice_channel) return; - - std::string title = voice_channel->getSessionName(); - - if (LLLocalSpeakerMgr::getInstance() == mSpeakerManager) + std::string title; + switch (mVoiceType) { + case VC_LOCAL_CHAT: title = getString("title_nearby"); + break; + case VC_PEER_TO_PEER: + title = voice_channel->getSessionName(); + break; + case VC_AD_HOC_CHAT: + title = getString("title_adhoc"); + break; + case VC_GROUP_CHAT: + LLStringUtil::format_map_t args; + args["[GROUP]"] = voice_channel->getSessionName(); + title = getString("title_group", args); + break; } - // *TODO: mantipov: update code to use title from xml for other chat types setTitle(title); } + +void LLCallFloater::initAgentData() +{ + childSetValue("user_icon", gAgentID); + + std::string name; + gCacheName->getFullName(gAgentID, name); + childSetValue("user_text", name); + + LLOutputMonitorCtrl* speaking_indicator = getChild<LLOutputMonitorCtrl>("speaking_indicator"); + speaking_indicator->setSpeakerId(gAgentID); +} //EOF diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h index 0cd5fe05c1..8a440873ff 100644 --- a/indra/newview/llcallfloater.h +++ b/indra/newview/llcallfloater.h @@ -61,6 +61,14 @@ public: /*virtual*/ void onOpen(const LLSD& key); private: + typedef enum e_voice_controls_type + { + VC_LOCAL_CHAT, + VC_GROUP_CHAT, + VC_AD_HOC_CHAT, + VC_PEER_TO_PEER + }EVoiceControls; + /** * Updates mSpeakerManager and list according to current Voice Channel * @@ -75,11 +83,13 @@ private: void refreshPartisipantList(); void onCurrentChannelChanged(const LLUUID& session_id); void updateTitle(); + void initAgentData(); private: LLSpeakerMgr* mSpeakerManager; LLParticipantList* mPaticipants; LLAvatarList* mAvatarList; + EVoiceControls mVoiceType; }; diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 310eaaec27..5e9ffdf410 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -34,6 +34,8 @@ #include "llimfloater.h" +#include "llnotificationsutil.h" + #include "llagent.h" #include "llappviewer.h" #include "llbutton.h" @@ -634,6 +636,9 @@ void LLIMFloater::processAgentListUpdates(const LLSD& body) else label = LLTrans::getString("IM_to_label") + " " + LLIMModel::instance().getName(mSessionID); mInputEditor->setLabel(label); + + if (moderator_muted_text) + LLNotificationsUtil::add("TextChatIsMutedByModerator"); } } } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 24092bab98..be719c0a78 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -451,6 +451,19 @@ bool LLIMModel::addToHistory(const LLUUID& session_id, const std::string& from, return true; } +bool LLIMModel::logToFile(const std::string& session_name, const std::string& from, const LLUUID& from_id, const std::string& utf8_text) +{ + if (gSavedPerAccountSettings.getBOOL("LogInstantMessages")) + { + LLLogChat::saveHistory(session_name, from, from_id, utf8_text); + return true; + } + else + { + return false; + } +} + bool LLIMModel::logToFile(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text) { if (gSavedPerAccountSettings.getBOOL("LogInstantMessages")) @@ -482,8 +495,7 @@ bool LLIMModel::proccessOnlineOfflineNotification( } bool LLIMModel::addMessage(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, - const std::string& utf8_text, bool log2file /* = true */) -{ + const std::string& utf8_text, bool log2file /* = true */) { LLIMSession* session = findIMSession(session_id); if (!session) @@ -492,7 +504,10 @@ bool LLIMModel::addMessage(const LLUUID& session_id, const std::string& from, co return false; } - addMessageSilently(*session, from, from_id, utf8_text, log2file); + addToHistory(session_id, from, from_id, utf8_text); + if (log2file) logToFile(session_id, from, from_id, utf8_text); + + session->mNumUnread++; // notify listeners LLSD arg; @@ -507,15 +522,6 @@ bool LLIMModel::addMessage(const LLUUID& session_id, const std::string& from, co return true; } -void LLIMModel::addMessageSilently(LLIMSession& session, const std::string& from, const LLUUID& from_id, - const std::string& utf8_text, bool log2file /* = true */) -{ - addToHistory(session.mSessionID, from, from_id, utf8_text); - if (log2file) logToFile(session.mSessionID, from, from_id, utf8_text); - - session.mNumUnread++; -} - const std::string& LLIMModel::getName(const LLUUID& session_id) const { diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 72fd006222..40e3a8fb69 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -146,11 +146,6 @@ public: bool addMessage(const LLUUID& session_id, const std::string& from, const LLUUID& other_participant_id, const std::string& utf8_text, bool log2file = true); /** - * Adds message without new message notification. - */ - void addMessageSilently(LLIMSession& session, const std::string& from, const LLUUID& other_participant_id, const std::string& utf8_text, bool log2file = true); - - /** * Add a system message to an IM Model */ bool proccessOnlineOfflineNotification(const LLUUID& session_id, const std::string& utf8_text); @@ -205,6 +200,11 @@ public: void testMessages(); + /** + * Saves an IM message into a file + */ + bool logToFile(const std::string& session_name, const std::string& from, const LLUUID& from_id, const std::string& utf8_text); + private: /** diff --git a/indra/newview/llnotificationgrouphandler.cpp b/indra/newview/llnotificationgrouphandler.cpp index 2e7f95660a..6889931956 100644 --- a/indra/newview/llnotificationgrouphandler.cpp +++ b/indra/newview/llnotificationgrouphandler.cpp @@ -88,6 +88,8 @@ bool LLGroupHandler::processNotification(const LLSD& notify) if(notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change") { + LLHandlerUtil::logGroupNoticeToIMGroup(notification); + LLPanel* notify_box = new LLToastGroupNotifyPanel(notification); LLToast::Params p; p.notif_id = notification->getID(); diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h index d42b0148d6..da8928321a 100644 --- a/indra/newview/llnotificationhandler.h +++ b/indra/newview/llnotificationhandler.h @@ -268,7 +268,20 @@ public: /** * Writes notification message to IM session. */ - static void logToIM(const LLNotificationPtr& notification); + static void logToIM(const EInstantMessage& session_type, + const std::string& session_name, const std::string& from_name, + const std::string& message, const LLUUID& session_owner_id, + const LLUUID& from_id); + + /** + * Writes notification message to IM p2p session. + */ + static void logToIMP2P(const LLNotificationPtr& notification); + + /** + * Writes group notice notification message to IM group session. + */ + static void logGroupNoticeToIMGroup(const LLNotificationPtr& notification); }; } diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index e1236b935e..857b7e9796 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -36,53 +36,95 @@ #include "llnotificationhandler.h" #include "llnotifications.h" #include "llimview.h" +#include "llagent.h" using namespace LLNotificationsUI; const static std::string GRANTED_MODIFY_RIGHTS("GrantedModifyRights"), REVOKED_MODIFY_RIGHTS("RevokedModifyRights"), OBJECT_GIVE_ITEM( "ObjectGiveItem"), OBJECT_GIVE_ITEM_UNKNOWN_USER( - "ObjectGiveItemUnknownUser"); + "ObjectGiveItemUnknownUser"), PAYMENT_RECIVED("PaymentRecived"); // static bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification) { return GRANTED_MODIFY_RIGHTS == notification->getName() - || REVOKED_MODIFY_RIGHTS == notification->getName(); + || REVOKED_MODIFY_RIGHTS == notification->getName() + || PAYMENT_RECIVED == notification->getName(); } // static -void LLHandlerUtil::logToIM(const LLNotificationPtr& notification) +void LLHandlerUtil::logToIM(const EInstantMessage& session_type, + const std::string& session_name, const std::string& from_name, + const std::string& message, const LLUUID& session_owner_id, + const LLUUID& from_id) +{ + LLUUID session_id = LLIMMgr::computeSessionID(session_type, + session_owner_id); + LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession( + session_id); + if (session == NULL) + { + LLIMModel::instance().logToFile(session_name, from_name, from_id, message); + } + else + { + // store active session id + const LLUUID & active_session_id = + LLIMModel::instance().getActiveSessionID(); + + // set searched session as active to avoid IM toast popup + LLIMModel::instance().setActiveSessionID(session_id); + + LLIMModel::instance().addMessage(session_id, from_name, from_id, + message); + + // restore active session id + LLIMModel::instance().setActiveSessionID(active_session_id); + } +} + +// static +void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification) { - // add message to IM const std::string name = notification->getSubstitutions().has("NAME") ? notification->getSubstitutions()["NAME"] : notification->getSubstitutions()["[NAME]"]; - // don't create IM session with objects, it's necessary condition to log + // don't create IM p2p session with objects, it's necessary condition to log if (notification->getName() != OBJECT_GIVE_ITEM && notification->getName() != OBJECT_GIVE_ITEM_UNKNOWN_USER) { LLUUID from_id = notification->getPayload()["from_id"]; - LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, - from_id); - - LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(session_id); - if (session == NULL) - { - session_id = LLIMMgr::instance().addSession(name, - IM_NOTHING_SPECIAL, from_id); - session = LLIMModel::instance().findIMSession(session_id); - } - - if (session == NULL) - { - llerrs << "session " << session_id << "does not exist " << llendl; - return; - } - - LLIMModel::instance().addMessageSilently(*session, name, from_id, - notification->getMessage()); + + logToIM(IM_NOTHING_SPECIAL, name, name, notification->getMessage(), + from_id, from_id); } } + +// static +void LLHandlerUtil::logGroupNoticeToIMGroup( + const LLNotificationPtr& notification) +{ + + const LLSD& payload = notification->getPayload(); + LLGroupData groupData; + if (!gAgent.getGroupData(payload["group_id"].asUUID(), groupData)) + { + llwarns + << "Group notice for unkown group: " + << payload["group_id"].asUUID() << llendl; + } + + const std::string group_name = groupData.mName; + const std::string sender_name = payload["sender_name"].asString(); + + // we can't retrieve sender id from group notice system message, so try to lookup it from cache + LLUUID sender_id; + gCacheName->getUUID(sender_name, sender_id); + + logToIM(IM_SESSION_GROUP_START, group_name, sender_name, payload["message"], + payload["group_id"], sender_id); +} + diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp index cfe7fd09ac..c179a2cf90 100644 --- a/indra/newview/llnotificationofferhandler.cpp +++ b/indra/newview/llnotificationofferhandler.cpp @@ -90,7 +90,7 @@ bool LLOfferHandler::processNotification(const LLSD& notify) if(notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change") { - LLHandlerUtil::logToIM(notification); + LLHandlerUtil::logToIMP2P(notification); LLToastNotifyPanel* notify_box = new LLToastNotifyPanel(notification); diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp index 6f91b6e58b..c7261199e3 100644 --- a/indra/newview/llnotificationscripthandler.cpp +++ b/indra/newview/llnotificationscripthandler.cpp @@ -98,7 +98,7 @@ bool LLScriptHandler::processNotification(const LLSD& notify) { if (LLHandlerUtil::canLogToIM(notification)) { - LLHandlerUtil::logToIM(notification); + LLHandlerUtil::logToIMP2P(notification); } if(SCRIPT_DIALOG == notification->getName() || SCRIPT_DIALOG_GROUP == notification->getName() || SCRIPT_LOAD_URL == notification->getName()) diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index c2bf881a60..eb9cb10d56 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -254,11 +254,19 @@ void LLPanelAvatarNotes::onCommitRights() const LLRelationship* buddy_relationship = LLAvatarTracker::instance().getBuddyInfo(getAvatarId()); bool allow_modify_objects = childGetValue("objects_check").asBoolean(); + + // if modify objects checkbox clicked if (buddy_relationship->isRightGrantedTo( LLRelationship::GRANT_MODIFY_OBJECTS) != allow_modify_objects) { confirmModifyRights(allow_modify_objects, rights); } + // only one checkbox can trigger commit, so store the rest of rights + else + { + LLAvatarPropertiesProcessor::getInstance()->sendFriendRights( + getAvatarId(), rights); + } } void LLPanelAvatarNotes::processProperties(void* data, EAvatarProcessorType type) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 9fc818e1ff..a5e06e7cff 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4347,7 +4347,28 @@ void process_money_balance_reply( LLMessageSystem* msg, void** ) // *TODO: Translate LLSD args; args["MESSAGE"] = desc; - LLNotificationsUtil::add("SystemMessage", args); + + // this is a marker to retrieve avatar name from server message: + // "<avatar name> paid you L$" + const std::string marker = "paid you L$"; + + // extract avatar name from system message + std::string name = desc.substr(0, desc.find(marker, 0)); + LLStringUtil::trim(name); + + // if name extracted and name cache contains avatar id send loggable notification + LLUUID from_id; + if(name.size() > 0 && gCacheName->getUUID(name, from_id)) + { + args["NAME"] = name; + LLSD payload; + payload["from_id"] = from_id; + LLNotificationsUtil::add("PaymentRecived", args, payload); + } + else + { + LLNotificationsUtil::add("SystemMessage", args); + } // Once the 'recent' container gets large enough, chop some // off the beginning. diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml index 4a5642e5c6..04696ca2e7 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_controls.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml @@ -20,32 +20,37 @@ name="title_adhoc"> Conference Call </string> + <string + name="no_one_near"> + No one near + </string> <panel bevel_style="in" follows="left|right|top" - height="73" + height="62" layout="topleft" left="0" name="control_panel" - width="285"> + width="282"> <panel - height="20" + height="18" + follows="top|left|right" layout="topleft" left="10" name="my_panel" - width="262"> + width="263"> <avatar_icon enabled="false" follows="left|top" height="18" - image_name="Generic_Person" + default_icon_name="Generic_Person" layout="topleft" left="0" name="user_icon" top="0" width="18" /> <text - follows="top|left" + follows="top|left|right" font="SansSerifSmallBold" height="16" layout="topleft" @@ -53,8 +58,20 @@ name="user_text" text_color="white" top="4" + use_ellipses="true" value="Mya Avatar:" - width="80" /> + width="210" /> + <output_monitor + auto_update="true" + draw_border="false" + follows="right" + height="16" + layout="topleft" + name="speaking_indicator" + right="-1" + top="2" + visible="true" + width="20" /> </panel> <layout_stack bottom="10" diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 49276172d5..254c8a0f21 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4611,6 +4611,13 @@ Please select at least one type of content to search (PG, Mature, or Adult). <notification icon="notify.tga" + name="PaymentRecived" + type="notify"> +[MESSAGE] + </notification> + + <notification + icon="notify.tga" name="EventNotification" type="notify"> Event Notification: @@ -5783,6 +5790,26 @@ Server Error: Media update or get failed. yestext="OK"/> </notification> + <notification + icon="alertmodal.tga" + name="TextChatIsMutedByModerator" + type="alertmodal"> +Your text chat has been muted by moderator. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="VoiceIsMutedByModerator" + type="alertmodal"> +Your voice has been muted by moderator. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + <notification icon="alertmodal.tga" name="ConfirmClearTeleportHistory" diff --git a/indra/newview/skins/default/xui/en/panel_im_control_panel.xml b/indra/newview/skins/default/xui/en/panel_im_control_panel.xml index 0a5812882d..0a3fd1699f 100644 --- a/indra/newview/skins/default/xui/en/panel_im_control_panel.xml +++ b/indra/newview/skins/default/xui/en/panel_im_control_panel.xml @@ -76,7 +76,6 @@ visible="false" width="100" /> <button - enabled="false" bottom="10" height="20" label="Voice Controls" |