Distinguish between local and “normal” Sones in FCP handler.
[Sone.git] / src / main / java / net / pterodactylus / sone / fcp / GetSoneCommand.java
index 5ebdc13..33f7bad 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - GetSoneCommand.java - Copyright © 2011 David Roden
+ * Sone - GetSoneCommand.java - Copyright © 2011–2013 David Roden
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 package net.pterodactylus.sone.fcp;
 
 import net.pterodactylus.sone.core.Core;
+import net.pterodactylus.sone.data.LocalSone;
 import net.pterodactylus.sone.data.Profile;
 import net.pterodactylus.sone.data.Sone;
 import net.pterodactylus.sone.freenet.fcp.FcpException;
+
+import com.google.common.base.Optional;
+
 import freenet.support.SimpleFieldSet;
 import freenet.support.api.Bucket;
 
@@ -47,8 +51,8 @@ public class GetSoneCommand extends AbstractSoneCommand {
         */
        @Override
        public Response execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) throws FcpException {
-               Sone sone = getSone(parameters, "Sone", false);
-               Sone localSone = getSone(parameters, "LocalSone", false, false);
+               Sone sone = getSone(parameters, "Sone");
+               Optional<LocalSone> localSone = getLocalSone(parameters, "LocalSone", false);
                return new Response("Sone", encodeSone(sone, "", localSone));
        }