Skip to content

Commit

Permalink
Merge pull request #146 from ssb-ngi-pointer/fix-label-invite
Browse files Browse the repository at this point in the history
fix invite QR code
  • Loading branch information
staltz authored Apr 15, 2021
2 parents 908f082 + ed5a7f6 commit ab0d6ed
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
9 changes: 8 additions & 1 deletion web/handlers/invites.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,14 @@ func (h inviteHandler) presentFacade(rw http.ResponseWriter, req *http.Request)
fallbackURL := urlTo(router.CompleteInviteFacadeFallback, "token", token)

// generate a QR code with the token inside so that you can open it easily in a supporting mobile app
qrCode, err := qrcode.New(string(joinRoomURI), qrcode.Medium)
thisURL := req.URL
thisURL.Host = h.networkInfo.Domain
thisURL.Scheme = "https"
if h.networkInfo.Development {
thisURL.Scheme = "http"
thisURL.Host += fmt.Sprintf(":%d", h.networkInfo.PortHTTPS)
}
qrCode, err := qrcode.New(thisURL.String(), qrcode.Medium)
if err != nil {
return nil, err
}
Expand Down
1 change: 1 addition & 0 deletions web/i18n/defaults/active.en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ InviteFacadeWelcome = "You have permission to become a member of this room becau
InviteFacadeInstruct = "To claim the invite, press the button below which will open a compatible SSB app, if it's installed."
InviteFacadeJoin = "Join this room"
InviteFacadeWaiting = "Opening SSB app"
InviteFacadeInstructQR = "If your SSB app is on another device, you can scan the following QR code to claim your invite on that device:"

InviteFacadeFallbackWelcome = "Are you new to SSB? It seems you don't have an SSB app capable of understanding that link. You can install one of these apps:"
InviteFacadeFallbackManyverse = "Install Manyverse"
Expand Down
2 changes: 1 addition & 1 deletion web/templates/invite/facade.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<hr class="mt-8 w-64 h-px bg-gray-200"></hr>

<span class="text-center mt-8">{{i18n "AuthWithSSBInstructQR"}}</span>
<span class="text-center mt-8">{{i18n "InviteFacadeInstructQR"}}</span>

<img
id="start-auth-qrcode"
Expand Down

0 comments on commit ab0d6ed

Please sign in to comment.