IM: implemented task EXT-1905 (Add "Call" and "End Call" functionality to new IIM Floater)
--HG-- branch : product-enginemeow-7.2.2
parent
4309277c1b
commit
3eb7f84b10
|
|
@ -202,9 +202,10 @@ BOOL LLIMFloater::postBuild()
|
|||
if (other_party_id.notNull())
|
||||
{
|
||||
mOtherParticipantUUID = other_party_id;
|
||||
mControlPanel->setID(mOtherParticipantUUID);
|
||||
}
|
||||
|
||||
mControlPanel->setSessionId(mSessionID);
|
||||
|
||||
LLButton* slide_left = getChild<LLButton>("slide_left_btn");
|
||||
slide_left->setVisible(mControlPanel->getVisible());
|
||||
slide_left->setClickedCallback(boost::bind(&LLIMFloater::onSlide, this));
|
||||
|
|
@ -248,6 +249,8 @@ BOOL LLIMFloater::postBuild()
|
|||
// virtual
|
||||
void LLIMFloater::draw()
|
||||
{
|
||||
|
||||
|
||||
if ( mMeTyping )
|
||||
{
|
||||
// Time out if user hasn't typed for a while.
|
||||
|
|
@ -403,10 +406,12 @@ void LLIMFloater::sessionInitReplyReceived(const LLUUID& im_session_id)
|
|||
{
|
||||
mSessionInitialized = true;
|
||||
|
||||
//will be different only for an ad-hoc im session
|
||||
if (mSessionID != im_session_id)
|
||||
{
|
||||
mSessionID = im_session_id;
|
||||
setKey(im_session_id);
|
||||
mControlPanel->setSessionId(im_session_id);
|
||||
}
|
||||
|
||||
//*TODO here we should remove "starting session..." warning message if we added it in postBuild() (IB)
|
||||
|
|
|
|||
|
|
@ -145,7 +145,8 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string&
|
|||
mInitialTargetIDs(ids),
|
||||
mVoiceChannel(NULL),
|
||||
mSpeakers(NULL),
|
||||
mSessionInitialized(false)
|
||||
mSessionInitialized(false),
|
||||
mCallBackEnabled(true)
|
||||
{
|
||||
if (IM_NOTHING_SPECIAL == type || IM_SESSION_P2P_INVITE == type)
|
||||
{
|
||||
|
|
@ -169,6 +170,11 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string&
|
|||
//so we're already initialized
|
||||
mSessionInitialized = true;
|
||||
}
|
||||
|
||||
if (IM_NOTHING_SPECIAL == type)
|
||||
{
|
||||
mCallBackEnabled = LLVoiceClient::getInstance()->isSessionCallBackPossible(mSessionID);
|
||||
}
|
||||
}
|
||||
|
||||
LLIMModel::LLIMSession::~LLIMSession()
|
||||
|
|
|
|||
|
|
@ -70,6 +70,10 @@ public:
|
|||
LLIMSpeakerMgr* mSpeakers;
|
||||
|
||||
bool mSessionInitialized;
|
||||
|
||||
//true if calling back the session URI after the session has closed is possible.
|
||||
//Currently this will be false only for PSTN P2P calls.
|
||||
bool mCallBackEnabled;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
|
||||
#include "llpanelimcontrolpanel.h"
|
||||
|
||||
#include "llagent.h"
|
||||
#include "llavataractions.h"
|
||||
#include "llavatariconctrl.h"
|
||||
#include "llbutton.h"
|
||||
|
|
@ -41,6 +42,53 @@
|
|||
#include "llavatarlist.h"
|
||||
#include "llparticipantlist.h"
|
||||
#include "llimview.h"
|
||||
#include "llvoicechannel.h"
|
||||
|
||||
void LLPanelChatControlPanel::onCallButtonClicked()
|
||||
{
|
||||
gIMMgr->startCall(mSessionId);
|
||||
}
|
||||
|
||||
void LLPanelChatControlPanel::onEndCallButtonClicked()
|
||||
{
|
||||
gIMMgr->endCall(mSessionId);
|
||||
}
|
||||
|
||||
BOOL LLPanelChatControlPanel::postBuild()
|
||||
{
|
||||
childSetAction("call_btn", boost::bind(&LLPanelChatControlPanel::onCallButtonClicked, this));
|
||||
childSetAction("end_call_btn", boost::bind(&LLPanelChatControlPanel::onEndCallButtonClicked, this));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLPanelChatControlPanel::draw()
|
||||
{
|
||||
// hide/show start call and end call buttons
|
||||
bool voice_enabled = LLVoiceClient::voiceEnabled();
|
||||
|
||||
LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(mSessionId);
|
||||
if (!session) return;
|
||||
|
||||
LLVoiceChannel* voice_channel = session->mVoiceChannel;
|
||||
if (voice_channel && voice_enabled)
|
||||
{
|
||||
childSetVisible("end_call_btn", voice_channel->getState() >= LLVoiceChannel::STATE_CALL_STARTED);
|
||||
childSetVisible("call_btn", voice_channel->getState() < LLVoiceChannel::STATE_CALL_STARTED);
|
||||
}
|
||||
|
||||
bool session_initialized = session->mSessionInitialized;
|
||||
bool callback_enabled = session->mCallBackEnabled;
|
||||
LLViewerRegion* region = gAgent.getRegion();
|
||||
|
||||
BOOL enable_connect = (region && region->getCapability("ChatSessionRequest") != "")
|
||||
&& session_initialized
|
||||
&& voice_enabled
|
||||
&& callback_enabled;
|
||||
childSetEnabled("call_btn", enable_connect);
|
||||
|
||||
LLPanel::draw();
|
||||
}
|
||||
|
||||
LLPanelIMControlPanel::LLPanelIMControlPanel()
|
||||
{
|
||||
|
|
@ -54,11 +102,11 @@ BOOL LLPanelIMControlPanel::postBuild()
|
|||
{
|
||||
childSetAction("view_profile_btn", boost::bind(&LLPanelIMControlPanel::onViewProfileButtonClicked, this));
|
||||
childSetAction("add_friend_btn", boost::bind(&LLPanelIMControlPanel::onAddFriendButtonClicked, this));
|
||||
childSetAction("call_btn", boost::bind(&LLPanelIMControlPanel::onCallButtonClicked, this));
|
||||
|
||||
childSetAction("share_btn", boost::bind(&LLPanelIMControlPanel::onShareButtonClicked, this));
|
||||
childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(getChild<LLAvatarIconCtrl>("avatar_icon")->getAvatarId()));
|
||||
|
||||
return TRUE;
|
||||
|
||||
return LLPanelChatControlPanel::postBuild();
|
||||
}
|
||||
|
||||
void LLPanelIMControlPanel::onViewProfileButtonClicked()
|
||||
|
|
@ -73,21 +121,20 @@ void LLPanelIMControlPanel::onAddFriendButtonClicked()
|
|||
LLAvatarActions::requestFriendshipDialog(avatar_icon->getAvatarId(), full_name);
|
||||
}
|
||||
|
||||
void LLPanelIMControlPanel::onCallButtonClicked()
|
||||
{
|
||||
// *TODO: Implement
|
||||
}
|
||||
|
||||
void LLPanelIMControlPanel::onShareButtonClicked()
|
||||
{
|
||||
// *TODO: Implement
|
||||
}
|
||||
|
||||
void LLPanelIMControlPanel::setID(const LLUUID& avatar_id)
|
||||
void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id)
|
||||
{
|
||||
LLPanelChatControlPanel::setSessionId(session_id);
|
||||
|
||||
LLUUID avatar_id = LLIMModel::getInstance()->getOtherParticipantID(session_id);
|
||||
|
||||
// Disable "Add friend" button for friends.
|
||||
childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(avatar_id));
|
||||
|
||||
|
||||
getChild<LLAvatarIconCtrl>("avatar_icon")->setValue(avatar_id);
|
||||
}
|
||||
|
||||
|
|
@ -100,12 +147,11 @@ LLPanelGroupControlPanel::LLPanelGroupControlPanel(const LLUUID& session_id)
|
|||
BOOL LLPanelGroupControlPanel::postBuild()
|
||||
{
|
||||
childSetAction("group_info_btn", boost::bind(&LLPanelGroupControlPanel::onGroupInfoButtonClicked, this));
|
||||
childSetAction("call_btn", boost::bind(&LLPanelGroupControlPanel::onCallButtonClicked, this));
|
||||
|
||||
mAvatarList = getChild<LLAvatarList>("speakers_list");
|
||||
mParticipantList = new LLParticipantList(mSpeakerManager, mAvatarList);
|
||||
|
||||
return TRUE;
|
||||
return LLPanelChatControlPanel::postBuild();
|
||||
}
|
||||
|
||||
LLPanelGroupControlPanel::~LLPanelGroupControlPanel()
|
||||
|
|
@ -127,13 +173,9 @@ void LLPanelGroupControlPanel::onGroupInfoButtonClicked()
|
|||
}
|
||||
|
||||
|
||||
void LLPanelGroupControlPanel::onCallButtonClicked()
|
||||
void LLPanelGroupControlPanel::setSessionId(const LLUUID& session_id)
|
||||
{
|
||||
// *TODO: Implement
|
||||
}
|
||||
LLPanelChatControlPanel::setSessionId(session_id);
|
||||
|
||||
|
||||
void LLPanelGroupControlPanel::setID(const LLUUID& id)
|
||||
{
|
||||
mGroupID = id;
|
||||
mGroupID = LLIMModel::getInstance()->getOtherParticipantID(session_id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,8 +45,16 @@ public:
|
|||
LLPanelChatControlPanel() {};
|
||||
~LLPanelChatControlPanel() {};
|
||||
|
||||
// sets the group or avatar UUID
|
||||
virtual void setID(const LLUUID& avatar_id)= 0;
|
||||
virtual BOOL postBuild();
|
||||
virtual void draw();
|
||||
|
||||
void onCallButtonClicked();
|
||||
void onEndCallButtonClicked();
|
||||
|
||||
virtual void setSessionId(const LLUUID& session_id) { mSessionId = session_id; }
|
||||
|
||||
private:
|
||||
LLUUID mSessionId;
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -58,13 +66,14 @@ public:
|
|||
|
||||
BOOL postBuild();
|
||||
|
||||
void setID(const LLUUID& avatar_id);
|
||||
void setSessionId(const LLUUID& session_id);
|
||||
|
||||
private:
|
||||
void onViewProfileButtonClicked();
|
||||
void onAddFriendButtonClicked();
|
||||
void onCallButtonClicked();
|
||||
void onShareButtonClicked();
|
||||
|
||||
LLUUID mAvatarID;
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -76,12 +85,11 @@ public:
|
|||
|
||||
BOOL postBuild();
|
||||
|
||||
void setID(const LLUUID& id);
|
||||
void setSessionId(const LLUUID& session_id);
|
||||
/*virtual*/ void draw();
|
||||
|
||||
private:
|
||||
void onGroupInfoButtonClicked();
|
||||
void onCallButtonClicked();
|
||||
|
||||
LLUUID mGroupID;
|
||||
LLSpeakerMgr* mSpeakerManager;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<avatar_list
|
||||
color="DkGray2"
|
||||
follows="left|top|right|bottom"
|
||||
height="150"
|
||||
height="130"
|
||||
layout="topleft"
|
||||
left="3"
|
||||
name="speakers_list"
|
||||
|
|
@ -24,4 +24,10 @@
|
|||
label="Call"
|
||||
width="90"
|
||||
height="20" />
|
||||
<button
|
||||
name="end_call_btn"
|
||||
label="End Call"
|
||||
width="90"
|
||||
height="20"
|
||||
visible="false"/>
|
||||
</panel>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<panel name="panel_im_control_panel"
|
||||
width="96"
|
||||
height="215"
|
||||
height="225"
|
||||
border="false">
|
||||
|
||||
<avatar_icon name="avatar_icon"
|
||||
|
|
@ -24,6 +24,13 @@
|
|||
width="90"
|
||||
height="20" />
|
||||
|
||||
<button
|
||||
height="20"
|
||||
label="End Call"
|
||||
name="end_call_btn"
|
||||
visible="false"
|
||||
width="90" />
|
||||
|
||||
<button name="share_btn"
|
||||
label="Share"
|
||||
width="90"
|
||||
|
|
|
|||
Loading…
Reference in New Issue