clj-symphony.room
Operations related to ‘rooms’. A ‘room’ is a named chat containing 1 or more participants from 1 or 2 pods.
add-user-to-room!
(add-user-to-room! c r u)
Add a user (either identified as per clj-symphony.user/user-id, or using an email address) to the given room.
add-users-to-room!
(add-users-to-room! c r u)
Add all of the provided users (identified as per clj-symphony.user/user-id, or using an email address) to the given room.
create-room!
(create-room! c r)
Create a new room, returning it as a map. See create-roomobj! for details.
create-roomobj!
multimethod
(create-roomobj! c r)
Creates a new room and returns the org.symphonyoss.symphony.clients.model.SymRoomDetail
object for it. The details of the room can be provided as a org.symphonyoss.symphony.clients.model.SymRoomAttributes
object, or a map with these keys:
Key | Description |
---|---|
:name |
Name of the room. |
:description |
Description of the room. |
:public |
Boolean indicating whether the room is ‘public’ (i.e. cross-pod enabled). |
:read-only |
Boolean indicating whether the room is read/only. |
:discoverable |
Boolean indicating whether the room is discoverable (searchable). |
:copy-protected |
Boolean indicating whether the room is copy protected. |
:can-members-invite |
Boolean indicating whether members can invite others to the room. |
:keywords |
A map containing ‘keywords’ (key/value pairs, both of which must be strings) for the room. |
:name
is mandatory (it must be present and cannot be nil
).
remove-user-from-room!
(remove-user-from-room! c r u)
Remove a user (either identified as per clj-symphony.user/user-id, or using an email address) from the given room.
remove-users-from-room!
(remove-users-from-room! c r u)
Remove all of the provided users (identified as per clj-symphony.user/user-id, or using an email address) from the given room.
room
(room c r)
Returns the given room as a map (see roomobj->map for details), or nil
if the room doesn’t exist. r
can be anything supported by roomobj.
room-members
(room-members c r)
Returns all users participating in the given room, as a sequence of maps (see clj-symphony.user/userobj->map for details on the map structure).
roomobj
multimethod
(roomobj c r)
Returns an org.symphonyoss.symphony.clients.model.SymRoomDetail
object for the given room (as a stream id or map containing a :stream-id
). Returns nil
if the room doesn’t exist.
roomobj->map
(roomobj->map r)
Converts a org.symphonyoss.symphony.clients.model.SymRoomDetail
object into a map with these keys:
Key | Description |
---|---|
:stream-id |
The stream id of the room. |
:creation-date |
The creation date of the room. |
:created-by-user-id |
The user id of the user who created the room. |
:active |
A boolean indicating whether the room is active or not. |
:name |
The name of the room. |
:description |
The description of the room. |
:public |
A boolean indicating whether the room is public. |
:read-only |
A boolean indicating whether the room is read only. |
:discoverable |
A boolean indicating whether the room is discoverable (can be found via search). |
:copy-protected |
A boolean indicating whether the room is copy protected. |
:can-members-invite |
A boolean indicating whether members of the room can invite other users to the room. |
:keywords |
A map of ‘keywords’ (key/value pairs, both of which are strings) for the room. |
roomobjs
(roomobjs c)
Returns a lazy sequence containing all org.symphonyoss.symphony.clients.model.SymRoomDetail
objects for the authenticated connection user.
WARNING: this methods results in many calls to the server. Use with caution!
rooms
(rooms c)
Returns a lazy sequence containing all rooms (as maps) for the authenticated connection user.
WARNING: this methods results in many calls to the server. Use with caution!
update-room!
(update-room! c r)
Updates the details of an existing room (provided as a map), returning the updated room (as a map).
The new room details map may contain these keys (additional keys offered by create-roomobj! cannot be modified post-creation):
Key | Description |
---|---|
:stream-id |
The stream id of the room. |
:name |
The new name for the room. |
:description |
The new description of the room. |
:discoverable |
Boolean indicating whether the room is to become discoverable (searchable). |
:copy-protected |
Boolean indicating whether the room is to become copy protected. |
:can-members-invite |
Boolean indicating whether members will be allowed to invite others to the room. |
:keywords |
A map containing the new ‘keywords’ (key/value pairs, both of which must be strings) for the room. |
:stream-id
is mandatory (it must be present and cannot be nil
).