diff --git a/server/http.go b/server/http.go index 6850ce65..570afc1e 100644 --- a/server/http.go +++ b/server/http.go @@ -46,9 +46,7 @@ const ( type startMeetingRequest struct { ChannelID string `json:"channel_id"` RootID string `json:"root_id"` - Personal bool `json:"personal"` Topic string `json:"topic"` - MeetingID int `json:"meeting_id"` UsePMI string `json:"use_pmi"` } @@ -548,7 +546,7 @@ func (p *Plugin) handleStartMeeting(w http.ResponseWriter, r *http.Request) { } } - if err = p.postMeeting(user, meetingID, req.ChannelID, "", topic); err != nil { + if err = p.postMeeting(user, meetingID, req.ChannelID, req.RootID, topic); err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return } diff --git a/webapp/src/actions/index.js b/webapp/src/actions/index.js index 5a713c3e..83d2428b 100644 --- a/webapp/src/actions/index.js +++ b/webapp/src/actions/index.js @@ -5,19 +5,10 @@ import {PostTypes} from 'mattermost-redux/action_types'; import Client from '../client'; -export function startMeeting(channelId, rootId, force = false, topic = '') { +export function startMeeting(channelId, rootId = '', force = false, topic = '') { return async (dispatch, getState) => { try { - let meetingURL = ''; - if (force) { - meetingURL = await Client.forceStartMeeting( - channelId, true, '', 0, topic, - ); - } else { - meetingURL = await Client.startMeeting( - channelId, true, '', 0, false, topic, - ); - } + const meetingURL = await Client.startMeeting(channelId, rootId, topic, force); if (meetingURL) { window.open(meetingURL); } diff --git a/webapp/src/client/client.js b/webapp/src/client/client.js index 4258d2e9..1a76564f 100644 --- a/webapp/src/client/client.js +++ b/webapp/src/client/client.js @@ -11,24 +11,16 @@ export default class Client { this.url = url + '/plugins/' + id; } - startMeeting = async ( - channelId, personal = true, topic = '', meetingId = 0, force = false, - ) => { + startMeeting = async (channelId, rootId, topic = '', force = false) => { const res = await doPost(`${this.url}/api/v1/meetings${force ? '?force=true' : ''}`, { channel_id: channelId, - personal, topic, - meeting_id: meetingId, + root_id: rootId, }); return res.meeting_url; } - forceStartMeeting = async (channelId, rootId, personal = true, topic = '', meetingId = 0) => { - const meetingUrl = await this.startMeeting(channelId, rootId, personal, topic, meetingId, true); - return meetingUrl; - } - getChannelIdForThread = async (baseURL, threadId) => { const threadDetails = await doGet(`${baseURL}/api/v4/posts/${threadId}/thread`); return threadDetails.posts[threadId].channel_id; diff --git a/webapp/src/components/post_type_zoom/post_type_zoom.jsx b/webapp/src/components/post_type_zoom/post_type_zoom.jsx index 8ff40c71..44addb5c 100644 --- a/webapp/src/components/post_type_zoom/post_type_zoom.jsx +++ b/webapp/src/components/post_type_zoom/post_type_zoom.jsx @@ -177,7 +177,7 @@ export default class PostTypeZoom extends React.PureComponent { className='btn btn-lg btn-primary' style={style.button} rel='noopener noreferrer' - onClick={() => this.props.actions.startMeeting(this.props.currentChannelId, true, props.meeting_topic)} + onClick={() => this.props.actions.startMeeting(this.props.currentChannelId, '', true, props.meeting_topic)} > {'CREATE NEW MEETING'}