1
votes

I have Ejabberd server and mobile iOS/Android apps.

I want to build a simple Chat app with something like 2 screens:

  • List of chats
  • Screen with messages of particular chat

I have an issue with the List of chats implementation. I use XEP-0313: Message Archive Management to store chat history and it suites very well for my 2nd screen - screen with messages of particular chat.

But I can't find a proper way to show a list of chats

I have an idea to merge all user's contacts (roster) + group rooms and then show, but users do not have active chats with all their contacts so this is not a right solution.

It's also good to show a last message text along with each chat on a list of chats screen. So this is a pretty standard feature in all modern messengers.

Is it possible to do with any XEPs? or maybe I can use a Message Archive XEP in some way

Some thoughts here Get last message of each conversation with XEP-0313?, but still no answer

1
Do you use local storage like SQLite database? What is difference between chatlist and current chats? Is it time difference or something more?Kenan Begić
I use SQLite, but I want it to be accessible from all of my devices, so the same data should be on the Chats screen across all of my devices.Rubycon
@KenanBegić what do you mean by "between chatlist and current chats". We can call it as you wish, it's just a list of all users chatsRubycon
@Rubycon, this is a great question. Did you find an answer or a workaround?AtomicBoolean
@AtomicBoolean I ended up with building an external API endpoint to get it all and provide to user. This endpoint can access Ejabberd DBRubycon

1 Answers

0
votes

But I can't find a proper way to show a list of chats

List of rooms where a particular account is occupant (has joined):

$ ejabberdctl get_user_rooms user1 localhost
[email protected]
[email protected]