diff options
Diffstat (limited to 'linden/indra/newview/llimpanel.cpp')
-rw-r--r-- | linden/indra/newview/llimpanel.cpp | 66 |
1 files changed, 44 insertions, 22 deletions
diff --git a/linden/indra/newview/llimpanel.cpp b/linden/indra/newview/llimpanel.cpp index 3cb9dfb..2e3682d 100644 --- a/linden/indra/newview/llimpanel.cpp +++ b/linden/indra/newview/llimpanel.cpp | |||
@@ -48,16 +48,19 @@ | |||
48 | #include "llchat.h" | 48 | #include "llchat.h" |
49 | #include "llconsole.h" | 49 | #include "llconsole.h" |
50 | #include "llfloater.h" | 50 | #include "llfloater.h" |
51 | #include "llfloatergroupinfo.h" | ||
52 | #include "llimview.h" | ||
51 | #include "llinventory.h" | 53 | #include "llinventory.h" |
52 | #include "llinventorymodel.h" | 54 | #include "llinventorymodel.h" |
53 | #include "llinventoryview.h" | 55 | #include "llinventoryview.h" |
56 | #include "llfloateractivespeakers.h" | ||
54 | #include "llfloateravatarinfo.h" | 57 | #include "llfloateravatarinfo.h" |
55 | #include "llfloaterchat.h" | 58 | #include "llfloaterchat.h" |
56 | #include "llkeyboard.h" | 59 | #include "llkeyboard.h" |
57 | #include "lllineeditor.h" | 60 | #include "lllineeditor.h" |
61 | #include "llnotify.h" | ||
58 | #include "llresmgr.h" | 62 | #include "llresmgr.h" |
59 | #include "lltabcontainer.h" | 63 | #include "lltabcontainer.h" |
60 | #include "llimview.h" | ||
61 | #include "llviewertexteditor.h" | 64 | #include "llviewertexteditor.h" |
62 | #include "llviewermessage.h" | 65 | #include "llviewermessage.h" |
63 | #include "llviewerstats.h" | 66 | #include "llviewerstats.h" |
@@ -68,11 +71,8 @@ | |||
68 | #include "llfloaterhtml.h" | 71 | #include "llfloaterhtml.h" |
69 | #include "llweb.h" | 72 | #include "llweb.h" |
70 | #include "llhttpclient.h" | 73 | #include "llhttpclient.h" |
71 | #include "llfloateractivespeakers.h" // LLSpeakerMgr | ||
72 | #include "llfloatergroupinfo.h" | ||
73 | #include "llsdutil.h" | ||
74 | #include "llnotify.h" | ||
75 | #include "llmutelist.h" | 74 | #include "llmutelist.h" |
75 | #include "llstylemap.h" | ||
76 | 76 | ||
77 | // | 77 | // |
78 | // Constants | 78 | // Constants |
@@ -1454,24 +1454,20 @@ BOOL LLFloaterIMPanel::inviteToSession(const LLDynamicArray<LLUUID>& ids) | |||
1454 | return TRUE; | 1454 | return TRUE; |
1455 | } | 1455 | } |
1456 | 1456 | ||
1457 | void LLFloaterIMPanel::addHistoryLine(const LLUUID& source, const std::string &utf8msg, const LLColor4& color, bool log_to_file) | 1457 | void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, const LLColor4& color, bool log_to_file, const LLUUID& source, const char *name) |
1458 | { | 1458 | { |
1459 | // start tab flashing when receiving im for background session from user | 1459 | // start tab flashing when receiving im for background session from user |
1460 | LLMultiFloater* hostp = getHost(); | 1460 | if (source != LLUUID::null) |
1461 | if( !isInVisibleChain() | ||
1462 | && hostp | ||
1463 | && source != gAgent.getID()) | ||
1464 | { | 1461 | { |
1465 | hostp->setFloaterFlashing(this, TRUE); | 1462 | LLMultiFloater* hostp = getHost(); |
1463 | if( !isInVisibleChain() | ||
1464 | && hostp | ||
1465 | && source != gAgent.getID()) | ||
1466 | { | ||
1467 | hostp->setFloaterFlashing(this, TRUE); | ||
1468 | } | ||
1466 | } | 1469 | } |
1467 | 1470 | ||
1468 | addHistoryLine(utf8msg, color, log_to_file); | ||
1469 | mSpeakers->speakerChatted(source); | ||
1470 | mSpeakers->setSpeakerTyping(source, FALSE); | ||
1471 | } | ||
1472 | |||
1473 | void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, const LLColor4& color, bool log_to_file) | ||
1474 | { | ||
1475 | // Now we're adding the actual line of text, so erase the | 1471 | // Now we're adding the actual line of text, so erase the |
1476 | // "Foo is typing..." text segment, and the optional timestamp | 1472 | // "Foo is typing..." text segment, and the optional timestamp |
1477 | // if it was present. JC | 1473 | // if it was present. JC |
@@ -1485,6 +1481,22 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, const LLColor4 | |||
1485 | timestring = mHistoryEditor->appendTime(prepend_newline); | 1481 | timestring = mHistoryEditor->appendTime(prepend_newline); |
1486 | prepend_newline = false; | 1482 | prepend_newline = false; |
1487 | } | 1483 | } |
1484 | |||
1485 | // 'name' is a sender name that we want to hotlink so that clicking on it opens a profile. | ||
1486 | if (name != NULL) // If name exists, then add it to the front of the message. | ||
1487 | { | ||
1488 | // Don't hotlink any messages from the system (e.g. "Second Life:"), so just add those in plain text. | ||
1489 | if (!strcmp(name,SYSTEM_FROM)) | ||
1490 | { | ||
1491 | mHistoryEditor->appendColoredText(name,false,false,color); | ||
1492 | } | ||
1493 | else | ||
1494 | { | ||
1495 | // Convert the name to a hotlink and add to message. | ||
1496 | const LLStyleSP &source_style = LLStyleMap::instance().lookup(source); | ||
1497 | mHistoryEditor->appendStyledText(name, false, false, &source_style); | ||
1498 | } | ||
1499 | } | ||
1488 | mHistoryEditor->appendColoredText(utf8msg, false, prepend_newline, color); | 1500 | mHistoryEditor->appendColoredText(utf8msg, false, prepend_newline, color); |
1489 | 1501 | ||
1490 | if (log_to_file | 1502 | if (log_to_file |
@@ -1492,9 +1504,9 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, const LLColor4 | |||
1492 | { | 1504 | { |
1493 | LLString histstr; | 1505 | LLString histstr; |
1494 | if (gSavedPerAccountSettings.getBOOL("IMLogTimestamp")) | 1506 | if (gSavedPerAccountSettings.getBOOL("IMLogTimestamp")) |
1495 | histstr = LLLogChat::timestamp(gSavedPerAccountSettings.getBOOL("LogTimestampDate")) + utf8msg; | 1507 | histstr = LLLogChat::timestamp(gSavedPerAccountSettings.getBOOL("LogTimestampDate")) + LLString(name) + utf8msg; |
1496 | else | 1508 | else |
1497 | histstr = utf8msg; | 1509 | histstr = LLString(name) + utf8msg; |
1498 | 1510 | ||
1499 | LLLogChat::saveHistory(getTitle(),histstr); | 1511 | LLLogChat::saveHistory(getTitle(),histstr); |
1500 | } | 1512 | } |
@@ -1503,6 +1515,12 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, const LLColor4 | |||
1503 | { | 1515 | { |
1504 | mNumUnreadMessages++; | 1516 | mNumUnreadMessages++; |
1505 | } | 1517 | } |
1518 | |||
1519 | if (source != LLUUID::null) | ||
1520 | { | ||
1521 | mSpeakers->speakerChatted(source); | ||
1522 | mSpeakers->setSpeakerTyping(source, FALSE); | ||
1523 | } | ||
1506 | } | 1524 | } |
1507 | 1525 | ||
1508 | 1526 | ||
@@ -1836,6 +1854,11 @@ void deliver_message(const std::string& utf8_text, | |||
1836 | (EInstantMessage)new_dialog, | 1854 | (EInstantMessage)new_dialog, |
1837 | im_session_id); | 1855 | im_session_id); |
1838 | gAgent.sendReliableMessage(); | 1856 | gAgent.sendReliableMessage(); |
1857 | |||
1858 | if (LLMuteList::getInstance()) | ||
1859 | { | ||
1860 | LLMuteList::getInstance()->autoRemove(other_participant_id, LLMuteList::AR_IM); | ||
1861 | } | ||
1839 | } | 1862 | } |
1840 | 1863 | ||
1841 | void LLFloaterIMPanel::sendMsg() | 1864 | void LLFloaterIMPanel::sendMsg() |
@@ -1888,7 +1911,7 @@ void LLFloaterIMPanel::sendMsg() | |||
1888 | 1911 | ||
1889 | BOOL other_was_typing = mOtherTyping; | 1912 | BOOL other_was_typing = mOtherTyping; |
1890 | 1913 | ||
1891 | addHistoryLine(gAgent.getID(), history_echo, gSavedSettings.getColor("IMChatColor")); | 1914 | addHistoryLine(history_echo, gSavedSettings.getColor("IMChatColor"), true, gAgent.getID()); |
1892 | 1915 | ||
1893 | if (other_was_typing) | 1916 | if (other_was_typing) |
1894 | { | 1917 | { |
@@ -2189,4 +2212,3 @@ void LLFloaterIMPanel::onConfirmForceCloseError(S32 option, void* data) | |||
2189 | } | 2212 | } |
2190 | 2213 | ||
2191 | 2214 | ||
2192 | |||