Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit eefab416 authored by tobiasKaminsky's avatar tobiasKaminsky
Browse files

use provided user ID

parent 8cf09590
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -50,6 +50,12 @@ public class GetPublicKeyOperation extends RemoteOperation {

    private static final String JSON_FORMAT = "?format=json";
    
    private String userID;
    
    public GetPublicKeyOperation(String userID) {
        this.userID = userID;
    }

    /**
     * @param client Client object
     */
@@ -69,10 +75,9 @@ public class GetPublicKeyOperation extends RemoteOperation {
                String response = getMethod.getResponseBodyAsString();

                // Parse the response
                String username = client.getCredentials().getUsername();
                JSONObject respJSON = new JSONObject(response);
                String key = (String) respJSON.getJSONObject(NODE_OCS).getJSONObject(NODE_DATA)
                        .getJSONObject(NODE_PUBLIC_KEYS).get(username);
                        .getJSONObject(NODE_PUBLIC_KEYS).get(userID);

                result = new RemoteOperationResult(true, getMethod);
                ArrayList<Object> keys = new ArrayList<>();