clj-symphony.stream

Operations related to ‘streams’. A ‘stream’ is the generic term for any kind of message channel in the Symphony platform, and comes in one of several flavours:

  1. 1:1 chat
  2. M:M chat
  3. room
  4. wall post

The primary difference between chats and rooms is that rooms have dynamic membership whereas the membership of a chat is fixed at creation time.

In addition, each type of stream can be ‘internal’ (intra-pod) or ‘external’ (include users from at most 1 other pod, aka ‘cross-pod’).

stream

(stream c s)

Returns the given stream identifier as a map (see streamobj->map for details), or nil if it doesn’t exist / isn’t accessible to the authenticated connection user.

stream-id

multimethod

(stream-id s)

Returns the stream id of the given stream.

stream-type

(stream-type c s)

Returns the type of the given stream identifier (see stream-types for the full set of possible values). Results are cached (via memoize).

stream-types

The set of possible stream types in Symphony, as keywords.

streamobj

(streamobj c s)

Returns the given stream identifier as a org.symphonyoss.symphony.clients.model.SymStreamAttributes object, or nil if it doesn’t exist / isn’t accessible to the authenticated connection user.

streamobj->map

(streamobj->map s)

Converts a org.symphonyoss.symphony.clients.model.SymStreamAttributes object into a map with these keys:

Key Description
:stream-id The stream id of the room.
:name The name of the stream (if any).
:active A boolean indicating whether the stream is active or not.
:type The type of the stream (see stream-types).
:cross-pod A boolean indicating whether the stream is cross-pod or not.
:member-user-ids A sequence of the user ids of members of the stream.

streamobjs

(streamobjs c)

Returns a list of org.symphonyoss.symphony.clients.model.SymStreamAttributes objects visible to the authenticated connection user.

streams

(streams c)

Returns a lazy sequence of streams (as maps, see streamobj->map for details) visible to the authenticated connection user.

users-from-stream

(users-from-stream c s)

Returns all users participating in the given stream, as a sequence of maps (see clj-symphony.user/userobj->map for details).

usersobjs-from-stream

(usersobjs-from-stream c s)

Returns all org.symphonyoss.symphony.clients.model.SymUser objects participating in the given stream.