aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llimview.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:42 -0500
committerJacek Antonelli2008-08-15 23:45:42 -0500
commitce28e056c20bf2723f565bbf464b87781ec248a2 (patch)
treeef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/newview/llimview.cpp
parentSecond Life viewer sources 1.19.1.4b (diff)
downloadmeta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz
Second Life viewer sources 1.20.2
Diffstat (limited to 'linden/indra/newview/llimview.cpp')
-rw-r--r--linden/indra/newview/llimview.cpp41
1 files changed, 23 insertions, 18 deletions
diff --git a/linden/indra/newview/llimview.cpp b/linden/indra/newview/llimview.cpp
index cad8649..e451388 100644
--- a/linden/indra/newview/llimview.cpp
+++ b/linden/indra/newview/llimview.cpp
@@ -40,7 +40,7 @@
40#include "llhttpclient.h" 40#include "llhttpclient.h"
41#include "llsdutil.h" 41#include "llsdutil.h"
42#include "llstring.h" 42#include "llstring.h"
43#include "llvieweruictrlfactory.h" 43#include "lluictrlfactory.h"
44 44
45#include "llagent.h" 45#include "llagent.h"
46#include "llcallingcard.h" 46#include "llcallingcard.h"
@@ -80,7 +80,7 @@ LLIMMgr* gIMMgr = NULL;
80// 80//
81// Statics 81// Statics
82// 82//
83//*FIXME: make these all either UIStrings or Strings 83// *FIXME: make these all either UIStrings or Strings
84static LLString sOnlyUserMessage; 84static LLString sOnlyUserMessage;
85static LLUIString sOfflineMessage; 85static LLUIString sOfflineMessage;
86static LLUIString sInviteMessage; 86static LLUIString sInviteMessage;
@@ -152,7 +152,7 @@ LLFloaterIM::LLFloaterIM()
152 // the size of the im-sesssion when they were created. This happens in 152 // the size of the im-sesssion when they were created. This happens in
153 // LLMultiFloater::resizeToContents() when called through LLMultiFloater::addFloater()) 153 // LLMultiFloater::resizeToContents() when called through LLMultiFloater::addFloater())
154 this->mAutoResize = FALSE; 154 this->mAutoResize = FALSE;
155 gUICtrlFactory->buildFloater(this, "floater_im.xml"); 155 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_im.xml");
156} 156}
157 157
158BOOL LLFloaterIM::postBuild() 158BOOL LLFloaterIM::postBuild()
@@ -374,7 +374,7 @@ LLIMMgr::LLIMMgr() :
374 mFriendObserver = new LLIMViewFriendObserver(this); 374 mFriendObserver = new LLIMViewFriendObserver(this);
375 LLAvatarTracker::instance().addObserver(mFriendObserver); 375 LLAvatarTracker::instance().addObserver(mFriendObserver);
376 376
377 //*HACK: use floater to initialize string constants from xml file 377 // *HACK: use floater to initialize string constants from xml file
378 // then delete it right away 378 // then delete it right away
379 LLFloaterIM* dummy_floater = new LLFloaterIM(); 379 LLFloaterIM* dummy_floater = new LLFloaterIM();
380 delete dummy_floater; 380 delete dummy_floater;
@@ -403,12 +403,12 @@ void LLIMMgr::addMessage(
403 const LLVector3& position) 403 const LLVector3& position)
404{ 404{
405 LLUUID other_participant_id = target_id; 405 LLUUID other_participant_id = target_id;
406 bool is_from_system = target_id.isNull(); 406 bool is_from_system = target_id.isNull() || !strcmp(from, SYSTEM_FROM);
407 407
408 // don't process muted IMs 408 // don't process muted IMs
409 if (gMuteListp->isMuted( 409 if (LLMuteList::getInstance()->isMuted(
410 other_participant_id, 410 other_participant_id,
411 LLMute::flagTextChat) && !gMuteListp->isLinden(from)) 411 LLMute::flagTextChat) && !LLMuteList::getInstance()->isLinden(from))
412 { 412 {
413 return; 413 return;
414 } 414 }
@@ -490,7 +490,7 @@ void LLIMMgr::addMessage(
490 } 490 }
491 else 491 else
492 { 492 {
493 floater->addHistoryLine(other_participant_id, msg); 493 floater->addHistoryLine(other_participant_id, msg, gSavedSettings.getColor("IMChatColor"));
494 } 494 }
495 495
496 LLFloaterChatterBox* chat_floater = LLFloaterChatterBox::getInstance(LLSD()); 496 LLFloaterChatterBox* chat_floater = LLFloaterChatterBox::getInstance(LLSD());
@@ -695,7 +695,7 @@ void LLIMMgr::inviteToSession(
695 const LLString& session_handle) 695 const LLString& session_handle)
696{ 696{
697 //ignore invites from muted residents 697 //ignore invites from muted residents
698 if (gMuteListp->isMuted(caller_id)) 698 if (LLMuteList::getInstance()->isMuted(caller_id))
699 { 699 {
700 return; 700 return;
701 } 701 }
@@ -740,7 +740,7 @@ void LLIMMgr::inviteToSession(
740 if (channelp && channelp->callStarted()) 740 if (channelp && channelp->callStarted())
741 { 741 {
742 // you have already started a call to the other user, so just accept the invite 742 // you have already started a call to the other user, so just accept the invite
743 inviteUserResponse(0, invite); 743 inviteUserResponse(0, invite); // inviteUserResponse deletes
744 return; 744 return;
745 } 745 }
746 746
@@ -754,7 +754,7 @@ void LLIMMgr::inviteToSession(
754 if (gSavedSettings.getBOOL("VoiceCallsFriendsOnly")) 754 if (gSavedSettings.getBOOL("VoiceCallsFriendsOnly"))
755 { 755 {
756 // invite not from a friend, so decline 756 // invite not from a friend, so decline
757 inviteUserResponse(1, invite); 757 inviteUserResponse(1, invite); // inviteUserResponse deletes
758 return; 758 return;
759 } 759 }
760 } 760 }
@@ -773,13 +773,17 @@ void LLIMMgr::inviteToSession(
773 args["[GROUP]"] = session_name; 773 args["[GROUP]"] = session_name;
774 774
775 LLNotifyBox::showXml(notify_box_type, 775 LLNotifyBox::showXml(notify_box_type,
776 args, 776 args,
777 inviteUserResponse, 777 inviteUserResponse,
778 (void*)invite); 778 (void*)invite); // inviteUserResponse deletes
779 779
780 } 780 }
781 mPendingInvitations[session_id.asString()] = LLSD(); 781 mPendingInvitations[session_id.asString()] = LLSD();
782 } 782 }
783 else
784 {
785 delete invite;
786 }
783} 787}
784 788
785//static 789//static
@@ -946,10 +950,10 @@ void LLIMMgr::inviteUserResponse(S32 option, void* user_data)
946 case 2: // mute (also implies ignore, so this falls through to the "ignore" case below) 950 case 2: // mute (also implies ignore, so this falls through to the "ignore" case below)
947 { 951 {
948 // mute the sender of this invite 952 // mute the sender of this invite
949 if (!gMuteListp->isMuted(invitep->mCallerID)) 953 if (!LLMuteList::getInstance()->isMuted(invitep->mCallerID))
950 { 954 {
951 LLMute mute(invitep->mCallerID, invitep->mCallerName, LLMute::AGENT); 955 LLMute mute(invitep->mCallerID, invitep->mCallerName, LLMute::AGENT);
952 gMuteListp->add(mute); 956 LLMuteList::getInstance()->add(mute);
953 } 957 }
954 } 958 }
955 /* FALLTHROUGH */ 959 /* FALLTHROUGH */
@@ -1475,12 +1479,12 @@ public:
1475 (time_t) message_params["timestamp"].asInteger(); 1479 (time_t) message_params["timestamp"].asInteger();
1476 1480
1477 BOOL is_busy = gAgent.getBusy(); 1481 BOOL is_busy = gAgent.getBusy();
1478 BOOL is_muted = gMuteListp->isMuted( 1482 BOOL is_muted = LLMuteList::getInstance()->isMuted(
1479 from_id, 1483 from_id,
1480 name.c_str(), 1484 name.c_str(),
1481 LLMute::flagTextChat); 1485 LLMute::flagTextChat);
1482 1486
1483 BOOL is_linden = gMuteListp->isLinden( 1487 BOOL is_linden = LLMuteList::getInstance()->isLinden(
1484 name.c_str()); 1488 name.c_str());
1485 char separator_string[3]=": "; /* Flawfinder: ignore */ 1489 char separator_string[3]=": "; /* Flawfinder: ignore */
1486 int message_offset=0; 1490 int message_offset=0;
@@ -1624,3 +1628,4 @@ LLHTTPRegistration<LLViewerChatterBoxInvitation>
1624 gHTTPRegistrationMessageChatterBoxInvitation( 1628 gHTTPRegistrationMessageChatterBoxInvitation(
1625 "/message/ChatterBoxInvitation"); 1629 "/message/ChatterBoxInvitation");
1626 1630
1631