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

Threads iterator #128

Open
gferon opened this issue Mar 9, 2023 · 2 comments
Open

Threads iterator #128

gferon opened this issue Mar 9, 2023 · 2 comments
Milestone

Comments

@gferon
Copy link
Collaborator

gferon commented Mar 9, 2023

Right now, one can derive the Thread from a message they receive, and decide to fetch all messages from this thread. This works, but doesn't provide any nice way to list all threads.

The idea is to provide what you need to build the main screen of a messaging app/client (like Signal-Android).

Idea: it should give you a thread, the picture, the name, the last message, the time of the last message and a handle to the iterator for all its messages

@Schmiddiii
Copy link
Contributor

I'm not sure how useful that would really be. We already have methods to get all contacts and groups and as one does not want a static page one would already have to distribute the messages to the different displayed channels and re-order the channels dynamically either way. (And it would probably need two iterators for the messages, one forward and one backward; The last message/time of the last message is not really required as it could be queried by the backwards-iterator).

@nanu-c
Copy link
Contributor

nanu-c commented Mar 16, 2023

Mhm in Axolotl we do not maintain a different database rather than sled in presage. Actually what we need is a fast way to assemble a dataset for each thread with:

  • the thread name aka contact or group name
  • Last message with timestamp
  • unread message counter
  • Muted boolean
  • Self destruction message setting (not for the first view, but as common information through all threads that isn't present in the Contact

In the current state i need to decrypt all groups, iterate through all threads to get the last message, sort the threads by the timestamp of the message, maintain a fork of presage for the muted boolean and the unread message counter. As i test this on my main signal account with now about 50 groups and 200 contacts, it takes 3-7 seconds for the initial loading of the "dataset" to show the first view. And the hardware is an android phone with 3gb of ram. So everything that could be saved in one place, with one iterator is beautiful :)

@gferon gferon added this to the 0.6.0 milestone Apr 19, 2023
@gferon gferon modified the milestones: 0.6.0, 0.7.0 Feb 24, 2024
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

No branches or pull requests

3 participants