-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Great invitations #4493
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
Open
sstrigler
wants to merge
2
commits into
processone:master
Choose a base branch
from
sstrigler:great_invitations
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+4,708
−40
Open
Great invitations #4493
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| -define(INVITE_TOKEN_EXPIRE_SECONDS_DEFAULT, 5*86400). | ||
| -define(INVITE_TOKEN_LENGTH_DEFAULT, 24). | ||
|
|
||
| -define(NS_INVITE_INVITE, <<"urn:xmpp:invite#invite">>). | ||
| -define(NS_INVITE_CREATE_ACCOUNT, <<"urn:xmpp:invite#create-account">>). | ||
|
|
||
| -record(invite_token, {token :: binary(), | ||
| inviter :: {binary(), binary()}, | ||
| %% A non-empty value if `invitee` indicates the invite has been used. | ||
| invitee = <<>> :: binary(), | ||
| created_at = calendar:now_to_datetime(erlang:timestamp()) :: calendar:datetime(), | ||
| expires = calendar:gregorian_seconds_to_datetime(calendar:datetime_to_gregorian_seconds(calendar:now_to_datetime(erlang:timestamp())) + ?INVITE_TOKEN_EXPIRE_SECONDS_DEFAULT) :: calendar:datetime(), | ||
| type = roster_only :: roster_only | account_only | account_subscription, | ||
| %% If type is 'roster_only' then we indicate a token has been used to create | ||
| %% an account (if allowed) by setting `account_name` to the name of the user | ||
| %% (which should match `invitee`). | ||
| account_name = <<>> :: binary() | ||
| }). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| <div class="container"> | ||
| <div class="row"> | ||
| {% for item in apps %} | ||
| <div class="card m-3 client-card {% for platform in item.platforms %}app-platform-{{ platform|lower }} {% endfor %} flex-wrap col-sm-12 col-md-8 col-lg-5"> | ||
| <div class="row no-gutters h-100"> | ||
| <div class="col-md-4"> | ||
| <img src="{{ static }}/{{ item.image }}" class="p-2 img-fluid" alt="{{ item.imagetext }}"> | ||
| </div> | ||
| <div class="col-md-8"> | ||
| <div class="card-body d-flex flex-column h-100"> | ||
| <h5 class="card-title text-nowrap mb-1">{{ item.name }}</h5> | ||
| <div> | ||
| {% for platform in item.platforms %}<span class="badge badge-info client-platform-badge client-platform-badge-{{ platform|lower }} mr-1 mb-3">{{ platform }}</span>{% endfor %} | ||
| </div> | ||
| <p class="card-text">{{ item.text }}</p> | ||
| <a href="{{ item.proceed_url }}" class="btn btn-primary mt-md-auto">{% if item.select_text %}{{ item.select_text }}{% else %}{% trans "Select" %}{% endif %}</a> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| {% endfor %} | ||
| </div> | ||
| </div> | ||
| <div id="show-all-clients-button-container" class="d-none alert alert-info"> | ||
| {% trans "Showing apps for <span class='platform-name'>your current platform</span> only. You may also <a href='#' id='show-all-clients-button'>view all apps.</a>" %} | ||
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,161 @@ | ||
| [ | ||
| { | ||
| "download": { | ||
| "buttons": [ | ||
| { | ||
| "image": "{{ static }}/logos/google_ps.png", | ||
| "url": "https://play.google.com/store/apps/details?id=eu.siacs.conversations", | ||
| "magic_link_format": "https://play.google.com/store/apps/details?id=eu.siacs.conversations&referrer={{ uri }}" | ||
| }, | ||
| { | ||
| "image": "{{ static }}/logos/fdroid.png", | ||
| "url": "https://f-droid.org/en/packages/eu.siacs.conversations/", | ||
| "magic_link_format": "https://f-droid.org/packages/eu.siacs.conversations/" | ||
| } | ||
| ] | ||
| }, | ||
| "image": "logos/conversations.svg", | ||
| "link": "https://play.google.com/store/apps/details?id=eu.siacs.conversations", | ||
| "magic_link_format": "https://play.google.com/store/apps/details?id=eu.siacs.conversations&referrer={{ uri }}", | ||
| "name": "Conversations", | ||
| "platforms": [ | ||
| "Android" | ||
| ], | ||
| "supports_preauth_uri": true, | ||
| "text": "{% trans "Conversations is a Jabber/XMPP client for Android 6.0+ smartphones that has been optimized to provide a unique mobile experience." %}" | ||
| }, | ||
| { | ||
| "download": { | ||
| "buttons": [ | ||
| { | ||
| "image": "{{ static }}/logos/apple_as.svg", | ||
| "target": "_blank", | ||
| "url": "https://apps.apple.com/app/id317711500" | ||
| } | ||
| ] | ||
| }, | ||
| "image": "logos/monal-tmp.svg", | ||
| "link": "https://monal-im.org/", | ||
| "name": "Monal", | ||
| "platforms": [ | ||
| "iOS", "iPadOS" | ||
| ], | ||
| "supports_preauth_uri": true, | ||
| "text": "{% trans "A modern open-source chat client for iPhone and iPad. It is easy to use and has a clean user interface." %}" | ||
| }, | ||
| { | ||
| "download": { | ||
| "buttons": [ | ||
| { | ||
| "image": "{{ static }}/logos/apple_as.svg", | ||
| "target": "_blank", | ||
| "url": "https://apps.apple.com/app/id1637078500" | ||
| } | ||
| ] | ||
| }, | ||
| "image": "logos/monal-tmp.svg", | ||
| "link": "https://monal-im.org/", | ||
| "name": "Monal (macOS)", | ||
| "platforms": [ | ||
| "macOS" | ||
| ], | ||
| "supports_preauth_uri": true, | ||
| "text": "{% trans "A modern open-source chat client for Mac. It is easy to use and has a clean user interface." %}" | ||
| }, | ||
| { | ||
| "download": { | ||
| "buttons": [ | ||
| { | ||
| "image": "{{ static }}/logos/apple_as.svg", | ||
| "target": "_blank", | ||
| "url": "https://apps.apple.com/us/app/siskin-im/id1153516838" | ||
| } | ||
| ] | ||
| }, | ||
| "image": "logos/siskin-im.svg", | ||
| "link": "https://apps.apple.com/us/app/siskin-im/id1153516838", | ||
| "name": "Siskin IM", | ||
| "platforms": [ | ||
| "iOS", "iPadOS" | ||
| ], | ||
| "supports_preauth_uri": true, | ||
| "text": "{% trans "A lightweight and powerful XMPP client for iPhone and iPad. It provides an easy way to talk and share moments with your friends." %}" | ||
| }, | ||
| { | ||
| "download": { | ||
| "buttons": [ | ||
| { | ||
| "target": "_blank", | ||
| "text": "{% trans "Download from Mac App Store" %}", | ||
| "url": "https://apps.apple.com/us/app/beagle-im/id1445349494" | ||
| } | ||
| ] | ||
| }, | ||
| "image": "logos/beagle-im.svg", | ||
| "link": "https://apps.apple.com/us/app/beagle-im/id1445349494", | ||
| "name": "Beagle IM", | ||
| "platforms": [ | ||
| "macOS" | ||
| ], | ||
| "setup": { | ||
| "text": "{% trans "Launch Beagle IM, and select 'Yes' to add a new account. Click the '+' button under the empty account list and then enter your credentials." %}" | ||
| }, | ||
| "text": "{% trans "Beagle IM by Tigase, Inc. is a lightweight and powerful XMPP client for macOS." %}" | ||
| }, | ||
| { | ||
| "download": { | ||
| "buttons": [ | ||
| { | ||
| "target": "_blank", | ||
| "text": "{% trans "Download Dino for Linux" %}", | ||
| "url": "https://dino.im/#download" | ||
| } | ||
| ], | ||
| "text": "{% trans "Click the button to open the Dino website where you can download and install it on your PC." %}" | ||
| }, | ||
| "image": "logos/dino.svg", | ||
| "link": "https://dino.im/", | ||
| "name": "Dino", | ||
| "platforms": [ | ||
| "Linux" | ||
| ], | ||
| "text": "{% trans "A modern open-source chat client for the desktop. It focuses on providing a clean and reliable Jabber/XMPP experience while having your privacy in mind." %}" | ||
| }, | ||
| { | ||
| "download": { | ||
| "buttons": [ | ||
| { | ||
| "target": "_blank", | ||
| "text": "{% trans "Download Gajim" %}", | ||
| "url": "https://gajim.org/download/" | ||
| } | ||
| ] | ||
| }, | ||
| "image": "logos/gajim.svg", | ||
| "link": "https://gajim.org/", | ||
| "name": "Gajim", | ||
| "platforms": [ | ||
| "Windows", | ||
| "Linux" | ||
| ], | ||
| "text": "{% trans "A fully-featured desktop chat client for Windows and Linux." %}" | ||
| }, | ||
| { | ||
| "download": { | ||
| "buttons": [ | ||
| { | ||
| "target": "_blank", | ||
| "text": "{% trans "Download Renga for Haiku" %}", | ||
| "url": "https://depot.haiku-os.org/#!/pkg/renga?bcguid=bc233-PQIA" | ||
| } | ||
| ] | ||
| }, | ||
| "image": "logos/renga.svg", | ||
| "link": "https://pulkomandy.tk/projects/renga", | ||
| "name": "Renga", | ||
| "platforms": [ | ||
| "Haiku" | ||
| ], | ||
| "text": "{% trans "XMPP client for Haiku" %}" | ||
| } | ||
| ] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| {% extends "base_min.html" %} | ||
|
|
||
| {% block rel_alternate %} | ||
| <link rel="alternate" href="{{ uri }}"> | ||
| {% endblock %} | ||
|
|
||
| {% block qr_button %} | ||
| <div id="qr-button-container" class="float-right w-25 border border-info p-3 d-none"> | ||
| {% trans "<strong>Tip:</strong> You can open this invite on your mobile device by scanning a barcode with your camera." %} | ||
| <button id="qr-modal-show" class="mt-2 d-block btn btn-info" title="{% trans "Send this invite to your device" %}" | ||
| data-toggle="modal" data-target="#qr-modal"> | ||
| <img src="{{ static }}/qr-logo.png" alt="{% trans "QR code icon" %}" class="align-middle h-50 mt-1" style="display:inline" > | ||
| {% trans "Scan with mobile device" %} | ||
| </button> | ||
| </div> | ||
| {% endblock %} | ||
|
|
||
| {% block qr_code %} | ||
| <div class="modal" tabindex="-1" role="dialog" id="qr-modal"> | ||
| <div class="modal-dialog" role="document"> | ||
| <div class="modal-content"> | ||
| <div class="modal-header"> | ||
| <h5 class="modal-title">{% trans "Scan invite code" %}</h5> | ||
| <button type="button" class="close" data-dismiss="modal" aria-label="Close"> | ||
| <span aria-hidden="true">×</span> | ||
| </button> | ||
| </div> | ||
| <div class="modal-body"> | ||
| <p>{% trans "You can transfer this invite to your mobile device by scanning a code with your camera." %}</p> | ||
| <div id="qr-info-url" class="tab-pane show active"> | ||
| <p>{% trans "Use a <em>QR code</em> scanner on your mobile device to scan the code below:" %}</p> | ||
| <div id="qr-invite-page" style="width: 256px;" class="bg-light mx-auto"></div> | ||
| </div> | ||
| </div> | ||
| <div class="modal-footer"> | ||
| <button type="button" class="btn btn-primary" data-dismiss="modal">{% trans "Close" %}</button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| {% endblock %} | ||
|
|
||
| {% block extra_scripts %} | ||
| <script src="{{ static }}/qrcode.min.js"></script> | ||
| <script src="{{ static }}/platform.min.js"></script> | ||
| <script src="{{ static }}/invite.js"></script> | ||
| {% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <meta charset="utf-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <title>{% block title %}{% blocktrans %}Invite to {{ site_name }}{% endblocktrans %}{% endblock %}</title> | ||
| {% block rel_alternate %}{% endblock %} | ||
| <link rel="stylesheet" href="/share/bootstrap4/css/bootstrap.min.css"> | ||
| <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"> | ||
| <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"> | ||
| <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"> | ||
| <link rel="manifest" href="/site.webmanifest"> | ||
| <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"> | ||
| <meta name="msapplication-TileColor" content="#fbd308"> | ||
| <meta name="theme-color" content="#fbd308"> | ||
| </head> | ||
| <body> | ||
| <div id="background" class="fixed-top overflow-hidden"></div> | ||
| <div id="form" class="{% block form_class %}container col-md-10 col-md-offset-1 col-sm-8 col-sm-offset-2 col-lg-10 col-lg-offset-1 mt-2 mt-md-5{% endblock %}"> | ||
| <div class="card rounded-lg shadow"> | ||
| <h1 class="card-header rounded-lg rounded-lg"> | ||
| {%block h1 %}{% blocktrans %}Invite to {{ site_name }}{% endblocktrans %}{% endblock %}<br/> | ||
| </h1> | ||
| <div class="card-body"> | ||
| {% block qr_button %}{% endblock %} | ||
| {% block content %}{% endblock %} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| {% block qr_code %}{% endblock %} | ||
| {% block extra_scripts %}{% endblock %} | ||
| <script src="/share/jquery/jquery.min.js"></script> | ||
| <script src="/share/bootstrap4/js/bootstrap.min.js"></script> | ||
| </body> | ||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| {% extends "base.html" %} | ||
|
|
||
| {% block h1 %} | ||
| {% blocktrans with app_name=app.name %}Join {{ site_name }} with {{ app_name }}{% endblocktrans %} | ||
| {% endblock %} | ||
|
|
||
| {% block content %} | ||
| <p>{% if invite.inviter|user %} | ||
| {% blocktrans with inviter=invite.inviter|user %}You have been invited to chat with <strong>{{ inviter }}</strong> on {{ site_name }}, part of the XMPP secure and decentralized messaging network.{% endblocktrans %} | ||
| {% else %} | ||
| {% blocktrans %}You have been invited to chat on {{ site_name }}, part of the XMPP secure and decentralized messaging network.{% endblocktrans %} | ||
| {% endif %} | ||
| </p> | ||
|
|
||
| <p>{% blocktrans with app_name=app.name %}You can start chatting right away with {{ app_name }}. Let's get started!{% endblocktrans %}</p> | ||
|
|
||
| <div class="card m-3 client-card {% for item in app.platforms %}app-platform-{{ item|lower }} {% endfor %} flex-wrap col-sm-12 col-md-8 col-lg-5"> | ||
| <div class="row no-gutters h-100"> | ||
| <div class="col-md-4"> | ||
| <img src="{{ static }}/{{ app.image }}" class="p-2 img-fluid" alt="{{ app.imagetext }}"> | ||
| </div> | ||
| <div class="col-md-8 h-100"> | ||
| <div class="card-body d-flex flex-column h-100"> | ||
| <h5 class="card-title text-nowrap mb-1">{{ app.name }}</h5> | ||
| <div> | ||
| {% for item in app.platforms %}<span class="badge badge-info client-platform-badge client-platform-badge-{{ item|lower }} mr-1 mb-3">{{ item }}</span> {% endfor %} | ||
| </div> | ||
| <p class="card-text">{{ app.text }}</p> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <h3 style="clear:both">{% blocktrans with app_name=app.name %}Step 1: Install {{ app_name }}{% endblocktrans %}</h3> | ||
|
|
||
| <p>{% if app.download.text %}{{ app.download.text }}{% else %}{% blocktrans with app_name=app.name %}Download and install {{ app_name }} below:{% endblocktrans %}{% endif %}</p> | ||
|
|
||
| <div class="ml-5"> | ||
| {% for button in app.download.buttons %} | ||
| {% if button.image %} | ||
| <a href="{% if button.magic_link %}{{ button.magic_link }}{% else %}{{ button.url }}{% endif %}" {% if button.target %}target="{{ button.target }}"{% endif %} rel="noopener"> | ||
| <img src="{{ button.image }}" {% if button.alttext %}alt="{{ button.alttext }}"{% endif %} style="max-width: 160px;"> | ||
| </a> | ||
| {% endif %} | ||
| {% if button.text %} | ||
| <a href="{{ button.url }}" {% if button.target %}target="{{ button.target }}"{% endif %} class="btn btn-primary" rel="noopener"> | ||
| {{ button.text }} | ||
| </a> | ||
| {% endif %} | ||
| {% endfor %} | ||
| </div> | ||
|
|
||
| <p class="mt-3">{% blocktrans with app_name=app.name %}After successfully installing {{ app_name }}, come back to this page and <strong>continue with Step 2</strong>.{% endblocktrans %}</p> | ||
|
|
||
| <h3>{% trans "Step 2: Activate your account" %}</h3> | ||
|
|
||
| <p>{% trans "Installed ok? Great! <strong>Click or tap the button below</strong> to accept your invite and continue with your account setup:" %}</p> | ||
|
|
||
| <div> | ||
| <a href="{{ uri }}" id="uri-cta" class="btn btn-primary ml-5 mt-1 mb-3">{% blocktrans with app_name=app.name %}Accept invite using {{ app_name }}{% endblocktrans %}</a><br/> | ||
| </div> | ||
|
|
||
| <p>{% blocktrans with app_name=app.name %}After clicking the button you will be taken to {{ app_name }} to finish setting up your new {{ site_name }} account.{% endblocktrans %}</p> | ||
| {% endblock %} | ||
|
|
||
| {% block extra_scripts %} | ||
| <script src="{{ static }}/qrcode.min.js"></script> | ||
| <script src="{{ static }}/platform.min.js"></script> | ||
| <script src="{{ static }}/invite.js"></script> | ||
| {% endblock %} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.