summaryrefslogtreecommitdiff
path: root/indra/newview/llchannelmanager.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-10-01 17:44:44 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-10-01 17:44:44 +0000
commitf05df68656d2abdc38d86cd6746398fa90eb8614 (patch)
tree95f389551a7132b86dd96ff7c55b92674ee16756 /indra/newview/llchannelmanager.cpp
parent090977608d3d4e1d6d26689064910221c66f6084 (diff)
merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@1868 https://svn.aws.productengine.com/secondlife/pe/stable-2@1876 -> viewer-2.0.0-3
* Bugs: EXT-1111 EXT-915 EXT-1131 EXT-1200 EXT-1202 EXT-1201 EXT-1205 EXT-1212 EXT-1173 EXT-1229 EXT-1218 EXT-1164 EXT-996 EXT-821 EXT-1030 EXT-1031 EXT-816 * Major Bugs: EXT-1142 (timeout during login due to processing group IMs) * Changes: EXT-1216 (minimize message well)
Diffstat (limited to 'indra/newview/llchannelmanager.cpp')
-rw-r--r--indra/newview/llchannelmanager.cpp54
1 files changed, 35 insertions, 19 deletions
diff --git a/indra/newview/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp
index 7ae9976338..b4b680416c 100644
--- a/indra/newview/llchannelmanager.cpp
+++ b/indra/newview/llchannelmanager.cpp
@@ -77,7 +77,7 @@ LLScreenChannel* LLChannelManager::createNotificationChannel()
p.channel_align = CA_RIGHT;
// Getting a Channel for our notifications
- return LLChannelManager::getInstance()->getChannel(p);
+ return dynamic_cast<LLScreenChannel*> (LLChannelManager::getInstance()->createChannel(p));
}
//--------------------------------------------------------------------------
@@ -113,7 +113,7 @@ void LLChannelManager::onLoginCompleted()
LLChannelManager::Params p;
p.id = LLUUID(gSavedSettings.getString("StartUpChannelUUID"));
p.channel_align = CA_RIGHT;
- mStartUpChannel = getChannel(p);
+ mStartUpChannel = createChannel(p);
if(!mStartUpChannel)
{
@@ -147,22 +147,32 @@ void LLChannelManager::onStartUpToastClose()
LLScreenChannel::setStartUpToastShown();
// force NEARBY CHAT CHANNEL to repost all toasts if present
- LLScreenChannel* nearby_channel = findChannelByID(LLUUID(gSavedSettings.getString("NearByChatChannelUUID")));
- nearby_channel->loadStoredToastsToChannel();
- nearby_channel->setCanStoreToasts(false);
+ //LLScreenChannelBase* nearby_channel = findChannelByID(LLUUID(gSavedSettings.getString("NearByChatChannelUUID")));
+ //!!!!!!!!!!!!!!
+ //FIXME
+ //nearby_channel->loadStoredToastsToChannel();
+ //nearby_channel->setCanStoreToasts(false);
}
//--------------------------------------------------------------------------
-LLScreenChannel* LLChannelManager::getChannel(LLChannelManager::Params& p)
+
+LLScreenChannelBase* LLChannelManager::addChannel(LLScreenChannelBase* channel)
{
- LLScreenChannel* new_channel = NULL;
+ if(!channel)
+ return 0;
- new_channel = findChannelByID(p.id);
+ ChannelElem new_elem;
+ new_elem.id = channel->getChannelID();
+ new_elem.channel = channel;
- if(new_channel)
- return new_channel;
+ mChannelList.push_back(new_elem);
- new_channel = new LLScreenChannel(p.id);
+ return channel;
+}
+
+LLScreenChannel* LLChannelManager::createChannel(LLChannelManager::Params& p)
+{
+ LLScreenChannel* new_channel = new LLScreenChannel(p.id);
if(!new_channel)
{
@@ -172,20 +182,26 @@ LLScreenChannel* LLChannelManager::getChannel(LLChannelManager::Params& p)
{
new_channel->setToastAlignment(p.toast_align);
new_channel->setChannelAlignment(p.channel_align);
- new_channel->setDisplayToastsAlways(p.display_toasts_always);
-
- ChannelElem new_elem;
- new_elem.id = p.id;
- new_elem.channel = new_channel;
+ new_channel->setDisplayToastsAlways(p.display_toasts_always);
- mChannelList.push_back(new_elem);
+ addChannel(new_channel);
}
-
return new_channel;
}
+LLScreenChannelBase* LLChannelManager::getChannel(LLChannelManager::Params& p)
+{
+ LLScreenChannelBase* new_channel = findChannelByID(p.id);
+
+ if(new_channel)
+ return new_channel;
+
+ return createChannel(p);
+
+}
+
//--------------------------------------------------------------------------
-LLScreenChannel* LLChannelManager::findChannelByID(const LLUUID id)
+LLScreenChannelBase* LLChannelManager::findChannelByID(const LLUUID id)
{
std::vector<ChannelElem>::iterator it = find(mChannelList.begin(), mChannelList.end(), id);
if(it != mChannelList.end())