[sldev] Slightly more involved patch - Added Invite to Group to avatar pie menu

Matthew Dowd matthew.dowd at hotmail.co.uk
Sat Jul 14 15:15:47 PDT 2007


Ok, this is actually a real can of worms, I think I will put the top back on!

Currently, the value of id passed to show(id, type) is only used as an identifier within a map so that a previous instance can be retrieved and reused, although as id is always equal to gAgent.getID() in all the calls that are actually made to this function, this seems pretty redundant!

initAgentGroups however pulls the groups list from gAgent (i.e. your group lists) and ignores the value of mID (the property in which the value passed in on show is stored). I suspect that whoever wrote the code originally intended to pull the groups belong to mID down but then hit the same problem I realised when looking at this.

pulling groups from gAgent is easy since they've already been cached.

pulling groups for anyone else requires sending a request avatar groups  message to the server, the problem is that the current messaging implementation passes the avater group response to the avatar profile window, so there's a major plumbing rewrite in order to get this to display an other avatar's groups.

As far as I can tell, show is only ever called with the value gAgent.getID() - including the case when the comment suggests you should call it with an Object's ID (incidently the value for type is wrong as well in the comment: SET_OBJECT_GROUP doesn't exist, and it should read CHOOSE_ONE).

Actually there is one exception - it appears that the code which handles the View | Groups... menu i.e. this bit from from menu_viewer.xml


     


was also meant to handle 

      

(xxxx-xxxx-xxxx-xxxx being an avatar's UUID), but as far as I can tell this code path is never called.

I'll change my code to call LLFloaterGroups::show with a value of gAgent.getID(), but I'll just jira the other concerns.

Matthew






________________________________
> Date: Sat, 14 Jul 2007 16:35:40 -0400
> From: able.whitman at gmail.com
> To: matthew.dowd at hotmail.co.uk; SLDev at lists.secondlife.com
> Subject: Re: [sldev] Slightly more involved patch - Added Invite to Group to avatar pie menu
> 
> If you patch initAgentGroups() to use the ID you pass in to the show() method, does it actually work as the comments for show() describe? That is, does it correctly show the group list for another resident?
> If it does, then I'd say the right thing to do is to patch initAgentGroups() so that it respects the ID provided to the show() method.
> On 7/14/07, Matthew Dowd < matthew.dowd at hotmail.co.uk> wrote:
> Mmmm, I've just realised that there may be a mistake in my code which throws up a mistake in the LLFloaterGroups code.
> Basically the description for show says
> // Call this with an agent id and AGENT_GROUPS for an agent's
> // groups, otherwise, call with an object id and SET_OBJECT_GROUP
> // when modifying an object.
> // static
> LLFloaterGroups* LLFloaterGroups::show(const LLUUID& id, EGroupDialog type, U64 powers_mask)
> Now in my code where I've realise I'm calling it with id set to the id at the agent you've just selected - now from the above description you'd expect it to display the groups of the agent with UUID id, however it actually gives your own groups due to code later down.
> void LLFloaterGroups::initAgentGroups(const LLUUID& highlight_id)
> {
>         S32 count = gAgent.mGroups.count();
> So although technically, I'm passing the wrong parameter, it didn't show up in my testing as LLFloaterGroups will only display your own groups never anyone elses.
> Looking through the rest of the codebase LLFloaterGroups::show is only ever called with gAgent.getId() so the problem has never occured.
> What's the best way forward - raise a jira issue with a patch? Assuming that is that my understanding of LLFloaterGroups::show is correct?
> Matthew
> ----------------------------------------
> > From: matthew.dowd at hotmail.co.uk 
> > To: sldev at lists.secondlife.com
> > Subject: RE: [sldev] Slightly more involved patch - Added Invite to Group to  avatar pie menu
> > Date: Sat, 14 Jul 2007 18:03:52 +0000
> >
> >
> > P.S. this was much more involved than the other patches I've submitted which was good in that it helped my knowledge of the source code. On the other hand, in reusing various dialogs, I may have introduced new issues, so peer review would be welcome!!
> >
> > Matthew
> >
> >
> >
> >
> > ----------------------------------------
> > > From: matthew.dowd at hotmail.co.uk
> > > To: sldev at lists.secondlife.com
> > > Date: Sat, 14 Jul 2007 18:01:45 +0000
> > > Subject: [sldev] Slightly more involved patch - Added Invite to Group to avatar pie menu
> > >
> > >
> > > OK, I've posted a somewhat more involved patch than the one earlier today at http://jira.secondlife.com/browse/VWR-1736
> > >
> > > This adds a new option to the avatar pie menu of invite to group.
> > >
> > > Also added a few new internal features which may be useful elsehwhere:
> > >
> > > LLFloaterGroups::show - now take a third optional parameter allowing you to list only groups with specified permissions
> > >
> > > LLFloaterGroupInvite::showForGroup - now takes a vector of avatar_ids which get automatically added to the invitee list.
> > >
> > > There's also a quirk in that llFloaterGroupInvite/LLPanelGroupInvite assume that the Group Information dialog has already cached the group information. This has the effect in the current browser that if you are quick enough (or if the group is large and/or SL is running slowly), if you press the Invite button in the Members and Group tab in Group Information, the roles dropdown list can remain blank (until you close and reopen the invite dialog).
> > >
> > > This is because an attempt to populate the dropdown list is only made when the dialog is first opened. The patch modifies LLPanelGroupInvite so that it keeps retrying to see if the data has been cached until it can populate the drop down list. (I've jira'd this seperately at http://jira.secondlife.com/browse/VWR-1737 but won't try to seperate this out as a seperate patch file unless requested - it isn't difficult to do from the hints I've given in jira anyway).
> > >
> > > Matthew
> > >
> > >
> > > _________________________________________________________________
> > > Feel like a local wherever you go with BackOfMyHand.com
> > > http://www.backofmyhand.com_______________________________________________
> > > Click here to unsubscribe or manage your list subscription:
> > > /index.html
> >
> > _________________________________________________________________
> > Celeb spotting – Play CelebMashup and win cool prizes
> > https://www.celebmashup.com/index2.html_______________________________________________
> > Click here to unsubscribe or manage your list subscription:
> > /index.html
> _________________________________________________________________
> Feel like a local wherever you go with BackOfMyHand.com
> http://www.backofmyhand.com_______________________________________________
> Click here to unsubscribe or manage your list subscription:
> /index.html

_________________________________________________________________
Try Live.com - your fast, personalised homepage with all the things you care about in one place.
http://www.live.com/?mkt=en-gb  


More information about the SLDev mailing list