@@ -274,7 +274,7 @@ void FSFloaterContacts::onOpen(const LLSD& key)
274274 // first set the tear-off host to the conversations container
275275 setHost (floater_container);
276276 // clear the tear-off host right after, the "last host used" will still stick
277- setHost (NULL );
277+ setHost (nullptr );
278278 // reparent to floater view
279279 gFloaterView ->addChild (this );
280280 }
@@ -389,7 +389,7 @@ void FSFloaterContacts::onDeleteFriendButtonClicked()
389389 }
390390}
391391
392- bool FSFloaterContacts::isItemsFreeOfFriends (const uuid_vec_t & uuids)
392+ bool FSFloaterContacts::isItemsFreeOfFriends (const uuid_vec_t & uuids) const
393393{
394394 const LLAvatarTracker& av_tracker = LLAvatarTracker::instance ();
395395 for (const auto & id : uuids)
@@ -723,11 +723,7 @@ void FSFloaterContacts::addFriend(const LLUUID& agent_id)
723723 update_gen_column[" column" ] = " friend_last_update_generation" ;
724724 update_gen_column[" value" ] = relationInfo->getChangeSerialNum ();
725725
726- mFriendsList ->addElement (element, ADD_BOTTOM);
727- if (LLScrollListItem* added_item = mFriendsList ->getItem (agent_id); added_item)
728- {
729- updateFriendItemColor (added_item, agent_id);
730- }
726+ updateFriendItemColor (mFriendsList ->addElement (element, ADD_BOTTOM), agent_id);
731727}
732728
733729void FSFloaterContacts::onMapButtonClicked ()
@@ -936,56 +932,52 @@ void FSFloaterContacts::onSelectName()
936932 applyRightsToFriends ();
937933}
938934
939- void FSFloaterContacts::confirmModifyRights (rights_map_t & ids, EGrantRevoke command)
935+ void FSFloaterContacts::confirmModifyRights (const rights_map_t & ids, EGrantRevoke command)
940936{
941937 if (ids.empty ())
942938 {
943939 return ;
944940 }
945941
946942 LLSD args;
947- if (ids.size () > 0 )
948- {
949- rights_map_t * rights = new rights_map_t (ids);
943+ rights_map_t * rights = new rights_map_t (ids);
950944
951- // for single friend, show their name
952- if (ids.size () == 1 )
945+ // for single friend, show their name
946+ if (ids.size () == 1 )
947+ {
948+ args[" NAME" ] = LLSLURL (" agent" , ids.begin ()->first , " completename" ).getSLURLString ();
949+ if (command == GRANT)
953950 {
954- args[" NAME" ] = LLSLURL (" agent" , ids.begin ()->first , " completename" ).getSLURLString ();
955- if (command == GRANT)
956- {
957- LLNotificationsUtil::add (" GrantModifyRights" ,
958- args,
959- LLSD (),
960- boost::bind (&FSFloaterContacts::modifyRightsConfirmation, this , _1, _2, rights));
961- }
962- else
963- {
964- LLNotificationsUtil::add (" RevokeModifyRights" ,
965- args,
966- LLSD (),
967- boost::bind (&FSFloaterContacts::modifyRightsConfirmation, this , _1, _2, rights));
968- }
951+ LLNotificationsUtil::add (" GrantModifyRights" ,
952+ args,
953+ LLSD (),
954+ boost::bind (&FSFloaterContacts::modifyRightsConfirmation, this , _1, _2, rights));
969955 }
970956 else
971957 {
972- if (command == GRANT)
973- {
974- LLNotificationsUtil::add (" GrantModifyRightsMultiple" ,
975- args,
976- LLSD (),
977- boost::bind (&FSFloaterContacts::modifyRightsConfirmation, this , _1, _2, rights));
978- }
979- else
980- {
981- LLNotificationsUtil::add (" RevokeModifyRightsMultiple" ,
982- args,
983- LLSD (),
984- boost::bind (&FSFloaterContacts::modifyRightsConfirmation, this , _1, _2, rights));
985- }
958+ LLNotificationsUtil::add (" RevokeModifyRights" ,
959+ args,
960+ LLSD (),
961+ boost::bind (&FSFloaterContacts::modifyRightsConfirmation, this , _1, _2, rights));
962+ }
963+ }
964+ else
965+ {
966+ if (command == GRANT)
967+ {
968+ LLNotificationsUtil::add (" GrantModifyRightsMultiple" ,
969+ args,
970+ LLSD (),
971+ boost::bind (&FSFloaterContacts::modifyRightsConfirmation, this , _1, _2, rights));
972+ }
973+ else
974+ {
975+ LLNotificationsUtil::add (" RevokeModifyRightsMultiple" ,
976+ args,
977+ LLSD (),
978+ boost::bind (&FSFloaterContacts::modifyRightsConfirmation, this , _1, _2, rights));
986979 }
987980 }
988-
989981}
990982
991983bool FSFloaterContacts::modifyRightsConfirmation (const LLSD& notification, const LLSD& response, rights_map_t * rights)
@@ -1113,7 +1105,7 @@ void FSFloaterContacts::applyRightsToFriends()
11131105 }
11141106}
11151107
1116- void FSFloaterContacts::sendRightsGrant (rights_map_t & ids)
1108+ void FSFloaterContacts::sendRightsGrant (const rights_map_t & ids)
11171109{
11181110 if (ids.empty ())
11191111 {
@@ -1312,7 +1304,7 @@ void FSFloaterContacts::onDisplayNameChanged()
13121304 mFriendsList ->setNeedsSort ();
13131305}
13141306
1315- std::string FSFloaterContacts::getFullName (const LLAvatarName& av_name)
1307+ std::string FSFloaterContacts::getFullName (const LLAvatarName& av_name) const
13161308{
13171309 if (av_name.isDisplayNameDefault () || !gSavedSettings .getBOOL (" UseDisplayNames" ))
13181310 {
0 commit comments