Posts tagged ‘chat history’

Chat history

We’ve (finally!) got round to releasing the chat history function on the live OpenLearn server (more details).. so pleased we’ve now got that done :-)

No more ‘lost’ MSG messages

I’ve now implemented the chat history function on the msg.open.ac.uk server, so we can try it out there for little while, before I transfer it over to the msg-openlearn server.

I have found a couple of little ‘quirks’ which I’m not sure will annoy users or not…

  1. the chat history is only written to the log files every 120 seconds (or whatever no of secs I set it to), presumably to stop too many file read/writes which would have performance implications. But it means that if you have a conversation, close the window, then immediately re-open a chat with the same user and try to load the history, you may not see the message history from the last couple of minutes (the history will be there later, just not now). I don’t know that I can completely resolve this, but I have set the log files to be written every 30 seconds, so hopefully it won’t be an issue.
  2. another thing that may look a bit odd is that if you have a chat with someone for a little while, and then decide to load the history, the messages from over 2 mins ago will appear twice. I don’t want to just overwrite the whole chat window, because then you won’t get the most recent messages (due to (1)), and I guess seeing the message twice is better than not at all. I think I’ve got a way around this, and that is to load mark the “loaded chat history” in the interface, so you know what is currently stored – and it then won’t look so odd that some messages appear twice.

Any feedback on the new chat history function is much appreciated :-)

MSG Chat History

Spent the day yesterday figuring out how I could implement a load chat history function in MSG – as one of the things I find a little annoying with MSG is that if you accidentally close the chat window, you can’t get the chat back – and if I find it irritating then I’m sure others do too ;-)

There were 2 ways I thought I could approach this…

  1. In BuddyXML (essentially the MSG server layer) intercept the messages as they are sent to/from users and store in files on the server, just in a directory structure reflecting the users involved
  2. Enable logging in the OpenFire server and parse these to give the user their chat conversation with the user selected

Each of these options has it’s pros and cons. Approach 1 means creating a new logging system (re-inventing functionality already implemented in OpenFire), but it would be quick to return the results to users (no parsing involved), whereas approach 2 has the opposite pros & cons – the logging is already implemented, but if the logs get big, it could take a while to parse/process them.

I decided to take approach 2, as it just *seems right*, but if it does start to become slow (with the parsing involved) we’ve got another method we could implement. In order to reduce the amount of parsing of log files, I’m restricting the conversation history returned to the last 7 days – although I’ll set the server to store the last 30 days, so we can increase the amount of history returned if it all works ok.

I’ve got most of this fixed up now and implemented – the final bit to put in place is to actually display the history back to the user in the chat window.

Hopefully this function with be useful to people (well, at the very least, I’ll find it handy!)