Skip to content

Commit

Permalink
Merge pull request #209 from blindsidenetworks/url-fix
Browse files Browse the repository at this point in the history
Fixed a bug where meeting end callback won't work
  • Loading branch information
harshilsharma63 authored Feb 17, 2022
2 parents e286325 + 34171d1 commit 0062a2d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion server/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (p *Plugin) PopulateMeeting(

var UrlEnd *url.URL
UrlEnd, _ = url.Parse(callbackURL)
UrlEnd.Path += "/plugins/bigbluebutton/meetingendedcallback?" + m.MeetingID_ + "&" + m.ValidToken
UrlEnd.Path += "/plugins/bigbluebutton/meetingendedcallback/" + m.MeetingID_ + "/" + m.ValidToken
Endmeetingcallback := UrlEnd.String()
m.Meta_endcallbackurl = Endmeetingcallback

Expand Down
16 changes: 11 additions & 5 deletions server/responsehandlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,11 +566,17 @@ func (p *Plugin) handleJoinMeetingExternalUser(w http.ResponseWriter, r *http.Re
// this method is responsible for updating meeting has ended inside mattermost when
// we end our meeting from inside BigBlueButton.
func (p *Plugin) handleImmediateEndMeetingCallback(w http.ResponseWriter, r *http.Request) {
startpoint := len("/meetingendedcallback?")
path := r.URL.Path
endpoint := strings.Index(path, "&")
meetingid := path[startpoint:endpoint]
validation := path[endpoint+1:]
pathComponents := strings.Split(r.URL.Path, "/")

if len(pathComponents) != 4 {
p.API.LogError("incorrect meeting end callback URL encountered. URL: " + r.URL.String())
http.Error(w, "incorrect meeting end callback URL encountered", http.StatusInternalServerError)
return
}

validation := pathComponents[len(pathComponents)-1]
meetingid := pathComponents[len(pathComponents)-2]

meetingpointer := p.FindMeeting(meetingid)
if meetingpointer == nil || meetingpointer.ValidToken != validation {
http.Error(w, "Validation token mismatch", http.StatusForbidden)
Expand Down
1 change: 0 additions & 1 deletion webapp/components/incoming_call/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ function mapDispatchTooProps(dispatch) {
function mapStateToProps(state, ownProps) {
const pluginState = getPluginState(state);
return {
show: pluginState.incomingCall.dismissed === false,
theme: getTheme(state),
siteURL: state.entities.general.config.SiteURL,
currentTeam: getTeam(state, getCurrentTeamId(state)),
Expand Down

0 comments on commit 0062a2d

Please sign in to comment.