[opensource-dev] Review Request: STORM-829 Viewer 2 does not parse /me in object Instant Messages

Twisted Laws twisted_laws at hotmail.com
Thu Jan 6 14:24:54 PST 2011


that would be bad to check for "/me", what about "/meow" ?

 


From: Aleric.Inglewood at gmail.com
To: opensource-dev at lists.secondlife.com; Aleric.Inglewood at gmail.com; jhwelch at gmail.com
Date: Thu, 6 Jan 2011 22:03:14 +0000
Subject: Re: [opensource-dev] Review Request: STORM-829 Viewer 2 does not parse /me in object Instant Messages






This is an automatically generated e-mail. To reply, visit: http://codereview.secondlife.com/r/71/ 


On January 6th, 2011, 7 a.m., Aleric Inglewood wrote:
What about /Me, /ME or /me followed by another punctuation? Ie, "/me?", "/me!", etc...
Just asking because these comparisions with just "/me " and "/me'" seem very limited,
almost weird. More logical would be to not check anything at ALL - and either expand
things, or not. What happens if you just set a flag saying "whatever is in this
string, don't expand /me, /who, /whois, /kick etc" without at that point checking
for one specific case (missing possibly many other variations).

On January 6th, 2011, 7:45 a.m., Jonathan Yap wrote:
If it was me writing the original code I would not have made it case-sensitive, but as this is a bug fix and not a new feature I am following the current design of having just /me work.  I didn't suggest to make it case insensitive, I wondered what happens
when you use /ME instead of /me with and without the patch.
And I wonder why it is necessary at all to compare a string with "/me ".
At the very least that indicates code duplication.

Let me clarify,

void do_it(std::string const& str)
{
  if (!flag && str == "/me")
    ...
  else
    ...
}

Bad code:

if (str == "/me")
  flag = 1;
do_it(str);

-------------------------------------------

Code that makes more sense:

flag = 1;
do_it(str);


But keep in mind that I didn't look at the actual code ;). I just looked at your patch.


- Aleric

On January 5th, 2011, 6:14 p.m., Jonathan Yap wrote:




Review request for Viewer.
By Jonathan Yap.
Updated Jan. 5, 2011, 6:14 p.m.
Description 



The "/me" in the lsl code below would be displayed rather than being translated to a name:
llInstantMessage(llGetOwner(),"/me Hello, Avatar!");
Bugs: STORM-829 
Diffs 

indra/newview/llviewermessage.cpp (845cab866155)
View Diff
_______________________________________________ Policies and (un)subscribe information available here: http://wiki.secondlife.com/wiki/OpenSource-Dev Please read the policies before posting to keep unmoderated posting privileges 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.secondlife.com/pipermail/opensource-dev/attachments/20110106/6b016a1e/attachment.htm 


More information about the opensource-dev mailing list