chat.pl -- The SWISH collaboration backbone
We have three levels of identity as enumerated below. Note that these
form a hierarchy: a particular user may be logged on using multiple
browsers which in turn may have multiple SWISH windows opened.
- Any open SWISH window has an associated websocket, represented
by the identifier returned by hub_add/3.
- Any browser, possibly having multiple open SWISH windows, is
identified by a session cookie.
- The user may be logged in, either based on the cookie or on
HTTP authentication.
- chat_broadcast(+Message) is det
- chat_broadcast(+Message, +Channel) is det
- Send Message to all known SWISH clients. Message is a valid JSON
object, i.e., a dict or option list. When using Redis we send the
message to the
swish:chat
pubsub channel and listening for
swish:chat
calls chat_broadcast_local/1,2 in each instance.
- Arguments:
-
Channel | - is either an atom or a term Channel/SubChannel,
where both Channel and SubChannel are atoms. |
- chat_about(+DocID, +Message) is det
- Distribute a chat message about DocID.
- chat_to_profile(ProfileID, :HTML) is det
- Send a HTML notification to users logged in using ProfileID.
- notifications(+Options)//
- The chat element is added to the navbar and managed by
web/js/chat.js
- broadcast_bell(+Options)//
- Adds a bell to indicate central chat messages
Re-exported predicates
The following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.
- chat_broadcast(+Message) is det
- chat_broadcast(+Message, +Channel) is det
- Send Message to all known SWISH clients. Message is a valid JSON
object, i.e., a dict or option list. When using Redis we send the
message to the
swish:chat
pubsub channel and listening for
swish:chat
calls chat_broadcast_local/1,2 in each instance.
- Arguments:
-
Channel | - is either an atom or a term Channel/SubChannel,
where both Channel and SubChannel are atoms. |