--HG--
branch : product-engine
master
Vadim Savchuk 2009-11-06 21:28:48 +02:00
commit 64b476133f
10 changed files with 71 additions and 9 deletions

View File

@ -178,7 +178,10 @@ void LLAvatarActions::startIM(const LLUUID& id)
std::string name;
gCacheName->getFullName(id, name);
LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, id);
LLIMFloater::show(session_id);
if (session_id != LLUUID::null)
{
LLIMFloater::show(session_id);
}
make_ui_sound("UISndStartIM");
}
@ -191,7 +194,11 @@ void LLAvatarActions::startConference(const std::vector<LLUUID>& ids)
{
id_array.push_back(*it);
}
gIMMgr->addSession("Friends Conference", IM_SESSION_CONFERENCE_START, ids[0], id_array);
LLUUID session_id = gIMMgr->addSession("Friends Conference", IM_SESSION_CONFERENCE_START, ids[0], id_array);
if (session_id != LLUUID::null)
{
LLIMFloater::show(session_id);
}
make_ui_sound("UISndStartIM");
}

View File

@ -44,6 +44,7 @@
#include "llcachename.h"
#include "llagentdata.h"
#include "llimfloater.h"
#define MENU_ITEM_VIEW_PROFILE 0
#define MENU_ITEM_SEND_IM 1
@ -354,7 +355,11 @@ void LLAvatarIconCtrl::onAvatarIconContextMenuItemClicked(const LLSD& userdata)
name.append(" ");
name.append(getLastName());
gIMMgr->addSession(name, IM_NOTHING_SPECIAL, id);
LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, id);
if (session_id != LLUUID::null)
{
LLIMFloater::show(session_id);
}
}
else if (level == "add")
{

View File

@ -43,6 +43,7 @@
#include "llimview.h" // for gIMMgr
#include "llsidetray.h"
#include "llstatusbar.h" // can_afford_transaction()
#include "llimfloater.h"
//
// Globals
@ -279,10 +280,14 @@ void LLGroupActions::startChat(const LLUUID& group_id)
LLGroupData group_data;
if (gAgent.getGroupData(group_id, group_data))
{
gIMMgr->addSession(
LLUUID session_id = gIMMgr->addSession(
group_data.mName,
IM_SESSION_GROUP_START,
group_id);
if (session_id != LLUUID::null)
{
LLIMFloater::show(session_id);
}
make_ui_sound("UISndStartIM");
}
else

View File

@ -1192,10 +1192,14 @@ void LLIncomingCallDialog::processCallResponse(S32 response)
}
else
{
gIMMgr->addSession(
LLUUID session_id = gIMMgr->addSession(
mPayload["session_name"].asString(),
type,
session_id);
if (session_id != LLUUID::null)
{
LLIMFloater::show(session_id);
}
std::string url = gAgent.getRegion()->getCapability(
"ChatSessionRequest");
@ -1279,10 +1283,14 @@ bool inviteUserResponse(const LLSD& notification, const LLSD& response)
}
else
{
gIMMgr->addSession(
LLUUID session_id = gIMMgr->addSession(
payload["session_name"].asString(),
type,
session_id);
if (session_id != LLUUID::null)
{
LLIMFloater::show(session_id);
}
std::string url = gAgent.getRegion()->getCapability(
"ChatSessionRequest");
@ -1548,6 +1556,10 @@ LLUUID LLIMMgr::addP2PSession(const std::string& name,
const std::string& caller_uri)
{
LLUUID session_id = addSession(name, IM_NOTHING_SPECIAL, other_participant_id);
if (session_id != LLUUID::null)
{
LLIMFloater::show(session_id);
}
LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(session_id);
if (speaker_mgr)

View File

@ -97,6 +97,7 @@
#include "llfloateropenobject.h"
#include "lltrans.h"
#include "llappearancemgr.h"
#include "llimfloater.h"
using namespace LLOldEvents;
@ -3347,7 +3348,11 @@ void LLCallingCardBridge::performAction(LLFolderView* folder, LLInventoryModel*
{
std::string callingcard_name;
gCacheName->getFullName(item->getCreatorUUID(), callingcard_name);
gIMMgr->addSession(callingcard_name, IM_NOTHING_SPECIAL, item->getCreatorUUID());
LLUUID session_id = gIMMgr->addSession(callingcard_name, IM_NOTHING_SPECIAL, item->getCreatorUUID());
if (session_id != LLUUID::null)
{
LLIMFloater::show(session_id);
}
}
}
else if ("lure" == action)

View File

@ -86,6 +86,7 @@
#include "llviewerwindow.h"
#include "llvoavatarself.h"
#include "llwearablelist.h"
#include "llimfloater.h"
static LLDefaultChildRegistry::Register<LLInventoryPanel> r("inventory_panel");
@ -800,7 +801,11 @@ bool LLInventoryPanel::beginIMSession()
name = llformat("Session %d", session_num++);
}
gIMMgr->addSession(name, type, members[0], members);
LLUUID session_id = gIMMgr->addSession(name, type, members[0], members);
if (session_id != LLUUID::null)
{
LLIMFloater::show(session_id);
}
return true;
}

View File

@ -99,6 +99,10 @@ bool LLOfferHandler::processNotification(const LLSD& notify)
session_id = LLIMMgr::instance().addSession(
notification->getSubstitutions()["NAME"], IM_NOTHING_SPECIAL,
notification->getPayload()["from_id"]);
if (session_id != LLUUID::null)
{
LLIMFloater::show(session_id);
}
}
LLIMMgr::instance().addMessage(session_id, LLUUID(),
notification->getSubstitutions()["NAME"],

View File

@ -499,6 +499,7 @@ void LLLandmarksPanel::updateListCommands()
// keep Options & Add Landmark buttons always enabled
mListCommands->childSetEnabled(ADD_FOLDER_BUTTON_NAME, add_folder_enabled);
mListCommands->childSetEnabled(TRASH_BUTTON_NAME, trash_enabled);
mListCommands->childSetEnabled(OPTIONS_BUTTON_NAME,getCurSelectedItem() != NULL);
}
void LLLandmarksPanel::onActionsButtonClick()

View File

@ -406,6 +406,7 @@ void LLTeleportHistoryPanel::getNextTab(const LLDate& item_date, S32& tab_idx, L
if (tab_idx <= tabs_cnt - 4)
{
// All tabs, except last three, are tabs for one day, so just push tab_date back by one day
tab_date.secondsSinceEpoch(tab_date.secondsSinceEpoch() - seconds_in_day);
}
else if (tab_idx == tabs_cnt - 3) // 6 day and older, low boundary is 1 month
@ -442,6 +443,7 @@ void LLTeleportHistoryPanel::getNextTab(const LLDate& item_date, S32& tab_idx, L
}
}
// Called to add items, no more, than ADD_LIMIT at time
void LLTeleportHistoryPanel::refresh()
{
if (!mHistoryAccordion)
@ -452,12 +454,16 @@ void LLTeleportHistoryPanel::refresh()
const LLTeleportHistoryStorage::slurl_list_t& items = mTeleportHistory->getItems();
// Setting tab_boundary_date to "now", so date from any item would be earlier, than boundary.
// That leads to call to getNextTab to get right tab_idx in first pass
LLDate tab_boundary_date = LLDate::now();
LLFlatListView* curr_flat_view = NULL;
U32 added_items = 0;
while (mCurrentItem >= 0)
{
// Filtering
std::string landmark_title = items[mCurrentItem].mTitle;
LLStringUtil::toUpper(landmark_title);
@ -470,10 +476,14 @@ void LLTeleportHistoryPanel::refresh()
continue;
}
// Checking whether date of item is earlier, than tab_boundary_date.
// In that case, item should be added to another tab
const LLDate &date = items[mCurrentItem].mDate;
if (date < tab_boundary_date)
{
// Getting apropriate tab_idx for this and subsequent items,
// tab_boundary_date would be earliest possible date for this tab
S32 tab_idx = 0;
getNextTab(date, tab_idx, tab_boundary_date);
@ -580,6 +590,9 @@ void LLTeleportHistoryPanel::replaceItem(S32 removed_index)
void LLTeleportHistoryPanel::showTeleportHistory()
{
mDirty = true;
// Starting to add items from last one, in reverse order,
// since TeleportHistory keeps most recent item at the end
mCurrentItem = mTeleportHistory->getItems().size() - 1;
for (S32 n = mItemContainers.size() - 1; n >= 0; --n)

View File

@ -210,6 +210,7 @@
#include "lltexlayer.h"
#include "llappearancemgr.h"
#include "llimfloater.h"
using namespace LLVOAvatarDefines;
@ -6265,9 +6266,13 @@ class LLAvatarSendIM : public view_listener_t
//EInstantMessage type = have_agent_callingcard(gLastHitObjectID)
// ? IM_SESSION_ADD : IM_SESSION_CARDLESS_START;
gIMMgr->addSession(name,
LLUUID session_id = gIMMgr->addSession(name,
IM_NOTHING_SPECIAL,
avatar->getID());
if (session_id != LLUUID::null)
{
LLIMFloater::show(session_id);
}
}
return true;
}