diff options
Diffstat (limited to 'linden/indra/newview/llimview.cpp')
-rw-r--r-- | linden/indra/newview/llimview.cpp | 67 |
1 files changed, 61 insertions, 6 deletions
diff --git a/linden/indra/newview/llimview.cpp b/linden/indra/newview/llimview.cpp index 38471ad..02578d2 100644 --- a/linden/indra/newview/llimview.cpp +++ b/linden/indra/newview/llimview.cpp | |||
@@ -374,11 +374,21 @@ void LLIMView::addMessage( | |||
374 | } | 374 | } |
375 | else | 375 | else |
376 | { | 376 | { |
377 | //if we have recently requsted to be dropped from a session | ||
378 | //but are still receiving messages from the session, don't make | ||
379 | //a new floater | ||
380 | // if ( mSessionsDropRequested.has(session_id.asString()) ) | ||
381 | // { | ||
382 | // return ; | ||
383 | // } | ||
384 | |||
377 | const char* name = from; | 385 | const char* name = from; |
378 | if(session_name && (strlen(session_name)>1)) | 386 | if(session_name && (strlen(session_name)>1)) |
379 | { | 387 | { |
380 | name = session_name; | 388 | name = session_name; |
381 | } | 389 | } |
390 | |||
391 | |||
382 | floater = createFloater(new_session_id, other_participant_id, name, dialog, FALSE); | 392 | floater = createFloater(new_session_id, other_participant_id, name, dialog, FALSE); |
383 | 393 | ||
384 | // When we get a new IM, and if you are a god, display a bit | 394 | // When we get a new IM, and if you are a god, display a bit |
@@ -502,13 +512,17 @@ LLUUID LLIMView::addSession(const std::string& name, | |||
502 | LLFloaterIMPanel* floater = findFloaterBySession(session_id); | 512 | LLFloaterIMPanel* floater = findFloaterBySession(session_id); |
503 | if(!floater) | 513 | if(!floater) |
504 | { | 514 | { |
505 | // On creation, use the first element of ids as the "other_participant_id" | 515 | // On creation, use the first element of ids as the |
516 | // "other_participant_id" | ||
506 | floater = createFloater(session_id, | 517 | floater = createFloater(session_id, |
507 | other_participant_id, | 518 | other_participant_id, |
508 | name, | 519 | name, |
509 | ids, | 520 | ids, |
510 | dialog, | 521 | dialog, |
511 | TRUE); | 522 | TRUE); |
523 | |||
524 | if ( !floater ) return LLUUID::null; | ||
525 | |||
512 | noteOfflineUsers(floater, ids); | 526 | noteOfflineUsers(floater, ids); |
513 | } | 527 | } |
514 | mTalkFloater->showFloater(floater); | 528 | mTalkFloater->showFloater(floater); |
@@ -528,6 +542,11 @@ void LLIMView::removeSession(const LLUUID& session_id) | |||
528 | mTalkFloater->removeFloater(floater); | 542 | mTalkFloater->removeFloater(floater); |
529 | //mTabContainer->removeTabPanel(floater); | 543 | //mTabContainer->removeTabPanel(floater); |
530 | } | 544 | } |
545 | |||
546 | // if ( session_id.notNull() ) | ||
547 | // { | ||
548 | // mSessionsDropRequested[session_id.asString()] = LLSD(); | ||
549 | // } | ||
531 | } | 550 | } |
532 | 551 | ||
533 | void LLIMView::refresh() | 552 | void LLIMView::refresh() |
@@ -705,6 +724,7 @@ LLFloaterIMPanel* LLIMView::createFloater( | |||
705 | { | 724 | { |
706 | llwarns << "Creating LLFloaterIMPanel with null session ID" << llendl; | 725 | llwarns << "Creating LLFloaterIMPanel with null session ID" << llendl; |
707 | } | 726 | } |
727 | |||
708 | llinfos << "LLIMView::createFloater: from " << other_participant_id | 728 | llinfos << "LLIMView::createFloater: from " << other_participant_id |
709 | << " in session " << session_id << llendl; | 729 | << " in session " << session_id << llendl; |
710 | LLFloaterIMPanel* floater = new LLFloaterIMPanel(session_label, | 730 | LLFloaterIMPanel* floater = new LLFloaterIMPanel(session_label, |
@@ -731,6 +751,7 @@ LLFloaterIMPanel* LLIMView::createFloater( | |||
731 | { | 751 | { |
732 | llwarns << "Creating LLFloaterIMPanel with null session ID" << llendl; | 752 | llwarns << "Creating LLFloaterIMPanel with null session ID" << llendl; |
733 | } | 753 | } |
754 | |||
734 | llinfos << "LLIMView::createFloater: from " << other_participant_id | 755 | llinfos << "LLIMView::createFloater: from " << other_participant_id |
735 | << " in session " << session_id << llendl; | 756 | << " in session " << session_id << llendl; |
736 | LLFloaterIMPanel* floater = new LLFloaterIMPanel(session_label, | 757 | LLFloaterIMPanel* floater = new LLFloaterIMPanel(session_label, |
@@ -805,6 +826,11 @@ void LLIMView::updateFloaterSessionID(const LLUUID& old_session_id, | |||
805 | } | 826 | } |
806 | } | 827 | } |
807 | 828 | ||
829 | void LLIMView::onDropRequestReplyReceived(const LLUUID& session_id) | ||
830 | { | ||
831 | mSessionsDropRequested.erase(session_id.asString()); | ||
832 | } | ||
833 | |||
808 | void onConfirmForceCloseError(S32 option, void* data) | 834 | void onConfirmForceCloseError(S32 option, void* data) |
809 | { | 835 | { |
810 | //only 1 option really | 836 | //only 1 option really |
@@ -869,7 +895,7 @@ public: | |||
869 | 895 | ||
870 | class LLViewerIMSessionEventReply : public LLHTTPNode | 896 | class LLViewerIMSessionEventReply : public LLHTTPNode |
871 | { | 897 | { |
872 | public: | 898 | public: |
873 | virtual void describe(Description& desc) const | 899 | virtual void describe(Description& desc) const |
874 | { | 900 | { |
875 | desc.shortInfo("Used for receiving a reply to a IM session event"); | 901 | desc.shortInfo("Used for receiving a reply to a IM session event"); |
@@ -913,7 +939,7 @@ class LLViewerIMSessionEventReply : public LLHTTPNode | |||
913 | 939 | ||
914 | class LLViewerForceCloseIMSession: public LLHTTPNode | 940 | class LLViewerForceCloseIMSession: public LLHTTPNode |
915 | { | 941 | { |
916 | 942 | public: | |
917 | virtual void post(ResponsePtr response, | 943 | virtual void post(ResponsePtr response, |
918 | const LLSD& context, | 944 | const LLSD& context, |
919 | const LLSD& input) const | 945 | const LLSD& input) const |
@@ -942,11 +968,40 @@ class LLViewerForceCloseIMSession: public LLHTTPNode | |||
942 | } | 968 | } |
943 | }; | 969 | }; |
944 | 970 | ||
971 | class LLViewerIMSessionDropReply : public LLHTTPNode | ||
972 | { | ||
973 | public: | ||
974 | virtual void post(ResponsePtr response, | ||
975 | const LLSD& context, | ||
976 | const LLSD& input) const | ||
977 | { | ||
978 | LLUUID session_id; | ||
979 | bool success; | ||
980 | |||
981 | success = input["body"]["success"].asBoolean(); | ||
982 | session_id = input["body"]["session_id"].asUUID(); | ||
983 | |||
984 | if ( !success ) | ||
985 | { | ||
986 | //throw an error alert? | ||
987 | } | ||
988 | |||
989 | gIMView->onDropRequestReplyReceived(session_id); | ||
990 | } | ||
991 | }; | ||
992 | |||
945 | LLHTTPRegistration<LLViewerIMSessionStartReply> | 993 | LLHTTPRegistration<LLViewerIMSessionStartReply> |
946 | gHTTPRegistrationMessageImsessionstartreply("/message/IMSessionStartReply"); | 994 | gHTTPRegistrationMessageImsessionstartreply( |
995 | "/message/IMSessionStartReply"); | ||
947 | 996 | ||
948 | LLHTTPRegistration<LLViewerIMSessionEventReply> | 997 | LLHTTPRegistration<LLViewerIMSessionEventReply> |
949 | gHTTPRegistrationMessageImsessioneventreply("/message/IMSessionEventReply"); | 998 | gHTTPRegistrationMessageImsessioneventreply( |
999 | "/message/IMSessionEventReply"); | ||
950 | 1000 | ||
951 | LLHTTPRegistration<LLViewerForceCloseIMSession> | 1001 | LLHTTPRegistration<LLViewerForceCloseIMSession> |
952 | gHTTPRegistrationMessageForceCloseImSession("/message/ForceCloseIMSession"); | 1002 | gHTTPRegistrationMessageForceCloseImSession( |
1003 | "/message/ForceCloseIMSession"); | ||
1004 | |||
1005 | LLHTTPRegistration<LLViewerIMSessionDropReply> | ||
1006 | gHTTPRegistrationMessageImSessionDropReply( | ||
1007 | "/message/IMSessionDropReply"); | ||