diff --git a/src/global_changes_httpd.erl b/src/global_changes_httpd.erl index 9a0c467..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} ]}; _ -> @@ -230,7 +217,7 @@ parse_global_changes_query(Req) -> {"heartbeat", "true"} -> [{heartbeat, true} | Args]; {"heartbeat", "false"} -> - Args; + Args; {"heartbeat", _} -> [{heartbeat, to_non_neg_int(Value)} | Args]; {"timeout", _} ->