• last updated 1 hour ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Use a simpler approach to achieve the intended result, which does not rely on events

Keep comments on the server side

Ensure chat javascript is executed only when the chat itself is actually a part of the DOM

This may not be the case at the time of rendering, e.g. because the chat is rendered inside of a <template> tag and appended to the document at a later moment.

Cleanup leftover library: latest javascript assumes XMLHttpRequest is supported

Chat reform

The goal of these changes is to reduce the "mode" specific javascript code in the chat implementation and reduce server-side guessing of browser capabilities.

- In the MessageRelay class from xotcl-core, we rework the javascript code sent to the connection when doing scripted streaming to make less assumptions about the functions defined in the parent scope

- In the chat code from xowiki, we move most of the logics to guess the mode into javascript, where we can test the actual capabilities of the browser without relying on the user agent

- The previously 4 javascript files dependant on the chat mode have been made into one

  1. … 7 more files in changeset.
When the mode is "streaming", use Server Sent Events instead of a "plain" endless request

This has the advantage of a clearer, less hacky api, which, for instance, does not require manual parsing of the partial response.

  1. … 4 more files in changeset.
Cleanup leftover method: its logics were moved to the MessageRelay class

Ensure scripts and internal use information are not rendered together with the content, in particular for dumber HTML renderer

move "-destroy_on_cleanup" towards the end of the parameter list

This change improves protection about ambiguous user input

  1. … 8 more files in changeset.
improved spelling

  1. … 2 more files in changeset.
Don't provide the url here, the require proc will takwe it from the connection, if any, and fallback otherwise

Follow-up for https://cvs.openacs.org/changelog/OpenACS?cs=oacs-5-10%3Agustafn%3A20230313120323

- make sure the anonymous users nsv is created when the chat is instantiated

- make sure xo::cc is available when the anonymous identifier is generated

- handle in the Chat package, that the uid may not be a user, but an IP address

- adapt other chat skins to the new anonymous user logics

  1. … 5 more files in changeset.
Added support for anonymous users in chat class

Previous version of the chat class required a login for participating

in the chat. The new version also supports a mixed mode, with

authenticated and non-authenticated users can participate. For

unauthenticated users, the disambiguation is performed over the peer

IP address, similar to the xotcl-request-monitor. Instead of the raw

IP address, an artificial username is displayed for such users (like

e.g. userXXX).

For unauthenticated users, some differences apply:

- one cannot provide a link to the private page

- unauthenticated users cannot access the user-portrait

of authenticated users.

The GUI changes are only made on chat-skins/chat-classic.js, not on

the other skins.

  1. … 1 more file in changeset.
Make sure configuration is applied consistently to all of the multiple instances of the chat class (add message, subscription, login...) that are involved in a conversation

This fixes certain options such as login and logout message not being applied correctly

reduce cache hits on nsv "::chat::Chat" and on "::chat::Chat-ID-options"

Fully qualify the parameter command to not conflict with the class having the same name in the ::xo namespace

prefer standard OpenACS API for accessing parameters

  1. … 4 more files in changeset.
use acs::clusterwide instead of xo::clusterwide

  1. … 5 more files in changeset.
don't rely on uppercase header field names

  1. … 10 more files in changeset.
factor out script wrappers

reduce number of locks when NaviServer is used

Prefer api to retrieve csp nonce, as it performs useful existance checks

improve spelling

  1. … 33 more files in changeset.
prefer "nsf::is object" over ":isobject" or "info commands", since it is faster, more generic and can be used in all contexts

  1. … 15 more files in changeset.
modernize code: use resolver variables rather than method calls

  1. … 14 more files in changeset.
reduce XOTcl 1.* idioms

  1. … 1 more file in changeset.
- modernize code (remove "my")

- prefer fully qualified commands based on IDs

  1. … 33 more files in changeset.
Prefer connchan message relay implementation (we check whether it is available anyway)

Make chat_id required, as path to the chat.tcl script is now immutable and all the potentially expensive package_id retrieval was only due to defaulting the chat_id. Use cases around already define their chat_id independently

Move chat.tcl into acs-subsite:

although this would depend on xowiki, having in xowiki/www might conflict with legitimate pages named "chat"

  1. … 2 more files in changeset.