aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterfriends.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llfloaterfriends.cpp')
-rw-r--r--linden/indra/newview/llfloaterfriends.cpp47
1 files changed, 29 insertions, 18 deletions
diff --git a/linden/indra/newview/llfloaterfriends.cpp b/linden/indra/newview/llfloaterfriends.cpp
index 8a36620..8d39890 100644
--- a/linden/indra/newview/llfloaterfriends.cpp
+++ b/linden/indra/newview/llfloaterfriends.cpp
@@ -6,6 +6,7 @@
6 * 6 *
7 * Copyright (c) 2005-2007, Linden Research, Inc. 7 * Copyright (c) 2005-2007, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code
9 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
10 * to you under the terms of the GNU General Public License, version 2.0 11 * to you under the terms of the GNU General Public License, version 2.0
11 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
@@ -520,14 +521,11 @@ void LLFloaterFriends::onClickIM(void* user_data)
520 } 521 }
521 else 522 else
522 { 523 {
523 LLUUID session_id;
524 session_id.generate();
525 gIMView->setFloaterOpen(TRUE); 524 gIMView->setFloaterOpen(TRUE);
526 gIMView->addSession( 525 gIMView->addSession("Friends Conference",
527 "Friends Conference", 526 IM_SESSION_CONFERENCE_START,
528 IM_SESSION_ADD, 527 ids[0],
529 session_id, 528 ids);
530 ids);
531 } 529 }
532 } 530 }
533} 531}
@@ -545,38 +543,51 @@ void LLFloaterFriends::requestFriendship(const LLUUID& target_id, const LLString
545 IM_FRIENDSHIP_OFFERED); 543 IM_FRIENDSHIP_OFFERED);
546} 544}
547 545
546struct LLAddFriendData
547{
548 LLUUID mID;
549 std::string mName;
550};
551
548// static 552// static
549void LLFloaterFriends::callbackAddFriend(S32 option, void* user_data) 553void LLFloaterFriends::callbackAddFriend(S32 option, void* data)
550{ 554{
555 LLAddFriendData* add = (LLAddFriendData*)data;
551 if (option == 0) 556 if (option == 0)
552 { 557 {
553 LLFloaterFriends* self = (LLFloaterFriends*)user_data; 558 requestFriendship(add->mID, add->mName);
554 requestFriendship(self->mAddFriendID, self->mAddFriendName);
555 } 559 }
560 delete add;
556} 561}
557 562
558// static 563// static
559void LLFloaterFriends::onPickAvatar(const std::vector<std::string>& names, 564void LLFloaterFriends::onPickAvatar(const std::vector<std::string>& names,
560 const std::vector<LLUUID>& ids, 565 const std::vector<LLUUID>& ids,
561 void* user_data) 566 void* )
562{ 567{
563 if (names.empty()) return; 568 if (names.empty()) return;
564 if (ids.empty()) return; 569 if (ids.empty()) return;
570 requestFriendshipDialog(ids[0], names[0]);
571}
565 572
566 LLFloaterFriends* self = (LLFloaterFriends*)user_data; 573// static
567 self->mAddFriendID = ids[0]; 574void LLFloaterFriends::requestFriendshipDialog(const LLUUID& id,
568 self->mAddFriendName = names[0]; 575 const std::string& name)
569 576{
570 if(ids[0] == gAgentID) 577 if(id == gAgentID)
571 { 578 {
572 LLNotifyBox::showXml("AddSelfFriend"); 579 LLNotifyBox::showXml("AddSelfFriend");
573 return; 580 return;
574 } 581 }
575 582
583 LLAddFriendData* data = new LLAddFriendData();
584 data->mID = id;
585 data->mName = name;
586
576 // TODO: accept a line of text with this dialog 587 // TODO: accept a line of text with this dialog
577 LLString::format_map_t args; 588 LLString::format_map_t args;
578 args["[NAME]"] = names[0]; 589 args["[NAME]"] = name;
579 gViewerWindow->alertXml("AddFriend", args, callbackAddFriend, user_data); 590 gViewerWindow->alertXml("AddFriend", args, callbackAddFriend, data);
580} 591}
581 592
582// static 593// static