AntzCode / ossn-theme-fakebook

Facebook theme for ossn-opensource-socailnetwork.org
3 stars 2 forks source link

Links should be clickable in Private Messages #6

Closed AntzCode closed 4 years ago

AntzCode commented 4 years ago

When person A sends a link to person B through Private Message, that link should be clickable.

In the real-time chat window, that is the case, and person B can click the link. In the Private Mesages window though, it is not clickable. Person B needs to copy/paste the link into a browser URL field.

It should be that URL's are clickable in Private Messages as they are in chats. (Notice that Private Message and chat are using the same content, so the difference is a matter of markup and presentation by the UI rather than any changes to the data).

AntzCode commented 4 years ago

Delegate an event that listens for changes to the DOM subtree of the message container. Whenever new messages are added to it, assess the message content to see if it contains a URL that is not already a link. If so, convert the URL into a link. Then replace the original message with the modified content.