How to implement a list of chats with XMPP

流过昼夜 提交于 2019-12-11 15:42:38

问题


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:


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
room1@muc.localhost
room2@muc.localhost


来源:https://stackoverflow.com/questions/52085402/how-to-implement-a-list-of-chats-with-xmpp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!