matterhorn-50200.11.0: Terminal client for the Mattermost chat system

Safe HaskellNone
LanguageHaskell2010

Matterhorn.Types.Users

Contents

Synopsis

Documentation

data UserInfo Source #

A UserInfo value represents everything we need to know at runtime about a user

Instances
Eq UserInfo Source # 
Instance details

Defined in Matterhorn.Types.Users

Show UserInfo Source # 
Instance details

Defined in Matterhorn.Types.Users

data UserStatus Source #

The UserStatus value represents possible current status for a user

Instances
Eq UserStatus Source # 
Instance details

Defined in Matterhorn.Types.Users

Show UserStatus Source # 
Instance details

Defined in Matterhorn.Types.Users

type Users = AllMyUsers UserInfo Source #

Define the exported typename which universally binds the collection to the UserInfo type.

Lenses created for accessing UserInfo fields

Various operations on UserInfo

Creating UserInfo objects

userInfoFromUser :: User -> Bool -> UserInfo Source #

Create a UserInfo value from a Mattermost User value

Miscellaneous

findUserById :: UserId -> Users -> Maybe UserInfo Source #

Get the User information given the UserId

findUserByUsername :: Text -> Users -> Maybe (UserId, UserInfo) Source #

Get the User information given the user's name. This is an exact match on the username field. It will automatically trim a user sigil from the input.

findUserByNickname :: Text -> Users -> Maybe (UserId, UserInfo) Source #

Get the User information given the user's name. This is an exact match on the nickname field, not necessarily the presented name. It will automatically trim a user sigil from the input.

noUsers :: Users Source #

Initial collection of Users with no members

addUser :: UserInfo -> Users -> Users Source #

Add a member to the existing collection of Users

allUsers :: Users -> [UserInfo] Source #

Get a list of all known users

modifyUserById :: UserId -> (UserInfo -> UserInfo) -> Users -> Users Source #

Extract a specific user from the collection and perform an endomorphism operation on it, then put it back into the collection.

userDeleted :: User -> Bool Source #

Is this user deleted?

type TypingUsers = AllMyUsers (Max UTCTime) Source #

Define the exported typename to represent the collection of users | who are currently typing. The values kept against the user id keys are the | latest timestamps of typing events from the server.

noTypingUsers :: TypingUsers Source #

Initial collection of TypingUsers with no members

addTypingUser :: UserId -> UTCTime -> TypingUsers -> TypingUsers Source #

Add a member to the existing collection of TypingUsers

allTypingUsers :: TypingUsers -> [UserId] Source #

Get a list of all typing users

expireTypingUsers :: UTCTime -> TypingUsers -> TypingUsers Source #

Remove all the expired users from the collection of TypingUsers. | Expiry is decided by the given timestamp.