From 090ca089812eec4fe5042bd19877081abffd36d3 Mon Sep 17 00:00:00 2001 From: Jay Threeth Date: Mon, 4 Apr 2011 08:20:54 -0700 Subject: build fixes, might build on linux now --- linden/indra/newview/app_settings/settings.xml | 16 +++++++++++ linden/indra/newview/llfirstuse.cpp | 2 +- linden/indra/newview/llimpanel.cpp | 32 ++++++++++++++++++++-- linden/indra/newview/llimpanel.h | 1 + linden/indra/newview/llimview.cpp | 4 +++ .../xui/en-us/panel_preferences_advanced.xml | 4 +-- 6 files changed, 53 insertions(+), 6 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index e55684a..b7e7196 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -221,6 +221,22 @@ Value 0 + IMEncryptedChatColor + + Comment + Color of encrypted instant messages from other residents + Persist + 1 + Type + Color4 + Value + + 1.0 + 1.0 + 0.8 + 1.0 + + AppearanceAnimate diff --git a/linden/indra/newview/llfirstuse.cpp b/linden/indra/newview/llfirstuse.cpp index a377959..50917f7 100644 --- a/linden/indra/newview/llfirstuse.cpp +++ b/linden/indra/newview/llfirstuse.cpp @@ -369,7 +369,7 @@ void LLFirstUse::callbackEmeraldOTR(const LLSD ¬ification, const LLSD &respon gSavedSettings.setWarning("EmeraldOTR", FALSE); S32 option = LLNotification::getSelectedOption(notification, response); - + if ( option == 0 ) { gSavedSettings.setU32("EmeraldUseOTR",(U32)1); diff --git a/linden/indra/newview/llimpanel.cpp b/linden/indra/newview/llimpanel.cpp index 3f531aa..75872e0 100644 --- a/linden/indra/newview/llimpanel.cpp +++ b/linden/indra/newview/llimpanel.cpp @@ -89,7 +89,6 @@ #include "otr_wrapper.h" #include "otr_floater_smp_dialog.h" #include "otr_floater_smp_progress.h" -#include "mfdKeywordFloater.h" #endif // USE_OTR // [/$PLOTR$] // @@ -1412,6 +1411,7 @@ BOOL LLFloaterIMPanel::postBuild() #if USE_OTR // [$PLOTR$] if (!gOTR) OTR_Wrapper::init(); + llinfos << "$PLOTR$ gOTR is " << gOTR << llendl; if (gOTR && (IM_NOTHING_SPECIAL == mDialog)) { LLComboBox *combo = getChild("otr_combo"); @@ -3183,16 +3183,31 @@ void LLFloaterIMPanel::sendMsg() std::string prefix = utf8_text.substr(0, 4); if (prefix == "/me " || prefix == "/me'") { +#if USE_OTR // [$PLOTR$] + if (isEncrypted()) + utf8_text.replace(0,3,"\xe2\x80\xa7"); + else +#endif // USE_OTR // [/$PLOTR$] utf8_text.replace(0,3,""); } else { +#if USE_OTR // [$PLOTR$] + if (isEncrypted()) + history_echo += "\xe2\x80\xa7: "; + else +#endif // USE_OTR // [/$PLOTR$] history_echo += ": "; } history_echo += utf8_text; BOOL other_was_typing = mOtherTyping; +#if USE_OTR // [$PLOTR$] + if (isEncrypted()) + addHistoryLine(history_echo, gSavedSettings.getColor("IMEncryptedChatColor"), true, gAgent.getID()); + else +#endif // USE_OTR // [/$PLOTR$] addHistoryLine(history_echo, gSavedSettings.getColor("IMChatColor"), true, gAgent.getID()); if (other_was_typing) @@ -3423,7 +3438,7 @@ void LLFloaterIMPanel::chatFromLogFile(LLLogChat::ELogLineType type, std::string //self->addHistoryLine(line, LLColor4::grey, FALSE); self->mHistoryEditor->appendColoredText(message, false, true, LLColor4::grey); } -/* +#if 0 // user is known to be offline when we receive this void LLFloaterIMPanel::setOffline() { @@ -3443,7 +3458,7 @@ void LLFloaterIMPanel::setOffline() } #endif // USE_OTR // [/$PLOTR$] } -*/ +#endif // 0 void LLFloaterIMPanel::showSessionStartError( const std::string& error_string) { @@ -3529,3 +3544,14 @@ bool LLFloaterIMPanel::onConfirmForceCloseError(const LLSD& notification, const } +#if USE_OTR // [$PLOTR$] +bool LLFloaterIMPanel::isEncrypted() +{ + if (gOTR) + { + ConnContext *context = getOtrContext(); + if (context && (context->msgstate == OTRL_MSGSTATE_ENCRYPTED)) return true; + } + return false; +} +#endif // USE_OTR // [/$PLOTR$] diff --git a/linden/indra/newview/llimpanel.h b/linden/indra/newview/llimpanel.h index 5a36648..cb77c24 100644 --- a/linden/indra/newview/llimpanel.h +++ b/linden/indra/newview/llimpanel.h @@ -356,6 +356,7 @@ private: OtrlMessageState mOtrLastStatus; OtrFloaterSmpDialog *mOtrSmpDialog; OtrFloaterSmpProgress *mOtrSmpProgress; + bool isEncrypted(); #endif // USE_OTR // [/$PLOTR$] private: diff --git a/linden/indra/newview/llimview.cpp b/linden/indra/newview/llimview.cpp index ea4070b..cba442b 100644 --- a/linden/indra/newview/llimview.cpp +++ b/linden/indra/newview/llimview.cpp @@ -681,6 +681,10 @@ void LLIMMgr::addMessage( LLColor4 color; if (is_from_system) color = gSavedSettings.getColor4("SystemChatColor"); + else if ((msg.substr(0, 3) == "\xe2\x80\xa7")) + { + color = gSavedSettings.getColor("IMEncryptedChatColor"); + } else { std::string new_line = std::string(msg); diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml index 94e5c6a..8e72c69 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml @@ -183,8 +183,8 @@ To use spellcheck, right-click a misspelled word + height="525" label="OTR" + left="1" mouse_opaque="true" name="OTR" width="418">