iijlab / direct-hs

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

[RFC] Make sender user and talk room available with Channel #51

Closed igrep closed 5 years ago

igrep commented 5 years ago

Problem

Messages got from recv function doesn't have their sender users' ID and name. This makes it impossible to create a bot which collects users' information in a GroupTalk (e.g. a survey bot which can count users' answers in a GroupTalk).

Solution

Add TalkRoom and User to the return value of recv function for consistency with the arguments of directCreateMessageHandler.

Request for Comments

It might be better to make a new (record) type to represent the tuple of (Message, MessageId, TalkRoom, User), which is transferred by directCreateMessageHandler, recv, and dispatch. But I can't make up a good name and a structure.