Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
375 views
in Technique[技术] by (71.8m points)

xmpp - How to get Openfire chat history on Android device with aSmack?

I am developing a chatting application, where user will chats with one of the domain expert's group member. user uses my android app and domain expert uses spark web for chatting. I made Openfire setup and Spark web setup and developed Android chatting app with aSmack library. My app users are able to chat with domain expert. So far it is fine. Now I would like show chat history of user with any or specific expert on Android device. After surfing web, I am able to install Monitoring Service plugin for my open fire server, which is showing chat history of user on Admin side as shown below.enter image description here

Now I would like to show this history in my Android app, How can I achieve this. Any suggestions, most welcome. Am I moving in the right direction? or there any simple ways to do my job? Any info on where this chat history will be stored in Open fire Database, so that I can make SQL queries and get data using webservices is most appreciated.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can get groupchat history by using following code:

DiscussionHistory history = new DiscussionHistory();
history.setMaxStanzas(0);


multiUserChat.join("username", "password", history, SmackConfiguration.getPacketReplyTimeout());

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...