From 345d7420af0f60da64e1c132e99bec929ac14a83 Mon Sep 17 00:00:00 2001 From: Arne Date: Sun, 1 Sep 2024 09:54:22 +0200 Subject: [PATCH] Further applying monocles database and strings --- .builds/debian-stable.yml | 34 +++++++++---------- README.md | 4 +-- .../siacs/conversations/entities/Message.java | 2 +- .../worker/ExportBackupWorker.java | 14 ++++---- .../de/monocles/chat/FinishOnboarding.java | 8 ++--- .../services/ImportBackupService.java | 2 +- src/monocleschat/res/values/strings.xml | 2 +- 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/.builds/debian-stable.yml b/.builds/debian-stable.yml index 77872e518..b815106bc 100644 --- a/.builds/debian-stable.yml +++ b/.builds/debian-stable.yml @@ -1,10 +1,10 @@ image: debian/stable sources: -- https://git.sr.ht/~singpolyma/cheogram-android +- https://codeberg.org/monocles/monocles_chat artifacts: -- cheogram.apk -- cheogram_google_play.apk -- cheogram_google_play.aab +- monocleschat.apk +- monocleschat_google_play.apk +- monocleschat_google_play.aab packages: - wget - unzip @@ -31,29 +31,29 @@ tasks: touch ~/.android/repositories.cfg yes | android/cmdline-tools/tools/bin/sdkmanager --licenses - sentry: | - cd cheogram-android - sed -ie 's///' src/cheogram/AndroidManifest.xml + cd monocles_chat + sed -ie 's///' src/monocleschat/AndroidManifest.xml sed -ie 's/\/\/ PLUGIN INSERT/id "io.sentry.android.gradle" version "4.2.0"/' build.gradle sed -ie 's/\/\/ ROOT INSERT/sentry { includeSourceContext = true }/' build.gradle - build_free: | set +x export SENTRY_AUTH_TOKEN=$(cat ~/sentry_auth_token) set -x - cd cheogram-android - ./gradlew assembleCheogramFreeDebug + cd monocles_chat + ./gradlew assemblemonocleschatFreeDebug - build_google_play: | set +x export SENTRY_AUTH_TOKEN=$(cat ~/sentry_auth_token) set -x - cd cheogram-android + cd monocles_chat mkdir -p src/playstore/res/values/ mv ~/push.xml src/playstore/res/values/ - ./gradlew assembleCheogramPlaystoreDebug - echo keystore=$HOME/.android/cheogram.keystore > signing.properties - echo keystore.password=cheogram >> signing.properties - echo keystore.alias=cheogram >> signing.properties - ./gradlew bundleCheogramPlaystoreRelease + ./gradlew assemblemonocleschatPlaystoreDebug + echo keystore=$HOME/.android/monocleschat.keystore > signing.properties + echo keystore.password=monocleschat >> signing.properties + echo keystore.alias=monocleschat >> signing.properties + ./gradlew bundlemonocleschatPlaystoreRelease - assets: | - mv cheogram-android/build/outputs/apk/cheogramFree/debug/*universal*.apk cheogram.apk - mv cheogram-android/build/outputs/apk/cheogramPlaystore/debug/*universal*.apk cheogram_google_play.apk - mv cheogram-android/build/outputs/bundle/cheogramPlaystoreRelease/*.aab cheogram_google_play.aab + mv monocles_chat/build/outputs/apk/monocleschatFree/debug/*universal*.apk monocleschat.apk + mv monocles_chat/build/outputs/apk/monocleschatPlaystore/debug/*universal*.apk monocleschat_google_play.apk + mv monocles_chat/build/outputs/bundle/monocleschatPlaystoreRelease/*.aab monocleschat_google_play.aab diff --git a/README.md b/README.md index 900b16b22..eeb6baf72 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# Cheogram Android +# monocles chat This is a fork of [Conversations](https://conversations.im) to implement features of use to the [Sopranica](https://soprani.ca) project. -The Cheogram Android app allows you to join a worldwide communication network. It especially focuses on features useful to users who want to contact those on other networks as well, such as SMS-enabled phone numbers. +The monocles chat app allows you to join a worldwide communication network. It especially focuses on features useful to users who want to contact those on other networks as well, such as SMS-enabled phone numbers. Based on the app Conversations, but with unique features: diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java index 2f45eba94..7af105618 100644 --- a/src/main/java/eu/siacs/conversations/entities/Message.java +++ b/src/main/java/eu/siacs/conversations/entities/Message.java @@ -340,7 +340,7 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable return message; } - public ContentValues getCheogramContentValues() { + public ContentValues getmonoclesContentValues() { final FileParams fp = fileParams; ContentValues values = new ContentValues(); values.put(UUID, uuid); diff --git a/src/main/java/eu/siacs/conversations/worker/ExportBackupWorker.java b/src/main/java/eu/siacs/conversations/worker/ExportBackupWorker.java index 1b36d5540..c79a15232 100644 --- a/src/main/java/eu/siacs/conversations/worker/ExportBackupWorker.java +++ b/src/main/java/eu/siacs/conversations/worker/ExportBackupWorker.java @@ -266,7 +266,7 @@ public class ExportBackupWorker extends Worker { accountExport(db, uuid, writer); simpleExport(db, Conversation.TABLENAME, Conversation.ACCOUNT, uuid, writer); messageExport(db, uuid, writer, progress); - messageExportCheogram(db, uuid, writer, progress); + messageExportmonocles(db, uuid, writer, progress); for (final String table : Arrays.asList( SQLiteAxolotlStore.PREKEY_TABLENAME, @@ -332,15 +332,15 @@ public class ExportBackupWorker extends Worker { } } - private void messageExportCheogram(SQLiteDatabase db, String uuid, PrintWriter writer, Progress progress) { + private void messageExportmonocles(SQLiteDatabase db, String uuid, PrintWriter writer, Progress progress) { final var notificationManager = getApplicationContext().getSystemService(NotificationManager.class); - Cursor cursor = db.rawQuery("select cmessages.* from messages join cheogram.messages cmessages using (uuid) join conversations on conversations.uuid=messages.conversationUuid where conversations.accountUuid=?", new String[]{uuid}); + Cursor cursor = db.rawQuery("select cmessages.* from messages join monocles.messages cmessages using (uuid) join conversations on conversations.uuid=messages.conversationUuid where conversations.accountUuid=?", new String[]{uuid}); int size = cursor != null ? cursor.getCount() : 0; - Log.d(Config.LOGTAG, "exporting " + size + " cheogram messages for account " + uuid); + Log.d(Config.LOGTAG, "exporting " + size + " monocles messages for account " + uuid); int i = 0; int p = 0; while (cursor != null && cursor.moveToNext()) { - writer.write(cursorToString("cheogram." + Message.TABLENAME, cursor, PAGE_SIZE, false)); + writer.write(cursorToString("monocles." + Message.TABLENAME, cursor, PAGE_SIZE, false)); if (i + PAGE_SIZE > size) { i = size; } else { @@ -356,11 +356,11 @@ public class ExportBackupWorker extends Worker { cursor.close(); } - cursor = db.rawQuery("select webxdc_updates.* from " + Conversation.TABLENAME + " join cheogram.webxdc_updates webxdc_updates on " + Conversation.TABLENAME + ".uuid=webxdc_updates." + Message.CONVERSATION + " where conversations.accountUuid=?", new String[]{uuid}); + cursor = db.rawQuery("select webxdc_updates.* from " + Conversation.TABLENAME + " join monocles.webxdc_updates webxdc_updates on " + Conversation.TABLENAME + ".uuid=webxdc_updates." + Message.CONVERSATION + " where conversations.accountUuid=?", new String[]{uuid}); size = cursor != null ? cursor.getCount() : 0; Log.d(Config.LOGTAG, "exporting " + size + " WebXDC updates for account " + uuid); while (cursor != null && cursor.moveToNext()) { - writer.write(cursorToString("cheogram.webxdc_updates", cursor, PAGE_SIZE, false)); + writer.write(cursorToString("monocles.webxdc_updates", cursor, PAGE_SIZE, false)); if (i + PAGE_SIZE > size) { i = size; } else { diff --git a/src/monocleschat/java/de/monocles/chat/FinishOnboarding.java b/src/monocleschat/java/de/monocles/chat/FinishOnboarding.java index bb6ba3f12..44b7843e2 100644 --- a/src/monocleschat/java/de/monocles/chat/FinishOnboarding.java +++ b/src/monocleschat/java/de/monocles/chat/FinishOnboarding.java @@ -97,11 +97,11 @@ public class FinishOnboarding { Element command4 = iq4.findChild("command", "http://jabber.org/protocol/commands"); if (command4 != null && command4.getAttribute("status") != null && command4.getAttribute("status").equals("completed")) { xmppConnectionService.createContact(newAccount.getRoster().getContact(iq4.getFrom().asBareJid()), true); - Conversation withCheogram = xmppConnectionService.findOrCreateConversation(newAccount, iq4.getFrom().asBareJid(), true, true, true); - xmppConnectionService.markRead(withCheogram); - xmppConnectionService.clearConversationHistory(withCheogram); + Conversation withmonocles = xmppConnectionService.findOrCreateConversation(newAccount, iq4.getFrom().asBareJid(), true, true, true); + xmppConnectionService.markRead(withmonocles); + xmppConnectionService.clearConversationHistory(withmonocles); xmppConnectionService.deleteAccount(onboardAccount); - activity.switchToConversation(withCheogram, null, false, null, false, false, "command"); + activity.switchToConversation(withmonocles, null, false, null, false, false, "command"); // We don't set WORKING back to false because we suceeded so it should never run again anyway } else { Log.e(Config.LOGTAG, "Error confirming jid switch, got: " + iq4); diff --git a/src/monocleschat/java/eu/siacs/conversations/services/ImportBackupService.java b/src/monocleschat/java/eu/siacs/conversations/services/ImportBackupService.java index 1718e4c46..01d2749b2 100644 --- a/src/monocleschat/java/eu/siacs/conversations/services/ImportBackupService.java +++ b/src/monocleschat/java/eu/siacs/conversations/services/ImportBackupService.java @@ -263,7 +263,7 @@ public class ImportBackupService extends Service { } } else { if (count % 2 == 0) { - if (line.startsWith("INSERT INTO cheogram.webxdc_updates(serial,")) { + if (line.startsWith("INSERT INTO monocles.webxdc_updates(serial,")) { // re-number webxdc using autoincrement in the local database line = line.replaceAll("\\([^,]+,", "("); } diff --git a/src/monocleschat/res/values/strings.xml b/src/monocleschat/res/values/strings.xml index 437854cd1..8920b6a31 100644 --- a/src/monocleschat/res/values/strings.xml +++ b/src/monocleschat/res/values/strings.xml @@ -6,7 +6,7 @@ I need to sign up I already have a Jabber ID I am a Snikket user - Do you already have a Jabber ID? This might be the case if you are already using a different Jabber client or have used Cheogram Android, Conversations, or Snikket before. If not you can create a new Jabber ID right now. + Do you already have a Jabber ID? This might be the case if you are already using a different Jabber client or have used monocles chat, Conversations, or Snikket before. If not you can create a new Jabber ID right now. Jabber is a provider independent instant messaging network, powered by the XMPP protocol. You can use this client with whatever Jabber service you choose. You will be able to communicate with users of other providers by giving them your full Jabber ID. You have been invited to %1$s. We will guide you through the process of creating an account.\nWhen picking %1$s as a provider you will be able to communicate with users of other providers by giving them your full Jabber ID.