diff --git a/README.md b/README.md index f88d235..4d630ed 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,8 @@ Go to Settings --> Scroll down to the Plugins section, and click on Webex Plugin Insert the Webex Meetings URL for your organization. It is often in the format of `.my.webex.com` or `.webex.com`. +Depending on your situation, you will want to disable the URL conversion (known unsupported on some case with Linux clients). + ## Usage Easily start and join Webex meetings directly from Mattermost diff --git a/plugin.json b/plugin.json index f217ab0..cbe930e 100644 --- a/plugin.json +++ b/plugin.json @@ -30,6 +30,13 @@ "help_text": "The hostname for your team's Webex site. For example: teamsite.webex.com.", "placeholder": "teamsite.webex.com", "default": null + }, + { + "key": "UrlConversion", + "display_name": "Convert Webex URLs:", + "type": "bool", + "help_text": "Enable or disable the conversion of URL: replace /meet/ by /join/ or /start/.", + "default": true } ] } diff --git a/server/configuration.go b/server/configuration.go index 3cd25b2..0f3e926 100644 --- a/server/configuration.go +++ b/server/configuration.go @@ -28,6 +28,8 @@ import ( type configuration struct { SiteHost string `json:"sitehost"` + URLConversion bool `json:"url_conversion"` + // siteName is the SiteHost up to .webex.com // Eg., for testsite.my.webex.com, siteName would be: testsite.my siteName string diff --git a/server/http_test.go b/server/http_test.go index d4c7276..6aa9fba 100644 --- a/server/http_test.go +++ b/server/http_test.go @@ -184,8 +184,9 @@ func TestPlugin(t *testing.T) { p := Plugin{} p.setConfiguration(&configuration{ - SiteHost: tc.SiteHost, - siteName: parseSiteNameFromSiteHost(tc.SiteHost), + SiteHost: tc.SiteHost, + siteName: parseSiteNameFromSiteHost(tc.SiteHost), + URLConversion: true, }) p.SetAPI(api) diff --git a/server/meeting.go b/server/meeting.go index a04488b..3b74d01 100644 --- a/server/meeting.go +++ b/server/meeting.go @@ -73,11 +73,19 @@ func (p *Plugin) startMeetingFromRoomURL(details meetingDetails) (*meetingPosts, } func (p *Plugin) makeJoinURL(meetingURL string) string { - return strings.Replace(meetingURL, "webex.com/meet/", "webex.com/join/", 1) + if p.getConfiguration().URLConversion { + meetingURL = strings.Replace(meetingURL, "webex.com/meet/", "webex.com/join/", 1) + } + + return meetingURL } func (p *Plugin) makeStartURL(meetingURL string) string { - return strings.Replace(meetingURL, "webex.com/meet/", "webex.com/start/", 1) + if p.getConfiguration().URLConversion { + meetingURL = strings.Replace(meetingURL, "webex.com/meet/", "webex.com/start/", 1) + } + + return meetingURL } func (p *Plugin) getURLFromRoomID(roomID string) (string, error) {