Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
docs/reference/user/connection.md {#RefConnection}
Types for connections between users.
Synopsis
- data UserConnection = UserConnection {}
- data UserConnectionList = UserConnectionList {
- clConnections :: [UserConnection]
- clHasMore :: Bool
- type ConnectionsPage = MultiTablePage "Connections" "connections" LocalOrRemoteTable UserConnection
- type ConnectionPagingState = MultiTablePagingState ConnectionPagingName LocalOrRemoteTable
- pattern ConnectionPagingState :: tables -> Maybe ByteString -> MultiTablePagingState name tables
- data Relation
- data RelationWithHistory
- = AcceptedWithHistory
- | BlockedWithHistory
- | PendingWithHistory
- | IgnoredWithHistory
- | SentWithHistory
- | CancelledWithHistory
- | MissingLegalholdConsentFromAccepted
- | MissingLegalholdConsentFromBlocked
- | MissingLegalholdConsentFromPending
- | MissingLegalholdConsentFromIgnored
- | MissingLegalholdConsentFromSent
- | MissingLegalholdConsentFromCancelled
- relationDropHistory :: RelationWithHistory -> Relation
- relationWithHistory :: Relation -> RelationWithHistory
- data ConnectionRequest = ConnectionRequest {}
- newtype ConnectionUpdate = ConnectionUpdate {}
- type ListConnectionsRequestPaginated = GetMultiTablePageRequest "Connections" LocalOrRemoteTable 500 100
UserConnection
data UserConnection Source #
Exact state of the connection between two users, stored in Brig database (see
lookupConnections
).
Connection states have a direction -- e.g. if A sends a connection request to B, we'll create connections (A, B, Sent) and (B, A, Pending).
UserConnection | |
|
Instances
data UserConnectionList Source #
Response type for endpoints returning lists of connections.
UserConnectionList | |
|
Instances
type ConnectionsPage = MultiTablePage "Connections" "connections" LocalOrRemoteTable UserConnection Source #
A page in response to ListConnectionsRequestPaginated
type ConnectionPagingState = MultiTablePagingState ConnectionPagingName LocalOrRemoteTable Source #
pattern ConnectionPagingState :: tables -> Maybe ByteString -> MultiTablePagingState name tables Source #
Possible relations between two users. For detailed descriptions of these states, see:
docs/reference/user/connection.md {#RefConnectionStates}
Accepted | |
Blocked | |
Pending | |
Ignored | |
Sent | |
Cancelled | |
MissingLegalholdConsent | behaves like blocked, the extra constructor is just to inform why. |
Instances
data RelationWithHistory Source #
updateConnectionInternal
, requires knowledge of the previous state (before
MissingLegalholdConsent
), but the clients don't need that information. To avoid having
to change the API, we introduce an internal variant of Relation
with surjective mapping
relationDropHistory
.
Instances
relationWithHistory :: Relation -> RelationWithHistory Source #
Convert a Relation
to RelationWithHistory
. This is to be used only if
the MissingLegalholdConsent case does not need to be supported.
Requests
data ConnectionRequest Source #
Payload type for a connection request from one user to another.
ConnectionRequest | |
|
Instances
newtype ConnectionUpdate Source #
Payload type for "please change the status of this connection".
Instances
type ListConnectionsRequestPaginated = GetMultiTablePageRequest "Connections" LocalOrRemoteTable 500 100 Source #
Request to get a paginated list of connection