如何使用XMPP实施聊天列表 [英] How to implement a list of chats with XMPP

查看:110
本文介绍了如何使用XMPP实施聊天列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Ejabberd服务器和移动iOS / Android应用。

I have Ejabberd server and mobile iOS/Android apps.

我想构建一个带有2个屏幕的简单聊天应用程序:

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


  • 聊天列表

  • 带有特定聊天消息的屏幕

我对聊天实施清单。我使用 XEP-0313:邮件存档管理来存储聊天记录,它非常适合我的第二个屏幕-包含特定聊天消息的屏幕。

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.

在聊天列表屏幕上显示每个聊天的最后一条消息文本也很不错。
因此,这是所有现代Messenger的相当标准的功能。

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.

是否可以使用任何XEP?或者也许我可以以某种方式使用Message Archive XEP

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

此处有些想法获取与XEP-0313的每次对话的最新消息吗?,但仍无答案

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

推荐答案


但是我找不到合适的方式来显示聊天列表

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

这篇关于如何使用XMPP实施聊天列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆