如何从Openfire的群聊的离线消息 [英] How to get offline message of group chat from Openfire

查看:2010
本文介绍了如何从Openfire的群聊的离线消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

XMPP任何方式,我得到的离线消息 MultiUserChat的,当我的用户登录并加入房间。

Is any way in xmpp that i get offline message of MultiUserChat, when my user login and join room.

我想实现的群聊的WhatsApp ,是实施此项请建议任何其他方式

I want implement group chat like WhatsApp, Is any other way to implement this please suggest

在此先感谢

推荐答案

至少,当你进入了聊天群,你必须输入你的最后一个时间戳,鉴于该时间戳你会从那个时候起接收的消息。

At least in ejjaberd when you enter the chat group, you have to enter your last timestamp, given that timestamp you will receive the messages from that moment.

从你的最后一条消息保存时间戳记,并且当你进入你的房间,如下所示:

Save the timestamp from your last message, and when you enter to your room, like the following:

 MultiUserChat muc = new MultiUserChat(mConnection, room_name);
                Log.d(TAG, "JOINING => " + room_name);

                DiscussionHistory history = new DiscussionHistory();
                if (mLastMessageDate == null)
                    history.setMaxStanzas(300);
                else
                    history.setSince(mLastMessageDate); //timestamp from your last message

 muc.join(mNickName, null, history,
                            SmackConfiguration.getDefaultPacketReplyTimeout());

希望它能帮助

这篇关于如何从Openfire的群聊的离线消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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