diff options
author | Jacek Antonelli | 2008-09-12 14:59:33 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-12 14:59:39 -0500 |
commit | 80a8bab2a9dd8e77262b001af973212a6cba4a5a (patch) | |
tree | 170168232fd4e2eec5f15295a9445535969cdb76 /linden/indra/newview/llfloaterfriends.cpp | |
parent | Second Life viewer sources 1.21.1-RC (diff) | |
download | meta-impy-80a8bab2a9dd8e77262b001af973212a6cba4a5a.zip meta-impy-80a8bab2a9dd8e77262b001af973212a6cba4a5a.tar.gz meta-impy-80a8bab2a9dd8e77262b001af973212a6cba4a5a.tar.bz2 meta-impy-80a8bab2a9dd8e77262b001af973212a6cba4a5a.tar.xz |
Second Life viewer sources 1.21.2-RC
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llfloaterfriends.cpp | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/linden/indra/newview/llfloaterfriends.cpp b/linden/indra/newview/llfloaterfriends.cpp index 7f6bf01..8fdaa52 100644 --- a/linden/indra/newview/llfloaterfriends.cpp +++ b/linden/indra/newview/llfloaterfriends.cpp | |||
@@ -41,6 +41,7 @@ | |||
41 | #include "lldir.h" | 41 | #include "lldir.h" |
42 | 42 | ||
43 | #include "llagent.h" | 43 | #include "llagent.h" |
44 | #include "llappviewer.h" // for gLastVersionChannel | ||
44 | #include "llfloateravatarpicker.h" | 45 | #include "llfloateravatarpicker.h" |
45 | #include "llviewerwindow.h" | 46 | #include "llviewerwindow.h" |
46 | #include "llbutton.h" | 47 | #include "llbutton.h" |
@@ -591,7 +592,7 @@ struct LLAddFriendData | |||
591 | }; | 592 | }; |
592 | 593 | ||
593 | // static | 594 | // static |
594 | void LLPanelFriends::callbackAddFriend(S32 option, const std::string& text, void* data) | 595 | void LLPanelFriends::callbackAddFriendWithMessage(S32 option, const std::string& text, void* data) |
595 | { | 596 | { |
596 | LLAddFriendData* add = (LLAddFriendData*)data; | 597 | LLAddFriendData* add = (LLAddFriendData*)data; |
597 | if (option == 0) | 598 | if (option == 0) |
@@ -602,6 +603,22 @@ void LLPanelFriends::callbackAddFriend(S32 option, const std::string& text, void | |||
602 | } | 603 | } |
603 | 604 | ||
604 | // static | 605 | // static |
606 | void LLPanelFriends::callbackAddFriend(S32 option, void* data) | ||
607 | { | ||
608 | LLAddFriendData* add = (LLAddFriendData*)data; | ||
609 | if (option == 0) | ||
610 | { | ||
611 | // Servers older than 1.25 require the text of the message to be the | ||
612 | // calling card folder ID for the offering user. JC | ||
613 | LLUUID calling_card_folder_id = | ||
614 | gInventory.findCategoryUUIDForType(LLAssetType::AT_CALLINGCARD); | ||
615 | std::string message = calling_card_folder_id.asString(); | ||
616 | requestFriendship(add->mID, add->mName, message); | ||
617 | } | ||
618 | delete add; | ||
619 | } | ||
620 | |||
621 | // static | ||
605 | void LLPanelFriends::onPickAvatar(const std::vector<std::string>& names, | 622 | void LLPanelFriends::onPickAvatar(const std::vector<std::string>& names, |
606 | const std::vector<LLUUID>& ids, | 623 | const std::vector<LLUUID>& ids, |
607 | void* ) | 624 | void* ) |
@@ -625,10 +642,20 @@ void LLPanelFriends::requestFriendshipDialog(const LLUUID& id, | |||
625 | data->mID = id; | 642 | data->mID = id; |
626 | data->mName = name; | 643 | data->mName = name; |
627 | 644 | ||
628 | // TODO: accept a line of text with this dialog | ||
629 | LLStringUtil::format_map_t args; | 645 | LLStringUtil::format_map_t args; |
630 | args["[NAME]"] = name; | 646 | args["[NAME]"] = name; |
631 | gViewerWindow->alertXmlEditText("AddFriend", args, NULL, NULL, callbackAddFriend, data); | 647 | |
648 | // Look for server versions like: Second Life Server 1.24.4.95600 | ||
649 | if (gLastVersionChannel.find(" 1.24.") != std::string::npos) | ||
650 | { | ||
651 | // Old and busted server version, doesn't support friend | ||
652 | // requests with messages. | ||
653 | gViewerWindow->alertXml("AddFriend", args, callbackAddFriend, data); | ||
654 | } | ||
655 | else | ||
656 | { | ||
657 | gViewerWindow->alertXmlEditText("AddFriendWithMessage", args, NULL, NULL, callbackAddFriendWithMessage, data); | ||
658 | } | ||
632 | } | 659 | } |
633 | 660 | ||
634 | // static | 661 | // static |