Sunday, January 26, 2014

People chat room messages Openfire issue records


posts by Lvmodel edited 2013-09-27 15:30:20
When a question ah openfire chat room when you exit the chat room to re-enter the record will get the message before so do not get how this record it?
I see online there is a saying that
DelayInformation inf = (DelayInformation) message.getExtension (
"X", "jabber: x: delay");
System.out.println ("news judgment");
if (inf == null && count> = 1) {
System.out.println ("news came");
isHistory = true;
} Else {
System.out.println ("This is old news");
}
Details: http://blog.csdn.net/lnb333666/article/details/7598488
But after such a judgment issued after exiting the chat room messages all become old news
there is no property to determine what messages have acquired not get the message before exiting after exiting and re-get?
ps: think before you set up after the user exits an identifier when entering the first use this identifier to determine what, but the next time the server can not be found between the information sent over, so I do not know how to start, again you pointing 12. Thank

Reply:
Very simple, own the best record writes about old news locally, if sent to the next in line, and now do not have control.
Reply:
cited a floor lieri111 reply:
very simple, own the best record writes about old news locally and sent to the next if the current consensus on the do not have control.

First, thank you for your answer
This method is also thought before, not feeling well, say the old message is sent over each store it on or after the user exits and then stored, if it is the first one then you have to set a maximum number of messages, if more than on automatically replaced (after all, the message will be more and more). The second, and if it was too late to save the sudden shutdown.

So would like to ask is there any property can be set.
Anyway thank you for your enthusiastic response.
Reply:
sharepreference only save a message, if the power of words, all of the devices in general will have a small backup power supply, you can top about 0.1 seconds, exactly enough for you to save the data.
Reply:
reference to the third floor lieri111 reply:
sharepreference only save a message, if the power of words, all of the devices in general will have a small backup power supply that can top 0.1 seconds so, complete enough to save your data.

Thank you. You said has been achieved, but did not test the effect. However, it should be.
Incidentally, looking forward to what other big cattle opinions!
Reply:
I also encountered the same problem, I do not know the landlord now has not been resolved? Kindly enlighten me!
Reply:
references, 5th Floor mars0122 reply:
I also encountered the same problem, I do not know the landlord now has not been resolved? Kindly enlighten me!

Does not yet have found the perfect solution, or save the old information to determine the method of
Reply:
reference to the 6th floor Lvmodel reply:
Quote: references, 5th Floor mars0122 reply:

I also encountered the same problem, I do not know the landlord now has not been resolved? Kindly enlighten me!

Does not yet have found the perfect solution, or save the information to judge the old method
used

If cleared away the data saved locally, then the next, then it is put before the historic message to push over, so do not Well
Reply:
Landlord you say, how so do not get the message before recording the chat room, in fact, can be
/ / Chat service will decide to accept the history of the number
DiscussionHistory history = new DiscussionHistory ();
history.setMaxChars (0);
But such an action would not get chat rooms offline message, the landlord should not be so mean.
DelayInformation inf = (DelayInformation) message.getExtension ("x", "jabber: x: delay");
if (if! = null) {/ / old messages}
But the old message is divided into've read and unread, the landlord should be the only hope to get old unread messages.
I also happen to have this problem, you can solve the following
Each message has a message id (eg: )
After reading the stored information to the local news, the next pull to old messages based on this id, if a local does not exist, perform pull

No comments:

Post a Comment