diff --git a/app/src/main/java/com/atakmap/android/meshtastic/MeshtasticDropDownReceiver.java b/app/src/main/java/com/atakmap/android/meshtastic/MeshtasticDropDownReceiver.java index 5c294db..bc20eec 100644 --- a/app/src/main/java/com/atakmap/android/meshtastic/MeshtasticDropDownReceiver.java +++ b/app/src/main/java/com/atakmap/android/meshtastic/MeshtasticDropDownReceiver.java @@ -150,6 +150,8 @@ protected MeshtasticDropDownReceiver(final MapView mapView, final Context contex '--> */ + + /* configBtn = mainView.findViewById(R.id.configBtn); configBtn.setOnClickListener(v -> { @@ -166,6 +168,7 @@ protected MeshtasticDropDownReceiver(final MapView mapView, final Context contex throw new RuntimeException(e); } }); + */ // Check if user has given permission to record audio, init the model after permission is granted int permissionCheck = ContextCompat.checkSelfPermission(mapView.getContext().getApplicationContext(), Manifest.permission.RECORD_AUDIO); diff --git a/app/src/main/java/com/atakmap/android/meshtastic/MeshtasticMapComponent.java b/app/src/main/java/com/atakmap/android/meshtastic/MeshtasticMapComponent.java index 494a816..0502c8c 100644 --- a/app/src/main/java/com/atakmap/android/meshtastic/MeshtasticMapComponent.java +++ b/app/src/main/java/com/atakmap/android/meshtastic/MeshtasticMapComponent.java @@ -329,7 +329,7 @@ public void processCotEvent(CotEvent cotEvent, String[] strings) { Log.d(TAG, "processCotEvent"); CotDetail cotDetail = cotEvent.getDetail(); - if (cotDetail.getChildren().contains("__meshtastic")) { + if (cotDetail.getChild("__meshtastic") != null) { Log.d(TAG, "Meshtastic message, don't forward"); return; } diff --git a/app/src/main/java/com/atakmap/android/meshtastic/MeshtasticReceiver.java b/app/src/main/java/com/atakmap/android/meshtastic/MeshtasticReceiver.java index 0141d25..d44e1a4 100644 --- a/app/src/main/java/com/atakmap/android/meshtastic/MeshtasticReceiver.java +++ b/app/src/main/java/com/atakmap/android/meshtastic/MeshtasticReceiver.java @@ -834,11 +834,11 @@ else if (team.equals("DarkGreen")) String deviceCallsign = contact.getDeviceCallsign(); String msgId = callsign + "-" + deviceCallsign + "-" + geoChat.getMessage().hashCode(); - Bundle chatMessage = ChatDatabase.getInstance(_mapView.getContext()).getChatMessage(msgId); - if (chatMessage != null) { - Log.d(TAG, "Duplicate message"); - return; - } + //Bundle chatMessage = ChatDatabase.getInstance(_mapView.getContext()).getChatMessage(msgId); + //if (chatMessage != null) { + // Log.d(TAG, "Duplicate message"); + // return; + //} if (prefs.getBoolean("plugin_meshtastic_voice", false)) { StringBuilder message = new StringBuilder(); @@ -935,11 +935,11 @@ else if (team.equals("DarkGreen")) String deviceCallsign = contact.getDeviceCallsign(); String msgId = callsign + "-" + deviceCallsign + "-" + geoChat.getMessage().hashCode(); - Bundle chatMessage = ChatDatabase.getInstance(_mapView.getContext()).getChatMessage(msgId); - if (chatMessage != null) { - Log.d(TAG, "Duplicate message"); - return; - } + //Bundle chatMessage = ChatDatabase.getInstance(_mapView.getContext()).getChatMessage(msgId); + //if (chatMessage != null) { + // Log.d(TAG, "Duplicate message"); + // return; + //} if (prefs.getBoolean("plugin_meshtastic_voice", false)) { StringBuilder message = new StringBuilder(); @@ -1021,10 +1021,11 @@ public void onCotEvent(CotEvent cotEvent, Bundle bundle) { CotDetail cotDetail = cotEvent.getDetail(); - if (cotDetail.getChildren().contains("__meshtastic")) { + if (cotDetail.getChild("__meshtastic") != null) { Log.d(TAG, "Meshtastic CoT from server"); return; } + Log.d(TAG, "onCotEvent"); Log.d(TAG, cotEvent.toString()); diff --git a/app/src/main/res/layout/main_layout.xml b/app/src/main/res/layout/main_layout.xml index 2949679..933080e 100644 --- a/app/src/main/res/layout/main_layout.xml +++ b/app/src/main/res/layout/main_layout.xml @@ -27,11 +27,14 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/tv" /> + +