couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject [2/2] couchdb-global-changes git commit: Fix _db_changes respone format
Date Thu, 07 May 2015 16:41:33 GMT
Fix _db_changes respone format

We are not suppose to return `account` field
`dnname` field is renamed to `db_name`

COUCHDB-2667


Project: http://git-wip-us.apache.org/repos/asf/couchdb-global-changes/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-global-changes/commit/2c267617
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-global-changes/tree/2c267617
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-global-changes/diff/2c267617

Branch: refs/heads/master
Commit: 2c267617d81f49a2ff549462075acf9a9b766b99
Parents: ab7c365
Author: ILYA Khlopotov <iilyak@ca.ibm.com>
Authored: Mon Apr 27 07:41:50 2015 -0700
Committer: ILYA Khlopotov <iilyak@ca.ibm.com>
Committed: Mon Apr 27 07:41:50 2015 -0700

----------------------------------------------------------------------
 src/global_changes_httpd.erl | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-global-changes/blob/2c267617/src/global_changes_httpd.erl
----------------------------------------------------------------------
diff --git a/src/global_changes_httpd.erl b/src/global_changes_httpd.erl
index b1dce7f..dc7c08a 100644
--- a/src/global_changes_httpd.erl
+++ b/src/global_changes_httpd.erl
@@ -70,30 +70,17 @@ transform_change(Username, _Resp, {Props}) ->
     {id, Id} = lists:keyfind(id, 1, Props),
     {seq, Seq} = lists:keyfind(seq, 1, Props),
     Info = case binary:split(Id, <<":">>) of
-        [Event0, DbNameAndUsername] ->
-            case binary:split(DbNameAndUsername, <<"/">>) of
-                [AccountName0, DbName0] ->
-                    {Event0, AccountName0, DbName0};
-                [DbName0] ->
-                    {Event0, '_admin', DbName0}
-            end;
+        [Event0, DbName0] ->
+            {Event0, DbName0};
         _ ->
             skip
     end,
     case Info of
-        % Matches the client's username
-        {Event, Username, DbName} when Username /= admin ->
-            {[
-                {dbname, DbName},
-                {type, Event},
-                {seq, Seq}
-            ]};
         % Client is an admin, show them everything.
-        {Event, AccountName, DbName} when Username == admin ->
+        {Event, DbName} when Username == admin ->
             {[
-                {dbname, DbName},
+                {db_name, DbName},
                 {type, Event},
-                {account, AccountName},
                 {seq, Seq}
             ]};
         _ ->


Mime
View raw message