Closed yotsuya closed 5 years ago
The initial design of PR was changed by the above discussion. So, I summarized the changes again.
data Client
clientMe
: data type changed from Maybe User
to User
clientUsers
: removedclientAcquaintances
: :new: [User]
for acquaintance users (retrieved by get_acquaintances
)data TalkRoom
talkUsers
: removedtalkUserIds
: [UserId]
for talk room membersdata Channel
channelTalkRoom
: removedBefore | After | |
---|---|---|
getMe | Client -> IO (Maybe User) | Client -> IO User |
setAcquaintances | - | :new: Client -> [User] -> IO () |
getAcquaintances | - | :new: Client -> IO [User] |
setUsers | Client -> [User] -> IO () | :no_entry: removed |
talkUsers | TalkRoom -> [User] | :no_entry: removed |
getTalkUsers | - | :new: Client -> TalkRoom -> IO Users |
channelTalkRoom | Channel -> TalkRoom | :no_entry: removed |
This PR modifies some data types to reduce data redundancy. The purpose of this PR is to make it easy to maintain the integrity of data when handling notifications.
Changes (UPDATE: see https://github.com/iij-ii/direct-hs/pull/62#issuecomment-440606390)
Implementation
data Users
User
instead of just[User]
.myself
:User
for the logged-in useracquaintances
:[User]
for other usersdata Client
clientMe
: removedclientUsers
holdsme
(asmyself
)clientUsers
: data type changed from[User]
toUsers
data TalkRoom
talkUsers
: removedtalkUserIds
:[UserId]
for talk room membersdata Channel
channelTalkRoom
: removedInterfaces