From 2d0a71fe14c49b080c3bf70244ca4996f6c3026b Mon Sep 17 00:00:00 2001 From: Mike Date: Tue, 24 Dec 2024 18:54:08 -0800 Subject: [PATCH] Export and UI IG Improvements --- src/IgateService.scala | 9 +++++++-- src/LogActivity.scala | 2 +- src/StorageDatabase.scala | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/IgateService.scala b/src/IgateService.scala index 14ca692..e26e6b7 100644 --- a/src/IgateService.scala +++ b/src/IgateService.scala @@ -289,8 +289,13 @@ class TcpSocketThread(host: String, port: Int, timeout: Int, service: AprsServic if (!aprsIstrafficEnabled) { // If the checkbox is enabled, perform the action - service.addPost(StorageDatabase.Post.TYPE_IG, "APRS-IS Received", message) - Log.d("IgateService", s"APRS-IS traffic enabled, post added: $message") + if (message.startsWith("#")) { + service.addPost(StorageDatabase.Post.TYPE_INFO, "APRS-IS", message) + Log.d("IgateService", s"APRS-IS traffic enabled, post added: $message") + } else { + service.addPost(StorageDatabase.Post.TYPE_IG, "APRS-IS", message) + Log.d("IgateService", s"APRS-IS traffic enabled, post added: $message") + } } else { // If the checkbox is not enabled, skip the action Log.d("IgateService", "APRS-IS traffic disabled, skipping the post.") diff --git a/src/LogActivity.scala b/src/LogActivity.scala index 8f6b25c..7fcabc3 100644 --- a/src/LogActivity.scala +++ b/src/LogActivity.scala @@ -66,7 +66,7 @@ class LogActivity extends MainListActivity("log", R.id.log) { //super.onListItemClick(l, v, position, id) val c = getListView().getItemAtPosition(position).asInstanceOf[Cursor] val t = c.getInt(COLUMN_TYPE) - if (t != TYPE_POST && t != TYPE_INCMG && t != TYPE_DIGI) + if (t != TYPE_POST && t != TYPE_INCMG && t != TYPE_DIGI && t != TYPE_IG) return val call = c.getString(COLUMN_MESSAGE).split(">")(0) Log.d(TAG, "onListItemClick: %s".format(call)) diff --git a/src/StorageDatabase.scala b/src/StorageDatabase.scala index 28c2e98..c79ba5f 100644 --- a/src/StorageDatabase.scala +++ b/src/StorageDatabase.scala @@ -406,12 +406,12 @@ class StorageDatabase(context : Context) extends def getExportPosts(call : String) : Cursor = { if (call != null) getWritableDatabase().query(Post.TABLE, Post.COLUMNS, - "type in (0, 3, 5) and message LIKE ?", + "type in (0, 3, 5, 6) and message LIKE ?", Array("%s%%".format(call)), null, null, null, null) else getWritableDatabase().query(Post.TABLE, Post.COLUMNS, - "type in (0, 3, 5)", null, + "type in (0, 3, 5, 6)", null, null, null, null, null) }