[FIX] Direct Message between multiple users REST (#1974)

This commit is contained in:
Djorkaeff Alexandre 2020-04-03 15:02:10 -03:00 committed by GitHub
parent df0a38566b
commit d810c28c30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -627,11 +627,11 @@ const RocketChat = {
},
createGroupChat() {
let { users } = reduxStore.getState().selectedUsers;
users = users.map(u => u.name);
const { users } = reduxStore.getState().selectedUsers;
const usernames = users.map(u => u.name).join(',');
// RC 3.1.0
return this.methodCall('createDirectMessage', ...users);
return this.post('im.create', { usernames });
},
createDiscussion({

View File

@ -28,7 +28,10 @@ const handleRequest = function* handleRequest({ data }) {
let sub;
if (data.group) {
sub = yield call(createGroupChat);
const result = yield call(createGroupChat);
if (result.success) {
({ room: sub } = result);
}
} else {
sub = yield call(createChannel, data);
}