Further applying monocles database and strings

This commit is contained in:
Arne 2024-09-01 09:54:22 +02:00
parent 00a72f6ef0
commit 345d7420af
7 changed files with 33 additions and 33 deletions

View file

@ -1,10 +1,10 @@
image: debian/stable image: debian/stable
sources: sources:
- https://git.sr.ht/~singpolyma/cheogram-android - https://codeberg.org/monocles/monocles_chat
artifacts: artifacts:
- cheogram.apk - monocleschat.apk
- cheogram_google_play.apk - monocleschat_google_play.apk
- cheogram_google_play.aab - monocleschat_google_play.aab
packages: packages:
- wget - wget
- unzip - unzip
@ -31,29 +31,29 @@ tasks:
touch ~/.android/repositories.cfg touch ~/.android/repositories.cfg
yes | android/cmdline-tools/tools/bin/sdkmanager --licenses yes | android/cmdline-tools/tools/bin/sdkmanager --licenses
- sentry: | - sentry: |
cd cheogram-android cd monocles_chat
sed -ie 's/<!-- INSERT -->/<meta-data android:name="io.sentry.dsn" android:value="https:\/\/ef8be0f096894172885533d912826e3e@app.glitchtip.com\/5857" \/>/' src/cheogram/AndroidManifest.xml sed -ie 's/<!-- INSERT -->/<meta-data android:name="io.sentry.dsn" android:value="https:\/\/ef8be0f096894172885533d912826e3e@app.glitchtip.com\/5857" \/>/' src/monocleschat/AndroidManifest.xml
sed -ie 's/\/\/ PLUGIN INSERT/id "io.sentry.android.gradle" version "4.2.0"/' build.gradle 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 sed -ie 's/\/\/ ROOT INSERT/sentry { includeSourceContext = true }/' build.gradle
- build_free: | - build_free: |
set +x set +x
export SENTRY_AUTH_TOKEN=$(cat ~/sentry_auth_token) export SENTRY_AUTH_TOKEN=$(cat ~/sentry_auth_token)
set -x set -x
cd cheogram-android cd monocles_chat
./gradlew assembleCheogramFreeDebug ./gradlew assemblemonocleschatFreeDebug
- build_google_play: | - build_google_play: |
set +x set +x
export SENTRY_AUTH_TOKEN=$(cat ~/sentry_auth_token) export SENTRY_AUTH_TOKEN=$(cat ~/sentry_auth_token)
set -x set -x
cd cheogram-android cd monocles_chat
mkdir -p src/playstore/res/values/ mkdir -p src/playstore/res/values/
mv ~/push.xml src/playstore/res/values/ mv ~/push.xml src/playstore/res/values/
./gradlew assembleCheogramPlaystoreDebug ./gradlew assemblemonocleschatPlaystoreDebug
echo keystore=$HOME/.android/cheogram.keystore > signing.properties echo keystore=$HOME/.android/monocleschat.keystore > signing.properties
echo keystore.password=cheogram >> signing.properties echo keystore.password=monocleschat >> signing.properties
echo keystore.alias=cheogram >> signing.properties echo keystore.alias=monocleschat >> signing.properties
./gradlew bundleCheogramPlaystoreRelease ./gradlew bundlemonocleschatPlaystoreRelease
- assets: | - assets: |
mv cheogram-android/build/outputs/apk/cheogramFree/debug/*universal*.apk cheogram.apk mv monocles_chat/build/outputs/apk/monocleschatFree/debug/*universal*.apk monocleschat.apk
mv cheogram-android/build/outputs/apk/cheogramPlaystore/debug/*universal*.apk cheogram_google_play.apk mv monocles_chat/build/outputs/apk/monocleschatPlaystore/debug/*universal*.apk monocleschat_google_play.apk
mv cheogram-android/build/outputs/bundle/cheogramPlaystoreRelease/*.aab cheogram_google_play.aab mv monocles_chat/build/outputs/bundle/monocleschatPlaystoreRelease/*.aab monocleschat_google_play.aab

View file

@ -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. 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: Based on the app Conversations, but with unique features:

View file

@ -340,7 +340,7 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable
return message; return message;
} }
public ContentValues getCheogramContentValues() { public ContentValues getmonoclesContentValues() {
final FileParams fp = fileParams; final FileParams fp = fileParams;
ContentValues values = new ContentValues(); ContentValues values = new ContentValues();
values.put(UUID, uuid); values.put(UUID, uuid);

View file

@ -266,7 +266,7 @@ public class ExportBackupWorker extends Worker {
accountExport(db, uuid, writer); accountExport(db, uuid, writer);
simpleExport(db, Conversation.TABLENAME, Conversation.ACCOUNT, uuid, writer); simpleExport(db, Conversation.TABLENAME, Conversation.ACCOUNT, uuid, writer);
messageExport(db, uuid, writer, progress); messageExport(db, uuid, writer, progress);
messageExportCheogram(db, uuid, writer, progress); messageExportmonocles(db, uuid, writer, progress);
for (final String table : for (final String table :
Arrays.asList( Arrays.asList(
SQLiteAxolotlStore.PREKEY_TABLENAME, 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); 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; 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 i = 0;
int p = 0; int p = 0;
while (cursor != null && cursor.moveToNext()) { 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) { if (i + PAGE_SIZE > size) {
i = size; i = size;
} else { } else {
@ -356,11 +356,11 @@ public class ExportBackupWorker extends Worker {
cursor.close(); 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; size = cursor != null ? cursor.getCount() : 0;
Log.d(Config.LOGTAG, "exporting " + size + " WebXDC updates for account " + uuid); Log.d(Config.LOGTAG, "exporting " + size + " WebXDC updates for account " + uuid);
while (cursor != null && cursor.moveToNext()) { 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) { if (i + PAGE_SIZE > size) {
i = size; i = size;
} else { } else {

View file

@ -97,11 +97,11 @@ public class FinishOnboarding {
Element command4 = iq4.findChild("command", "http://jabber.org/protocol/commands"); Element command4 = iq4.findChild("command", "http://jabber.org/protocol/commands");
if (command4 != null && command4.getAttribute("status") != null && command4.getAttribute("status").equals("completed")) { if (command4 != null && command4.getAttribute("status") != null && command4.getAttribute("status").equals("completed")) {
xmppConnectionService.createContact(newAccount.getRoster().getContact(iq4.getFrom().asBareJid()), true); xmppConnectionService.createContact(newAccount.getRoster().getContact(iq4.getFrom().asBareJid()), true);
Conversation withCheogram = xmppConnectionService.findOrCreateConversation(newAccount, iq4.getFrom().asBareJid(), true, true, true); Conversation withmonocles = xmppConnectionService.findOrCreateConversation(newAccount, iq4.getFrom().asBareJid(), true, true, true);
xmppConnectionService.markRead(withCheogram); xmppConnectionService.markRead(withmonocles);
xmppConnectionService.clearConversationHistory(withCheogram); xmppConnectionService.clearConversationHistory(withmonocles);
xmppConnectionService.deleteAccount(onboardAccount); 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 // We don't set WORKING back to false because we suceeded so it should never run again anyway
} else { } else {
Log.e(Config.LOGTAG, "Error confirming jid switch, got: " + iq4); Log.e(Config.LOGTAG, "Error confirming jid switch, got: " + iq4);

View file

@ -263,7 +263,7 @@ public class ImportBackupService extends Service {
} }
} else { } else {
if (count % 2 == 0) { 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 // re-number webxdc using autoincrement in the local database
line = line.replaceAll("\\([^,]+,", "("); line = line.replaceAll("\\([^,]+,", "(");
} }

View file

@ -6,7 +6,7 @@
<string name="create_new_account">I need to sign up</string> <string name="create_new_account">I need to sign up</string>
<string name="i_already_have_an_account">I already have a Jabber ID</string> <string name="i_already_have_an_account">I already have a Jabber ID</string>
<string name="i_am_snikket_user">I am a Snikket user</string> <string name="i_am_snikket_user">I am a Snikket user</string>
<string name="do_you_have_an_account">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.</string> <string name="do_you_have_an_account">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.</string>
<string name="server_select_text">Jabber is a provider independent instant messaging network, powered by the XMPP protocol. You can use this client with whatever Jabber service you choose.</string> <string name="server_select_text">Jabber is a provider independent instant messaging network, powered by the XMPP protocol. You can use this client with whatever Jabber service you choose.</string>
<string name="magic_create_text">You will be able to communicate with users of other providers by giving them your full Jabber ID.</string> <string name="magic_create_text">You will be able to communicate with users of other providers by giving them your full Jabber ID.</string>
<string name="magic_create_text_on_x">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.</string> <string name="magic_create_text_on_x">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.</string>