dont allow anonymous to be set as a friends alias in the interface

This commit is contained in:
Kevin Froman 2019-06-10 22:19:31 -05:00
parent 7e058b29e0
commit 6e1f26dc91
3 changed files with 12 additions and 7 deletions

View file

@ -27,6 +27,10 @@ function removeFriend(pubkey){
addForm.onsubmit = function(){
var friend = document.getElementsByName('addKey')[0]
var alias = document.getElementsByName('data')[0]
if (alias.value.toLowerCase() == 'anonymous'){
alert('Anonymous is a reserved name')
return false
}
fetch('/friends/add/' + friend.value, {
method: 'POST',

View file

@ -55,7 +55,8 @@ function openReply(bHash, quote, subject){
function openThread(bHash, sender, date, sigBool, pubkey, subjectLine){
var messageDisplay = document.getElementById('threadDisplay')
var blockContent = httpGet('/getblockbody/' + bHash)
document.getElementById('fromUser').value = sender
document.getElementById('fromUser').value = sender || 'Anonymous'
document.getElementById('subjectView').innerText = subjectLine
messageDisplay.innerText = blockContent
var sigEl = document.getElementById('sigValid')