diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 6fc325481..ef503ff5c 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -561,16 +561,14 @@ BOOL LLFloaterIMPanel::postBuild() mInputEditor->setReplaceNewlinesWithSpaces( FALSE ); mInputEditor->setPassDelete( TRUE ); - if (LLButton* btn = findChild("profile_callee_btn")) + if (LLUICtrl* ctrl = findChild("instant_message_flyout")) { - btn->setCommitCallback(boost::bind(LLAvatarActions::showProfile, mOtherParticipantUUID, false)); - if (!mProfileButtonEnabled) btn->setEnabled(false); + ctrl->setCommitCallback(boost::bind(&LLFloaterIMPanel::onFlyoutCommit, this, _2)); } - if (LLButton* btn = findChild("profile_tele_btn")) - btn->setCommitCallback(boost::bind(static_cast(LLAvatarActions::offerTeleport), mOtherParticipantUUID)); if (LLButton* btn = findChild("group_info_btn")) btn->setCommitCallback(boost::bind(LLGroupActions::show, mSessionUUID)); - childSetAction("history_btn", onClickHistory, this); + if (LLUICtrl* ctrl = findChild("history_btn")) + ctrl->setCommitCallback(boost::bind(&LLFloaterIMPanel::onClickHistory, this)); if (LLUICtrl* ctrl = findChild("rp_mode")) ctrl->setCommitCallback(boost::bind(&LLFloaterIMPanel::onRPMode, this, _2)); @@ -1061,17 +1059,30 @@ void LLFloaterIMPanel::onRPMode(const LLSD& value) mRPMode = value.asBoolean(); } -// static -void LLFloaterIMPanel::onClickHistory( void* userdata ) +void LLFloaterIMPanel::onFlyoutCommit(const LLSD& value) { - LLFloaterIMPanel* self = (LLFloaterIMPanel*) userdata; - - if (self->mOtherParticipantUUID.notNull()) + if (value.isUndefined()) + { + LLAvatarActions::showProfile(mOtherParticipantUUID); + return; + } + + int option = value.asInteger(); + if (option == 1) onClickHistory(); + else if (option == 2) LLAvatarActions::offerTeleport(mOtherParticipantUUID); + else if (option == 3) LLAvatarActions::teleportRequest(mOtherParticipantUUID); + else if (option == 4) LLAvatarActions::pay(mOtherParticipantUUID); + else if (option == 5) LLAvatarActions::inviteToGroup(mOtherParticipantUUID); +} + +void LLFloaterIMPanel::onClickHistory() +{ + if (mOtherParticipantUUID.notNull()) { char command[256]; // [Ansariel: Display name support] - //std::string fullname(gDirUtilp->getScrubbedFileName(self->getTitle())); - std::string fullname(gDirUtilp->getScrubbedFileName(self->mSessionLabel)); + //std::string fullname(gDirUtilp->getScrubbedFileName(getTitle())); + std::string fullname(gDirUtilp->getScrubbedFileName(mSessionLabel)); // [/Ansariel: Display name support] sprintf(command, "\"%s%s%s.txt\"", gDirUtilp->getPerAccountChatLogsDir().c_str(), gDirUtilp->getDirDelimiter().c_str(), fullname.c_str()); gViewerWindow->getWindow()->ShellEx(command); diff --git a/indra/newview/llimpanel.h b/indra/newview/llimpanel.h index 0f659a820..9e56ad0e7 100644 --- a/indra/newview/llimpanel.h +++ b/indra/newview/llimpanel.h @@ -113,8 +113,9 @@ public: void onInputEditorKeystroke(LLLineEditor* caller); static void onTabClick( void* userdata ); - static void onClickHistory( void* userdata ); + void onClickHistory(); void onRPMode(const LLSD& value); + void onFlyoutCommit(const LLSD& value); static void onClickStartCall( void* userdata ); static void onClickEndCall( void* userdata ); void onClickToggleActiveSpeakers(const LLSD& value); diff --git a/indra/newview/skins/default/xui/en-us/floater_instant_message.xml b/indra/newview/skins/default/xui/en-us/floater_instant_message.xml index 9d850539d..56dd2157b 100644 --- a/indra/newview/skins/default/xui/en-us/floater_instant_message.xml +++ b/indra/newview/skins/default/xui/en-us/floater_instant_message.xml @@ -11,9 +11,13 @@ Click here to instant message. Text chat is not available for this call. Inventory item offered -