If @me is the current viewer, why do we need both UserId.Type "viewer" and "me" constants? Will any service implementation ever treat these differently?
-- Adam Winer On Tue, Aug 5, 2008 at 5:59 PM, <[EMAIL PROTECTED]> wrote: > Author: doll > Date: Tue Aug 5 17:59:45 2008 > New Revision: 683070 > > URL: http://svn.apache.org/viewvc?rev=683070&view=rev > Log: > @me is now a supported userId type. it translates into the current viewer. > > > Modified: > > incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/spi/UserId.java > > incubator/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/opensocial/spi/UserIdTest.java > > Modified: > incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/spi/UserId.java > URL: > http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/spi/UserId.java?rev=683070&r1=683069&r2=683070&view=diff > ============================================================================== > --- > incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/spi/UserId.java > (original) > +++ > incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/spi/UserId.java > Tue Aug 5 17:59:45 2008 > @@ -23,7 +23,7 @@ > > public class UserId { > public enum Type { > - viewer, owner, userId > + me, viewer, owner, userId > } > > private Type type; > @@ -47,6 +47,7 @@ > case owner: > return token.getOwnerId(); > case viewer: > + case me: > return token.getViewerId(); > case userId: > return userId; > > Modified: > incubator/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/opensocial/spi/UserIdTest.java > URL: > http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/opensocial/spi/UserIdTest.java?rev=683070&r1=683069&r2=683070&view=diff > ============================================================================== > --- > incubator/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/opensocial/spi/UserIdTest.java > (original) > +++ > incubator/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/opensocial/spi/UserIdTest.java > Tue Aug 5 17:59:45 2008 > @@ -18,7 +18,6 @@ > package org.apache.shindig.social.opensocial.spi; > > import org.apache.shindig.common.testing.FakeGadgetToken; > -import org.apache.shindig.social.opensocial.spi.UserId; > > import junit.framework.TestCase; > > @@ -31,6 +30,9 @@ > UserId viewer = new UserId(UserId.Type.viewer, "hello"); > assertEquals("viewer", viewer.getUserId(new > FakeGadgetToken().setViewerId("viewer"))); > > + UserId me = new UserId(UserId.Type.me, "hello"); > + assertEquals("viewer", me.getUserId(new > FakeGadgetToken().setViewerId("viewer"))); > + > UserId user = new UserId(UserId.Type.userId, "hello"); > assertEquals("hello", user.getUserId(new FakeGadgetToken())); > } > @@ -42,6 +44,9 @@ > UserId viewer = UserId.fromJson("@viewer"); > assertEquals(UserId.Type.viewer, viewer.getType()); > > + UserId me = UserId.fromJson("@me"); > + assertEquals(UserId.Type.me, me.getType()); > + > UserId user = UserId.fromJson("john.doe"); > assertEquals(UserId.Type.userId, user.getType()); > assertEquals("john.doe", user.getUserId()); > > >

