Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a settings to control URL substitution #57

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<companyname>.my.webex.com` or `<companyname>.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

Expand Down
7 changes: 7 additions & 0 deletions plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
}
Expand Down
2 changes: 2 additions & 0 deletions server/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions server/meeting.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down