iijlab / direct-hs

Client library for https://direct4b.com in Haskell
8 stars 1 forks source link

Support multi domains #57

Closed yotsuya closed 6 years ago

yotsuya commented 6 years ago

This PR fixes the behavior of Web.Direct.getUsers and Web.Direct.getTalkRooms when the loggeed-in user belongs to multiple domains.

As-Is

To-Be

TODO

direct4b get

To check the above fixes, I added get sub command to direct4b command.

Usage:

direct4b get domains       # print domain list
direct4b get users         # print user list of current domain
direct4b get talks         # print talk room list of current domain
igrep commented 6 years ago

Nice description. 👍 Easy to get your intention!

To-Be

  • getUsers returns a list of acquaintances of the current domain. The head of the list should be me.
  • getTalkRooms returns a list of TalkRoom of the current domain. Their talkUsers should be a list of all members of the talk.

But I have one question: actually these new behaviors are implemented as separate functions: retrieveUsers, retrieveTalkRooms, right?

yotsuya commented 6 years ago

Nice description. 👍 Easy to get your intention!

Thanks! 😊

  • getUsers returns a list of acquaintances of the current domain. The head of the list should be me.
  • getTalkRooms returns a list of TalkRoom of the current domain. Their talkUsers should be a list of all members of the talk.

But I have one question: actually these new behaviors are implemented as separate functions: retrieveUsers, retrieveTalkRooms, right?

Are you saying that the behavior of getUsers/TalkRooms are still not changed? You can confirm that these new behaviors by running direct4b get users/talks. These commands are using getUsers/TalkRooms. retreiveUsers/TalkRooms are helper functions to update users/talks of Client when setCurrentDomain called. So, I'm planning move these codes to other module.

igrep commented 6 years ago

Are you saying that the behavior of getUsers/TalkRooms are still not changed?

Sorry, I've misunderstood.

yotsuya commented 6 years ago

I added some fixes for feedback.

I'd appriciate it if you would review again. 🙏