juho-jaakkola / elgg-chat

Chat-like messaging plugin for Elgg
10 stars 6 forks source link

Send messages using AJAX #8

Open juho-jaakkola opened 9 years ago

juho-jaakkola commented 9 years ago

What needs to be solved:

  1. What to do if user sends a message and receives another message simultaneously, but the responses arrive in the wrong order? Should the messages be reordered on client side using e.g. a timestamp sent along the response?
  2. How to parse content that usually gets parsed on server side (e.g. links)? Should the server return the parsed content on success?
Pasley70 commented 9 years ago
  1. Is it possible to use the creation-timestamp of the massage entity? If you ajax-load the whole thread (instad) in order of the timestamps, you do not need to reorder the thread. Advantage: edited messages will be updated also. Problem: Logic of controlling the limited output (latest x messages, view more ...)?
  2. I think so. We use javascript to convert links to youtube or links to files on the client side to display a player or images. This works also for dynamic updated content on the page. But there are other methods like ECML-converted contend or Hashtags/Mentions i expected parsed from the server.