[FIX] Join discussion (#1000)
This commit is contained in:
parent
1383b9b735
commit
e52739e305
|
@ -447,9 +447,12 @@ const RocketChat = {
|
||||||
// RC 0.59.0
|
// RC 0.59.0
|
||||||
return this.sdk.post('im.create', { username });
|
return this.sdk.post('im.create', { username });
|
||||||
},
|
},
|
||||||
joinRoom(roomId) {
|
joinRoom(roomId, type) {
|
||||||
// TODO: join code
|
// TODO: join code
|
||||||
// RC 0.48.0
|
// RC 0.48.0
|
||||||
|
if (type === 'p') {
|
||||||
|
return this.sdk.methodCall('joinRoom', roomId);
|
||||||
|
}
|
||||||
return this.sdk.post('channels.join', { roomId });
|
return this.sdk.post('channels.join', { roomId });
|
||||||
},
|
},
|
||||||
sendFileMessage,
|
sendFileMessage,
|
||||||
|
|
|
@ -437,12 +437,10 @@ export default class RoomView extends React.Component {
|
||||||
|
|
||||||
joinRoom = async() => {
|
joinRoom = async() => {
|
||||||
try {
|
try {
|
||||||
const result = await RocketChat.joinRoom(this.rid);
|
await RocketChat.joinRoom(this.rid, this.t);
|
||||||
if (result.success) {
|
|
||||||
this.internalSetState({
|
this.internalSetState({
|
||||||
joined: true
|
joined: true
|
||||||
});
|
});
|
||||||
}
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('err_join_room', e);
|
log('err_join_room', e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue