diff options
author | Jacek Antonelli | 2009-04-30 13:04:20 -0500 |
---|---|---|
committer | Jacek Antonelli | 2009-04-30 13:07:16 -0500 |
commit | ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch) | |
tree | 8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/newview/llimpanel.cpp | |
parent | Second Life viewer sources 1.22.11 (diff) | |
download | meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2 meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz |
Second Life viewer sources 1.23.0-RC
Diffstat (limited to 'linden/indra/newview/llimpanel.cpp')
-rw-r--r-- | linden/indra/newview/llimpanel.cpp | 218 |
1 files changed, 113 insertions, 105 deletions
diff --git a/linden/indra/newview/llimpanel.cpp b/linden/indra/newview/llimpanel.cpp index 6d77354..e35f12e 100644 --- a/linden/indra/newview/llimpanel.cpp +++ b/linden/indra/newview/llimpanel.cpp | |||
@@ -17,7 +17,8 @@ | |||
17 | * There are special exceptions to the terms and conditions of the GPL as | 17 | * There are special exceptions to the terms and conditions of the GPL as |
18 | * it is applied to this Source Code. View the full text of the exception | 18 | * it is applied to this Source Code. View the full text of the exception |
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 19 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | 20 | * online at |
21 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | 22 | * |
22 | * By copying, modifying or distributing this software, you acknowledge | 23 | * By copying, modifying or distributing this software, you acknowledge |
23 | * that you have read and understood your obligations described above, | 24 | * that you have read and understood your obligations described above, |
@@ -306,13 +307,13 @@ void LLVoiceCallCapResponder::error(U32 status, const std::string& reason) | |||
306 | if ( 403 == status ) | 307 | if ( 403 == status ) |
307 | { | 308 | { |
308 | //403 == no ability | 309 | //403 == no ability |
309 | LLNotifyBox::showXml( | 310 | LLNotifications::instance().add( |
310 | "VoiceNotAllowed", | 311 | "VoiceNotAllowed", |
311 | channelp->getNotifyArgs()); | 312 | channelp->getNotifyArgs()); |
312 | } | 313 | } |
313 | else | 314 | else |
314 | { | 315 | { |
315 | LLNotifyBox::showXml( | 316 | LLNotifications::instance().add( |
316 | "VoiceCallGenericError", | 317 | "VoiceCallGenericError", |
317 | channelp->getNotifyArgs()); | 318 | channelp->getNotifyArgs()); |
318 | } | 319 | } |
@@ -348,7 +349,7 @@ LLVoiceChannel::LLVoiceChannel(const LLUUID& session_id, const std::string& sess | |||
348 | mSessionName(session_name), | 349 | mSessionName(session_name), |
349 | mIgnoreNextSessionLeave(FALSE) | 350 | mIgnoreNextSessionLeave(FALSE) |
350 | { | 351 | { |
351 | mNotifyArgs["[VOICE_CHANNEL_NAME]"] = mSessionName; | 352 | mNotifyArgs["VOICE_CHANNEL_NAME"] = mSessionName; |
352 | 353 | ||
353 | if (!sVoiceChannelMap.insert(std::make_pair(session_id, this)).second) | 354 | if (!sVoiceChannelMap.insert(std::make_pair(session_id, this)).second) |
354 | { | 355 | { |
@@ -384,13 +385,13 @@ void LLVoiceChannel::setChannelInfo( | |||
384 | { | 385 | { |
385 | if (mURI.empty()) | 386 | if (mURI.empty()) |
386 | { | 387 | { |
387 | LLNotifyBox::showXml("VoiceChannelJoinFailed", mNotifyArgs); | 388 | LLNotifications::instance().add("VoiceChannelJoinFailed", mNotifyArgs); |
388 | llwarns << "Received empty URI for channel " << mSessionName << llendl; | 389 | llwarns << "Received empty URI for channel " << mSessionName << llendl; |
389 | deactivate(); | 390 | deactivate(); |
390 | } | 391 | } |
391 | else if (mCredentials.empty()) | 392 | else if (mCredentials.empty()) |
392 | { | 393 | { |
393 | LLNotifyBox::showXml("VoiceChannelJoinFailed", mNotifyArgs); | 394 | LLNotifications::instance().add("VoiceChannelJoinFailed", mNotifyArgs); |
394 | llwarns << "Received empty credentials for channel " << mSessionName << llendl; | 395 | llwarns << "Received empty credentials for channel " << mSessionName << llendl; |
395 | deactivate(); | 396 | deactivate(); |
396 | } | 397 | } |
@@ -433,25 +434,26 @@ void LLVoiceChannel::handleStatusChange(EStatusType type) | |||
433 | switch(type) | 434 | switch(type) |
434 | { | 435 | { |
435 | case STATUS_LOGIN_RETRY: | 436 | case STATUS_LOGIN_RETRY: |
436 | mLoginNotificationHandle = LLNotifyBox::showXml("VoiceLoginRetry")->getHandle(); | 437 | //mLoginNotificationHandle = LLNotifyBox::showXml("VoiceLoginRetry")->getHandle(); |
438 | LLNotifications::instance().add("VoiceLoginRetry"); | ||
437 | break; | 439 | break; |
438 | case STATUS_LOGGED_IN: | 440 | case STATUS_LOGGED_IN: |
439 | if (!mLoginNotificationHandle.isDead()) | 441 | //if (!mLoginNotificationHandle.isDead()) |
440 | { | 442 | //{ |
441 | LLNotifyBox* notifyp = (LLNotifyBox*)mLoginNotificationHandle.get(); | 443 | // LLNotifyBox* notifyp = (LLNotifyBox*)mLoginNotificationHandle.get(); |
442 | if (notifyp) | 444 | // if (notifyp) |
443 | { | 445 | // { |
444 | notifyp->close(); | 446 | // notifyp->close(); |
445 | } | 447 | // } |
446 | mLoginNotificationHandle.markDead(); | 448 | // mLoginNotificationHandle.markDead(); |
447 | } | 449 | //} |
448 | break; | 450 | break; |
449 | case STATUS_LEFT_CHANNEL: | 451 | case STATUS_LEFT_CHANNEL: |
450 | if (callStarted() && !mIgnoreNextSessionLeave && !sSuspended) | 452 | if (callStarted() && !mIgnoreNextSessionLeave && !sSuspended) |
451 | { | 453 | { |
452 | // if forceably removed from channel | 454 | // if forceably removed from channel |
453 | // update the UI and revert to default channel | 455 | // update the UI and revert to default channel |
454 | LLNotifyBox::showXml("VoiceChannelDisconnected", mNotifyArgs); | 456 | LLNotifications::instance().add("VoiceChannelDisconnected", mNotifyArgs); |
455 | deactivate(); | 457 | deactivate(); |
456 | } | 458 | } |
457 | mIgnoreNextSessionLeave = FALSE; | 459 | mIgnoreNextSessionLeave = FALSE; |
@@ -502,7 +504,13 @@ void LLVoiceChannel::deactivate() | |||
502 | if (callStarted()) | 504 | if (callStarted()) |
503 | { | 505 | { |
504 | setState(STATE_HUNG_UP); | 506 | setState(STATE_HUNG_UP); |
507 | // mute the microphone if required when returning to the proximal channel | ||
508 | if (gSavedSettings.getBOOL("AutoDisengageMic") && sCurrentVoiceChannel == this) | ||
509 | { | ||
510 | gSavedSettings.setBOOL("PTTCurrentlyEnabled", true); | ||
511 | } | ||
505 | } | 512 | } |
513 | |||
506 | if (sCurrentVoiceChannel == this) | 514 | if (sCurrentVoiceChannel == this) |
507 | { | 515 | { |
508 | // default channel is proximal channel | 516 | // default channel is proximal channel |
@@ -521,11 +529,14 @@ void LLVoiceChannel::activate() | |||
521 | // deactivate old channel and mark ourselves as the active one | 529 | // deactivate old channel and mark ourselves as the active one |
522 | if (sCurrentVoiceChannel != this) | 530 | if (sCurrentVoiceChannel != this) |
523 | { | 531 | { |
524 | if (sCurrentVoiceChannel) | 532 | // mark as current before deactivating the old channel to prevent |
533 | // activating the proximal channel between IM calls | ||
534 | LLVoiceChannel* old_channel = sCurrentVoiceChannel; | ||
535 | sCurrentVoiceChannel = this; | ||
536 | if (old_channel) | ||
525 | { | 537 | { |
526 | sCurrentVoiceChannel->deactivate(); | 538 | old_channel->deactivate(); |
527 | } | 539 | } |
528 | sCurrentVoiceChannel = this; | ||
529 | } | 540 | } |
530 | 541 | ||
531 | if (mState == STATE_NO_CHANNEL_INFO) | 542 | if (mState == STATE_NO_CHANNEL_INFO) |
@@ -793,9 +804,9 @@ void LLVoiceChannelGroup::handleError(EStatusType status) | |||
793 | // notification | 804 | // notification |
794 | if (!notify.empty()) | 805 | if (!notify.empty()) |
795 | { | 806 | { |
796 | LLNotifyBox::showXml(notify, mNotifyArgs); | 807 | LLNotificationPtr notification = LLNotifications::instance().add(notify, mNotifyArgs); |
797 | // echo to im window | 808 | // echo to im window |
798 | gIMMgr->addMessage(mSessionID, LLUUID::null, SYSTEM_FROM, LLNotifyBox::getTemplateMessage(notify, mNotifyArgs)); | 809 | gIMMgr->addMessage(mSessionID, LLUUID::null, SYSTEM_FROM, notification->getMessage()); |
799 | } | 810 | } |
800 | 811 | ||
801 | LLVoiceChannel::handleError(status); | 812 | LLVoiceChannel::handleError(status); |
@@ -896,7 +907,7 @@ void LLVoiceChannelProximal::handleError(EStatusType status) | |||
896 | // notification | 907 | // notification |
897 | if (!notify.empty()) | 908 | if (!notify.empty()) |
898 | { | 909 | { |
899 | LLNotifyBox::showXml(notify, mNotifyArgs); | 910 | LLNotifications::instance().add(notify, mNotifyArgs); |
900 | } | 911 | } |
901 | 912 | ||
902 | LLVoiceChannel::handleError(status); | 913 | LLVoiceChannel::handleError(status); |
@@ -934,12 +945,12 @@ void LLVoiceChannelP2P::handleStatusChange(EStatusType type) | |||
934 | if (mState == STATE_RINGING) | 945 | if (mState == STATE_RINGING) |
935 | { | 946 | { |
936 | // other user declined call | 947 | // other user declined call |
937 | LLNotifyBox::showXml("P2PCallDeclined", mNotifyArgs); | 948 | LLNotifications::instance().add("P2PCallDeclined", mNotifyArgs); |
938 | } | 949 | } |
939 | else | 950 | else |
940 | { | 951 | { |
941 | // other user hung up | 952 | // other user hung up |
942 | LLNotifyBox::showXml("VoiceChannelDisconnectedP2P", mNotifyArgs); | 953 | LLNotifications::instance().add("VoiceChannelDisconnectedP2P", mNotifyArgs); |
943 | } | 954 | } |
944 | deactivate(); | 955 | deactivate(); |
945 | } | 956 | } |
@@ -957,7 +968,7 @@ void LLVoiceChannelP2P::handleError(EStatusType type) | |||
957 | switch(type) | 968 | switch(type) |
958 | { | 969 | { |
959 | case ERROR_NOT_AVAILABLE: | 970 | case ERROR_NOT_AVAILABLE: |
960 | LLNotifyBox::showXml("P2PCallNoAnswer", mNotifyArgs); | 971 | LLNotifications::instance().add("P2PCallNoAnswer", mNotifyArgs); |
961 | break; | 972 | break; |
962 | default: | 973 | default: |
963 | break; | 974 | break; |
@@ -1081,6 +1092,10 @@ LLFloaterIMPanel::LLFloaterIMPanel( | |||
1081 | mNumUnreadMessages(0), | 1092 | mNumUnreadMessages(0), |
1082 | mShowSpeakersOnConnect(TRUE), | 1093 | mShowSpeakersOnConnect(TRUE), |
1083 | mAutoConnect(FALSE), | 1094 | mAutoConnect(FALSE), |
1095 | mTextIMPossible(TRUE), | ||
1096 | mProfileButtonEnabled(TRUE), | ||
1097 | mCallBackEnabled(TRUE), | ||
1098 | mSpeakers(NULL), | ||
1084 | mSpeakerPanel(NULL), | 1099 | mSpeakerPanel(NULL), |
1085 | mFirstKeystrokeTimer(), | 1100 | mFirstKeystrokeTimer(), |
1086 | mLastKeystrokeTimer() | 1101 | mLastKeystrokeTimer() |
@@ -1109,6 +1124,9 @@ LLFloaterIMPanel::LLFloaterIMPanel( | |||
1109 | mSentTypingState(TRUE), | 1124 | mSentTypingState(TRUE), |
1110 | mShowSpeakersOnConnect(TRUE), | 1125 | mShowSpeakersOnConnect(TRUE), |
1111 | mAutoConnect(FALSE), | 1126 | mAutoConnect(FALSE), |
1127 | mTextIMPossible(TRUE), | ||
1128 | mProfileButtonEnabled(TRUE), | ||
1129 | mCallBackEnabled(TRUE), | ||
1112 | mSpeakers(NULL), | 1130 | mSpeakers(NULL), |
1113 | mSpeakerPanel(NULL), | 1131 | mSpeakerPanel(NULL), |
1114 | mFirstKeystrokeTimer(), | 1132 | mFirstKeystrokeTimer(), |
@@ -1154,7 +1172,13 @@ void LLFloaterIMPanel::init(const std::string& session_label) | |||
1154 | break; | 1172 | break; |
1155 | // just received text from another user | 1173 | // just received text from another user |
1156 | case IM_NOTHING_SPECIAL: | 1174 | case IM_NOTHING_SPECIAL: |
1175 | |||
1157 | xml_filename = "floater_instant_message.xml"; | 1176 | xml_filename = "floater_instant_message.xml"; |
1177 | |||
1178 | mTextIMPossible = LLVoiceClient::getInstance()->isSessionTextIMPossible(mSessionUUID); | ||
1179 | mProfileButtonEnabled = LLVoiceClient::getInstance()->isParticipantAvatar(mSessionUUID); | ||
1180 | mCallBackEnabled = LLVoiceClient::getInstance()->isSessionCallBackPossible(mSessionUUID); | ||
1181 | |||
1158 | mVoiceChannel = new LLVoiceChannelP2P(mSessionUUID, mSessionLabel, mOtherParticipantUUID); | 1182 | mVoiceChannel = new LLVoiceChannelP2P(mSessionUUID, mSessionLabel, mOtherParticipantUUID); |
1159 | break; | 1183 | break; |
1160 | default: | 1184 | default: |
@@ -1280,11 +1304,17 @@ BOOL LLFloaterIMPanel::postBuild() | |||
1280 | 1304 | ||
1281 | mHistoryEditor = getChild<LLViewerTextEditor>("im_history"); | 1305 | mHistoryEditor = getChild<LLViewerTextEditor>("im_history"); |
1282 | mHistoryEditor->setParseHTML(TRUE); | 1306 | mHistoryEditor->setParseHTML(TRUE); |
1307 | mHistoryEditor->setParseHighlights(TRUE); | ||
1283 | 1308 | ||
1284 | if ( IM_SESSION_GROUP_START == mDialog ) | 1309 | if ( IM_SESSION_GROUP_START == mDialog ) |
1285 | { | 1310 | { |
1286 | childSetEnabled("profile_btn", FALSE); | 1311 | childSetEnabled("profile_btn", FALSE); |
1287 | } | 1312 | } |
1313 | |||
1314 | if(!mProfileButtonEnabled) | ||
1315 | { | ||
1316 | childSetEnabled("profile_callee_btn", FALSE); | ||
1317 | } | ||
1288 | 1318 | ||
1289 | sTitleString = getString("title_string"); | 1319 | sTitleString = getString("title_string"); |
1290 | sTypingStartString = getString("typing_start_string"); | 1320 | sTypingStartString = getString("typing_start_string"); |
@@ -1353,7 +1383,8 @@ void LLFloaterIMPanel::draw() | |||
1353 | 1383 | ||
1354 | BOOL enable_connect = (region && region->getCapability("ChatSessionRequest") != "") | 1384 | BOOL enable_connect = (region && region->getCapability("ChatSessionRequest") != "") |
1355 | && mSessionInitialized | 1385 | && mSessionInitialized |
1356 | && LLVoiceClient::voiceEnabled(); | 1386 | && LLVoiceClient::voiceEnabled() |
1387 | && mCallBackEnabled; | ||
1357 | 1388 | ||
1358 | // hide/show start call and end call buttons | 1389 | // hide/show start call and end call buttons |
1359 | childSetVisible("end_call_btn", LLVoiceClient::voiceEnabled() && mVoiceChannel->getState() >= LLVoiceChannel::STATE_CALL_STARTED); | 1390 | childSetVisible("end_call_btn", LLVoiceClient::voiceEnabled() && mVoiceChannel->getState() >= LLVoiceChannel::STATE_CALL_STARTED); |
@@ -1362,7 +1393,12 @@ void LLFloaterIMPanel::draw() | |||
1362 | childSetEnabled("send_btn", !childGetValue("chat_editor").asString().empty()); | 1393 | childSetEnabled("send_btn", !childGetValue("chat_editor").asString().empty()); |
1363 | 1394 | ||
1364 | LLPointer<LLSpeaker> self_speaker = mSpeakers->findSpeaker(gAgent.getID()); | 1395 | LLPointer<LLSpeaker> self_speaker = mSpeakers->findSpeaker(gAgent.getID()); |
1365 | if (self_speaker.notNull() && self_speaker->mModeratorMutedText) | 1396 | if(!mTextIMPossible) |
1397 | { | ||
1398 | mInputEditor->setEnabled(FALSE); | ||
1399 | mInputEditor->setLabel(getString("unavailable_text_label")); | ||
1400 | } | ||
1401 | else if (self_speaker.notNull() && self_speaker->mModeratorMutedText) | ||
1366 | { | 1402 | { |
1367 | mInputEditor->setEnabled(FALSE); | 1403 | mInputEditor->setEnabled(FALSE); |
1368 | mInputEditor->setLabel(getString("muted_text_label")); | 1404 | mInputEditor->setLabel(getString("muted_text_label")); |
@@ -1526,8 +1562,8 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, const LLColor4 | |||
1526 | else | 1562 | else |
1527 | { | 1563 | { |
1528 | // Convert the name to a hotlink and add to message. | 1564 | // Convert the name to a hotlink and add to message. |
1529 | const LLStyleSP &source_style = LLStyleMap::instance().lookup(source); | 1565 | const LLStyleSP &source_style = LLStyleMap::instance().lookupAgent(source); |
1530 | mHistoryEditor->appendStyledText(name,false,prepend_newline,&source_style); | 1566 | mHistoryEditor->appendStyledText(name,false,prepend_newline,source_style); |
1531 | } | 1567 | } |
1532 | prepend_newline = false; | 1568 | prepend_newline = false; |
1533 | } | 1569 | } |
@@ -1632,62 +1668,32 @@ BOOL LLFloaterIMPanel::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, | |||
1632 | EAcceptance* accept, | 1668 | EAcceptance* accept, |
1633 | std::string& tooltip_msg) | 1669 | std::string& tooltip_msg) |
1634 | { | 1670 | { |
1635 | BOOL accepted = FALSE; | 1671 | |
1636 | switch(cargo_type) | 1672 | if (mDialog == IM_NOTHING_SPECIAL) |
1637 | { | 1673 | { |
1638 | case DAD_CALLINGCARD: | 1674 | LLToolDragAndDrop::handleGiveDragAndDrop(mOtherParticipantUUID, mSessionUUID, drop, |
1639 | { | 1675 | cargo_type, cargo_data, accept); |
1640 | accepted = dropCallingCard((LLInventoryItem*)cargo_data, drop); | 1676 | } |
1641 | break; | 1677 | |
1642 | } | 1678 | // handle case for dropping calling cards (and folders of calling cards) onto invitation panel for invites |
1643 | case DAD_CATEGORY: | 1679 | else if (isInviteAllowed()) |
1680 | { | ||
1681 | *accept = ACCEPT_NO; | ||
1682 | |||
1683 | if (cargo_type == DAD_CALLINGCARD) | ||
1644 | { | 1684 | { |
1645 | accepted = dropCategory((LLInventoryCategory*)cargo_data, drop); | 1685 | if (dropCallingCard((LLInventoryItem*)cargo_data, drop)) |
1646 | break; | 1686 | { |
1687 | *accept = ACCEPT_YES_MULTI; | ||
1688 | } | ||
1647 | } | 1689 | } |
1648 | 1690 | else if (cargo_type == DAD_CATEGORY) | |
1649 | // See stdenums.h | ||
1650 | case DAD_TEXTURE: | ||
1651 | case DAD_SOUND: | ||
1652 | // DAD_CALLINGCARD above | ||
1653 | case DAD_LANDMARK: | ||
1654 | case DAD_SCRIPT: | ||
1655 | case DAD_CLOTHING: | ||
1656 | case DAD_OBJECT: | ||
1657 | case DAD_NOTECARD: | ||
1658 | // DAD_CATEGORY above | ||
1659 | case DAD_BODYPART: | ||
1660 | case DAD_ANIMATION: | ||
1661 | case DAD_GESTURE: | ||
1662 | { | 1691 | { |
1663 | if (mDialog == IM_NOTHING_SPECIAL) | 1692 | if (dropCategory((LLInventoryCategory*)cargo_data, drop)) |
1664 | { | 1693 | { |
1665 | // See LLDropTarget for similar code. | 1694 | *accept = ACCEPT_YES_MULTI; |
1666 | LLViewerInventoryItem* inv_item = (LLViewerInventoryItem*)cargo_data; | ||
1667 | if(gInventory.getItem(inv_item->getUUID()) | ||
1668 | && LLToolDragAndDrop::isInventoryGiveAcceptable(inv_item)) | ||
1669 | { | ||
1670 | accepted = true; | ||
1671 | if(drop) | ||
1672 | { | ||
1673 | LLToolDragAndDrop::giveInventory(mOtherParticipantUUID, inv_item); | ||
1674 | LLStringUtil::format_map_t args; | ||
1675 | gIMMgr->addSystemMessage(mSessionUUID, "inventory_item_offered", args); | ||
1676 | } | ||
1677 | } | ||
1678 | } | 1695 | } |
1679 | break; | ||
1680 | } | 1696 | } |
1681 | default: | ||
1682 | break; | ||
1683 | } | ||
1684 | if (accepted) | ||
1685 | { | ||
1686 | *accept = ACCEPT_YES_MULTI; | ||
1687 | } | ||
1688 | else | ||
1689 | { | ||
1690 | *accept = ACCEPT_NO; | ||
1691 | } | 1697 | } |
1692 | return TRUE; | 1698 | return TRUE; |
1693 | } | 1699 | } |
@@ -2253,35 +2259,33 @@ void LLFloaterIMPanel::showSessionStartError( | |||
2253 | //their own XML file which would be read in by any LLIMPanel | 2259 | //their own XML file which would be read in by any LLIMPanel |
2254 | //post build function instead of repeating the same info | 2260 | //post build function instead of repeating the same info |
2255 | //in the group, adhoc and normal IM xml files. | 2261 | //in the group, adhoc and normal IM xml files. |
2256 | LLStringUtil::format_map_t args; | 2262 | LLSD args; |
2257 | args["[REASON]"] = | 2263 | args["REASON"] = |
2258 | LLFloaterIM::sErrorStringsMap[error_string]; | 2264 | LLFloaterIM::sErrorStringsMap[error_string]; |
2259 | args["[RECIPIENT]"] = getTitle(); | 2265 | args["RECIPIENT"] = getTitle(); |
2266 | |||
2267 | LLSD payload; | ||
2268 | payload["session_id"] = mSessionUUID; | ||
2260 | 2269 | ||
2261 | gViewerWindow->alertXml( | 2270 | LLNotifications::instance().add( |
2262 | "ChatterBoxSessionStartError", | 2271 | "ChatterBoxSessionStartError", |
2263 | args, | 2272 | args, |
2264 | onConfirmForceCloseError, | 2273 | payload, |
2265 | new LLUUID(mSessionUUID)); | 2274 | onConfirmForceCloseError); |
2266 | } | 2275 | } |
2267 | 2276 | ||
2268 | void LLFloaterIMPanel::showSessionEventError( | 2277 | void LLFloaterIMPanel::showSessionEventError( |
2269 | const std::string& event_string, | 2278 | const std::string& event_string, |
2270 | const std::string& error_string) | 2279 | const std::string& error_string) |
2271 | { | 2280 | { |
2272 | LLStringUtil::format_map_t args; | 2281 | LLSD args; |
2273 | std::string event; | 2282 | args["REASON"] = |
2274 | 2283 | LLFloaterIM::sErrorStringsMap[error_string]; | |
2275 | event = LLFloaterIM::sEventStringsMap[event_string]; | 2284 | args["EVENT"] = |
2276 | args["[RECIPIENT]"] = getTitle(); | 2285 | LLFloaterIM::sEventStringsMap[event_string]; |
2277 | LLStringUtil::format(event, args); | 2286 | args["RECIPIENT"] = getTitle(); |
2278 | |||
2279 | |||
2280 | args = LLStringUtil::format_map_t(); | ||
2281 | args["[REASON]"] = LLFloaterIM::sErrorStringsMap[error_string]; | ||
2282 | args["[EVENT]"] = event; | ||
2283 | 2287 | ||
2284 | gViewerWindow->alertXml( | 2288 | LLNotifications::instance().add( |
2285 | "ChatterBoxSessionEventError", | 2289 | "ChatterBoxSessionEventError", |
2286 | args); | 2290 | args); |
2287 | } | 2291 | } |
@@ -2289,16 +2293,19 @@ void LLFloaterIMPanel::showSessionEventError( | |||
2289 | void LLFloaterIMPanel::showSessionForceClose( | 2293 | void LLFloaterIMPanel::showSessionForceClose( |
2290 | const std::string& reason_string) | 2294 | const std::string& reason_string) |
2291 | { | 2295 | { |
2292 | LLStringUtil::format_map_t args; | 2296 | LLSD args; |
2297 | |||
2298 | args["NAME"] = getTitle(); | ||
2299 | args["REASON"] = LLFloaterIM::sForceCloseSessionMap[reason_string]; | ||
2293 | 2300 | ||
2294 | args["[NAME]"] = getTitle(); | 2301 | LLSD payload; |
2295 | args["[REASON]"] = LLFloaterIM::sForceCloseSessionMap[reason_string]; | 2302 | payload["session_id"] = mSessionUUID; |
2296 | 2303 | ||
2297 | gViewerWindow->alertXml( | 2304 | LLNotifications::instance().add( |
2298 | "ForceCloseChatterBoxSession", | 2305 | "ForceCloseChatterBoxSession", |
2299 | args, | 2306 | args, |
2300 | LLFloaterIMPanel::onConfirmForceCloseError, | 2307 | payload, |
2301 | new LLUUID(mSessionUUID)); | 2308 | LLFloaterIMPanel::onConfirmForceCloseError); |
2302 | 2309 | ||
2303 | } | 2310 | } |
2304 | 2311 | ||
@@ -2308,10 +2315,10 @@ void LLFloaterIMPanel::onKickSpeaker(void* user_data) | |||
2308 | 2315 | ||
2309 | } | 2316 | } |
2310 | 2317 | ||
2311 | void LLFloaterIMPanel::onConfirmForceCloseError(S32 option, void* data) | 2318 | bool LLFloaterIMPanel::onConfirmForceCloseError(const LLSD& notification, const LLSD& response) |
2312 | { | 2319 | { |
2313 | //only 1 option really | 2320 | //only 1 option really |
2314 | LLUUID session_id = *((LLUUID*) data); | 2321 | LLUUID session_id = notification["payload"]["session_id"]; |
2315 | 2322 | ||
2316 | if ( gIMMgr ) | 2323 | if ( gIMMgr ) |
2317 | { | 2324 | { |
@@ -2320,6 +2327,7 @@ void LLFloaterIMPanel::onConfirmForceCloseError(S32 option, void* data) | |||
2320 | 2327 | ||
2321 | if ( floaterp ) floaterp->close(FALSE); | 2328 | if ( floaterp ) floaterp->close(FALSE); |
2322 | } | 2329 | } |
2330 | return false; | ||
2323 | } | 2331 | } |
2324 | 2332 | ||
2325 | 2333 | ||