aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llimpanel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llimpanel.cpp')
-rw-r--r--linden/indra/newview/llimpanel.cpp77
1 files changed, 77 insertions, 0 deletions
diff --git a/linden/indra/newview/llimpanel.cpp b/linden/indra/newview/llimpanel.cpp
index 63d7907..9368e4e 100644
--- a/linden/indra/newview/llimpanel.cpp
+++ b/linden/indra/newview/llimpanel.cpp
@@ -74,6 +74,7 @@
74#include "llhttpclient.h" 74#include "llhttpclient.h"
75#include "llmutelist.h" 75#include "llmutelist.h"
76#include "llstylemap.h" 76#include "llstylemap.h"
77#include <sys/stat.h>
77 78
78// 79//
79// Constants 80// Constants
@@ -1279,6 +1280,10 @@ BOOL LLFloaterIMPanel::postBuild()
1279 requires<LLLineEditor>("chat_editor"); 1280 requires<LLLineEditor>("chat_editor");
1280 requires<LLTextEditor>("im_history"); 1281 requires<LLTextEditor>("im_history");
1281 1282
1283#if LL_LINUX || LL_DARWIN
1284 childSetVisible("history_btn", false);
1285#endif
1286
1282 if (checkRequirements()) 1287 if (checkRequirements())
1283 { 1288 {
1284 mInputEditor = getChild<LLLineEditor>("chat_editor"); 1289 mInputEditor = getChild<LLLineEditor>("chat_editor");
@@ -1293,6 +1298,7 @@ BOOL LLFloaterIMPanel::postBuild()
1293 1298
1294 childSetAction("profile_callee_btn", onClickProfile, this); 1299 childSetAction("profile_callee_btn", onClickProfile, this);
1295 childSetAction("group_info_btn", onClickGroupInfo, this); 1300 childSetAction("group_info_btn", onClickGroupInfo, this);
1301 childSetAction("history_btn", onClickHistory, this);
1296 1302
1297 childSetAction("start_call_btn", onClickStartCall, this); 1303 childSetAction("start_call_btn", onClickStartCall, this);
1298 childSetAction("end_call_btn", onClickEndCall, this); 1304 childSetAction("end_call_btn", onClickEndCall, this);
@@ -1806,6 +1812,41 @@ void LLFloaterIMPanel::onClickProfile( void* userdata )
1806} 1812}
1807 1813
1808// static 1814// static
1815void LLFloaterIMPanel::onClickHistory( void* userdata )
1816{
1817 LLFloaterIMPanel* self = (LLFloaterIMPanel*) userdata;
1818
1819 if (self->mOtherParticipantUUID.notNull())
1820 {
1821 struct stat fileInfo;
1822 int result;
1823
1824 std::string fullname = self->getTitle();;
1825 //gCacheName->getFullName(self->mOtherParticipantUUID, fullname);
1826 //if(fullname == "(Loading...)")
1827 std::string file_path = gDirUtilp->getPerAccountChatLogsDir() + "\\" + fullname + ".txt";
1828
1829 // check if file exists by trying to get its attributes
1830 result = stat(file_path.c_str(), &fileInfo);
1831 if(result == 0)
1832 {
1833 char command[256];
1834 sprintf(command, "\"%s\\%s.txt\"", gDirUtilp->getPerAccountChatLogsDir().c_str(),fullname.c_str());
1835 gViewerWindow->getWindow()->ShellEx(command);
1836
1837 llinfos << command << llendl;
1838 }
1839 else
1840 {
1841 LLStringUtil::format_map_t args;
1842 args["[NAME]"] = fullname;
1843 gViewerWindow->alertXml("IMLogNotFound", args);
1844 llinfos << file_path << llendl;
1845 }
1846 }
1847}
1848
1849// static
1809void LLFloaterIMPanel::onClickGroupInfo( void* userdata ) 1850void LLFloaterIMPanel::onClickGroupInfo( void* userdata )
1810{ 1851{
1811 // Bring up the Profile window 1852 // Bring up the Profile window
@@ -2015,6 +2056,42 @@ void LLFloaterIMPanel::sendMsg()
2015 std::string utf8_text = wstring_to_utf8str(text); 2056 std::string utf8_text = wstring_to_utf8str(text);
2016 utf8_text = utf8str_truncate(utf8_text, MAX_MSG_BUF_SIZE - 1); 2057 utf8_text = utf8str_truncate(utf8_text, MAX_MSG_BUF_SIZE - 1);
2017 2058
2059// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-1.0.0g
2060 if (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM))
2061 {
2062 if (IM_NOTHING_SPECIAL == mDialog) // One-on-one IM: allow if recipient is a sendim exception
2063 {
2064 if (!gRlvHandler.isException(RLV_BHVR_SENDIM, mOtherParticipantUUID))
2065 utf8_text = rlv_handler_t::cstrBlockedSendIM;
2066 }
2067 else if (gAgent.isInGroup(mSessionUUID)) // Group chat: allow if recipient is a sendim exception
2068 {
2069 if (!gRlvHandler.isException(RLV_BHVR_SENDIM, mSessionUUID))
2070 utf8_text = rlv_handler_t::cstrBlockedSendIM;
2071 }
2072 else if (mSpeakers) // Conference chat: allow if all participants are sendim exceptions
2073 {
2074 LLSpeakerMgr::speaker_list_t speakers;
2075 mSpeakers->getSpeakerList(&speakers, TRUE);
2076
2077 for (LLSpeakerMgr::speaker_list_t::const_iterator itSpeaker = speakers.begin();
2078 itSpeaker != speakers.end(); ++itSpeaker)
2079 {
2080 LLSpeaker* pSpeaker = *itSpeaker;
2081 if ( (gAgent.getID() != pSpeaker->mID) && (!gRlvHandler.isException(RLV_BHVR_SENDIM, pSpeaker->mID)) )
2082 {
2083 utf8_text = rlv_handler_t::cstrBlockedSendIM;
2084 break;
2085 }
2086 }
2087 }
2088 else // Catch all fall-through
2089 {
2090 utf8_text = rlv_handler_t::cstrBlockedSendIM;
2091 }
2092 }
2093// [/RLVa:KB]
2094
2018 if ( mSessionInitialized ) 2095 if ( mSessionInitialized )
2019 { 2096 {
2020 deliver_message(utf8_text, 2097 deliver_message(utf8_text,