Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Option to Backup Messages #1076

Merged
merged 1 commit into from
Oct 30, 2022
Merged

Conversation

theAkito
Copy link
Collaborator

@theAkito theAkito commented Oct 30, 2022

Example Output JSON

{
  "version" : 1,
  "timestamp" : "2022-10-30T02-32-04",
  "locationSaved" : "/document/3",
  "entries" : [ {
    "publicKey" : "4B9CD365CFF0F4BF0A13ACFE71C612AECF26A4699F04D1384AEA8F5A52734106",
    "message" : "Asfdljkdsflkjfsdfds\nSadf;ljsdaflksdfalkjfsda",
    "sender" : "Sent",
    "type" : "Normal",
    "correlationId" : 1,
    "timestamp" : 1667079807880,
    "id" : 1
  }, {
    "publicKey" : "4B9CD365CFF0F4BF0A13ACFE71C612AECF26A4699F04D1384AEA8F5A52734106",
    "message" : "Dsfgdfgsgfdsgfds",
    "sender" : "Sent",
    "type" : "Normal",
    "correlationId" : 2,
    "timestamp" : 1667079809018,
    "id" : 2
  }, {
    "publicKey" : "4B9CD365CFF0F4BF0A13ACFE71C612AECF26A4699F04D1384AEA8F5A52734106",
    "message" : "dfsgsfgdsgdfsgfd",
    "sender" : "Sent",
    "type" : "Normal",
    "correlationId" : 3,
    "timestamp" : 1667079810011,
    "id" : 3
  }, {
    "publicKey" : "4B9CD365CFF0F4BF0A13ACFE71C612AECF26A4699F04D1384AEA8F5A52734106",
    "message" : "Dsfgdfgsfgdssssssssssssssssssssssss",
    "sender" : "Sent",
    "type" : "Normal",
    "correlationId" : 4,
    "timestamp" : 1667079812271,
    "id" : 4
  }, {
    "publicKey" : "4B9CD365CFF0F4BF0A13ACFE71C612AECF26A4699F04D1384AEA8F5A52734106",
    "message" : "dsfggggggggggggggggggggg",
    "sender" : "Received",
    "type" : "Normal",
    "correlationId" : -2147483648,
    "timestamp" : 1667079814764,
    "id" : 5
  }, {
    "publicKey" : "4B9CD365CFF0F4BF0A13ACFE71C612AECF26A4699F04D1384AEA8F5A52734106",
    "message" : "dsfgfdgf",
    "sender" : "Received",
    "type" : "Normal",
    "correlationId" : -2147483648,
    "timestamp" : 1667079815929,
    "id" : 6
  }, {
    "publicKey" : "4B9CD365CFF0F4BF0A13ACFE71C612AECF26A4699F04D1384AEA8F5A52734106",
    "message" : "retertert",
    "sender" : "Received",
    "type" : "Normal",
    "correlationId" : -2147483648,
    "timestamp" : 1667079817058,
    "id" : 7
  }, {
    "publicKey" : "4B9CD365CFF0F4BF0A13ACFE71C612AECF26A4699F04D1384AEA8F5A52734106",
    "message" : "ertter",
    "sender" : "Received",
    "type" : "Normal",
    "correlationId" : -2147483648,
    "timestamp" : 1667079817632,
    "id" : 8
  }, {
    "publicKey" : "4B9CD365CFF0F4BF0A13ACFE71C612AECF26A4699F04D1384AEA8F5A52734106",
    "message" : "terter",
    "sender" : "Received",
    "type" : "Normal",
    "correlationId" : -2147483648,
    "timestamp" : 1667079817777,
    "id" : 9
  }, {
    "publicKey" : "4B9CD365CFF0F4BF0A13ACFE71C612AECF26A4699F04D1384AEA8F5A52734106",
    "message" : "ter",
    "sender" : "Received",
    "type" : "Normal",
    "correlationId" : -2147483648,
    "timestamp" : 1667079818199,
    "id" : 10
  }, {
    "publicKey" : "4B9CD365CFF0F4BF0A13ACFE71C612AECF26A4699F04D1384AEA8F5A52734106",
    "message" : "teretr",
    "sender" : "Received",
    "type" : "Normal",
    "correlationId" : -2147483648,
    "timestamp" : 1667079818653,
    "id" : 11
  }, {
    "publicKey" : "4B9CD365CFF0F4BF0A13ACFE71C612AECF26A4699F04D1384AEA8F5A52734106",
    "message" : "etretrrrrrrrrrrrrrrrrrrrrrrr",
    "sender" : "Received",
    "type" : "Normal",
    "correlationId" : -2147483648,
    "timestamp" : 1667079819886,
    "id" : 12
  }, {
    "publicKey" : "4B9CD365CFF0F4BF0A13ACFE71C612AECF26A4699F04D1384AEA8F5A52734106",
    "message" : "r",
    "sender" : "Received",
    "type" : "Normal",
    "correlationId" : -2147483648,
    "timestamp" : 1667079820246,
    "id" : 13
  }, {
    "publicKey" : "4B9CD365CFF0F4BF0A13ACFE71C612AECF26A4699F04D1384AEA8F5A52734106",
    "message" : "treterterrrrrrrrrrrrrrrrrr",
    "sender" : "Received",
    "type" : "Normal",
    "correlationId" : -2147483648,
    "timestamp" : 1667079821790,
    "id" : 14
  }, {
    "publicKey" : "4B9CD365CFF0F4BF0A13ACFE71C612AECF26A4699F04D1384AEA8F5A52734106",
    "message" : "r",
    "sender" : "Received",
    "type" : "Normal",
    "correlationId" : -2147483648,
    "timestamp" : 1667079822150,
    "id" : 15
  }, {
    "publicKey" : "4B9CD365CFF0F4BF0A13ACFE71C612AECF26A4699F04D1384AEA8F5A52734106",
    "message" : "rteeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
    "sender" : "Received",
    "type" : "Normal",
    "correlationId" : -2147483648,
    "timestamp" : 1667079824827,
    "id" : 16
  }, {
    "publicKey" : "4B9CD365CFF0F4BF0A13ACFE71C612AECF26A4699F04D1384AEA8F5A52734106",
    "message" : "Fdsfsd",
    "sender" : "Sent",
    "type" : "Normal",
    "correlationId" : 5,
    "timestamp" : 1667083455796,
    "id" : 17
  } ]
}

Resolves #292

Toast.LENGTH_LONG
).show()
}
} catch (e: Exception) {

Check warning

Code scanning / detekt

The caught exception is too generic. Prefer catching specific exceptions to the case that is currently handled.

The caught exception is too generic. Prefer catching specific exceptions to the case that is currently handled.
Copy link
Collaborator

@robinlinden robinlinden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good overall! Some minor nitpicks to fix before merge. :P I also pushed a commit refactoring the message-getting so we don't need a separate API to get a snapshot of the messages we want to export.

atox/src/main/res/values/strings.xml Outdated Show resolved Hide resolved
atox/src/main/res/values/strings.xml Outdated Show resolved Hide resolved
domain/src/main/kotlin/feature/BackupManager.kt Outdated Show resolved Hide resolved
domain/src/main/kotlin/feature/BackupManager.kt Outdated Show resolved Hide resolved
domain/src/main/kotlin/feature/BackupManager.kt Outdated Show resolved Hide resolved
domain/src/main/kotlin/feature/BackupManager.kt Outdated Show resolved Hide resolved
domain/src/main/kotlin/feature/BackupManager.kt Outdated Show resolved Hide resolved
domain/src/main/kotlin/feature/BackupManager.kt Outdated Show resolved Hide resolved
domain/src/main/kotlin/feature/BackupManager.kt Outdated Show resolved Hide resolved
domain/src/main/kotlin/feature/BackupManager.kt Outdated Show resolved Hide resolved
Copy link
Collaborator

@robinlinden robinlinden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Looks great. :D

@robinlinden robinlinden merged commit 9dfd2f8 into evilcorpltd:master Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow exporting chat history
2 participants