Allow specifying a full JID

This commit is contained in:
pitchum 2021-07-23 10:09:35 +02:00 committed by root
parent a31ee0fd38
commit 2747e3f502
2 changed files with 10 additions and 4 deletions

View File

@ -87,7 +87,7 @@ img.app, img.store {
<article>
<h1>J'ai déménagé&nbsp;!</h1>
<p>Je suis désormais joignable pour tchatter sur le réseau indépendant Jabber/XMPP.</p>
<p>Mon adresse XMPP&nbsp;: <strong>{{username}}@chapril.org</strong></p>
<p>Mon adresse XMPP&nbsp;: <strong>{{user_jid}}</strong></p>
<u>Pour me joindre&nbsp;:</u><br/>
<p>1) Installe une appli Jabber/XMPP et crée-toi un compte</p>
<ul id="downloads">
@ -170,7 +170,7 @@ img.app, img.store {
</div>
-->
<p>2) Puis ajoute mon adresse à ta liste de contacts en cliquant sur ce bouton&nbsp;:
<a href="xmpp:{{username}}@chapril.org"><button class="button"><strong>{{username}}@chapril.org</strong></button></a>
<a href="xmpp:{{user_jid}}"><button class="button"><strong>{{user_jid}}</strong></button></a>
</p>
</article>
</body>

View File

@ -1,14 +1,20 @@
#! /bin/sh
USERNAME=$(basename ${REQUEST_URI})
DOMAIN=$(echo "${USERNAME}" | cut -d@ -f2)
if [ "${USERNAME}" = "${DOMAIN}" ]; then
USER_JID=${USERNAME}@chapril.org
else
USER_JID=${USERNAME}
fi
echo "Content-type: text/html"
echo ""
#echo -n "<pre>" ; env ; echo "</pre>" # DEBUG
#echo "<pre>USERNAME=${USERNAME}" ; echo "DOMAIN=$DOMAIN" ; echo "</pre>" # DEBUG
cat index.html.tpl | sed "s/{{username}}/${USERNAME}/g"
cat index.html.tpl | sed "s/{{user_jid}}/${USER_JID}/g"
exit 0