[FIX] Direct Message between multiple users REST (#1974)
This commit is contained in:
parent
df0a38566b
commit
d810c28c30
|
@ -627,11 +627,11 @@ const RocketChat = {
|
||||||
},
|
},
|
||||||
|
|
||||||
createGroupChat() {
|
createGroupChat() {
|
||||||
let { users } = reduxStore.getState().selectedUsers;
|
const { users } = reduxStore.getState().selectedUsers;
|
||||||
users = users.map(u => u.name);
|
const usernames = users.map(u => u.name).join(',');
|
||||||
|
|
||||||
// RC 3.1.0
|
// RC 3.1.0
|
||||||
return this.methodCall('createDirectMessage', ...users);
|
return this.post('im.create', { usernames });
|
||||||
},
|
},
|
||||||
|
|
||||||
createDiscussion({
|
createDiscussion({
|
||||||
|
|
|
@ -28,7 +28,10 @@ const handleRequest = function* handleRequest({ data }) {
|
||||||
|
|
||||||
let sub;
|
let sub;
|
||||||
if (data.group) {
|
if (data.group) {
|
||||||
sub = yield call(createGroupChat);
|
const result = yield call(createGroupChat);
|
||||||
|
if (result.success) {
|
||||||
|
({ room: sub } = result);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
sub = yield call(createChannel, data);
|
sub = yield call(createChannel, data);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue