Skip to content
Snippets Groups Projects
Commit 60b4b077 authored by Bob Mottram's avatar Bob Mottram
Browse files

Show onion email address as QR code on user control panel

parent 43133492
No related branches found
No related tags found
No related merge requests found
......@@ -856,28 +856,50 @@ function show_your_email_address {
if [ -f "$HOME/.email_onion_domain" ]; then
onion_domain=$(cat "$HOME/.email_onion_domain")
fi
dialog_height=14
if [[ "$HOSTNAME" != *'.onion' && "$onion_domain" ]]; then
msgstr=$"Email Address: $MY_EMAIL_ADDRESS\\n\\nOnion Email: ${USER}@${onion_domain}\\n\\nKey ID: $GPG_ID\\n\\nFingerprint: $GPG_FINGERPRINT\\n\\nCreated: $GPG_DATE"
if [ ! -f ~/.mutt/bdsmail ]; then
msgstr=$"\\nYou can press SHIFT and then drag the mouse and right click to copy.\\n\\nEmail Address: $MY_EMAIL_ADDRESS\\n\\nOnion Email: ${USER}@${onion_domain}\\n\\nKey ID: $GPG_ID\\n\\nFingerprint: $GPG_FINGERPRINT\\n\\nCreated: $GPG_DATE"
dialog_height=17
else
bdsmail_address=$(grep 'set from=' ~/.mutt/bdsmail | awk -F '=' '{print $2}')
msgstr=$"\\nYou can press SHIFT and then drag the mouse and right click to copy.\\n\\nEmail Address: $MY_EMAIL_ADDRESS\\n\\nOnion Email: ${USER}@${onion_domain}\\n\\nKey ID: $GPG_ID\\n\\nFingerprint: $GPG_FINGERPRINT\\n\\nCreated: $GPG_DATE\\n\\nI2P Address: ${bdsmail_address}"
dialog_height=20
fi
else
msgstr=$"Email Address: $MY_EMAIL_ADDRESS\\n\\nKey ID: $GPG_ID\\n\\nFingerprint: $GPG_FINGERPRINT\\n\\nCreated: $GPG_DATE"
if [ ! -f ~/.mutt/bdsmail ]; then
msgstr=$"\\nYou can press SHIFT and then drag the mouse and right click to copy.\\n\\nEmail Address: $MY_EMAIL_ADDRESS\\n\\nKey ID: $GPG_ID\\n\\nFingerprint: $GPG_FINGERPRINT\\n\\nCreated: $GPG_DATE"
dialog_height=14
else
bdsmail_address=$(grep 'set from=' ~/.mutt/bdsmail | awk -F '=' '{print $2}')
msgstr=$"\\nYou can press SHIFT and then drag the mouse and right click to copy.\\n\\nEmail Address: $MY_EMAIL_ADDRESS\\n\\nKey ID: $GPG_ID\\n\\nFingerprint: $GPG_FINGERPRINT\\n\\nCreated: $GPG_DATE\\n\\nI2P Address: ${bdsmail_address}"
dialog_height=17
fi
fi
if [ ! -f ~/.mutt/bdsmail ]; then
dialog --title $"Show your Email Address" \
--backtitle $"Freedombone User Control Panel" \
--msgbox "$msgstr" 14 100
else
bdsmail_address=$(grep 'set from=' ~/.mutt/bdsmail | awk -F '=' '{print $2}')
dialog --title $"Show your Email Address" \
--backtitle $"Freedombone User Control Panel" \
--msgbox $"\\nYou can press SHIFT and then drag the mouse and right click to copy.\\n\\nEmail Address: $MY_EMAIL_ADDRESS\\n\\nKey ID: $GPG_ID\\n\\nFingerprint: $GPG_FINGERPRINT\\n\\nCreated: $GPG_DATE\\n\\nI2P Address: ${bdsmail_address}" 17 100
clear
dialog --title $"Show your Email Address" \
--backtitle $"Freedombone User Control Panel" \
--msgbox "$msgstr" $dialog_height 100
clear
qr_code_shown=
if [ "$onion_domain" ]; then
echo ''
echo $'Your bdsmail address as a QR code'
echo $'Your onion email address:'
echo ''
echo -n "${bdsmail_address}" | qrencode -t UTF8
echo -n "${USER}@${onion_domain}" | qrencode -t UTF8
echo ''
qr_code_shown=1
fi
if [ -f ~/.mutt/bdsmail ]; then
echo ''
echo $'Your bdsmail address:'
echo ''
echo "${bdsmail_address}"
echo -n "${bdsmail_address}" | qrencode -t UTF8
echo ''
qr_code_shown=1
fi
if [ $qr_code_shown ]; then
any_key
fi
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment