Ticket #24298: Add_the_ability_to_know_the_OSM_server_via_Remote_Control.patch

File Add_the_ability_to_know_the_OSM_server_via_Remote_Control.patch, 4.0 KB (added by TrickyFoxy, 12 months ago)
  • core/src/org/openstreetmap/josm/io/remotecontrol/handler/VersionHandler.java

    Subject: [PATCH] Add the ability to know the OSM server via Remote Control
    ---
    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/core/src/org/openstreetmap/josm/io/remotecontrol/handler/VersionHandler.java b/core/src/org/openstreetmap/josm/io/remotecontrol/handler/VersionHandler.java
    a b  
    1919    @Override
    2020    protected void handleRequest() throws RequestHandlerErrorException,
    2121            RequestHandlerBadRequestException {
    22         content = RequestProcessor.PROTOCOLVERSION;
     22        content = RequestProcessor.getProtocolVersion();
    2323        contentType = "application/json";
    2424        if (args.containsKey("jsonp")) {
    2525            content = args.get("jsonp") + " && " + args.get("jsonp") + '(' + content + ')';
  • core/src/org/openstreetmap/josm/io/remotecontrol/RemoteControl.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/core/src/org/openstreetmap/josm/io/remotecontrol/RemoteControl.java b/core/src/org/openstreetmap/josm/io/remotecontrol/RemoteControl.java
    a b  
    3131     * changes.
    3232     */
    3333    static final int protocolMajorVersion = 1;
    34     static final int protocolMinorVersion = 12;
     34    static final int protocolMinorVersion = 13;
    3535
    3636    /**
    3737     * Starts the remote control server
  • core/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/core/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java b/core/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java
    a b  
    2929
    3030import org.openstreetmap.josm.data.Version;
    3131import org.openstreetmap.josm.gui.help.HelpUtil;
     32import org.openstreetmap.josm.io.OsmApi;
    3233import org.openstreetmap.josm.io.remotecontrol.handler.AddNodeHandler;
    3334import org.openstreetmap.josm.io.remotecontrol.handler.AddWayHandler;
    3435import org.openstreetmap.josm.io.remotecontrol.handler.AuthorizationHandler;
     
    7172     * interface extensions. Change major number in case of incompatible
    7273     * changes.
    7374     */
    74     public static final String PROTOCOLVERSION = Json.createObjectBuilder()
    75             .add("protocolversion", Json.createObjectBuilder()
    76                     .add("major", RemoteControl.protocolMajorVersion)
    77                     .add("minor", RemoteControl.protocolMinorVersion))
    78             .add("application", JOSM_REMOTE_CONTROL)
    79             .add("version", Version.getInstance().getVersion())
    80             .build().toString();
     75    public static String getProtocolVersion() {
     76        return Json.createObjectBuilder()
     77                .add("protocolversion", Json.createObjectBuilder()
     78                        .add("major", RemoteControl.protocolMajorVersion)
     79                        .add("minor", RemoteControl.protocolMinorVersion))
     80                .add("application", JOSM_REMOTE_CONTROL)
     81                .add("version", Version.getInstance().getVersion())
     82                .add("osm_server_url", OsmApi.getOsmApi().getServerUrl())
     83                .build().toString();
     84    }
    8185
    8286    /** The socket this processor listens on */
    8387    private final Socket request;