Skip to content

Commit

Permalink
Post the already created authmessage on failed connection when using …
Browse files Browse the repository at this point in the history
…the header icon (#138)
  • Loading branch information
larkox authored Jun 25, 2020
1 parent 46c2424 commit 9f45447
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions server/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ func (p *Plugin) handleStartMeeting(w http.ResponseWriter, r *http.Request) {
if err != nil {
p.API.LogWarn("failed to write response", "error", err.Error())
}
p.postConnect(req.ChannelID, userID)
p.postAuthenticationMessage(req.ChannelID, userID, authErr.Message)
return
}

Expand Down Expand Up @@ -440,15 +440,11 @@ func (p *Plugin) postConfirm(meetingID int, channelID string, topic string, user
return p.API.SendEphemeralPost(userID, post)
}

func (p *Plugin) postConnect(channelID string, userID string) *model.Post {
oauthMsg := fmt.Sprintf(
zoomOAuthMessage,
*p.API.GetConfig().ServiceSettings.SiteURL, channelID)

func (p *Plugin) postAuthenticationMessage(channelID string, userID string, message string) *model.Post {
post := &model.Post{
UserId: p.botUserID,
ChannelId: channelID,
Message: oauthMsg,
Message: message,
}

return p.API.SendEphemeralPost(userID, post)
Expand Down

0 comments on commit 9f45447

Please sign in to comment.