SkygearIO / chat

Skygear Plugin - Chat SDK
Apache License 2.0
17 stars 18 forks source link

Should allow create conversation with user record and id #236

Closed carmenlau closed 5 years ago

carmenlau commented 5 years ago

Expected Results

In js sdk, user should be able to create chat with user record or id, so all of the following call should be valid.

await skygearChat.createDirectConversation(user._id, null)
await skygearChat.createDirectConversation(user, null)
await skygearChat.createDirectConversation(user.id, null)

Actual Results

Example

To test it in js:

const user = (await skygear.publicDB.query(new skygear.Query(skygear.UserRecord).contains('username', ['user1'])))[0]
await skygearChat.createDirectConversation(user, null)