Author: chabotc
Date: Thu Oct  9 00:20:05 2008
New Revision: 703082

URL: http://svn.apache.org/viewvc?rev=703082&view=rev
Log:
removed temp work around for my 0.7/0.8 features confusion

Modified:
    incubator/shindig/trunk/php/src/social/spi/UserId.php

Modified: incubator/shindig/trunk/php/src/social/spi/UserId.php
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social/spi/UserId.php?rev=703082&r1=703081&r2=703082&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social/spi/UserId.php (original)
+++ incubator/shindig/trunk/php/src/social/spi/UserId.php Thu Oct  9 00:20:05 
2008
@@ -18,7 +18,7 @@
  */
 
 class UserId {
-       public static $types = array('viewer', 'owner', 'userId');
+       public static $types = array('me', 'viewer', 'owner', 'userId');
        private $type;
        private $userId;
 
@@ -30,14 +30,8 @@
 
        static public function fromJson($jsonId)
        {
-               if (is_array($jsonId)) {
-                       //FIXME need to verify why this data structure is so 
different between 0.7 and 0.8 opensocial gadgets
-                       // (this if is the 0.8 version, the else is for 0.7)
-                       return new 
UserId(strtolower($jsonId['fields_']['userId']), 
strtolower($jsonId['fields_']['groupId']));
-               } else {
-                       if (in_array(substr($jsonId, 1), UserId::$types)) {
-                               return new UserId(substr($jsonId, 1), null);
-                       }
+               if (in_array(substr($jsonId, 1), UserId::$types)) {
+                       return new UserId(substr($jsonId, 1), null);
                }
                return new UserId('userId', $jsonId);
        }
@@ -46,6 +40,7 @@
        {
                switch ($this->type) {
                        case 'viewer':
+                       case 'me':
                                return $token->getViewerId();
                                break;
                        case 'owner':


Reply via email to