diff --git a/KdeConnect/src/main/java/org/kde/connect/LinkProviders/BroadcastTcpLinkProvider.java b/KdeConnect/src/main/java/org/kde/connect/LinkProviders/BroadcastTcpLinkProvider.java index 96b96804..5033bea1 100644 --- a/KdeConnect/src/main/java/org/kde/connect/LinkProviders/BroadcastTcpLinkProvider.java +++ b/KdeConnect/src/main/java/org/kde/connect/LinkProviders/BroadcastTcpLinkProvider.java @@ -145,6 +145,11 @@ public class BroadcastTcpLinkProvider extends BaseLinkProvider { if (!np.getType().equals(NetworkPackage.PACKAGE_TYPE_IDENTITY)) { Log.e("BroadcastTcpLinkProvider", "1 Expecting an identity package"); return; + } else { + String myId = NetworkPackage.createIdentityPackage(context).getString("deviceId"); + if (np.getType().equals(myId)) { + return; + } } Log.e("BroadcastTcpLinkProvider", "It is an identity package, creating link"); diff --git a/KdeConnect/src/main/java/org/kde/connect/NetworkPackage.java b/KdeConnect/src/main/java/org/kde/connect/NetworkPackage.java index 2a22d56a..523c6636 100644 --- a/KdeConnect/src/main/java/org/kde/connect/NetworkPackage.java +++ b/KdeConnect/src/main/java/org/kde/connect/NetworkPackage.java @@ -104,8 +104,9 @@ public class NetworkPackage { jo.put("version",mVersion); } catch(Exception e) { } - Log.e("NetworkPackage.serialize",jo.toString()+"\n"); - return jo.toString(); + String json = jo.toString()+"\n"; + Log.e("NetworkPackage.serialize",json); + return json; } static public NetworkPackage unserialize(String s) {